[gdal-dev] ogr2ogr: cartesian geographic coordinates problem
emmexx
emmexx at tiscalinet.it
Mon Oct 10 05:14:55 EDT 2011
I'm new to this list, sorry if my question is not new or OT.
I was given a shape file containing linestrings based on a CTR map (CTR
is a "technical italian map").
The file uses Roma1940 and the coordinates are geographic. This is the
start of the output of ogrinfo -al:
Geometry: Line String
Feature Count: 185
Extent: (9.048641, 45.413654) - (9.267740, 45.527227)
Layer SRS WKT:
GEOGCS["GCS_Roma_1940",
DATUM["Roma_1940",
SPHEROID["International_1924",6378388,297]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]]
I need to convert the shape file to EPSG:4326 to view the data on google
or osm maps.
I received, and found also on the web, some srs to make the conversion
from Gauss-Boaga to wgs84 but, if I understand correctly, all those
files expect the coordinates of the points to be cartesian, not geographic.
I tried to use ogr2ogr with the following parameters:
ogr2ogr -a_srs "gausboaga.prj" -s_srs "latlong_wgs84.prj" -t_srs
"EPSG:4326" -f "one of many formats" outputfile myshape.shp
(the srs files at the end of the message)
What I get are points with geographic coordinates changed at the
13th-14th decimal place. E.g.:
9.170837078374765,45.525406361655726
becomes
9.170837078374774,45.525406361655769
As a test I downloaded a shape file of my city roads from a regional web
service, the coordinates are cartesian, then I used a web tool to
convert that shape file from epsg:3003 to epsg:4326 and the result is a
file with lines that perfectly match gmaps or osm roads.
If I try to use the same service with my shape file I get an error.
I found out some formulas to derive cartesian from geographic
coordinates for a transverse mercator projection
(http://www.remotesensing.org/geotiff/proj_list/guid7.html) but I wonder
if there is some ogr2ogr parameter or some srs to do the same.
Thank you
maxx
"gausboaga.prj"
PROJCS["Monte Mario / Italy zone 1",
GEOGCS["Monte Mario",
DATUM["Monte_Mario",
SPHEROID["International 1924", 6378388.0, 297.0,
AUTHORITY["EPSG","7022"]],
TOWGS84[-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68],
AUTHORITY["EPSG","6265"]],
PRIMEM["Greenwich", 0.0,
AUTHORITY["EPSG","8901"]],
UNIT["degree", 0.017453292519943295],
AXIS["Lon", EAST],
AXIS["Lat", NORTH],
AUTHORITY["EPSG","4265"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["central_meridian", 9.0],
PARAMETER["latitude_of_origin", 0.0],
PARAMETER["scale_factor", 0.9996],
PARAMETER["false_easting", 1500000.0],
PARAMETER["false_northing", 0.0],
UNIT["m", 1.0],
AXIS["x", EAST],
AXIS["y", NORTH],
AUTHORITY["EPSG","3003"]]
"latlon_wgs84.prj"
GEOGCS["wgs84",DATUM["WGS_1984",
SPHEROID["wgs84",6378137,298.257223563],
TOWGS84[0.000000,0.000000,0.000000]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433]]
More information about the gdal-dev
mailing list