2

I try to load this WFS https://fbinter.stadt-berlin.de/fb/wfs/data/senstadt/s_lor_plr_2021 into PostGIS using QGIS. However, I always get the following error

Error: 6 Object writing error: Object create error: from #-9223372036854775808 to #-9223372036854775808. FError was: PostGIS-Error on adding attributes: FEHLER: Geometry type (MultiPolygon) does not match column type (Polygon)

Only 0 from 542 Objects written

Screenshot import dialog

Whats going wrong?

7
  • 1
    the column type of your table ispolygon instead of multipolygon
    – Ian Turton
    Jan 11, 2022 at 14:08
  • @IanTurton but where do I set this? I have no table in PostGIS into which I import the WFS. The table is created upon import. I never set polygon anywhere...
    – four-eyes
    Jan 11, 2022 at 14:20
  • you must have when you created the table
    – Ian Turton
    Jan 11, 2022 at 14:21
  • 1
    That tool implies the geometry type from the first feature it reads, which is not necessarily the case for all import features. Since now that table exists in the DB, ALTER its geometry type to MULTIPOLYGON, uncheck Zieltabelle ersetzen and reimport - and hope for the WFS not to serve even other types.
    – geozelot
    Jan 11, 2022 at 14:37
  • @geozelot Hm, I changed the type the following: ALTER TABLE "fis:s_lor_plr_2021" ALTER COLUMN geom type geometry(MultiPolygon, 102689) using ST_Multi(geom);. However, when I uncheck Replace table if exists I get the error Relation »fis:s_lor_plr_2021« exists already
    – four-eyes
    Jan 11, 2022 at 14:44

1 Answer 1

2

Apparently there are mixed geometries in the Input Dataset. PostGIS does not like that (see Comments on my Questions)

They way I solved it now: Since I opened the data in QGIS anyway, and it complained bout mixed geometry types I converted all the geometries to single geometries.

Processing Tools -> Vector -> Multi- to Single Geometries.

Since I know the data this is fine!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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