[gdal-dev] Error when appending non-spatial tables in GML to PostGIS

Even Rouault even.rouault at mines-paris.org
Tue Nov 26 05:55:43 PST 2013


Selon Matt Walker <walkermatt at longwayaround.org.uk>:

> Hi,
>
> I'm loading some Ordnance Survey ITN GML data into PostgreSQL 9.1 / PostGIS
> 1.5 which contains a number of feature types that are lookups without any
> geometry, the first file loads fine but loading subsequent files using the
> ogr2ogr -append option fails with the error:
>
>     ERROR 1: Layer road already exists, CreateLayer failed.
>     Use the layer creation option OVERWRITE=YES to replace it.
>
> I'm finding that the gfs file generated by OGR sets the geometry type to
> 100 (no geometry), manually editing the gfs file to remove the GeometryType
> element for the lookup feature types works around the error but creates a
> redundant geometry column and an entry in geometry_columns.
>
> I've put further details and two sample gml files containing a single
> "feature" in each here: https://gist.github.com/walkermatt/7655745
>
> Happy to create at ticket if it's appropriate.

You probably need to add "--config PG_LIST_ALL_TABLES YES" on the command line
so that the table without geometry is correctly loaded (after it has been
created). By default only registered spatial tables are recognized. See
http://gdal.org/ogr/drv_pg_advanced.html
The .gfs hack is likely unnecessary.

>
> Thanks,
>
> Matt
>
> --
> Matt Walker
> Astun Technology
> @_walkermatt
>




More information about the gdal-dev mailing list