Select to view content in your preferred language

ExportVectorTilesTask: falsely claims that service doesn't support exporting tiles

1562
3
Jump to solution
03-25-2022 03:01 PM
esp1rl
by
Occasional Contributor

The following code fails with an exception even though the service states exportTilesAllowed=true.

Exception: "Tile export is not enabled: Vector tile service does not support exporting tiles"

I've included code for loading the basemap using ArcGISVectorTiledLayer which accurately parses the exportTilesAllowed as true. See the screenshot.

 

var uri = new Uri("https://services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheBasisTerreng/VectorTileServer");
var basemap = new ArcGISVectorTiledLayer(uri);
await basemap.LoadAsync();
try
{
    var exportVectorTilesTask = await ExportVectorTilesTask.CreateAsync(uri);
}
catch (Exception e)
{
    // fails with: "Tile export is not enabled: Vector tile service does not support exporting tiles"
    throw;
}

 

 

esp1rl_0-1648244848795.png

I've also tested with "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_Export_v2/VectorTileServer" which works just fine.

 

Using ArcGIS Runtime for .NET v100.13 @WinUI 3

0 Kudos
1 Solution

Accepted Solutions
Nicholas-Furness
Esri Regular Contributor

Thanks for providing those URLs.

Each vector tile layer has a set of style resources to go with it. You can see those at these URLs:

What's happening is that the style for the GeocacheBasisTerreng layer actually brings a couple more layers into the mix. Here's the style JSON's sources property:

"sources": {
  "esri": {
    "url": "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheBasis/VectorTileServer/",
    "type": "vector",
    "maxzoom": 16,
    "tiles": [
      "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheBasis/VectorTileServer/tile/{z}/{y}/{x}.pbf"
    ]
  },
  "curves": {
    "url": "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheHoydekurver/VectorTileServer/",
    "type": "vector",
    "maxzoom": 16,
    "tiles": [
      "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheHoydekurver/VectorTileServer/tile/{z}/{y}/{x}.pbf"
    ]
  },
  "hillshade": {
    "url": "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheRelieff/VectorTileServer/",
    "type": "vector",
    "maxzoom": 16,
    "tiles": [
      "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheRelieff/VectorTileServer/tile/{z}/{y}/{x}.pbf"
    ]
  }
}

You can see the curves and hillshade layers that exist in addition to that specified in the GeocacheBasis layer.

One of those, GeocacheHoydekurver has this JSON definition which has exportTilesAllowed set to false, which is disabling the overall layer:

You would need to reach out to the service owner to see if they could enable exporting tiles for the GeocacheHoydekurver service.

Hope that helps!

View solution in original post

0 Kudos
3 Replies
esp1rl
by
Occasional Contributor

I played some more with different services.

https://services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheBasisTerreng/VectorTil...

https://services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheBasis/VectorTileServer

The first one is the one that fails. The second one is from the same vendor, same server. It works, and the only difference in the service json document is the service name.

 

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Thanks for providing those URLs.

Each vector tile layer has a set of style resources to go with it. You can see those at these URLs:

What's happening is that the style for the GeocacheBasisTerreng layer actually brings a couple more layers into the mix. Here's the style JSON's sources property:

"sources": {
  "esri": {
    "url": "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheBasis/VectorTileServer/",
    "type": "vector",
    "maxzoom": 16,
    "tiles": [
      "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheBasis/VectorTileServer/tile/{z}/{y}/{x}.pbf"
    ]
  },
  "curves": {
    "url": "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheHoydekurver/VectorTileServer/",
    "type": "vector",
    "maxzoom": 16,
    "tiles": [
      "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheHoydekurver/VectorTileServer/tile/{z}/{y}/{x}.pbf"
    ]
  },
  "hillshade": {
    "url": "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheRelieff/VectorTileServer/",
    "type": "vector",
    "maxzoom": 16,
    "tiles": [
      "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheRelieff/VectorTileServer/tile/{z}/{y}/{x}.pbf"
    ]
  }
}

You can see the curves and hillshade layers that exist in addition to that specified in the GeocacheBasis layer.

One of those, GeocacheHoydekurver has this JSON definition which has exportTilesAllowed set to false, which is disabling the overall layer:

You would need to reach out to the service owner to see if they could enable exporting tiles for the GeocacheHoydekurver service.

Hope that helps!

0 Kudos
esp1rl
by
Occasional Contributor

That explains alot. Thank you for your quick response.

0 Kudos