Skip to main content
Solved

Polygon to Multipolygon


Forum|alt.badge.img

I want to transform a Personal Geodatabase to a PostGIS database. In my Personal Geodatabase are Polygons (which also have multi parts). I used an Aggregator Grouped by OBJECTID of the features to create Multipolygons. Unfortunately this resulted in a geometry collection, so I used a GeometryRefiner which was suggested to me, but this only converted the Geometry collection back to Polygons. I also applied a GeometryFilter to check that there are only Areas in the dataset - this is actually true.

So, how can I identify the error? And how can I create Multipolygons so that my transformation will be successful?

Best answer by david_r

Also, when creating the writer, make sure to deselect "Create generic spatial columns", that way you can manually specify the geometry type in the output feature type properties:

View original
Did this help you find an answer to your question?

14 replies

david_r
Celebrity
  • September 15, 2016

What exactly is the error that you're getting? Can you post log here please.

If you use the Aggregator and group by the OBJECTID, it is very probable that no aggregates are generated, as usually the OBJECTID is unique.

In most cases, FME should be able to automaticall convert your geometries to the format expected by PostGIS. Which geometry type is used in your destination table?


Forum|alt.badge.img
  • Author
  • September 15, 2016
david_r wrote:

What exactly is the error that you're getting? Can you post log here please.

If you use the Aggregator and group by the OBJECTID, it is very probable that no aggregates are generated, as usually the OBJECTID is unique.

In most cases, FME should be able to automaticall convert your geometries to the format expected by PostGIS. Which geometry type is used in your destination table?

Hi david,

 

the error with the Geometry refiner is:

 

Bulk copy failed on table 'cadaster.parcel' using delimiter ':'. Error was 'ERROR: Geometry type (Polygon) does not match column type (MultiPolygon)

 

If I use an aggregator without a geometry refiner, I would get a geometrycollection and the following error:

 

Error was 'ERROR: Geometry type (GeometryCollection) does not match column type (MultiPolygon)

 

CONTEXT: COPY parcel, line 1, column geometry: "0107000020887F000001000000010600000002000000010300

 

 


david_r
Celebrity
  • September 15, 2016

What happens if you try to set postgis_type to postgis_multipolyon:

Documentation here: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/postgis/Feature_Representation.htm


david_r
Celebrity
  • Best Answer
  • September 15, 2016

Also, when creating the writer, make sure to deselect "Create generic spatial columns", that way you can manually specify the geometry type in the output feature type properties:


Forum|alt.badge.img
  • Author
  • September 15, 2016
david_r wrote:

Also, when creating the writer, make sure to deselect "Create generic spatial columns", that way you can manually specify the geometry type in the output feature type properties:

Great - That solved it!

 

Always a pleasure!

 

 


darkspatiallord
Forum|alt.badge.img+6

this is a bit of a trick in the system as you can only get to it when you first create the writer

once setup it is easy but if you leave it to generic you could end up with anything, we even had multisurface....


darkspatiallord
Forum|alt.badge.img+6
david_r wrote:

Also, when creating the writer, make sure to deselect "Create generic spatial columns", that way you can manually specify the geometry type in the output feature type properties:

maybe the check box should be reversed to be off by default

 

 


darkspatiallord
Forum|alt.badge.img+6
david_r wrote:

What happens if you try to set postgis_type to postgis_multipolyon:

Documentation here: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/postgis/Feature_Representation.htm

 

i tried that as a solution and it failed

fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • January 9, 2017

An idea to add a parameter on the PostGIS Writer to better handle geometry situations like these has been posted on the Ideas Exchange:

 

PostGIS Writer: Add option to better manage geometry

Check it out and be sure to up vote it if you think it'll help your workflows!


tsirkuse
  • June 12, 2019
david_r wrote:

Also, when creating the writer, make sure to deselect "Create generic spatial columns", that way you can manually specify the geometry type in the output feature type properties:

Where can I find this geometry type setting? I can't seem to find it in my postGIS writter... Thanks !


david_r
Celebrity
  • June 12, 2019
tsirkuse wrote:

Where can I find this geometry type setting? I can't seem to find it in my postGIS writter... Thanks !

I just checked with FME 2019.0.2 and the setting is still there. Where are you looking?


nielsgerrits
VIP
Forum|alt.badge.img+54
tsirkuse wrote:

Where can I find this geometry type setting? I can't seem to find it in my postGIS writter... Thanks !

@tsirkuse you probably have to uncheck "Create Generic Spatial Columns" in the "PostGIS Parameters" to set a geometry type in the writer.


david_r wrote:

Also, when creating the writer, make sure to deselect "Create generic spatial columns", that way you can manually specify the geometry type in the output feature type properties:

Hi. Is mulpolygon not available on FME 2018? I can see that option in the writer... If not, how can I convert a polygon to a multipolygon? Thanks!


kailinatsafe
Safer
Forum|alt.badge.img+21
juanrodriguezso wrote:

Hi. Is mulpolygon not available on FME 2018? I can see that option in the writer... If not, how can I convert a polygon to a multipolygon? Thanks!

Hi @juanrodriguezso! Multipolygons should be available in FME 2018 if you use the Aggregator transformer. Take a look at this suggestion here: https://knowledge.safe.com/answers/114846/view.html


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings