<?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: Planetary computer tiles in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/planetary-computer-tiles/m-p/1195319#M78032</link>
    <description>&lt;P&gt;strange, I copied these names...&lt;/P&gt;&lt;P&gt;anyway, seems that I got a conception of&amp;nbsp;WebTileLayer incorrectly, the intention of this layer is to load tiles from different subdomains in parallel, right?&lt;/P&gt;&lt;P&gt;But my intention was - to load tiles from different URLs for some particular boundary box and seems that I "found" a way how to do this, but this solution is working pretty bad so far&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// tileObjects - array of objects with fields { bbox: number[]; link: string }

let customTileLayer = BaseTileLayer.createSubclass({
  properties: {
	urlTemplate: null
  },
  getTileUrl: function (level: any, row: any, col: any) {
	let tileUrl = '';
	const bounds = this.getTileBounds(level, row, col);
	// probably I missed something but getTileBounds() returns not lat/lon coordinates but a diffrent projection, like [-13227886.366918996, 4011415.244407987, -13208318.487677995, 4030983.123648987]
	let outSpatialReference = new SpatialReference({
	  wkid: 3857
	});
	tileObjects.forEach(tileObject =&amp;gt; {
	  // change coordinates projection
	  const objBbox = self.extentToBbox(projection.project(self.bboxToExtent(tileObject.bbox), outSpatialReference));
	  // if tile boundary box belongs to boundary box of particular "item" in planetary computer collection
	  if (self.rectanglesIntersect(objBbox, bounds) || self.rectanglesIntersect(bounds, objBbox)) {
		tileUrl = tileObject.link;
	  }
	});
	return tileUrl.replace("{z}", level).replace("{x}", col).replace("{y}", row);
  }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two more URLs to load items:&lt;/P&gt;&lt;P&gt;&lt;A href="https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-9&amp;amp;assets=data&amp;amp;nodata=-9999" target="_blank"&gt;https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-9&amp;amp;assets=data&amp;amp;nodata=-9999&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-10&amp;amp;assets=data&amp;amp;nodata=-9999" target="_blank"&gt;https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-10&amp;amp;assets=data&amp;amp;nodata=-9999&lt;/A&gt;&lt;/P&gt;&lt;P&gt;with tiles -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/11/348/818@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-9&amp;amp;assets=data&amp;amp;nodata=-9999" target="_blank"&gt;https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/11/348/818@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-9&amp;amp;assets=data&amp;amp;nodata=-9999&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/11/348/817@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-10&amp;amp;assets=data&amp;amp;nodata=-9999" target="_blank"&gt;https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/11/348/817@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-10&amp;amp;assets=data&amp;amp;nodata=-9999&lt;/A&gt;&lt;/P&gt;&lt;P&gt;so, item names would be ['USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-9', 'USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-10']&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess I need to work on math with fitting different "items" to each other(boundaries intersection).&lt;/P&gt;&lt;P&gt;If I'm wrong and you know a better way - let me know, please&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jul 2022 07:38:08 GMT</pubDate>
    <dc:creator>Karrok</dc:creator>
    <dc:date>2022-07-25T07:38:08Z</dc:date>
    <item>
      <title>Planetary computer tiles</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/planetary-computer-tiles/m-p/1194828#M78015</link>
      <description>&lt;P&gt;I'm trying to figure out how can I use Planetary computer as a provider of tiles.&lt;/P&gt;&lt;P&gt;I found how can I get links for a particular region, but unfortunately, Planetary Computer has a different format of URLs that supported by&amp;nbsp;&lt;SPAN&gt;WebTileLayer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;examples of URLs -&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=3dep-lidar-dsm&amp;amp;item=VA_UpperMiddleNeckQL2_B2_2018-dsm-2m-1-2&amp;amp;assets=data&amp;amp;nodata=-9999" target="_blank"&gt;https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=3dep-lidar-dsm&amp;amp;item=VA_UpperMiddleNeckQL2_B2_2018-dsm-2m-1-2&amp;amp;assets=data&amp;amp;nodata=-9999&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=3dep-lidar-dsm&amp;amp;item=VA_UpperMiddleNeckQL2_B2_2018-dsm-2m-1-1&amp;amp;assets=data&amp;amp;nodata=-9999" target="_blank"&gt;https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=3dep-lidar-dsm&amp;amp;item=VA_UpperMiddleNeckQL2_B2_2018-dsm-2m-1-1&amp;amp;assets=data&amp;amp;nodata=-9999&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As you can see the only difference is "item", but seems that&amp;nbsp;WebTileLayer works with subdomains only.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can anyone recommend which layer to use or how I can tweak&amp;nbsp;WebTileLayer to work not with subdomains.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I already tried:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let customTileLayer = WebTileLayer.createSubclass({
      properties: {
        urlTemplate: "https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/undefined/undefined/undefined@1x?collection=3dep-lidar-returns&amp;amp;item={subDomain}&amp;amp;assets=data&amp;amp;colormap_name=lidar-returns&amp;amp;nodata=-9999",
        subDomains: ['VA_UpperMiddleNeckQL2_B2_2018-dsm-2m-1-1', 'VA_UpperMiddleNeckQL2_B2_2018-dsm-2m-1-2']
      },
      getTileUrl: function (level: any, row: any, col: any) {
        return this.urlTemplate.replace("{z}", level).replace("{x}", col).replace("{y}", row);
      }
    });&lt;/LI-CODE&gt;&lt;P&gt;but it is not working&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 09:24:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/planetary-computer-tiles/m-p/1194828#M78015</guid>
      <dc:creator>Karrok</dc:creator>
      <dc:date>2022-07-22T09:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Planetary computer tiles</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/planetary-computer-tiles/m-p/1194955#M78021</link>
      <description>&lt;P&gt;The WebTileLayer supports the zxy format so something like this should work:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let customTileLayer = new WebTileLayer({
 urlTemplate: "https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=3dep-lidar-returns&amp;amp;item=VA_UpperMiddleNeckQL2_B2_2018-dsm-2m-1-2&amp;amp;assets=data&amp;amp;colormap_name=lidar-returns&amp;amp;nodata=-9999"
});&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;However, the service is returning this error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;No item 'VA_UpperMiddleNeckQL2_B2_2018-dsm-2m-1-2' found in '3dep-lidar-returns' collection&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;...so the URL parameters are not correct.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 15:32:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/planetary-computer-tiles/m-p/1194955#M78021</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2022-07-22T15:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Planetary computer tiles</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/planetary-computer-tiles/m-p/1195319#M78032</link>
      <description>&lt;P&gt;strange, I copied these names...&lt;/P&gt;&lt;P&gt;anyway, seems that I got a conception of&amp;nbsp;WebTileLayer incorrectly, the intention of this layer is to load tiles from different subdomains in parallel, right?&lt;/P&gt;&lt;P&gt;But my intention was - to load tiles from different URLs for some particular boundary box and seems that I "found" a way how to do this, but this solution is working pretty bad so far&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// tileObjects - array of objects with fields { bbox: number[]; link: string }

let customTileLayer = BaseTileLayer.createSubclass({
  properties: {
	urlTemplate: null
  },
  getTileUrl: function (level: any, row: any, col: any) {
	let tileUrl = '';
	const bounds = this.getTileBounds(level, row, col);
	// probably I missed something but getTileBounds() returns not lat/lon coordinates but a diffrent projection, like [-13227886.366918996, 4011415.244407987, -13208318.487677995, 4030983.123648987]
	let outSpatialReference = new SpatialReference({
	  wkid: 3857
	});
	tileObjects.forEach(tileObject =&amp;gt; {
	  // change coordinates projection
	  const objBbox = self.extentToBbox(projection.project(self.bboxToExtent(tileObject.bbox), outSpatialReference));
	  // if tile boundary box belongs to boundary box of particular "item" in planetary computer collection
	  if (self.rectanglesIntersect(objBbox, bounds) || self.rectanglesIntersect(bounds, objBbox)) {
		tileUrl = tileObject.link;
	  }
	});
	return tileUrl.replace("{z}", level).replace("{x}", col).replace("{y}", row);
  }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two more URLs to load items:&lt;/P&gt;&lt;P&gt;&lt;A href="https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-9&amp;amp;assets=data&amp;amp;nodata=-9999" target="_blank"&gt;https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-9&amp;amp;assets=data&amp;amp;nodata=-9999&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-10&amp;amp;assets=data&amp;amp;nodata=-9999" target="_blank"&gt;https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-10&amp;amp;assets=data&amp;amp;nodata=-9999&lt;/A&gt;&lt;/P&gt;&lt;P&gt;with tiles -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/11/348/818@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-9&amp;amp;assets=data&amp;amp;nodata=-9999" target="_blank"&gt;https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/11/348/818@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-9&amp;amp;assets=data&amp;amp;nodata=-9999&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/11/348/817@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-10&amp;amp;assets=data&amp;amp;nodata=-9999" target="_blank"&gt;https://planetarycomputer.microsoft.com/api/data/v1/item/tiles/WebMercatorQuad/11/348/817@1x?collection=3dep-lidar-dtm-native&amp;amp;item=USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-10&amp;amp;assets=data&amp;amp;nodata=-9999&lt;/A&gt;&lt;/P&gt;&lt;P&gt;so, item names would be ['USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-9', 'USGS_LPC_CA_LosAngeles_2016_LAS_2018-dtm_native-2m-1-10']&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess I need to work on math with fitting different "items" to each other(boundaries intersection).&lt;/P&gt;&lt;P&gt;If I'm wrong and you know a better way - let me know, please&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 07:38:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/planetary-computer-tiles/m-p/1195319#M78032</guid>
      <dc:creator>Karrok</dc:creator>
      <dc:date>2022-07-25T07:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Planetary computer tiles</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/planetary-computer-tiles/m-p/1195432#M78042</link>
      <description>&lt;P&gt;Correct, the data you're trying to load seems to represent two distinct datasets and the way to configure each one is via the URL parameters and &lt;EM&gt;not&lt;/EM&gt; as part of the base URL, so you will need two different layers.&amp;nbsp; It always helps is you have a simple CodePen or similar showing us what you're trying, that way we can better understand your issues.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 15:26:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/planetary-computer-tiles/m-p/1195432#M78042</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2022-07-25T15:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Planetary computer tiles</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/planetary-computer-tiles/m-p/1195502#M78045</link>
      <description>&lt;P&gt;Not sure if this helps as I'm not familiar enough with this service, but here's an example of how you can extend the BaseTileLayer to access the service and use custom parameters:&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/john-grayson/pen/VwXWbjK" target="_blank"&gt;https://codepen.io/john-grayson/pen/VwXWbjK&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 17:35:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/planetary-computer-tiles/m-p/1195502#M78045</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2022-07-25T17:35:21Z</dc:date>
    </item>
  </channel>
</rss>

