<?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: Map: Geometry cannot be converted in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479322#M44552</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This bug seems to still be present in V3.4.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am still trying to find a workaround.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Christophe&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Apr 2013 12:45:02 GMT</pubDate>
    <dc:creator>ChristopheDAMOUR</dc:creator>
    <dc:date>2013-04-04T12:45:02Z</dc:date>
    <item>
      <title>Map: Geometry cannot be converted</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479318#M44548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When using WMTSLayer in v3.3 I can't set the initial extent. Using the "center" option gives the same result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am getting this really weird log entry in the console:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[HTML]Map: Geometry (wkid: 4326) cannot be converted to spatial reference of the map (wkid: 4326)[/HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
var map;
require(["esri/map", "esri/layers/wmts", "dojo/parser", "dijit/layout/BorderContainer",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "dijit/layout/ContentPane", "dojo/domReady!"], function (myMap, wmts, parser) {

&amp;nbsp;&amp;nbsp;&amp;nbsp; parser.parse();
&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.config.defaults.io.proxyUrl = "proxy/proxy.ashx";

&amp;nbsp;&amp;nbsp;&amp;nbsp; map = new esri.Map("map", {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; extent: new esri.geometry.Extent(-166.27, -95.74, 166.67, 5.54, new esri.SpatialReference({ "wkid": 4326 }))
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp; var layerInfo = new esri.layers.WMTSLayerInfo({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifier: "world",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tileMatrixSet: "EPSG:4326",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format: "gif"
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp; var options = {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; serviceMode: "KVP",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layerInfo: layerInfo
&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp;&amp;nbsp; var wmtsLayer = new esri.layers.WMTSLayer("http://v2.suite.opengeo.org/geoserver/gwc/service/wmts",options);
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(wmtsLayer);
});
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess this must be a bug. The problem is not present in v2.8, which I am currently updating from.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 11:03:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479318#M44548</guid>
      <dc:creator>JonasEngedal</dc:creator>
      <dc:date>2013-01-24T11:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Map: Geometry cannot be converted</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479319#M44549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i can confirm your results and i would agree that it looks like a bug.&amp;nbsp; i will do some more testing and let you know what i find.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 15:12:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479319#M44549</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2013-01-24T15:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Map: Geometry cannot be converted</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479320#M44550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i have logged the following bug related to this issue.&amp;nbsp; thank you for bringing the item to our attention!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[NIM088460: It is not possible to control the map extent when a WMTS layer is present in JS API 3.3. Error (Map: Geometry (wkid: "x") cannot be converted to spatial reference of the map (wkid: "x") )]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 16:14:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479320#M44550</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2013-01-28T16:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Map: Geometry cannot be converted</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479321#M44551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any news or workaround for that bug ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Christophe&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 11:58:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479321#M44551</guid>
      <dc:creator>ChristopheDAMOUR</dc:creator>
      <dc:date>2013-03-01T11:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Map: Geometry cannot be converted</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479322#M44552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This bug seems to still be present in V3.4.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am still trying to find a workaround.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Christophe&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2013 12:45:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479322#M44552</guid>
      <dc:creator>ChristopheDAMOUR</dc:creator>
      <dc:date>2013-04-04T12:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Map: Geometry cannot be converted</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479323#M44553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Seems that this bug is still preset in 3.5 as well, would be nice if we could get an idea of a work around or when this will be fixed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 12:47:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479323#M44553</guid>
      <dc:creator>AdamSkoog</dc:creator>
      <dc:date>2013-05-22T12:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Map: Geometry cannot be converted</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479324#M44554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is my work around to fix this issue. Basically just need to use the geometry service to do a projection. Hopefully this helps someone out, I'm guess this is something they are not going to fix as it says in the documentation of setExtent that it needs to be in the same spatial reference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var extent = &amp;lt;populate extent&amp;gt;;

var projectParams = new esri.tasks.ProjectParameters();
projectParams.geometries = [extent];
projectParams.outSR = map.spatialReference;

var defer = esri.config.defaults.geometryService.project(projectParams);
dojo.when(defer, function (projectedGeometry) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (projectedGeometry.length &amp;gt; 0) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(projectedGeometry[0]);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
});
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:09:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479324#M44554</guid>
      <dc:creator>AdamSkoog</dc:creator>
      <dc:date>2021-12-11T21:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Map: Geometry cannot be converted</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479325#M44555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I know this won;t be the fix for everyone but for me it was a simple mater of just using the Spatial reference already defined.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, instead of&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;new esri.SpatialReference({ "wkid": 4326 })&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;use this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;map.spatialReference&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;of course if you are create a geometry that is not the same SR as the map then you will need to follow the example already given by AMxtremezx2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure why using the same wkid doesn't make the same SR but that fixed it for me... and really make more sense than creating a new one anyway.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2013 09:55:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479325#M44555</guid>
      <dc:creator>GarthTissington</dc:creator>
      <dc:date>2013-09-19T09:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Map: Geometry cannot be converted</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479326#M44556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I get the same issue in 3.6.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2013 07:44:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479326#M44556</guid>
      <dc:creator>kjetpett</dc:creator>
      <dc:date>2013-09-23T07:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Map: Geometry cannot be converted</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479327#M44557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using 3.7. My WMTS is not in ESPG:4326. When I use the service in ArcMap, the projection shows up correctly. When using the Javascript API, if you check the spatial reference for the layer it appears as 4326. After adding the layer to the map, the map's spatial reference is correct, but I still get this error. Could it be that the spatial reference isn't interpreted properly when creating the layer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Geometry (wkid: 32617) cannot be converted to spatial reference of the map (wkid: 32617)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2013 16:55:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479327#M44557</guid>
      <dc:creator>AzharIbrahim</dc:creator>
      <dc:date>2013-11-14T16:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Map: Geometry cannot be converted</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479328#M44558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I had the same issue when I was using wkid as string instead of number, coming from a JSON configuration file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After changing wkid to number, the extent for the tile service was loaded correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead of: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;new SpatialReference({wkid: "2056"})&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;use this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;new SpatialReference({wkid: 2056})&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;map.spatialReference is not available before map loading is complete.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 11:18:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479328#M44558</guid>
      <dc:creator>ChristophHoesli</dc:creator>
      <dc:date>2014-01-10T11:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Map: Geometry cannot be converted</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479329#M44559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I happened upon the post below, which worked for me as a way to do this with a non-WMTS layer that was in a different projection:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/75265"&gt;Map options: issues with non-mercator spatial reference&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Aug 2014 14:31:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479329#M44559</guid>
      <dc:creator>GregYetman</dc:creator>
      <dc:date>2014-08-12T14:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Map: Geometry cannot be converted</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479330#M44560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For anyone still having this issue (I was in 3.18), this appears to be the fix. It's not a "bug" per se, just that the wkid you pass to the SpatialReference constructor must be a number, not a string. If you are getting your wkid from a configuration file, consider using dojo/number.parse() to convert it to a number.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 00:50:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-geometry-cannot-be-converted/m-p/479330#M44560</guid>
      <dc:creator>TimCollyer</dc:creator>
      <dc:date>2017-03-06T00:50:50Z</dc:date>
    </item>
  </channel>
</rss>

