<?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 Geo Point Converter? (WGS84 to Web Mercator) in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/geo-point-converter-wgs84-to-web-mercator/m-p/504255#M1559</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does the API have a function for converting WGS84 lat/lon points to Web Mercator (as expected by the JMap / ArcGISLocalTiledLayer)? I have been unable to locate such...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Oct 2013 18:18:13 GMT</pubDate>
    <dc:creator>StephenBaier</dc:creator>
    <dc:date>2013-10-02T18:18:13Z</dc:date>
    <item>
      <title>Geo Point Converter? (WGS84 to Web Mercator)</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/geo-point-converter-wgs84-to-web-mercator/m-p/504255#M1559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does the API have a function for converting WGS84 lat/lon points to Web Mercator (as expected by the JMap / ArcGISLocalTiledLayer)? I have been unable to locate such...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 18:18:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/geo-point-converter-wgs84-to-web-mercator/m-p/504255#M1559</guid>
      <dc:creator>StephenBaier</dc:creator>
      <dc:date>2013-10-02T18:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Geo Point Converter? (WGS84 to Web Mercator)</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/geo-point-converter-wgs84-to-web-mercator/m-p/504256#M1560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've done a Utility Class with a function to reproject on the fly... so in case I need to reproject a Geometry (Point, Polyline, ...) from WGS 84 to the map's Spatial Reference, I'm using &lt;/SPAN&gt;&lt;STRONG&gt;GeometryEngine&lt;/STRONG&gt;&lt;SPAN&gt; !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is one solution :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;private static final SpatialReference SPATIAL_REF_WGS84 = SpatialReference.create(4326);&amp;nbsp; ...&amp;nbsp; public static Geometry projectGeometryWGS84ToMap(Geometry geometryWGS84, SpatialReference spatialRefMap)&amp;nbsp; throws ReprojectException {&amp;nbsp; Geometry result;&amp;nbsp;&amp;nbsp; try { &amp;nbsp; if (spatialRefMap != null &amp;amp;&amp;amp; SPATIAL_REF_WGS84.getID() != spatialRefMap.getID()) { &amp;nbsp;&amp;nbsp; // reproject here &amp;nbsp;&amp;nbsp; result = GeometryEngine.project(geometryWGS84, SPATIAL_REF_WGS84, spatialRefMap);&amp;nbsp; &amp;nbsp; } &amp;nbsp; else { &amp;nbsp;&amp;nbsp; // map is already in WGS 84 &amp;nbsp;&amp;nbsp; result = geometryWGS84; &amp;nbsp; }&amp;nbsp; }&amp;nbsp; catch (ArrayIndexOutOfBoundsException e) { &amp;nbsp; // In case of Polygon, I face this kind of Exception sometimes... but don't know why &amp;nbsp; throw new ReprojectException ...&amp;nbsp; }&amp;nbsp;&amp;nbsp; return result; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can obtain your map Spatial Reference by &lt;/SPAN&gt;&lt;STRONG&gt;jMap.getSpatialReference()&lt;/STRONG&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 06:47:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/geo-point-converter-wgs84-to-web-mercator/m-p/504256#M1560</guid>
      <dc:creator>JeremieJoalland1</dc:creator>
      <dc:date>2013-10-03T06:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Geo Point Converter? (WGS84 to Web Mercator)</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/geo-point-converter-wgs84-to-web-mercator/m-p/504257#M1561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hadn't seen that particular interface, I had tried using the GE.project( x, y, spatialRef ). When I used that it took minutes to do the conversion of a few thousand points, which was no acceptable at all. Using the method you mentioned it took only 523ms for about 13000 data points (30ms if I put them all in one line and do a "bulk" projection).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks! +1&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 12:15:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/geo-point-converter-wgs84-to-web-mercator/m-p/504257#M1561</guid>
      <dc:creator>StephenBaier</dc:creator>
      <dc:date>2013-10-03T12:15:43Z</dc:date>
    </item>
  </channel>
</rss>

