Closed pessimo closed 1 year ago
there's something wrong with my postgresql build. I found that I'm using a image which lack of protobuf-c support. So, I changed the image and the last problem goes away.
but still, tegola can't find geometry column.
if I change to use ST_AsBinary, and tell tegola geometry_type specificly, tegola will output something like
unable to convert geometry field (geometry) into bytes
and I find a similar issue in #779
Hey @pessimo
You are overwriting your geometry column in your sql.
[[providers.layers]]
name = "building"
# tablename = "vm_0.customer_0"
geometry_fieldname = "geometry"
geometry_type = "Polygon"
id_fieldname = "id"
sql = "SELECT ST_AsBinary(geometry) AS geom, id FROM vm_0.customer_0 WHERE geometry && !BBOX!"
Either set geometry_fieldname
to geom
or change your sql to SELECT ST_AsBinary(geometry) AS geometry [...]
. The postgis
provider expects the geometry as binary, the mvt_provider
expects the geometry as mvtgeom.
thanks for the reply, I understand now.
1、the geometry_fieldname is not pointing to the geometry column in the real table but is actually pointing to the result output of sql, so you need to match them two
2、 postgis provider need ST_AsBinary in sql and mvt_postgis provider need ST_AsMVTGeom, is that correct?
I tried the two providers, mvt_postgis paired with st_asmvtgeom gives me the right result with no error(I can see tiles in the viewer), while postgis provider paired with st_asbinary gives me no output(no tile in the viewer and also no error output).
so is there any difference between postgis and mvt_postgis provider?
There is a world of difference between the two.
postgis
: tegola fetches row from PostGIS, infers the geometry type, cuts data into pieces, creates the tiles and pushes it to the client.mvt_postgis
: PostGIS does the heavy lifting, tegola just passes the created tiles forward.https://github.com/iwpnd/tegola-example-bonn
This package contains the example for Bonn in a quick to start containerized setup. Check the configs there and see if that helps you to figure out the issue.
thanks again for the reply, I'll check the Bonn example
I tried to use the edge build as well as the latest build of gospatial/tegola docker image, with a pg14 database, but it gives me error.
This error persist even if i change to use prebuilt binary from the release.
This is my config.
the database table structure looks like this
so I'm pretty sure 'geometry' column is in the table.
content was downloaded from the internet, they were outlines of countries.
Also, I noticed that if I level geometry_type blank, the serve command will output a error like this
I tried to debug with
but it didn't output sql I want.
I tried to change sql with something like
It says