Distance from lat/lng to coast?

788
5
Jump to solution
01-09-2020 07:46 AM
CharlieGrosvenor
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)
0 Kudos
1 Solution

Accepted Solutions
XanderBakker
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
XanderBakker
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:

CharlieGrosvenor1
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?

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi bcgrosvenor ,

Is it a floating raster or integer?

0 Kudos
CharlieGrosvenor
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
0 Kudos
XanderBakker
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.

0 Kudos