3

I have an ESRI File Geodatabase of data that I upload to PostGIS using FME. Seeing as I have to have the data in PostGIS for other purposes, it would be great to view the data in ArcMap straight from the PostGIS database, rather than having to use the file geodatabase. I dont need to edit the data in ArcMap.

If I open the data from the ESRI File Geodatabase in ArcMap or QGIS, the data displays fine.

If I load the PostGIS version in QGIS, it displays fine.

However, when I open the PostGIS version in ArcMap, I get the following error:

One or more layers failed to draw: Linestring or poly boundary is self-intersecting

In my FME workspace I am using a GeometryValidator transformer to check that the geometries are correct - I use the tests Fails OGC Simple and Fails OGC Valid and write only the valid geometries to PostGIS. At the moment I am only loading the valid geometries to PostGIS (I will deal with the invalid ones once I get get ArcMap to display the valid ones).

I have double checked that the data is valid in PostGIS by checking the data with ST_IsValid().

I am using ArcGIS 10.2.1 and what I believe is a supported version of PostgreSQL/PostGIS (PostgreSQL 9.2.4 64-bit and PostGIS 2.0.3). I also have the dll files on the client machine and have no problems connecting the the database.

I have also tried with a newer version of both PostgreSQL and PostGIS (which are not supported by ESRI) and they dont work either.

Any ideas?

  • Is the data loaded in a geodatabase (ArcSDE) or just a Query Layer? – Vince Mar 3 '14 at 15:07
  • It's just in a normal postgis database. No ArcSDE involved. Loaded in from both catalog and add query layer gives same result. – James S Mar 3 '14 at 15:50
  • Your answer contradicts itself. Did you enable an enterprise geodatabase in the PG instance? Is there an SDE user in the database? Does an sde.layers table exist? – Vince Mar 3 '14 at 16:20
  • Do you see any features that FME is filtering out in your workspace when you convert it to a FGDB? – Mintx Mar 3 '14 at 16:49
  • Vince - I did not enable an enterprise geodatabase, there is no SDE useror sde.layers table in the PostGIS database. Mintx - The data is coming from FGDB to PostGIS. – James S Mar 3 '14 at 17:06
2

PostGIS and ArcGIS can arrive at different results for a self-intersection test, presumably because of some epsilon tolerance value baked into ArcGIS somewhere.

The ST_MinimumClearance function effectively lets you check for validity using a tolerance, so you can emulate the Arc behavior.

If you want to find geometries in PostGIS that will be seen as invalid by ArcGIS, you should expand your validity check in PostGIS to be something like this:

WHERE (NOT ST_IsValid(geom)) OR ST_MinimumClearance(geom) < 1e-14

2

I realize that this is an old post, but I just stumbled upon it looking for answers, because I was having similar problems.

So I had a polygon layer in PostGIS that I was able to see in QGIS, but in ArcMap it gave me the same problem (Linestring or poly boundary is self-intersecting) as I tried to load it in the map.

I tried first to use the ST_IsValid function directly in the PG/PostGIS DB, but it was not able to locate all invalid (to ArcGIS) features in the data.

The approach that I used with success was the following:

  1. Export the polygon layer to shapefile through QGIS;
  2. Run the Repair Geometry tool (from ArcToolBox > Data Management Tools > Features) in ArcGIS over the exported shapefile;
  3. Import the corrected shapefile, from QGIS, to the PG/PostGIS DB with a different name;
  4. Update the geometries of the original layer based on the corrected layer through SQL.

Hope this helps anyone.

1

Normally I use self intersection in 2D and Basic geometry integrity in FME/GeometryValidator.. and I use it 2 times.(reader, GeometryValidator, GeometryValidator and then writer). If that does not work I add also spike remover..

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.