Select to view content in your preferred language

Converting an IPoint to an ILocation

431
1
Jump to solution
02-29-2024 12:35 PM
dwmkerr
New Contributor

I am trying to get weather data for places I am looking up with the 'geocode' and 'reverseGeocode' operations. I notice that they return IPoint objects, rather than latitude/longitude. Is there a way to convert an IPoint to an ILocation? The weather APIs I'm using need lat/long rather than x/y. Apologies if this is a dumb question I'm new to the APIs and not familiar with the coordinate systems!

0 Kudos
1 Solution

Accepted Solutions
GavinRehkemper
Esri Contributor

Hi, if you're using the geocode function, the default is to return the X and Y in the WGS84 spatial reference (SRID: 4326), which is essentially lat/long. The X will be the longitude and the Y will be the latitude. You can also pass in a different spatial reference for it to return and it will return the X/Y in that spatial reference. But you should not need to do that since you want lat/long and that is the default.

Here is a tutorial that may help: https://developers.arcgis.com/arcgis-rest-js/geocode-and-search/search-for-an-address/

 

View solution in original post

0 Kudos
1 Reply
GavinRehkemper
Esri Contributor

Hi, if you're using the geocode function, the default is to return the X and Y in the WGS84 spatial reference (SRID: 4326), which is essentially lat/long. The X will be the longitude and the Y will be the latitude. You can also pass in a different spatial reference for it to return and it will return the X/Y in that spatial reference. But you should not need to do that since you want lat/long and that is the default.

Here is a tutorial that may help: https://developers.arcgis.com/arcgis-rest-js/geocode-and-search/search-for-an-address/

 

0 Kudos