Monday, 7 August 2017

coordinate system - why is there a difference between using EPSG and using basic code


I have the OSgeo4w installed on my PC and I am trying to upload ITM(israel transverse mercator) landmarks to google earth.
To do this I am using the cs2cs command.

I noticed that i get a deviation using the next code:
cs2cs +proj=longlat +ellps=WGS84 +datum=WGS84 +to +proj=tmerc +lat_0=31.73439361111111 +lon_0=35.20451694444445 +k=1.000007 +x_0=219529.584 +y_0=626907.39 +ellps=GRS80 +units=m
I tried the next code:
cs2cs +init=epsg:4326 +to +init=EPSG:2039
this time my deviation decreased significantly.
why does this happen?
Another thing is, when i use the EPSG code I get a third number (that is always zero using the first code).
The third number, after the lon and lat is around 20, it cannot be the elevation so what does it represent?



Answer



You're using the ellipsoid grs80 which is a general ellipsoid applicable for the whole world.



Each country have a set of parameters to localize their ellipsoid of choice for their region. That set of parameters are called datum, and they define how much an ellipsoid must be shifted at the x,y and z axis so to be locally correct.


You haven't specified the datum shift in your proj4 string. You need to add the +towgs84=-48,55,52 flag in your string.


so the string should become :


 +proj=longlat +ellps=WGS84 +datum=WGS84 +to +proj=tmerc +lat_0=31.73439361111111 +lon_0=35.20451694444445 +k=1.000007 +x_0=219529.584 +y_0=626907.39 +ellps=GRS80 +units=m +towgs84=-48,55,52

Using the flag -init=EPSG:2039 is like a shortcut to that lengthy string yout tried to type manually .


No comments:

Post a Comment