ThinkGeo.com    |     Documentation    |     Premium Support

Getting the max value to determine feature to use

I have a calculation that returns the percentage of each intersecting feature. I want to get the feature that returns the highest percentage.

How would I do this?

Hi Chris7,

Do you means, you want to query in an area, find which two features have the biggest overlapping area?

I think you can loop all the features, then call our API to get intersecting part, and calculate its size. Then you can find which two features.

The code should looks like:

PolygonShape poly1 = f1.GetShape() as PolygonShape;
PolygonShape poly2 = f2.GetShape() as PolygonShape;
poly1.GetIntersection(poly2).GetArea(GeographyUnit.DecimalDegree, AreaUnit.SquareMeters);

Wish that’s helpful.

Regards,

Don