Skip to main content
Question

Specifying the geometry type when writing from ESRI Shapefile into PostGIS

  • November 11, 2020
  • 6 replies
  • 217 views

Hi, I am using FME to write a Shapefile to PostGIS and I am wondering if there is a way that you can specify that it writes polygons only? When it is writing into PostGIS it is coming in as an unknown geometry with a warning triange!

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

david_r
Celebrity
  • November 11, 2020

Have you looked at the GeometryFilter? Would that help?


nielsgerrits
VIP
Forum|alt.badge.img+62

In the writer parameters, uncheck “create generic geometry”. Then safe as default. Not your fault, everybody asks this when using it for the first time.


  • Author
  • November 11, 2020

​Thank you for your replies.  When I use "Geometry filter" and select "area" it writes as multipolygon in the PostGIS table and then it doesn't allow the table to be edited in QGIS.

 

I couldn't find "create generic geometry" - I did try unchecking "Create Generic Spatial Columns" but then this failed to write anything from the table.


nielsgerrits
VIP
Forum|alt.badge.img+62

​Thank you for your replies.  When I use "Geometry filter" and select "area" it writes as multipolygon in the PostGIS table and then it doesn't allow the table to be edited in QGIS.

 

I couldn't find "create generic geometry" - I did try unchecking "Create Generic Spatial Columns" but then this failed to write anything from the table.

When you leave the Create Generic Spatial Columns checked, FME will write to a multi geometry type spatial column. QGIS does not support multi geometry type spatial columns, as far as I know.

 

When you uncheck it, you can define what kind of geometry you want to write:

PostGISParametersFeatureWriterParametersIf you want to edit the geometry using PostGIS, you also need to add a ID field. I use a field pkey, type serial, Index PrimaryKey.

FeatureWriterParametersUserAttributes


  • Author
  • November 12, 2020

When you leave the Create Generic Spatial Columns checked, FME will write to a multi geometry type spatial column. QGIS does not support multi geometry type spatial columns, as far as I know.

 

When you uncheck it, you can define what kind of geometry you want to write:

PostGISParametersFeatureWriterParametersIf you want to edit the geometry using PostGIS, you also need to add a ID field. I use a field pkey, type serial, Index PrimaryKey.

FeatureWriterParametersUserAttributes

​Thank you but in my "Feature Writer" I don't have the drop -down option "postgis_polygons". I am using FME 2020

 

FME_Query


nielsgerrits
VIP
Forum|alt.badge.img+62

When you leave the Create Generic Spatial Columns checked, FME will write to a multi geometry type spatial column. QGIS does not support multi geometry type spatial columns, as far as I know.

 

When you uncheck it, you can define what kind of geometry you want to write:

PostGISParametersFeatureWriterParametersIf you want to edit the geometry using PostGIS, you also need to add a ID field. I use a field pkey, type serial, Index PrimaryKey.

FeatureWriterParametersUserAttributes

This is because "Create Generic Spatial Columns" is checked. If you uncheck it, you can choose a geometry type.

 

Please, @safeemployee safeemployee​  uncheck this by Default.