Closed KCC-IT-Admin closed 1 year ago
@KCC-IT-Admin can you post your tegola config? I bet if you were to define the geometry_type
on the config this error would go away. What's happening is tegola is trying to infer your geometry_type during startup and is hitting an error. If you set the geometry_type
in the config this step is bypassed during init.
Duplicate of #343
@KCC-IT-Admin can you post your tegola config? I bet if you were to define the
geometry_type
on the config this error would go away. What's happening is tegola is trying to infer your geometry_type during startup and is hitting an error. If you set thegeometry_type
in the config this step is bypassed during init.
That was it exactly. Working now as intended, thank you!
I'm using a Tegola Lambda function, but when attempting to use the !ZOOM! function in my custom query it throws an exception:
2022-09-21 21:16:41 [FATAL] main.go:71: error fetching geometry type for layer (us_pos1): ERROR: syntax error at or near "ANY" (SQLSTATE 42601)
As I understand, !ZOOM! replaces with the requested Zoom level of the tile you request. Not sure why it's substituting ANY for it. if I substitute my !ZOOM! and !BBOX! variables with numbers, it works as expected in PGAdmin
the relevant toml sql:
sql = "SELECT gid, adm0code, pos1code, CASE When !ZOOM! < 5 THEN ST_AsBinary(ST_SimplifyPreserveTopology(geom,1)) When !ZOOM! < 10 THEN ST_AsBinary(ST_SimplifyPreserveTopology(geom,0.01)) When !ZOOM! >= 10 THEN ST_AsBinary(ST_SimplifyPreserveTopology(geom,0.005)) ELSE ST_AsBinary(geom) END AS geom FROM public.us_pos1 WHERE geom && !BBOX!"
The below query line works, but doesn't have the extra simplification I'm looking to get with my CASE commands. (Is simplification not supported in the Lambda version?)
sql = "SELECT gid, adm0code, pos1code, ST_AsBinary(ST_SimplifyPreserveTopology(geom,0.005)) AS geom FROM public.us_pos1 WHERE geom && !BBOX!"