I am trying to work with MVT tiles served by a geoserver instance.

The vector tile spec contains obligatory fields for type and geometry, and optional fields for id and tags.

The MVT tiles as served by the GeoServer instance leaves the id field as undefined, which isn't ideal when working with hover / selection workflows.

Is there a way to configure the GeoServer instance to automatically generate a unique id for populating the id field?

Example feature data as returned from mapbox queryRenderedFeature:

  type: "Feature",
  properties: {
    col_id: 'uniqueId',  <-- the table data contains a unique id
    col_1: 'some data',
    col_2: 'more data'
  id: undefined,  <-- this "outer" MVT id is undefined
  geometry: ...
  • what sort of data source are you using? does it have a primary key?
    – Ian Turton
    Feb 3, 2020 at 16:17
  • yes, the data has a unique primary key, currently served inside the properties object.
    – songololo
    Feb 3, 2020 at 20:00
  • could you add an example of the id - if it's the "wrong" format or too large it won't be added to the output. Other issue is what version of GeoServer are you using?
    – Ian Turton
    Feb 4, 2020 at 18:12
  • @ianTurton the primary id on the tables are strings, for example: "abcd1000001802738274". (That is the ids served inside the "properties" attribute alongside other column data for the source table.)
    – songololo
    Feb 5, 2020 at 19:57
  • I don't understand what you mean by served inside the properties attribute - can you include an example feature in your question using the edit button
    – Ian Turton
    Feb 6, 2020 at 9:04

1 Answer 1


GeoServer MVT generates the id if your source data has:

  • A Numeric primary key (or numeric identifier in whatever source is available)
  • The value is a valid 32 bits integer.

Has been implemented in https://osgeo-org.atlassian.net/browse/GEOS-8875 so it should be part of 2.15.2, but does not hurt to try out a more recent version.

  • Adding this comment for others running into this issue and unable to resolve due to reasons outside their control: Mapbox v1.7.0 now supports a promoteId option for sources. This will automatically furnish an MVT id based on a selected attribute.
    – songololo
    Feb 11, 2020 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.