# Filter Vector Points by Class (Maps)

**URL:** <https://discuss.elastic.co/t/filter-vector-points-by-class-maps/329234>\
**Category:** Kibana\
**Tags:** maps\
**Created:** [April 3, 2023, 4:29pm UTC](https://discuss.elastic.co/t/filter-vector-points-by-class-maps/329234 "2023-04-03T16:29:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.hanna](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@m.hanna](https://discuss.elastic.co/u/m.hanna)\
**Post date:** [April 3, 2023, 4:29pm UTC](https://discuss.elastic.co/t/filter-vector-points-by-class-maps/329234/1 "2023-04-03T16:29:39Z")

</div>

We have a map server on a disconnected network that is serving vector tiles only (tileserver-gl-light). I can create a basemap in the Elastic Maps, but would like to be able to filter the points by class. For example, "place" is a point, but I would like to only display Country Name, so I would like to filter something like "class == country" to remove all city, state and continent names. Is that possible in Elastic Maps?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/2/f2634d012e1658aae696f4c2f710f5a8dc6569f6.png)

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [April 3, 2023, 9:23pm UTC](https://discuss.elastic.co/t/filter-vector-points-by-class-maps/329234/2 "2023-04-03T21:23:09Z")

</div>

Did you know that Elasticsearch can [serve vector tiles](https://www.elastic.co/blog/introducing-elasticsearch-vector-tile-search-api-for-geospatial)? You could load our map server features into Elasticsearch and use [layer filtering](https://www.elastic.co/guide/en/kibana/8.6/maps-layer-based-filtering.html) to narrow down the results by any feature property.

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [April 3, 2023, 9:29pm UTC](https://discuss.elastic.co/t/filter-vector-points-by-class-maps/329234/3 "2023-04-03T21:29:09Z")

</div>

If your vector tile server specifies different feature classes as different sources, then another option would be to add vector tiles with `Vector tiles` wizard and specify `source` field to only show features a single source

 ![Screen Shot 2023-04-03 at 3.18.24 PM](https://us1.discourse-cdn.com/elastic/original/3X/8/8/88f93c87c1abbc3832ac8d97393dba2f8a2263a1.png)

 ![Screen Shot 2023-04-03 at 3.18.32 PM](https://us1.discourse-cdn.com/elastic/original/3X/4/d/4dee8aa9f52eb5c18e29057d78fc58a780ad0b2a.png)

---

<div class="post-metadata">

**Author:** ![m.hanna](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@m.hanna](https://discuss.elastic.co/u/m.hanna)\
**Post date:** [April 3, 2023, 9:45pm UTC](https://discuss.elastic.co/t/filter-vector-points-by-class-maps/329234/4 "2023-04-03T21:45:40Z")

</div>

Layer filtering seems like what I would want, but I don't see the filtering option when I add the map source layer. Not sure if that is just for data coming from Elastic?

Unfortunately, the vector tiles we have don't have the sources broken out that granularly. In the example I posted "place" is a source layer, but it includes classes for "continent, country, state, and city" so all of those names show up. I was unsuccessful trying to specify a single class as the source layer.

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [April 4, 2023, 1:51am UTC](https://discuss.elastic.co/t/filter-vector-points-by-class-maps/329234/5 "2023-04-04T01:51:54Z")

</div>

> Layer filtering seems like what I would want, but I don't see the filtering option when I add the map source layer. Not sure if that is just for data coming from Elastic?

That is correct, filtering is only supported for layers from Elasticsearch

> Unfortunately, the vector tiles we have don't have the sources broken out that granularly

What are you using to serve the vector tiles? Does that application allow you to specify styles for the vector tiles? You could use [style expressions](https://maplibre.org/maplibre-gl-js-docs/style-spec/expressions/) to hide features.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 2, 2023, 1:52am UTC](https://discuss.elastic.co/t/filter-vector-points-by-class-maps/329234/6 "2023-05-02T01:52:36Z")

</div>

Closed on May 2, 2023, 1:52am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
