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.
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 theid_fieldname
is not set then the default column name ofgid
is used. But what about situations where no feature ID needs to encoded? In this instancetegola-postgis
throws the following error:A quick workaround is to hardcode the feature id by adding the following SQL statement to the provider layer:
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 sayMUST
be unique.