This attribute rule used to work just fine until now. It uses arcade to intersect two polygon layers and calculate the intersecting areas based on a category field. Here is the attribute rule:
var buff = Buffer($feature,-0.001,'feet')
var intersectsLayer = Intersects(FeatureSetByName($datastore, "PER_NOTIOY_AIGAIOY"),buff)
var intcount = Count(intersectsLayer)
var expr = ' '
if(intcount == 0){
expr = 'εκτός αναρτησης'
}
else{
var das_list = ''
for (var f in intersectsLayer){
expr += f.KATHGORDX + " " + Round(area(Intersection($feature,f)),2) + " τ.μ. "
}
}
return
Hi @KosThe,
Have you tried modifying the Arcade to include the Spatial Reference?
Something around this lines like below:
var buff = Buffer($feature, -0.001, 'feet')
var intersectsLayer = Intersects(FeatureSetByName($datastore, "PER_NOTIOY_AIGAIOY"), buff)
var intcount = Count(intersectsLayer)
var expr = ' '
if (intcount == 0) {
expr = 'εκτός αναρτησης'
} else {
var das_list = ''
var sr = SpatialReference(2100) // EGSA87 Greek Grid
for (var f in intersectsLayer) {
var geom1 = Project($feature, sr)
var geom2 = Project(f, sr)
expr += f.KATHGORDX + " " + Round(Area(Intersection(geom1, geom2)), 2) + " τ.μ. "
}
}
return expr