[gdal-dev] Unions shapefiles using ogr

Paul Meems bontepaarden at gmail.com
Mon Dec 17 05:02:56 PST 2012


Hi all,

How can I union several shapefiles into one using ogr?
I tried using the OGR Virtual Format and created a XML file similar to this:

<OGRVRTDataSource>
    <OGRVRTUnionLayer name="unionLayer">
        <OGRVRTLayer name="source1">
            <SrcDataSource>source1.shp</SrcDataSource>
        </OGRVRTLayer>
        <OGRVRTLayer name="source2">
            <SrcDataSource>source2.shp</SrcDataSource>
        </OGRVRTLayer>
    </OGRVRTUnionLayer>
</OGRVRTDataSource>

My next step was to call ogr2ogr to created the new file.
The above XML merges all shapes instead of performing an union.
How can I do a proper union using ogr?

Thanks,

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20121217/dea865f2/attachment.html>


More information about the gdal-dev mailing list