ST_ClipByBox2D and NaN Coordinates for POLYGON Z
Denis Rykov
rykovd at gmail.com
Thu Apr 3 14:43:51 PDT 2025
Is it expected for ST_ClipByBox2D to return NaN coordinates for 'POLYGON Z'
geometries?
Here is an example. The following SQL query:
SELECT
ST_AsText(
ST_SimplifyPreserveTopology(
ST_ClipByBox2D(
ST_GeomFromText(
'POLYGON Z ((9109727.260586184 7235765.611871982
0,9109793.397475857 7235780.37911723 0,9109880.551536862 7235799.226171476
0,9109912.974452058 7235743.263961895 0,9109949.41754929 7235677.287550647
0,9109986.927785816 7235610.625640362 0,9110029.388466287 7235535.445041807
0,9110063.152192863 7235481.075809712 0,9110058.528985653 7235478.79780619
0,9110066.094453445 7235463.4091950925 0,9110094.816342745
7235418.349932027 0,9110128.716586944 7235357.442269537 0,9110170.311475156
7235283.992565744 0,9110207.570403146 7235217.92016041 0,9110271.536255063
7235090.866183731 0,9110290.55592083 7235042.889807568 0,9110192.389007365
7235014.391634338 0,9110169.194172846 7235007.739006326 0,9109951.366830455
7235432.506918687 0,9109937.453975307 7235459.0955318 0,9109797.566462943
7235663.435298668 0,9109727.260586184 7235765.611871982 0))'
),
ST_MakeEnvelope(
9108725.486174684, 7235101.049109253,
9111416.069569945, 7237791.632504516
)
),
5
)
);
fails with the 'Geometry contains invalid coordinates' error, but wrapping
the geometry in ST_Force2D makes it work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20250403/a324094f/attachment.htm>
More information about the postgis-users
mailing list