[gdal-dev] Re: Change the spatial reference of a shapeile

Chaitanya kumar CH chaitanya.ch at gmail.com
Tue Jul 12 07:51:39 EDT 2011


Solimyr,

Since mean_provaimp didn't have any extent data at first, it is created
during the ogr2ogr process. There must be some features that are beyond the
extents of the other shapefile for this to have extended extents.

FYI, the bounds are stored in the .shp file's header from the 37th to 68th
byte. Refer the following links.
http://en.wikipedia.org/wiki/Shapefile
http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf

On Tue, Jul 12, 2011 at 1:31 PM, Solimyr <giannicristian at msn.com> wrote:

> Thx for the answers, now I get the right srs but the extent is different:
>
> SHAPE 1 ( the one where I want to get the info and copy to the new)
> $ ogrinfo -al provaimp.shp
> INFO: Open of `provaimp.shp'
>      using driver `ESRI Shapefile' successful.
>
> Layer name: provaimp
> Geometry: Polygon
> Feature Count: 2
> Extent: (15.548977, 38.176478) - (15.551497, 38.179126)
> Layer SRS WKT:
> GEOGCS["GCS_WGS_1984",
>    DATUM["WGS_1984",
>        SPHEROID["WGS_1984",637813.0,298.252223563]],
>    PRIMEM["Greenwich",0.0],
>    UNIT["Degree",0.0174532925199433]]
> Id: Integer (6.0)
> OGRFeature(provaimp):0
>  Id (Integer) = 0
>  POLYGON ((15.550555060572606 38.17912619284624,15.550983363553598
> 38.179090500931238,15.550690689850001 38.177876975818322,15.550383739380152
> 38.17775562330695,15.550555060572606 38.17912619284624))
>
> OGRFeature(provaimp):1
>  Id (Integer) = 0
>  POLYGON ((15.548977477925689 38.177298766793797,15.550590752487608
> 38.177363012241017,15.551497327130903 38.176527821427953,15.549598517248228
> 38.176477852746871,15.548977477925689 38.177298766793797))
>
> SHAPE 2 (the one with wrong extent but (now) correct srs)
> $ ogrinfo -al mean_provaimp.shp
> INFO: Open of `mean_provaimp.shp'
>      using driver `ESRI Shapefile' successful.
>
> Layer name: mean_provaimp
> Geometry: Polygon
> Feature Count: 2
> Extent: (0.000000, 0.000000) - (376.000000, 390.000000)
> Layer SRS WKT:
> GEOGCS["GCS_WGS_1984",
>    DATUM["WGS_1984",
>        SPHEROID["WGS_1984",637813.0,298.252223563]],
>    PRIMEM["Greenwich",0.0],
>     UNIT["Degree",0.017453292519943295]]
> VALUE: Real (26.6)
> OGRFeature(mean_provaimp):0
> OGRFeature(mean_provaimp):0
>  VALUE (Real) =                 33.124565
>  POLYGON ((15.550555060572606 38.17912619284624,15.550983363553598
> 38.179090500931238,15.550690689850001 38.177876975818322,15.550383739380152
> 38.17775562330695,15.550555060572606 38.17912619284624))
>
> OGRFeature(mean_provaimp):1
>  VALUE (Real) =                  45.133755
>  POLYGON ((15.548977477925689 38.177298766793797,15.550590752487608
> 38.177363012241017,15.551497327130903 38.176527821427953,15.549598517248228
> 38.176477852746871,15.548977477925689 38.177298766793797))
>
>
> Do you know where the extent information of the shapefile are preserve?So I
> can get, copy and paste or doing something similar...
>
>
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/Change-the-spatial-reference-of-a-shapeile-tp6561998p6574135.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110712/e64f7b67/attachment.html


More information about the gdal-dev mailing list