Skip to main content
Solved

FME Shapefile not Valid in PostGIS

  • 22 March 2013
  • 6 replies
  • 12 views

Dear FME experts,

 

 

 

I’m getting quite desperate about a problem I still can’t solve.

 

 

 

The input format is shape which contains areas.

 

 

 

We use FME desktop (2013 SP1) to correct a great number of these geometries. The workbench contains AreaOnAreaOverlayers / Dissolvers etc. At the end we check the geometries with the GeometryValidator where we test all issues. 4 geometries are repaired.

 

 

 

The output is shape again. Until here everything is fine.

 

 

 

After this we use SPIT to load the shapes in PostGIS. Running isValid in PostGIS returns a lot of errors. Self intersections.

 

 

 

Our workaround is to repair geometry in ArcGIS which solves the self intersections. (a lot of them!)

 

 

 

Then we load the shape again in FME, run the feautures through the GeometryValidator with all checks. 16 geometries are getting repaired.

 

 

 

Now we can successfully load the shapes in PostGIS. The isValid function returns nothing now.

 

 

 

I would love to skip the repair geometry cycle in ArcGIS.

 

 

 

My latest guess is it should have to do something with the precision of shape vs the precision of FFS & precision of PostGIS. Using the attributerounder (x, y, z parameter = 4) before testing the GeometryValidator didn’t solve the problem.

 

 

 

Pretty stuck now, any suggestions?
Hi,

 

 

does your process include a SelfIntersector? Also, why not write the geometries directly to PostGIS with FME?

 

 

Generally, these issues can be hard to debug without intimate knowledge about both the input and output data, as well as your process...

 

 

David
Hi Niels!

 

 

After the GeometryValidator. Have you tried to add a second GeomtetryValidator - with the PASSED and REPAIRED from the first GeometryValidator as input?
Heya David,

 

 

the GeometryValidator checks for self intersections and Attempt Repair = yes. So the SelfIntersecter is included.

 

 

We need the data in another application as well which can't get data from a PostGIS source... so thats why we use the Shape route.

 

 

Of course I understand how hard debugging is without data & workbench... I'm just not allowed to put it on the internet.

 

 

I hope it is a known problem which someone smarter than me already solved.

 

 

Thanks for the input!
Hi Niels,

 

 

in that case, try the excellent suggestion from SigTill.

 

 

Also be aware that the order of the operations inside the GeometryValidator can matter. You can switch around the order of the checks using the small up/down buttons on the upper right of the list of issues to check for. They can be hard to spot unless you're actively looking for them...

 

 

David
Hooray!

 

 

Sigbjørn thanks a lot for the solution.

 

 

We didn't test the shape route yet but writing directly to PostGIS without the extra GeometryValidator didn't solve the problem.

 

 

Adding the extra GeometryValidator did the trick! It crossed my mind but I never actually tested it.

 

 

David, thanks for pointing out the order of checks / arrows. Indeed I had not spotted them myself.

 

 

Problem solved, case closed.
Hi NielsG

 

If you have a best answer among these (looks like it's SigTill) would you mind voting it best answer.

 

Thanks

 

 


Reply