Pulling an individual layer from a custom basemap's JSON file and then convert it to a feature class?

846
3
02-15-2021 02:38 PM
ZackLoken
New Contributor II

I've been trying to use the 'JSON to Feature' tool in ArcGIS Pro to convert a layer from a vector tile custom basemap into a feature class that can be added into the map for various data management purposes. However, the tool fails midway through the process and returns 'ERROR 001558: Error parsing json file' due to structure of the input JSON file. Any ideas how I might better define spatialReference, geometryType, and fields in the code below?

Here's my JSON code: *this is a subset taken from the JSON code for entire custom basemap*

{

    "version"8,
    "sources": {
        "esri": {
            "type""vector",
        }
    },
    "layers": [
        {
            "id""Marine area/1",
            "type""line",
            "source""esri",
            "source-layer""Marine area",
            "layout": {
                "visibility""visible",
                "line-cap""butt"
            },
            "paint": {
                "line-color""#768682",
                "line-width"4
            }
        }
    ]
}    
 
Anybody know if it is possible to convert an individual layer from a custom vector tile basemap into a feature class? And if so, how I might modify this code to be compatible with the 'JSON to Feature' tool in Pro? 
 
Thanks
0 Kudos
3 Replies
jcarlson
MVP Notable Contributor

The JSON to Feature tool is made to take in a very different sort of file than a vector tile's output. Vector tiles, as far as I know, are output as PBF. The JSON you've posted is just the style. I doubt you'll find any way of reliably pulling data from a vector tile service that isn't a lot more work for you.

Even if you didpull out the features from a vector tile service (which you can), you'll find that:

  1. The features are clipped to the tile's extent at the LOD you're viewing
  2. The features contain little or no more information than is necessary to render it in the basemap

Consider the world basemap vector data here:

jcarlson_0-1613430186033.png

Note that's QGIS shown there, which can interactively browse a vector tile service's features.

Each "feature", such as it is, only has the attributes "Viz" and "_symbol". Vector tile features may have additional attributes, but not always. Esri's vector tiles typically don't. Additionally, labels are their own features in vector tiles.

You're better off trying to find an actual feature service, perhaps via the Living Atlas or some Open Data site. Can you elaborate on what data you're trying to get and how you want to use it?

- Josh Carlson
Kendall County GIS
0 Kudos
ZackLoken
New Contributor II

Thanks, Josh. This makes sense and figured it wouldn't be as simple as simply defining spatial reference and geometry types.

I'm looking for a line/polygon feature class of the San Francisco Bay shoreline that I can use to clip the boundaries of County, State, and Federal lands found along the bay -- which often extend out into water -- for a map layout. All of the layers I've found through living atlas/open data sites don't align well with the basemap, so it wouldn't improve map aesthetics anymore than leaving the land boundaries as is. 

Think I'm just going to have to zoom-in a split out the non-land areas by hand; probably could have finished this already in the amount of time I've spent messing around with the JSON file. 

Best, 

Zack

0 Kudos
jcarlson
MVP Notable Contributor

Give a glance to what's in OSM, if all you need is a decent cutline. That you actually can export to GeoJSON and import as a feature class.

- Josh Carlson
Kendall County GIS