0

I took a vector tile to read the Layer and its corresponding features.

I found

My layer is "Landuse" I found all the features that are inside the "Landuse" Layer. I know that some of the features belong to Cemetry, Education etc..

The problem is , i am not able to find the ID of each feature like its been represented in the StyleSheet.

With out the "id", i cannot cannot seperate and display my features with in "landuse" layer

Here is one sample from the style sheet

 "id": "landuse_cemetery",
            "source": "orgVector",
            "source-layer": "landuse",
            "type": "fill",
            "minzoom": 11

My question is how to get the "id" along with features?

Please help me if i am missing some thing while reading the MVT tile.

1 Answer 1

1

You're confusing vector tile layers and style layers.

Your vector tiles contain a layer called landuse.

Your style can contain layers called whatever they want. In this case your style layer is called landuse_cemetery, but you could call it something else. The link between your style layer and the vector tile layer is this:

        "source-layer": "landuse",

If you want your cemetery layer to only include cemeteries, you probably want to add a further filter, which make use of other attributes in the data.

You can use Vector Inspector to better understand what those are.

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you so much Steve. Yes, i got confused with ID. But now its clear with your explanation. One more question i have is.. Can i go with MapBox "vector-tile-js" library to read MVT tiles ? Because i dont see any commits from past 2 years.
You should ask a separate question.
Sure. Will do that

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.