Overlapping polygons

149
1
01-17-2020 12:12 AM
MichelleDiana_Hansen
New Contributor

I have a layer which contains 12 "factors".

The layer is a shapefile, where the municipalities needs to be in differents colours depending on which factors apply.

E.g.if "Beholder 2-kammer" contains 'x' and "Miljøstation/genbrug" does the same, then the municipality needs to be red.

But if "Beholder 2-kammer" contains 'x' and "Miljøstation/genbrug" doesn't, then it needs to be yellow, etc. etc.

There are many combinations, so I need a lot of colours.

I've tried with

"if($feature['KOMMUNE_parcelhuse_plast_ExcelToTable.Der_indsamles_hård_og_blød_plast_separat']=='x') + ($feature['KOMMUNE_parcelhuse_plast_ExcelToTable.Kun_genbrugsplads']=='x');

else if ($feature['KOMMUNE_parcelhuse_plast_ExcelToTable.Der__indsamles_kun_hård_plast']=='x') + ($feature['KOMMUNE_parcelhuse_plast_ExcelToTable.Miljøstation_genbrugsø']=='x');

else if ($feature['KOMMUNE_parcelhuse_plast_ExcelToTable.Der_indsamles_blandet_hård_og_blød_plast']=='x') + ($feature['KOMMUNE_parcelhuse_plast_ExcelToTable.Beholder_2_kammer']=='x')"

And

var geom1 = Polygon($feature['KOMMUNE_parcelhuse_plast_ExcelToTable.Kun_genbrugsplads']=='x');

var geom2 = Polygon($feature['KOMMUNE_parcelhuse_plast_ExcelToTable.Der_indsamles_hård_og_blød_plast_separat']=='x');

Overlaps(geom1,geom2);

var geom1 = Polygon($feature['KOMMUNE_parcelhuse_plast_ExcelToTable.Kun_genbrugsplads']=='x');

var geom2 = Polygon($feature['KOMMUNE_parcelhuse_plast_ExcelToTable.Der_indsamles_hård_og_blød_plast_separat']=='x');

Overlaps(geom1,geom2);

But it doesn't seem to work the right way.

0 Kudos
1 Reply
XanderBakker
Esri Esteemed Contributor

Hi Michelle Diana Hansen ,

If you just want to obtain all the unique combinations you can create a simple arcade expression that concatenates the 12 factors. You mentioned you need a lot of colors and perhaps that is not a good thing, since these colores will have to be distinguished and interpreted correctly by the end user to make sense. It would be better to apply some sort of classification that will make sense to the end user and avoids the interpretation of a large variety of colors.

I also notice in the second part that you are doing overlap of polygons. I assume from that that your polygons are overlapping. Arcade wont help you with visualizing this type of information, since each feature will have its own symbology (and the symbology profile does not allow accessing multiple geometries). In addition, when you have two polygon features which partially overlap, you have 3 resulting polygons of the combinations, buy you only have two features and the Arcade function will not replace the existing geometries. So, doing the overlap in Arcade is probably not what you are looking for.

0 Kudos