Select to view content in your preferred language

Given a lat lng or x,y coordinate, I need to specify whether it is in a land or sea in map

804
5
Jump to solution
02-13-2019 10:49 PM
AarthiAdhikesavan
New Contributor

Given a lat lng or x,y coordinate, I need to specify whether it is in a land or sea in map using arcgis for javascript api.  Can anyone help with this ?  Thank you in advance.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Aarthi,

  Use a public map service like this:

https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Boundaries_and_Places/MapServ...

And yes you can use it in JS API or I would not have suggested it.

QueryTask:

QueryTask | API Reference | ArcGIS API for JavaScript 3.27 

Query:

Query | API Reference | ArcGIS API for JavaScript 3.27 

Sample of how to use Query and QueryTask with a mouse click:

ArcGIS API for JavaScript Sandbox 

View solution in original post

5 Replies
RobertScheitlin__GISP
MVP Emeritus

 Aarthi,

   You would need to use a map service that represents land and query that map service to see if the clicked point intersects if the returned features are greater than 0 then you are on land.

0 Kudos
AarthiAdhikesavan
New Contributor

Thank you Robert, for your response.  Can you please explain what kind of map service it is and will I be able to make use of it in arcgis api for javascript ?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Aarthi,

  Use a public map service like this:

https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Boundaries_and_Places/MapServ...

And yes you can use it in JS API or I would not have suggested it.

QueryTask:

QueryTask | API Reference | ArcGIS API for JavaScript 3.27 

Query:

Query | API Reference | ArcGIS API for JavaScript 3.27 

Sample of how to use Query and QueryTask with a mouse click:

ArcGIS API for JavaScript Sandbox 

AarthiAdhikesavan
New Contributor

Thank you so much.  I will have a look at these references and services.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.

0 Kudos