AnsweredAssumed Answered

Click to select a sub-polygon from a Multi-Polygon

Question asked by woobler on Oct 29, 2018
Latest reply on Oct 31, 2018 by woobler

This is my very first question, so please forgive me if i'm not using best practice... here is my question:

I have an web app where people can draw polygons over a basemap (html based), the polygons are then stored in my sql server database as a WKT string ("MULTIPOLYGON(((lat long, lat long, lat long, ...)),((lat long, lat long, lat long, ...)), ...)").

Which means one multipolygon string has many sub-polygons which display as different shapes on the screen when the page re-loads.

 

Is there a way to click on one shape and identify which sub-polygon is being clicked (the goal is to be able to delete it from sql if shape was incorrectly done)?

e.g. the bold string below, being sub-polygon number 2 of the multipolygon (also shown on the image i attached):

 

MULTIPOLYGON (((-74.4897049011512 40.802801297423777, -74.489796096257678 40.802841904076779, -74.489778661899081 40.802862207393964, -74.489690149001618 40.80282160075339, -74.4897049011512 40.802801297423777)), ((-74.489702550924846 40.802796180105481, -74.489713279760892 40.8027789222691, -74.489821909225967 40.802829680598578, -74.4898071570764 40.802835771595511, -74.489702550924846 40.802796180105481)))

 

I was thinking something like getting the coordinates of the click and check if it falls inside any of the sub-polygon, but i am having a hard time trying to do it, and was wondering if ArcGis API had already something existing.

 

thanks

 

Dan.

Attachments

Outcomes