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

Add get_bbox() function to geometries in Lua #2222

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

joto
Copy link
Collaborator

@joto joto commented Aug 13, 2024

Add new get_bbox() function for geometries in Lua. Like the get_bbox() function on OSM objects it returns the bounding box as four numbers in a Lua array (table). Having this function on geometries allows for more flexibility, you can call it on a centroid or a projected geometry for instance.

It is faster to call get_bbox() on the OSM object, because it removes the step of building the geometry first, so for those cases where this is good enough the old use is fine and is still supported.

See #2219

I have chosen the get_bbox() name instead of envelope(). a) this is consistent with get_bbox() on OSM objects and b) this leaves the option for adding a envelope() function later that returns a geometry, not a Lua array.

Add new get_bbox() function for geometries in Lua. Like the get_bbox()
function on OSM objects it returns the bounding box as four numbers in a
Lua array (table). Having this function on geometries allows for more
flexibility, you can call it on a centroid or a projected geometry for
instance.

It is faster to call get_bbox() on the OSM object, because it removes
the step of building the geometry first, so for those cases where this
is good enough the old use is fine and is still supported.

See osm2pgsql-dev#2219
@lonvia lonvia merged commit f8c78ae into osm2pgsql-dev:master Aug 13, 2024
26 checks passed
@joto joto deleted the geom-get-bbox branch August 14, 2024 11:50
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

Successfully merging this pull request may close these issues.

2 participants