Distance from lat/lng to coast?

97
5
Jump to solution
01-09-2020 07:46 AM
Highlighted
New Contributor

Hello,

I have found the following: https://www.arcgis.com/home/item.html?id=edc6d54479014a49941122acf1104cbe which suggests it could be used to get the distance to coast from a point. I would like to be able to give a lat / lng and it returns the distance. Is this doable with ArcGIS online?

Thanks

Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Esteemed Contributor

Hi charlie.grosvenor@bellandclements.com ,

When you add the layer to a web map in ArcGIS Online you can search for the lat lon location and click on the map to get the result:

You can also use the REST API, like this:

https://oceans2.arcgis.com/arcgis/rest/services/Distance_to_Coast/ImageServer/identify?geometry=%7B%...

This will return the result in the format you specify:

View solution in original post

5 Replies
Highlighted
Esri Esteemed Contributor

Hi charlie.grosvenor@bellandclements.com ,

When you add the layer to a web map in ArcGIS Online you can search for the lat lon location and click on the map to get the result:

You can also use the REST API, like this:

https://oceans2.arcgis.com/arcgis/rest/services/Distance_to_Coast/ImageServer/identify?geometry=%7B%...

This will return the result in the format you specify:

View solution in original post

Highlighted
New Contributor

Thank you for the response. Have it working now. Do you know if its possible to get decimal values back. The API only seems to return whole numbers?

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi bcgrosvenor ,

Is it a floating raster or integer?

Reply
0 Kudos
Highlighted
New Contributor
Hello,
It returns:
{ "objectId": 0, "name": "Pixel", "value": "101", "location": { "x": -8412354.919917563, "y": 693391.3328019552, "spatialReference": { "wkid": 102100, "latestWkid": 3857 } }, "properties": null, "catalogItems": null, "catalogItemVisibilities": [] }
I assume that value is in kilometers. Is there a way to make it return something different?
Thanks
Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi charlie.grosvenor@bellandclements.com ,

I'm sorry, but yes the pixel type of the service is U16 (unsigned 16 bit integer, range 0 to 65535), so you will not obtain a decimal value.

Reply
0 Kudos