#4788 closed enhancement (fixed)
ST_SquareGrid (and others) don't support points on input
Reported by: | tobwen | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 3.1.0 |
Component: | postgis | Version: | master |
Keywords: | Cc: |
Description
current situation
Currently, ST_SquareGrid (and similar functions) only supports polygons as input. When using points, there's neither any output nor a warning.
suggestion
In many cases, it's useful to generate a grid, which is based on a point.
current workaround
Buffer the point a little bit.
SELECT * FROM ST_SquareGrid(1E1, ST_Buffer(ST_SetSRID(ST_MakePoint(12345, 54321), 3857), 1E-11));
Change History (5)
comment:1 by , 4 years ago
Version: | 3.0.x → master |
---|
comment:2 by , 4 years ago
comment:3 by , 4 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
The input geometry is really just a bounds to fill. A point has no area in its bounds, so the function naturally returns nothing.
/* quick opt-out if we get nonsensical inputs */ if (size <= 0.0 || gbounds_is_empty || bounds_width <= 0.0 || bounds_height <= 0.0) { funcctx = SRF_PERCALL_SETUP(); SRF_RETURN_DONE(funcctx); }
Note:
See TracTickets
for help on using tickets.
ST_Expand is a more efficient workaround.