[gdal-dev] ogr2ogr, Possible to control layer combining?

Frank Warmerdam warmerdam at p...
Thu Jul 18 17:00:33 EDT 2002


Martin, Daniel wrote:
> No response on this. Is there a better place for me to ask user 
> questions? I know this is the developers list, but it does say on 
> the web page that user questions should be directed here.

Dan,

This is the best place to ask such questions. There just isn't an
easy solution.

> I've been using ogr2ogr to convert various formats to MITAB. When I
> used it against a set of TIGER Line data, it combined all the layers
> in one folder into a single layer. 

Note that this "automerging" is a property of the TIGER reader. It treats
all county datasets in a single directory as a single dataset with the
layer splitting being on feature type.

> Now I'm trying to convert a set of shape files (Census' 2000
> ZCTA layers) into MITAB. When I do, it's converting each shape file
> into a separate layer. Is there any way to force ogr2ogr to convert
> the entire folder into one layer, as it did with the TIGER data?

> MapInfo does have tools to combine the resulting MITAB layers, but
> (not surprisingly) they don't work half the time (this time included).

Because the MapInfo OGR driver does not support appending to an existing
dataset, this is pretty hard. I will look at modifying the shapefile
driver to support layer append, and then - hopefully - you would be able
to merge you different shapefiles into one shapefile, and then convert
that to mapinfo. Of course, many other GIS tools provide some sort of
merge option too.

Later,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at p...
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent






More information about the Gdal-dev mailing list