3

I am having an issue when trying to append shapefile data to an existing table in my PostGIS database using ogr2ogr. The existing table has multiple geometry fields. When I append the shapefile the attribute data uploads fine but the geometry fields are all NULL. I have tested out the upload appending to a new table with only one geometry field and it works fine, but when there are multiple fields it just fails to input any geometry information.

My command looks something like:

ogr2ogr.exe -update -append \
  -f PostgreSQL "PG:host=xxxx port=5432 dbname=yyyy password=***** user=zzz" "C:\xxx.shp" \
  -nlt PROMOTE_TO_MULTI \
  -lco GEOMETRY_NAME=geom \
  -nln schema.tablename \
  -a_srs EPSG:3857

How do I make sure my geometry information is also appended?

I have tried using the sql argument to select columns and rename the geometry column to match the one I want the data in, but nothing has worked so far. Any layer creation options are ignored as it is an append.

1 Answer 1

0

This may help others even if I it useless for this specific topic.

ogr2ogr cannot import into table with two geography columns

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.