<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert a lat long value to ESRI Map Point in ArcGis using Java in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/convert-a-lat-long-value-to-esri-map-point-in/m-p/385839#M1164</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok i got it.&lt;/P&gt;&lt;P&gt;i use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; lineGeometry.startPath( GeometryEngine.project(23.63733,37.94721, SpatialReference.create(102113)));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lineGeometry.lineTo(GeometryEngine.project(24.07617,35.49069, SpatialReference.create(102113)));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it worked like a charm!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Aug 2014 16:56:56 GMT</pubDate>
    <dc:creator>GeorgeNikoloudakis</dc:creator>
    <dc:date>2014-08-28T16:56:56Z</dc:date>
    <item>
      <title>Convert a lat long value to ESRI Map Point in ArcGis using Java</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/convert-a-lat-long-value-to-esri-map-point-in/m-p/385834#M1159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Experts,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have the latitude and longitude values of a particular building. I am developing an Android application using ESRI maps. Below is the extent of the map. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Initial Extent: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;XMin: -8566095.96034392&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;YMin: 4719176.71718385&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;XMax: -8564317.60510787&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;YMax: 4720265.94483682&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Spatial Reference: 102100 (3857)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Full Extent: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;XMin: -8569852.61240501&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;YMin: 4715537.21773259&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;XMax: -8559507.60286413&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;YMax: 4724195.31894739&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Spatial Reference: 102100 (3857)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Units: esriMeters&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am facing the following difficulties. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Describing a point in Java using lat and long value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2)Converting the point from lat long form to the co-ordinate system in which the above details are.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 01:47:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/convert-a-lat-long-value-to-esri-map-point-in/m-p/385834#M1159</guid>
      <dc:creator>AdityaK_N</dc:creator>
      <dc:date>2012-09-12T01:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a lat long value to ESRI Map Point in ArcGis using Java</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/convert-a-lat-long-value-to-esri-map-point-in/m-p/385835#M1160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A Point (&lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/core/geometry/Point.html"&gt;com.esri.core.geometry.Point&lt;/A&gt;) in the API consists of an x coordinate and a y coordinate, so to create a point from lat and lon values, you can do:&lt;/P&gt;&lt;P&gt;Point point = new Point(lon, lat); // x is longitude and y is latitude)&lt;/P&gt;&lt;P&gt;So far the Point doesn't care about the spatial reference. When you come to add it to a map, however, you need to make sure your Point has x and y values in the correct units/spatial reference, i.e. the ones of your map. Lat-lon coordinates describe points in the 4326 or WGS84 spatial reference, and you want to project the points to the 102100 spatial reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have methods in the GeometryEngine class to project geometries (such as Points) from one spatial reference to another. One is &lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/core/geometry/GeometryEngine.html#project(double, double, com.esri.core.geometry.SpatialReference)"&gt;project(double x, double y, SpatialReference sr)&lt;/A&gt; and it takes lon/lat coordinates, and returns a point in the specified spatial reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in your case you can do something like:&lt;/P&gt;&lt;P&gt;Point projectedPoint = GeometryEngine.project(lon, lat, SpatialReference.create(102100));&lt;/P&gt;&lt;P&gt;or more generally, just use the spatial reference of your map:&lt;/P&gt;&lt;P&gt;Point projectedPoint = GeometryEngine.project(lon, lat, map.getSpatialReference());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~elise&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 10:54:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/convert-a-lat-long-value-to-esri-map-point-in/m-p/385835#M1160</guid>
      <dc:creator>EliseAcheson1</dc:creator>
      <dc:date>2014-07-09T10:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a lat long value to ESRI Map Point in ArcGis using Java</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/convert-a-lat-long-value-to-esri-map-point-in/m-p/385836#M1161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how i do the same with a polyline?&lt;/P&gt;&lt;P&gt;geometry returns a point? who i get the correct x,y values for polyline path?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2014 13:31:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/convert-a-lat-long-value-to-esri-map-point-in/m-p/385836#M1161</guid>
      <dc:creator>GeorgeNikoloudakis</dc:creator>
      <dc:date>2014-08-28T13:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a lat long value to ESRI Map Point in ArcGis using Java</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/convert-a-lat-long-value-to-esri-map-point-in/m-p/385837#M1162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use another overload of the 'project' method I link to in my previous comment. For example the next one below takes a Geometry as a parameter, an input spatial reference, and an output spatial reference. It returns a geometry, so if you pass in a polyline you'll get a polyline back and so on. The output spatial reference you can get from your map. The input spatial reference if you're using lat lon points will be WGS84 with wkid=4326, so you can create a SpatialReference object, to use as input spatial reference in these conversions, like this: SpatialReference.create(4326).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~elise&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2014 16:36:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/convert-a-lat-long-value-to-esri-map-point-in/m-p/385837#M1162</guid>
      <dc:creator>EliseAcheson1</dc:creator>
      <dc:date>2014-08-28T16:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a lat long value to ESRI Map Point in ArcGis using Java</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/convert-a-lat-long-value-to-esri-map-point-in/m-p/385838#M1163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i dont understant how to implement this in code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coordinate from google map&lt;/P&gt;&lt;P&gt;(23.63733,37.94721);&lt;/P&gt;&lt;P&gt;(24.63733,38.94721);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have a code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Polyline lineGeometry = new Polyline();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lineGeometry.startPath(23.63733,37.94721);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lineGeometry.lineTo(24.63733,38.94721);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it not shown at correct place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for point in this coordinates i use this code and it work like a charm on my map&lt;/P&gt;&lt;P&gt;Point pointGeometry = GeometryEngine.project(23.63733,37.94721, SpatialReference.create(102113));&lt;/P&gt;&lt;P&gt;Point pointGeometry = GeometryEngine.project(24.63733,38.94721, SpatialReference.create(102113));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to use this with a polyline;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2014 16:46:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/convert-a-lat-long-value-to-esri-map-point-in/m-p/385838#M1163</guid>
      <dc:creator>GeorgeNikoloudakis</dc:creator>
      <dc:date>2014-08-28T16:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a lat long value to ESRI Map Point in ArcGis using Java</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/convert-a-lat-long-value-to-esri-map-point-in/m-p/385839#M1164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok i got it.&lt;/P&gt;&lt;P&gt;i use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; lineGeometry.startPath( GeometryEngine.project(23.63733,37.94721, SpatialReference.create(102113)));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lineGeometry.lineTo(GeometryEngine.project(24.07617,35.49069, SpatialReference.create(102113)));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it worked like a charm!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2014 16:56:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/convert-a-lat-long-value-to-esri-map-point-in/m-p/385839#M1164</guid>
      <dc:creator>GeorgeNikoloudakis</dc:creator>
      <dc:date>2014-08-28T16:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a lat long value to ESRI Map Point in ArcGis using Java</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/convert-a-lat-long-value-to-esri-map-point-in/m-p/385840#M1165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suggest you try using &lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/core/geometry/GeometryEngine.html#project(com.esri.core.geometry.Geometry, com.esri.core.geometry.SpatialReference, com.esri.core.geometry.SpatialReference)"&gt;this project method&lt;/A&gt; overload. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can project your polyline in one go:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// spatial reference object you can reuse&lt;/P&gt;&lt;P&gt;SpatialReference wgs84 = SpatialReference.create(4326);&lt;/P&gt;&lt;P&gt;// project geometry and cast to the correct output geometry&lt;/P&gt;&lt;P&gt;Polyline projectedPolyline = (Polyline) GeometryEngine.project(lineGeometry, wgs84, map.getSpatialReference());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's other ways of doing it, and your code above works as you say, but if you do this lots of time you'll probably want to avoid projecting each point individually and avoid creating a SpatialReference object each time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~elise&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2014 17:04:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/convert-a-lat-long-value-to-esri-map-point-in/m-p/385840#M1165</guid>
      <dc:creator>EliseAcheson1</dc:creator>
      <dc:date>2014-08-28T17:04:36Z</dc:date>
    </item>
  </channel>
</rss>

