[gdal-dev] Re: combine shapefiles?

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Wed Oct 13 03:10:52 EDT 2010


Frank Warmerdam <warmerdam <at> pobox.com> writes:


> I was successful doing this to copy a file to another file and then
> append another copy of the same features onto the second file.
> 
>    ogr2ogr out.shp in.shp
>    ogr2ogr -update -append out.shp in.shp in -nln out

That's what I have used too, exept I think there is one "in" too much in the
latter command and this should be enough.
ogr2ogr -update -append out.shp in.shp -nln out

What is important is to use the -nln switch, otherwise ogr2ogr tries to create a
new layer into the out.shp shapefile for each shapefile to be added and that
will fail. And of course the aim is to collect everything on the same layer.

However, the .shp part of shapefile can not grow bigger than 4 gigabytes. For
bigger datasets spatialite feels a good alternative and I have done some tests
with it. Unfortunately adding new shapefiles into spatialite comes extremely
slow once the filesize of the database gets bigger and I have not had patience
to continue beyond 8 gigabytes. I feel this has something to do with journal
tables which spatialite is using for making updates safe. My guess is that the
bigger the database file is the bigger is also the journal table and finally all
the time is spent with journals.  I noticed that after 24 hour run I had more
than 30000 deleted spatialite journal tables in the trashbox of my network drive.

Your ultimate problem was that Mapserver WMS GetFeatureInfo request does not
work through OGR tileindex. I had a try with our WMS server and I can see the
same behaviour. Result is allways "msQueryByPoint(): Search returned no results.
No matching record(s) found." I suggest you to have another try on Mapserver
mailing list and see if this is something worth a bug report or feature request.

-Jukka Rahkonen-



More information about the gdal-dev mailing list