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.

swiss_knight
11.3k9 gold badges57 silver badges140 bronze badges
asked Feb 12, 2021 at 12:03

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

answered Apr 19, 2022 at 8:39

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.