Opened 11 years ago
Closed 11 years ago
#2786 closed defect (wontfix)
st_buildArea returns null geom
Reported by: | mjurce | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | |
Component: | postgis | Version: | 2.0.x |
Keywords: | Cc: |
Description
select st_asText(st_buildArea( st_curvetoline(st_GeomFromText('MULTICURVE((715537.187 91770.539,715541.774 91782.060,715552.413 91787.648,715554.587 91795.922,715557.280 91801.092,715557.152 91795.643,715559.827 91794.284,715580.191 91814.057,715584.102 91815.280,715607.318 91826.989,715609.459 91829.830,715609.588 91839.660,715606.190 91837.710,715603.506 91837.322,715599.678 91834.403,715593.014 91831.325,715592.151 91830.889,715588.161 91831.919,715584.211 91834.084,715580.055 91837.074,715575.738 91839.398,715571.882 91841.719,715569.010 91842.588,715562.923 91844.881,715551.009 91847.220,715541.481 91845.339,715538.953 91842.280,715528.604 91842.106,715527.956 91846.181,715525.549 91849.393,715525.717 91849.515,715516.818 91860.240,715505.961 91849.502,715501.797 91845.422,715491.018 91834.644,715479.196 91810.681,715477.609 91812.014,715446.445 91826.586,715445.016 91827.461,715443.889 91828.677,715443.198 91830.216,715443.020 91831.896,715443.345 91833.529,715438.564 91830.984,715437.963 91829.340,715432.470 91814.247,715423.645 91818.572,715416.744 91810.214,715417.434 91810.007,715412.152 91802.380,715411.587 91794.394,715411.386 91791.554,715411.378 91783.632,715411.425 91782.252,715411.638 91777.893,715413.585 91771.282,715408.214 91770.716,715406.827 91770.484,715401.043 91769.483,715391.406 91767.254,715378.023 91762.959,715377.340 91762.528,715376.939 91761.826,715369.312 91760.180,715370.885 91759.433,715372.130 91757.782,715372.655 91755.781,715373.354 91720.501,715370.178 91721.285,715368.303 91705.398,715365.812 91705.458,715365.203 91699.854,715377.986 91699.243,715379.798 91688.574,715382.266 91682.528,715382.283 91684.028,715382.403 91688.324,715384.534 91695.865,715388.055 91701.887,715395.704 91714.939),CIRCULARSTRING(715395.704 91714.939,715395.742 91715.167,715395.679 91715.389),(715395.679 91715.389,715395.186 91716.412),CIRCULARSTRING(715395.186 91716.412,715394.911 91716.841,715394.579 91717.227),CIRCULARSTRING(715394.579 91717.227,715394.199 91717.561,715393.776 91717.838),CIRCULARSTRING(715393.776 91717.838,715393.310 91718.057,715392.808 91718.172),CIRCULARSTRING(715392.808 91718.172,715392.532 91718.189,715392.255 91718.174),(715392.255 91718.174,715405.385 91719.053,715417.385 91719.739,715436.177 91720.812,715440.093 91720.705,715444.376 91719.881,715446.928 91718.899,715448.936 91718.127,715453.889 91715.987),CIRCULARSTRING(715453.889 91715.987,715453.301 91717.020,715452.497 91717.896),(715452.497 91717.896,715453.751 91717.354,715460.889 91714.267,715464.984 91712.969,715469.019 91712.225,715473.079 91711.950,715488.666 91711.014,715488.704 91715.333,715472.950 91716.313,715475.197 91719.457,715480.797 91727.668,715484.038 91732.282,715485.594 91731.384,715488.190 91729.587,715486.780 91726.930,715495.235 91720.858,715508.002 91712.134,715514.139 91709.249,715521.129 91710.293,715521.337 91711.690,715524.085 91719.505,715525.492 91722.476,715531.480 91720.161,715536.262 91728.232,715527.955 91736.355,715533.632 91752.179,715536.527 91767.968,715537.187 91770.539))') ) ))
Change History (5)
comment:1 by , 11 years ago
Priority: | blocker → medium |
---|
comment:2 by , 11 years ago
With ST_SimplifyPreserveTopology(geom,0.005) build area works. Why not pass to st_makeValid() the result of st_buildArea() before return?
ST_CurveToLine() definitely has to be improved as stated here #2464.
comment:3 by , 11 years ago
mjurce,
That would just cover under the blankets any issues. That's more like a workaround or something that should be done by the user.
For example with ST_SimplifyPreserveTopology the tolerance you would want depends on spatial ref so we can't hard code something there. Nor do I think we should cause you might not want any simplification.
As far as ST_MakeValid that does have the issue of giving you something you don't want. So I think those types of solutions should be left up to the discretion of the user.
comment:4 by , 11 years ago
Sure. But I need the work to be done. ST_SimplifyPreserveTopology was a workaround for precision issue of st_curvetoline.
For me fixed with a better hack: commented out in geos the part that discards not valid rings. Let the user decide about the result of st_buildArea().
I'm not sure there is an issue here. Result seems to be a cause of rounding effects which makes the generated polygon invalid. Just to get to the point, your example can be reduced to:
which gives you a seemingly nice looking closed linestring which we can use our lazy ST_MakePolygon to build a polygon out of:
Except for the tincy littly problem that the generated polygon is invalid even though it passes the quick spot check of being closed.
Yields:
So build area is fine, it will return NULL if the resulting polygon is invalid. We can argue if ST_CurveToLine is at fault here and if anything can be done about it or if that's just what you get with floating precision issues.
I think this might end up being a won't fix (I've downgrade from blocker to medium) but will leave that for others more knowledgeable to judge.