Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pls example by use parameters in sql for filter sql #924

Open
Hosseinpour6572 opened this issue Apr 28, 2023 · 1 comment
Open

pls example by use parameters in sql for filter sql #924

Hosseinpour6572 opened this issue Apr 28, 2023 · 1 comment

Comments

@Hosseinpour6572
Copy link

sql = "SELECT "Id" as osm_id,"Name", ST_asmvtgeom("Geom",!BBOX!) AS geom FROM "Provinces" where "Geom" && !BBOX! !PARAMS!"
.........

name = "province"
provider_layer = "my_postgis.province"
min_zoom = 2
max_zoom = 18
[[maps.params]]
name = ""CodeSabti""
token = "!PARAM!"
type = "int"
sql = " AND "CodeSabti" = 23 "
default_value = "23"


ERROR: syntax error at or near "LIMIT" (SQLSTATE 42601)

@ARolek
Copy link
Member

ARolek commented May 9, 2023

@Hosseinpour6572 can you set the geometry_type on your provider config? What's happening is that PostGIS is trying to form up SQL to inspect the database and get the geometry type and it's failing. If you set the geometry_type this step will be skipped. This is a common problem and should probably be added to a "Troubleshooting" section of the dataprovider: https://github.com/go-spatial/tegola/tree/master/mvtprovider/postgis

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

No branches or pull requests

2 participants