I try to convert WGS84 points data from googlemaps to local x,y referential in meters. I looked to many post on this site and others, but the way to define the local referential to get true distances and angles has not been depicted in these elements.
To do this conversion, I’m using the Proj4.js library, based on the following instruction:
var LocalProjection = "+proj=merc +lat_ts=43.6 +lon_0=3.9 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs" //to define the local referential
proj4('WGS84',LocalProjection,Point)
However, when doing this, I got distances between points which doesn’t match the ones I measure on google maps, so I believe there is an issue in the definition of the local referential I cannot figure out. Would you have any clue on this, and especially on the parameters of the local referential ? Example: I consider the following points, representative of the outline from a typical building.
var PointTopLeft=[43.587778, 3.868792]
var PointTopRight=[43.587744, 3.868873]
var PointBottomRight=[43.587695, 3.868743]
var PointBottomLeft=[43.587666, 3.868822]
The distance between two points in the above order is calculated to respectively 7.0m, 9.3m, 7.5m and 11m, using pythagora formula on the difference between points. Distance between points TopLeft - BottomLeft and between points TopRight – BottomRight should be 10m according to measure done on google earth. Similarly, distance between points TopLeft - BottomRight and between points TopRight – BottomLeft should be 7.5m according to measure done on google earth.