[postgis-tickets] [PostGIS] #3099: ST_curveToLine bad conversion for some arcs
PostGIS
trac at osgeo.org
Sun Nov 22 02:56:39 PST 2015
#3099: ST_curveToLine bad conversion for some arcs
--------------------------+----------------------------
Reporter: claudeunger | Owner: pramsey
Type: defect | Status: new
Priority: critical | Milestone: PostGIS 2.1.9
Component: postgis | Version: 2.1.x
Resolution: | Keywords: ST_curveToLine
--------------------------+----------------------------
Comment (by tiiipponen):
Hi
I include here file “arc_stroking_lw_arc_center.txt”. [[BR]]
It has fixed function “lw_arc_center” from file lwalgorithm.c. [[BR]]
http://postgis.net/docs/doxygen/2.1/dc/dc0/lwalgorithm_8c_source.html
[[BR]]
Original function returned incorrect centroid and radius for arc geometry.
[[BR]]
This attached function is minimum correction to fix the problem. [[BR]]
I have tested mathematics of attached function only with Python in Safe
Software FME environment. [[BR]]
I also include Python function in file arc_stroking_python.txt for
reference. [[BR]]
My Python function has also some extra functionality, [[BR]]
but implementing that in current PostGIS library is more complicated.
[[BR]]
I still would like to some day see following functionality in PostGIS
ST_CurveToLine function. [[BR]]
Tolerance parameter. In GIS data this is important. [[BR]]
If user gives “Tolerance parameter” value > 0, then “vertex count”
parameter means minimum vertices in stroked arc. [[BR]]
For example given tolerance with “vertex count”=0 means, that stroked arc
can even be straight line if tolerance allows it. [[BR]]
I am ready to test new fixed ST_CurveToLine function heavily when it is
available.
Timo
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3099#comment:6>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list