Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Removal of duplicate or overlaping spatial objects.

Kli_crown
6 - Meteoroid

Hi,

 

I'm trying to reduce a table that has overlapping or duplicate spatial lines and then calculate the length of the remaining lines. However if I have an exact duplicate of 2 lines each with 1 mile length, the spatial summarize and st_length function. would return a length of 2 miles. 

 

However when combining a duplicate polygon the area and length function returns the area length of only the single combined polygon. I.E. a duplicate 1 mile square box would reduce to a single polygon and return an area of 1 sq mile and 4 mile length.

 

Is this a bug of is there another way to get the output I want?

 

Kli_crown_0-1657638394648.png

 

Kli_crown_1-1657638412456.png

 

6 REPLIES 6
Emmanuel_G
13 - Pulsar

Hi @Kli_crown ,

 

You can use sample tool to take just the first row for each ID and avoid duplicates rows for each.

 

You have to check ID in group by section.

 

Do you want something like this ?

 

Emmanuel_G_0-1657638918026.png

 

Kli_crown
6 - Meteoroid

Hi Emmanuel,

 

The ID column here is not an identifier so this would not work. Similarly, if I had 2 sets of spatial lines the identifiers may not be key value pairs between the datasets.

OllieClarke
15 - Aurora
15 - Aurora

This is really interesting @Kli_crown I'm also surprised that alteryx is doing this.

 

What I'd recommend is splitting your combined lines into points, and then remaking them as lines with the poly split/build tool. this seems to get past the issue

EDIT: Sorry, you also need to skip the first row per label. The poly split tool is splitting each line into 3 points, rather than the expected 2, so if you remove the first, or last one, then you get back to your proper length.

OllieClarke_0-1657639666466.png

 

 

I wonder if @Hollingsworth might be able to explain what's going on under the hood to cause this

Kli_crown
6 - Meteoroid

Your workaround seems indicate what I suspected. The decomposition of the lines includes duplicate points so your work around fails if there is more than 1 duplicate.

Kli_crown
6 - Meteoroid

See the attached workflow. If there's more than one duplicate as mentioned in my other post your workaround fails.

EdP
Alteryx
Alteryx

I believe the behavior of the Sum Tool is correct.  It's creating a Poly-line including each line segment.  Think of each of the three duplicate line segments as capturing a person walking between point A and point B.  If you Sum them you get a poly-line that includes the three line segments and the length of the poly-line, correctly, includes the length of all three segments.


Attached is a workflow that

(Option A)  Uses the Unique Tool to either remove the duplicate lines before the Sum Tool.  This doesn't work if the lines have their start/end points reversed.

(Option B)  Removes duplicate points from the poly-line produced by the Sum Tool and rebuilds the line (the effect is to get down to just the two endpoints).  

In the real world, I'm hopeful the context of the incoming data can be used to de-dupe before summing spatial data to avoid creating a poly-line based on duplicate line segments.

Ed Phelps
Sr CSE
Alteryx
Labels