[gdal-dev] Problem appending non-geometry tables in PostGis

Saulteau Don sault.don at gmail.com
Thu Jun 4 18:14:53 PDT 2015


If you add "-nlt NONE" to the ogr2ogr command, does that work?

You might need to do that just for the non-spatial tables, because if you
do that with the spatial tables, they will only upload the attributes.


Donovan

On Thu, Jun 4, 2015 at 5:19 PM, Roger André <randre at gmail.com> wrote:

> Hi All,
>
> I'm having some trouble using ogr2ogr to do batch uploads to a Postgis
> DB.  It appears that on tables which don't contain geometry, CreateLayer is
> failing and not allowing data to be appended to an existing table.  Here is
> the command that is being used to load each feature class:
>
> ogr2ogr -f "PostgreSQL" -lco ENCODING=UTF-8 -append -update PG:"host=foo
> dbname=bar user=crak password=head" ./nokia_here_asia/file.gdb CityPOINames
>
> Below is my logging output.  The first set of data shows the asia data set
> being loaded, which creates the PostGIS tables. The next set shows what
> happens with the europe data set.  Although warnings are given for
> MapAdminArea, MapAdminLink and CityPOI layers, they are sucessfully
> appended.  However, CityPOINames, MapAreaNames, and MapNameTrans all fail
> with the CreateLayer error.  Those tables are different in that they lack
> geometry.
> --------
> Extracting from ./nokia_here_asia/file.gdb
> Loading MapAdminArea feature_class
> Loading MapAdminLink feature_class
> Loading CityPOI feature_class
> Loading CityPOINames feature_class
> Loading MapAreaNames feature_class
> Loading MapNameTrans feature_class
> --------
> Extracting from ./nokia_here_europe/file.gdb
> Loading MapAdminArea feature_class
> WARNING: Layer creation options ignored since an existing layer is
>          being appended to.
> Loading MapAdminLink feature_class
> WARNING: Layer creation options ignored since an existing layer is
>          being appended to.
> Loading CityPOI feature_class
> WARNING: Layer creation options ignored since an existing layer is
>          being appended to.
> Loading CityPOINames feature_class
> ERROR 1: Layer citypoinames already exists, CreateLayer failed.
> Use the layer creation option OVERWRITE=YES to replace it.
> ERROR 1: Terminating translation prematurely after failed
> translation of layer CityPOINames (use -skipfailures to skip errors)
>
> Loading MapAreaNames feature_class
> ERROR 1: Layer mapareanames already exists, CreateLayer failed.
> Use the layer creation option OVERWRITE=YES to replace it.
> ERROR 1: Terminating translation prematurely after failed
> translation of layer MapAreaNames (use -skipfailures to skip errors)
>
> Loading MapNameTrans feature_class
> ERROR 1: Layer mapnametrans already exists, CreateLayer failed.
> Use the layer creation option OVERWRITE=YES to replace it.
> ERROR 1: Terminating translation prematurely after failed
> translation of layer MapNameTrans (use -skipfailures to skip errors)
> --------
>
> I could create some giant CSV files and load these in one shot, but I'd
> prefer it if I could handle the entire load using ogr2ogr.  Has anyone else
> encountered this, or have suggestions for dealing with the problem?
>
> Thanks,
>
> Roger
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150604/1f45e8a8/attachment-0001.html>


More information about the gdal-dev mailing list