ArcGIS Online Vector Tile Service not caching attributes

1401
15
12-07-2021 10:55 AM
ChrisLowrie1
New Contributor II

I'm trying to host Vector Tiles for a large, global point dataset (~35 million records).  The data has one attribute, a float.  The intention is to host the tiles for consumption in a MapboxGL application.

AGOL isn't building the vector tiles with this attribute, after enabling it.  I have enabled the attributes checkbox in 'Settings', and the tile cache was rebuilt, however the attribute is not part of the tile layer when tested in my application.  Currently AGOL shows the attribute as enabled.

Is this perhaps a problem with large datasets?  Or is there anything else I can do to force, or at least debug, the tile cache build process?  

(Note that I could try Mapbox Vector Tile Service next, but since my organization already uses Arc it would be best to do this through AGOL) 

Tags (2)
0 Kudos
15 Replies
ErikMartin
Occasional Contributor

Thanks for the update.  I just finished running a test on another vector tile service that I created a couple months ago.  It is still working properly, passing the requested attributes into the vector tiles, to support client-side data-driven styling.  I just used the exact same .aprx project and re-published it as a new vector tile service with a new name (without deleting the old one).  After publishing, I went into AGOL and selected the attributes to include in the tile cache and rebuilt the cache.  However, the attributes are not being passed through into the tiles on the new service.  The original tile service is still working as expected.  This makes me wonder if there was a change on the back end that has broken this functionality.

Coincidently, I noticed that the checkboxes on the dialog to select attributes are not behaving normally.  If you check in the actual box, it will not select.  If you click on the attribute name, however, it does select.  This behavior happens in both Chrome and Firefox and makes me wonder if it is an AGOL front-end problem.  Or, maybe just coincidence.

ChrisLowrie1
New Contributor II

My suspicion is that it's on the backend, since after selecting attributes, rebuilding the cache, and refreshing the page, the attributes are still shown as selected (meaning that the attribute selection is being stored, even if it is not being added to the finished tile cache).

Notably, the tiles do build, but they are geometry-only.

0 Kudos
ErikMartin
Occasional Contributor

I concur - the geometry is building fine, but attributes are not being attached when selected and the cache is rebuilt.  I did find that if I symbolize the layer in ArcGIS Pro before sharing as vector tiles, then the resulting tiles will have an automatically-generated "_symbol" attribute populated with integer values that correspond to each of the symbol classes in my data.  And the tiles draw up with the correct colors based on the styling in ArcGIS Pro.  In JavaScript, I am successfully able to use this "_symbol" attribute as a property to style my fill-color.  The actual attribute, however, is not accessible nor are any of the other attributes I selected to pass into the vector tiles. 

0 Kudos
RussellMoffitt
New Contributor

Two years later did anyone come across a solution to this issue?  It's now October 2023, and I have a vector tile layer published from a hosted feature layer exhibiting the same problem.  The attributes are not included in the vector tiles despite enabling them explicitly and rebuilding.

0 Kudos
ErikMartin
Occasional Contributor

A bug was  logged for this back in 2021:  BUG-000146399.  In February of this year the bug was closed and the status was updated to "Known Limitation."  "This is related to a known limitation with the software that lies outside of Esri's control. "

I don't know for sure, but I suspect what is happening is that there isn't a warning/error process to alert you if individual vector tiles get too big, so some attributes just get dropped to keep the .pbf tiles small enough.

IMHO, I think Esri sees vector tiles more as basemaps and less for serving feature data.  The "Esri way" is to use feature layer views and renderers. So changing this isn't a top priority.

I've read that Geoanalytics Engine can be used to create the vector tiles  (analogous to Tippecanoe, see below) but I haven't personally used it: https://developers.arcgis.com/geoanalytics/data/data-sources/vector-tiles/  It includes more controls than AGOL and produces a vector tile package that can be uploaded to AGOL, so if you have a Geoanalytics Engine license this may be the easiest option.  

I've successfully used 2 work different arounds, though both take a bit of effort.  The first was to build the tiles myself using Mapbox's Tippecanoe command line software.  This gives you granular control over tile creation so you can, for example, include certain attributes at different scales and/or use simplified geometries at some scales.  This can reduce the file size of individual .pbf tiles (and will throw a warning if you exceed the max tile size & features get dropped).  Then, you can write a Node.js vector tile server to server up those tiles.  This takes some patience, but there's some good resources out there to help with this: 

 

The other approach I've used is to publish my data as vector tiles to AGOL, but with only a single attribute that serves as a feature unique ID.  Then separately, upload all of the other attributes to a csv file.  On the initial app load, the CSV gets downloaded and parsed into a JS object.  Then use a function to find all of the Unique IDs for each class of a given symbology.  So, for example, if I have polygons of forest type I write a function to go through the CSV file and find all the Unique IDs for "Oak-Confier" and add these IDs to an array.  So you end up with arrays of IDs for each symbology class.  You can then use a Mapbox expression to style the vector tiles based on those arrays of IDs.  

Finally, I've also read of folks serving vector tiles directly from S3 (e.g. https://gis.stackexchange.com/questions/304483/is-it-possible-to-serve-vector-tiles-directly-from-s3), but I haven't done this personally.

Good luck -- it's a frustrating limitation, but the process of going through these workarounds definitely deepened my understanding of vector tiles, so that's a silver lining.

0 Kudos
RussellMoffitt
New Contributor

@ErikMartin, thanks for all of that info.  Yes, I have no issues making vector tiles through other means such as Mapbox's tools and cli like tippecanoe.  I will continue to go that route for many projects going forward.

A) To add some more info to this issue described in this thread, in Arc Pro I shared a feature as a weblayer, selected vector tile layer with attached hosted feature layer, and published to ArcGIS Online.  Attributes don't show up, but the 10 levels I used to classify the symbology are available as "_symbol" 0-9.  In the vector tile settings, enabling the attribute fields in the vector tiles and rebuilding the cache doesn't work.

B) In Arc Pro, publishing instead to a vector tile package file locally works fine.  If I upload that package to ArcGIS Online, all of the attributes are available to use in vector tile style json for feature rendering and labels.  I'm using this approach now to make things work as expected.

0 Kudos