[gdal-dev] Problem re-projecting shapefile by using ogr2ogr
Stefano Iacovella
stefano.iacovella at gmail.com
Thu Dec 13 00:19:23 PST 2012
2012/12/13 deb <otrov at hush.ai>:
> Hi,
>
> I want to re-project shapefile from current projection (whatever that is) to ESPG:4326.
> My example layer (misc.shp) is in EPSG:31227:
>
> > ogrinfo -al -so misc.shp
> INFO: Open of `misc.shp'
> using driver `ESRI Shapefile' successful.
>
> Layer name: misc
> Geometry: Line String
> Feature Count: 10
> Extent: (21.267388, 42.015857) - (21.270225, 42.017470)
> Layer SRS WKT:
> PROJCS["MGI_Balkans_zone_7_deprecated",
> GEOGCS["GCS_MGI",
> DATUM["Militar_Geographische_Institute",
> SPHEROID["Bessel_1841",6377397.155,299.1528128]],
> PRIMEM["Greenwich",0],
> UNIT["Degree",0.017453292519943295]],
> PROJECTION["Transverse_Mercator"],
> PARAMETER["latitude_of_origin",0],
> PARAMETER["central_meridian",21],
> PARAMETER["scale_factor",0.9999],
> PARAMETER["false_easting",7500000],
> PARAMETER["false_northing",0],
> UNIT["Meter",1]]
> id: Integer (10.0)
>
>
> As suggested by couple of sources from Google search results, I used this:
>
> > ogr2ogr -t_srs EPSG:4326 misc_re.shp misc.shp
>
>
> And then investigate metadata of newly creates vector:
>
> > ogrinfo -al -so misc_re.shp
> INFO: Open of `misc_re.shp'
> using driver `ESRI Shapefile' successful.
>
> Layer name: misc_re
> Geometry: Line String
> Feature Count: 10
> Extent: (-34.004490, 0.000230) - (-34.004490, 0.000230)
> Layer SRS WKT:
> GEOGCS["GCS_WGS_1984",
> DATUM["WGS_1984",
> SPHEROID["WGS_84",6378137,298.257223563]],
> PRIMEM["Greenwich",0],
> UNIT["Degree",0.017453292519943295]]
> id: Integer (10.0)
>
>
> There is no projection (PROJCS) in metadata and coordinates are different from source vector.
> I then tried various EPSG codes, and I get PROJCS metadata, but Extent values are totally different for each projection, so even if I assume some units issue, there can't be that different units in existence.
>
There is no PROJCS as your target SRS is a geographic one. Indeeed you
can see the GEOGCS label.
EPSG:31227 is not only deprecated, it was removed from EPSG database,
looking at epsg-registry.org I can't find it.
Anyway as the WKT states is a Transverse Mercator flavour the extent
sounds quite strange to me.
May be it is EPSG:3909?
For a gentle introduction to SRS, maps and projections you may have a look at
http://www.progonos.com/furuti/MapProj/Normal/TOC/cartTOC.html
---------------------------------------------------
41.95581N 12.52854E
http://www.linkedin.com/in/stefanoiacovella
http://twitter.com/#!/Iacovellas
More information about the gdal-dev
mailing list