Question

Writing geometry to PostgreSQL database

  • 28 October 2022
  • 7 replies
  • 5 views

Userlevel 3
Badge +26

I'm attempting to write data into a PostgreSQL database using the PostGIS writer. The issue I'm having is that the geometry is not being 'drawn' in ArcPro. When selecting the record in the attribute table, the geometry highlights but is not visible. When creating a feature from scratch in ArcPro, it draws as expected. This makes me believe it's a configuration issue within FME.

 

I have verified the Shape Column is 'shape' (as defined in the database), and that the SRID matches that which is specified as a constraint in the database (3857). The coordinate system I'm using on the writer is EPSG:3857. I'm converting from DGN, if that is relevant.

 

When reading the data back in with FME, all geometry appears normal and in the correct location.

 

What could be the issue?

 

image 


7 replies

Userlevel 6
Badge +31

Does recalculate extent and / or spatial index make the geometry visible?

Userlevel 3
Badge +26

Does recalculate extent and / or spatial index make the geometry visible?

It does not, unfortunately.

 

Badge +3

validate the geometry just before writing . use geometry validator transformer.

Sometimes , some geometries are not rendering, because too many points in one location, self intersecting, phantom elements etc...

Userlevel 3
Badge +16

I've seen dgn files with extreme Z coordinates which can cause an issue for esri. Try 3D forcing it to 0.

Userlevel 3
Badge +26

Digging into this a little further -

 

In this database provided by the client, there was existing data in another feature class that appears in the correct location in ArcPro. Note the coordinates in the screenshot:

imageNow I read in that same feature class with FME, along with the feature class I've written into with FME. The coordinates being displayed in FME Data Inspector do not match what is in ArcPro:

imageZooming out in Data Inspector and hovering over the features I created in FME, the coordinates match as expected (where the existing data is being displayed in ArcPro).

imageI feel like this is a projection issue, but it's not making much sense to me at this point.

Userlevel 3
Badge +16

Possibly the data was identified as the wrong coordinate system before you reprojected it? I don't think FME recognises DGN coordinate systems, which could be it too. Use a CoordinateSystemSetter to tell the data what its coordinate system is before reprojecting it. Compare with the existing data like you've done to be sure it comes out in the right place, right coordinate range etc.

Userlevel 3
Badge +26

So, there was a whole host of issues. There were several geometry validation errors, as well as projection issues. I fixed these with the GeometryValidator, and the EsriReprojector, and all is fairly well now 😁 . Thanks @ctredinnick​ and @f.kemminje​ for the suggestions. They helped a lot.

Reply