Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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)
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)
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!
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);
You might use the GeoProjectGeometry('mercator',AreaPolygon) function instead of the geoaggrgeometry() function
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).
There's just a minor aesthetic problem with this solution, which is that when selecting the layer, all internal borders will be selected aswell:
In this specific example, it's not a big deal, but using the real data, it gets kind of clunky for the end user:
Would you know by any chance if there's a workaround this?
Thanks again anyway!
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);
Thanks again Joost, this works really well!
Just for demonstration purposes, below is the polygon containing all customers areas of influence (circumferences):