Hi Max,

have you tried

ogr2ogr -t_srs EPSG:4326 -f "one of many formats" outputfile myshape.shp

As ogrinfo recognizes the source shape CS (I guess it has a .prj file
associated with it), you should only transform (-t_srs) into the
destination CS.

All the best

Sig


> 


Il giorno lun, 10/10/2011 alle 11.14 +0200, emmexx ha scritto:
> 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]]
> 
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


_____________
PRIVACY
Le informazioni contenute in questo messaggio sono riservate e confidenziali. 
Il loro utilizzo e' consentito esclusivamente al destinatario del messaggio, 
per le finalità indicate nel messaggio stesso. Qualora Lei non fosse la persona 
a cui il presente messaggio è destinato, La invitiamo ad eliminarlo dal Suo 
Sistema e a distruggere le varie copie o stampe, dandone gentilmente 
comunicazione all’indirizzo mail del mittente. Ogni utilizzo improprio e' 
contrario ai principi del D.lgs 196/03 e alla legislazione europea (Direttiva 
2002/58/CE).

PRIVACY
Le informazioni contenute in questo messaggio sono riservate e confidenziali. 
Il loro utilizzo e' consentito esclusivamente al destinatario del messaggio, 
per le finalità indicate nel messaggio stesso. Qualora Lei non fosse la persona 
a cui il presente messaggio è destinato, La invitiamo ad eliminarlo dal Suo 
Sistema e a distruggere le varie copie o stampe, dandone gentilmente 
comunicazione all’indirizzo mail del mittente. Ogni utilizzo improprio e' 
contrario ai principi del D.lgs 196/03 e alla legislazione europea (Direttiva 
2002/58/CE).
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to