-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add bbox plugin #14
Add bbox plugin #14
Conversation
Can you have a look at the errors https://github.com/osm2pgsql-dev/osm2pgsql-themepark/actions/runs/8433369573/job/23096899346#step:4:79 ? You can also run these locally using |
Now tested with |
In the tilekiln implementation, the buffer size seems to be zoom level dependent. Should that also be supported by other implementations? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few tiny issues to fix, but apart from that it looks good to me. I haven't tested the result, but I guess you have. :-)
lua/themepark/plugins/bbox.lua
Outdated
{ | ||
name = 'db', | ||
postgis = { | ||
url = "postgres:///db" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this hardcoding a database name? Not sure how this works with bbox, but maybe leave this empty so it picks up database connection from PG* env vars if they are available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BBOX currently requires a configuraton, but it can be overwritten with env vars. A possbile way is to add comments at the begin of the config file explaining this.
Is it possible to get the used db parameters for adding a matching PG url?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The libpq library from PostgreSQL looks at some PG* env variables, this should work more or less everwhere unless that library is not used. So having no database config options is totally okay for osm2pgsql and should be for bbox also.
So there are several different ways of specifiying which database to use to osm2pgsql, maybe we can expose this information to Lua. But should we expose the original command line option or what's used in the end (taking env vars into account)? I have to think about this some more.
lua/themepark/plugins/bbox.lua
Outdated
end | ||
|
||
local config = { | ||
webserver = { server_addr = '0.0.0.0:8080' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default should probably be 127.0.0.1 to not open up a server to the world.
This is probably something we want to make configurable. The t-rex plugin also needs those settings. But okay for now. We can do that after this has been merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to 127.0.0.1 (0.0.0.0 is needed for Docker setups).
return keys1 | ||
end | ||
|
||
local function dump_toml(o, indent_size, parents) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to pull this out later and re-use it in the t-rex config plugin also.
lua/themepark/plugins/bbox.lua
Outdated
geometry_field = info.geom_column, | ||
geometry_type = string.upper(info.geom_type), | ||
srid = plugin.themepark.options.srid, | ||
-- simplify = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't set simplify
by default, escpecially when using osm2pgsql-gen.
I am merging this now. We can sort out the details of how to specify database access params later. |
Adaption of the t-rex plugin for bbox. Replaced the toml dependency, because its installation was too cumbersome for me.
Not tested yet with
shortbread_gen
and will try to make a simpler implementation like the tilekiln plugin.