So, I have created a simple tool that converts an address into lat and long coordinates. I was wondering if there is an api which can use coordinates against a feature layer to see which polygon it belongs to using spatial join?
I basically want to map the coordinates to several hosted layers and get the polygon name which it maps to.
Solved! Go to Solution.
Hi @TheGamer ,
I'd suggest using the coordinates from your tool for the address to perform a spatial query on the feature layer. More information on the Query class can be found here:
https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html
There is also a convenient method to use to create a new query object from a feature layer documented here:
Hi @TheGamer ,
I'd suggest using the coordinates from your tool for the address to perform a spatial query on the feature layer. More information on the Query class can be found here:
https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html
There is also a convenient method to use to create a new query object from a feature layer documented here:
Hi, is there a way to check if the graphic contains the centroids of a feature layer?
@TheGamer Yes, use the geometryEngine.
Hi @BlakeTerhune I can't find the method, I want to get the ids of the feature layer whose centroids are in the graphic
I think the contains method is what you would use. While looping over the features in the feature layer, test contains and then look at the attributes of the current feature and grab the id when you get a true.