Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
marcusva
Contributor III
Contributor III

How to aggregate superposed areas in a single area while conserving their intersection?

Hello,

I need to add a new layer to a map made of the aggregation of multiple areas.

The areas are based on a radius of 40km of multiple coordinates (the coordinates are the location of some customers), which I was able to generate for each customer using qlik script. (see below)

marcusva_0-1743085492985.png

I tried to use the GeoAggrGeometry() function to create the new polygon aggregating all areas, however it seems that the function cancels out any intersection between areas. Since I have customers that are very close to each other, I can't get a map with a full single merged area.(see below)

marcusva_1-1743085539258.png

Does anyone know if there's a workaround this issue or another way to get the expected result?

Thanks in advance for any information that may help!


reference: https://help.qlik.com/en-US/sense/November2024/Subsystems/Hub/Content/Sense_Hub/Scripting/Geospatial...

 

 

 

Labels (5)
1 Solution

Accepted Solutions
joostvanegmond7
Partner - Creator
Partner - Creator

Hi, 

maybe you should use the dissolve operation. I've just it in QLik Cloud with below example; that works; 

 

tmp:
load
1 as id,
GeoAggrGeometry('[[1,-29.069230769231],[1,-27.569230769231],[2,-27.569230769231],[2,-29.069230769231]]') as coordinate
autogenerate (1);

concatenate(tmp)
load
1 as id,
GeoAggrGeometry('[[1,-31.069230769231],[1,-27.969230769231],[2,-27.969230769231],[2,-31.069230769231]]') as coordinate
autogenerate (1)
;

[DissolveResultTable]:
Load * Extension GeoOperations.ScriptEval('
SELECT id, DissolvedPolygon FROM
Dissolve(dissolveField="id", resolution="Auto")
DATASOURCE dissolveDataset INTABLE crs="auto", polygonField="coordinate"
', tmp);

View solution in original post

4 Replies
joostvanegmond7
Partner - Creator
Partner - Creator

You might use the GeoProjectGeometry('mercator',AreaPolygon) function instead of the geoaggrgeometry() function

marcusva
Contributor III
Contributor III
Author

Hi Joost, thanks for your suggestion, it works!

In a visual way, however, the layer is not an unified polygon. Therefore it contains all the borders of each component (which I know can be faded by setting the opacity back to 0).

marcusva_0-1743619502094.png

There's just a minor aesthetic problem with this solution, which is that when selecting the layer, all internal borders will be selected aswell:

marcusva_1-1743619565696.png

In this specific example, it's not a big deal, but using the real data, it gets kind of clunky for the end user:

marcusva_2-1743619665008.png

 

Would you know by any chance if there's a workaround this?

Thanks again anyway!

 

joostvanegmond7
Partner - Creator
Partner - Creator

Hi, 

maybe you should use the dissolve operation. I've just it in QLik Cloud with below example; that works; 

 

tmp:
load
1 as id,
GeoAggrGeometry('[[1,-29.069230769231],[1,-27.569230769231],[2,-27.569230769231],[2,-29.069230769231]]') as coordinate
autogenerate (1);

concatenate(tmp)
load
1 as id,
GeoAggrGeometry('[[1,-31.069230769231],[1,-27.969230769231],[2,-27.969230769231],[2,-31.069230769231]]') as coordinate
autogenerate (1)
;

[DissolveResultTable]:
Load * Extension GeoOperations.ScriptEval('
SELECT id, DissolvedPolygon FROM
Dissolve(dissolveField="id", resolution="Auto")
DATASOURCE dissolveDataset INTABLE crs="auto", polygonField="coordinate"
', tmp);

marcusva
Contributor III
Contributor III
Author

Thanks again Joost, this works really well!

Just for demonstration purposes, below is the polygon containing all customers areas of influence (circumferences):

marcusva_1-1743681878890.png