[gdal-dev] ogrtindex take only one feature from a layer

Even Rouault even.rouault at mines-paris.org
Wed Jul 14 19:30:43 EDT 2010


What you describe is the expected behaviour of ogrtindex... It takes the 
spatial extent of the whole source shapefile and add it as an entry in the 
tile index. This is intended to be used by MapServer

I'm not sure what you want to do. Probably merging several shapefiles into 
a single one. Then you need ogr2ogr : http://gdal.org/ogr2ogr.html

Le mercredi 14 juillet 2010 10:13:14, easyl a écrit :
> I tried ogrtindex on two shapefiles.
> Each source shapefile has more than one "Feature Count" in a Polygon 
layer.
> 
> after running "ogrtindex index.shp src/*.shp"
> I got index.shp with only two features (one from each source shapefile).
> And the Polygon is not the same from the source data.
> 
> How exactly should and how I use orgtindex?
> 
> > ogrinfo index.shp index
> 
> INFO: Open of `index.shp'
>       using driver `ESRI Shapefile' successful.
> 
> Layer name: index
> Geometry: Polygon
> Feature Count: 2
> Extent: (7.140330, 53.137500) - (8.255000, 53.652667)
> Layer SRS WKT:
> (unknown)
> LOCATION: String (200.0)
> OGRFeature(index):0
>   LOCATION (String) = src/1.shp,0
>   POLYGON ((7.14033 53.621002500000003,7.14033 
53.6526675,7.165335
> 53.6526675,7.165335 53.621002500000003,7.14033 
53.621002500000003))
> 
> OGRFeature(index):1
>   LOCATION (String) = src/2.shp,0
>   POLYGON ((8.223832399999999 
53.137500000000003,8.223832399999999
> 53.145000000000003,8.255 53.145000000000003,8.255
> 53.137500000000003,8.223832399999999 53.137500000000003))


More information about the gdal-dev mailing list