top of page

Classic ARC/INFO Commands in PostGIS: Symmetrical Difference

Today we'll start exploring some of the topological functions in ARC/INFO such as Symmetrical Difference, Erase, Intersect, Identity, and Union. These are known as the overlay toolset in ArcGIS Pro. But, years and years ago, these tools were the bread and butter of what made ARC/INFO such a powerful tool.


Funny side conversation and name drop


In 1990 I was in Redlands, CA benchmarking ARC/INFO.  We had a really “difficult” task for them: overlay 25,000 hexagons with 25,000 triangles!!!  They were running it on a Sun  Sparcstation 1 – so, back then, this was very difficult. Today, not so much.  


They started the task before lunch, and it was done when we got back – very impressive.  After the two day benchmark was over, we were off to Ottawa to visit with GeoVision to run the benchmark there.  As we were leaving, Jack Dangermond grabbed my arm and said “you make them do the intersection test“.  I curtly nodded, and he pointed his finger at me and reiterated “no, I’m serious, you make them do it“.


Lo and behold, when the time came to run the test, the President of GeoVision acknowledged that based on their timing estimation, it would take around 3 days to complete the task – so they opted not to do it.  Back then, ARC/INFO was the only software that could do a task like that.


Now of course, other software products can do these tests, but I don’t think there is anything as fast as ARC/INFO doing overlays on a COVERAGE.


I’ve attempted to create the same shapes as is illustrated in the ESRI user manual.  

We'll first look at Symmetrical Difference, that return those features that do not intersect, as shown in the ArcGIS Pro help manual:


ree

The code for this is quite easy, simply using the ST_SymDifference function:

Here I am returning the symmetrical difference between two polygon features. You can modify this query by returning any attribute you'd like.


Here is an example of the original two polygons:

ree

and here is the result:

ree

well, I have some bad news for you - this answer is wrong!! The reason it is wrong is because the data is returned as a multipart geometry. Therefore, it only returns one record. However, you can see that we have two polygons. So, using a little SQL imagination, we can leverage the ST_Difference command as follows:


in this case, in line 1, we are obtaining the difference from a->b, and in line 4, we are obtaining the difference from b->a. I've also included the attributes for the column [side], which tells me if it is the right or left side.

 
 
 

© 2023, Arthur J. Lembo, Jr.

bottom of page