70002476 Convert GPS Survey data in Latitude format to XY format

 Article 70002476 Type HowTo Product Engine Version 11 Date Added 2/5/2024 12:00:00 AM Fixed 11.0.1.0 (2/5/2024 12:00:00 AM) Submitted by chandrashekhar chougule

Summary

Convert GPS Survey data in Latitude / Longitude (Northing / Easting) format to X-Y format

Solution

Try a code like:

// using VectorDraw.Geometry.GPS
//tranform GPS Latitude and Longitude to VDF x,y coordinates
//First we need to create a GPS_MAP object
//Create a  GPS_MAP object passing the desired ellipsoid of our area from the redifined at the follow link:https://developers.arcgis.com/javascript/3/jshelp/pcs.html
GPS.GPS_MAP gmap =  new GPS.GPS_MAP("PROJCS[\"Greek_Grid\",GEOGCS[\"GCS_GGRS_1987\",DATUM[\"D_GGRS_1987\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",500000.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",24],PARAMETER[\"Scale_Factor\",0.9996],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0]]");

//Now we add some GPS positions to our VDF drawing as vdPoint objects, using the PointAt_GPS method
//NOTE: you can also use the VectorDraw.Geomentry.GPS.Receiver to get real time GPS positions from your system
GPS.GPS_POSITION gp1 = new GPS.GPS_POSITION("37.88794838876842, 23.777916121699967");
GPS.GPS_POSITION gp2 = new GPS.GPS_POSITION("37.887745754239305, 23.77716794388667");
GPS.GPS_POSITION gpmid = new GPS.GPS_POSITION("37.88785687646948, 23.777565499625105");
gPoint pp1 = gmap.PointAt_GPS(gp1);
gPoint pp2 = gmap.PointAt_GPS(gp2);
gPoint ppm = gmap.PointAt_GPS(gpmid);