Skip to content
This repository has been archived by the owner on Aug 27, 2020. It is now read-only.

Support provider layers that don't have a feature_id #8

Open
ARolek opened this issue Jan 20, 2020 · 0 comments
Open

Support provider layers that don't have a feature_id #8

ARolek opened this issue Jan 20, 2020 · 0 comments

Comments

@ARolek
Copy link
Member

ARolek commented Jan 20, 2020

Some layers greatly benefit from having a feature_id encoded in them while others do not. Currently tegola-postgis assumes a feature_id will be encoded. If the user defines the id_fieldname in a provider layer then that field will be encoded as the feature ID in the tile. If the id_fieldname is not set then the default column name of gid is used. But what about situations where no feature ID needs to encoded? In this instance tegola-postgis throws the following error:

[ERROR] handle_map_layer_zxy.go:165: error marshalling tile: ERROR: mvt_agg_transfn: Could not find column '' of integer type (SQLSTATE XX000)

A quick workaround is to hardcode the feature id by adding the following SQL statement to the provider layer:

gid AS 1

All features for that provider layer will now have the feature ID of 1. This is not ideal, but according to the MVT spec feature IDs SHOULD be unique, but it does not say MUST be unique.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant