<div>Make sure you are using:</div><div><a href="http://smtpout.secureserver.net">smtpout.secureserver.net</a></div><div><br></div><div>Try it now...</div><div><br></div><br clear="all">Bo Coughlin<br><a href="mailto:bo@rekindl.com">bo@rekindl.com</a><br>
704.414.0805<br>
<br><br><div class="gmail_quote">On Wed, Jul 29, 2009 at 8:56 AM, <span dir="ltr"><<a href="mailto:mario@geosar.ch">mario@geosar.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Thanks for you answer Mark,<br>
but st_linetocurve in my test cases always add a segment at the end or at<br>
the start of the original curve.<br>
St_linetocurve behaviour in this way is not good for me because I need the<br>
same curves with the same original points ( millimeter differences can be<br>
accepted ).<br>
<br>
Postgis functions curve geometry support is planed for development?<br>
<br>
Anyway thanks<br>
<br>
mario<br>
<div><div></div><div class="h5"><br>
-----Original Message-----<br>
From: <a href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a><br>
[mailto:<a href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a>] On Behalf Of Mark<br>
Cave-Ayland<br>
Sent: mercoledė, 29. luglio 2009 14:33<br>
To: PostGIS Users Discussion<br>
Subject: Re: [postgis-users] postgis 1.4 and curves<br>
<br>
<a href="mailto:mario@geosar.ch">mario@geosar.ch</a> wrote:<br>
<br>
> Hi,<br>
> the geometry is :<br>
> GeomFromText('COMPOUNDCURVE((723702.522 121248.15,723892.918<br>
> 121297.093),(723892.918 121297.093,724230.191<br>
> 121220.96),CIRCULARSTRING(724230.191 121220.96,724268.27<br>
> 121144.826,724251.951 121025.188))')<br>
><br>
> Then try:<br>
> select st_astext( st_linetocurve(<br>
> st_curvetoline(GeomFromText('COMPOUNDCURVE((723702.522<br>
121248.15,723892.918<br>
> 121297.093),(723892.918 121297.093,724230.191<br>
> 121220.96),CIRCULARSTRING(724230.191 121220.96,724268.27<br>
> 121144.826,724251.951 121025.188))')) ) )<br>
><br>
> I obtain:<br>
> COMPOUNDCURVE((723702.522 121248.15,723892.918 121297.093,724230.191<br>
> 121220.96),CIRCULARSTRING(724230.191 121220.96,724271.107624879<br>
> 121128.220456049,724253.605225062 121028.378284577),(724253.605225062<br>
> 121028.378284577,724251.951 121025.188))<br>
><br>
> After the arc another line is added and the points of the arc are<br>
different.<br>
><br>
> Thanks<br>
> Mario<br>
<br>
Hi Mario,<br>
<br>
I don't think that this is actually a PostGIS bug. The reason for this<br>
is that the transformation from curve to line is lossy in that any<br>
CIRCULARSTRINGs are converted from smooth curves into a series of short<br>
linestring segments, and so when converting back from line to curve, the<br>
curve fitting algorithm has no knowledge of the makeup of the original<br>
geometry. So as it traverses the input line segments, it will generate<br>
CIRCULARSTRINGs for lines that appear to fit around a given radius,<br>
regardless of whether they were originally mapped as LINESTRINGs or<br>
CIRCULARSTRINGs.<br>
<br>
Note that you can test yourself to see that your original input geometry<br>
and the output geometry are equivalent by comparing the results of the<br>
conversion from curves back to lines:<br>
<br>
<br>
postgis14=# select<br>
st_astext(st_curvetoline(geomfromtext('COMPOUNDCURVE((723702.522<br>
121248.15,723892.918 121297.093,724230.191<br>
121220.96),CIRCULARSTRING(724230.191 121220.96,724271.107624879<br>
121128.220456049,724253.605225062 121028.378284577),(724253.605225062<br>
121028.378284577,724251.951 121025.188))')));<br>
<br>
<br>
<br>
<br>
<br>
<br>
st_astext<br>
<br>
<br>
<br>
<br>
<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
-----------------------------------------------------------------------<br>
LINESTRING(723702.522 121248.15,723892.918 121297.093,724230.191<br>
121220.96,724235.615995416 121214.326233812,724240.708952709<br>
121207.434266378,724245.457602499 121200.300701051,724249.850504871<br>
121192.942723214,724253.87707694 121185.378058881,724257.527618341<br>
121177.62493199,724260.793334599 121169.702020504,724263.666358319<br>
121161.62841141,724266.139768134 121153.423554739,724268.207605384<br>
121145.10721671,724269.864888467 121136.69943211,724271.107624843<br>
121128.220456028,724271.932820652 121119.69071506,724272.338487925<br>
121111.1307581,724272.323649373 121102.561206832,724271.888340744<br>
121094.002706058,724271.033610735 121085.475873955,724269.761518465<br>
121077.001252409,724268.075128515 121068.599257524,724265.978503548<br>
121060.290130444,724263.476694515 121052.093888581,724260.575728495<br>
121044.030277402,724257.282594168 121036.118722851,724253.605225062<br>
121028.378284577,724251.951 121025.188)<br>
(1 row)<br>
<br>
<br>
postgis14=# select<br>
st_astext(st_curvetoline(GeomFromText('COMPOUNDCURVE((723702.522<br>
121248.15,723892.918<br>
121297.093),(723892.918 121297.093,724230.191<br>
121220.96),CIRCULARSTRING(724230.191 121220.96,724268.27<br>
121144.826,724251.951 121025.188))')));<br>
<br>
<br>
<br>
<br>
<br>
<br>
st_astext<br>
<br>
<br>
<br>
<br>
<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
----------------------------------------------------------------------------<br>
-----------------------------------------------------------------------<br>
LINESTRING(723702.522 121248.15,723892.918 121297.093,724230.191<br>
121220.96,724235.61599542 121214.326233776,724240.708952716<br>
121207.434266306,724245.457602506 121200.300700942,724249.850504877<br>
121192.942723069,724253.877076943 121185.378058699,724257.527618339<br>
121177.624931772,724260.793334591 121169.70202025,724263.666358302<br>
121161.62841112,724266.139768107 121153.423554414,724268.207605344<br>
121145.107216351,724269.864888414 121136.699431717,724271.107624775<br>
121128.220455602,724271.932820567 121119.690714601,724272.338487822<br>
121111.130757609,724272.32364925 121102.561206312,724271.8883406<br>
121094.002705508,724271.033610568 121085.475873377,724269.761518274<br>
121077.001251803,724268.075128299 121068.599256892,724265.978503305<br>
121060.290129786,724263.476694244 121052.0938879,724260.575728195<br>
121044.030276699,724257.282593838 121036.118722128,724253.605224622<br>
121028.378283815,724251.951 121025.188)<br>
(1 row)<br>
<br>
<br>
(Note that there are some small rounding errors since the CIRCULARSTRING<br>
conversions occur in different places, but again remember that these<br>
conversions are lossy)<br>
<br>
<br>
HTH,<br>
<br>
Mark.<br>
<br>
--<br>
Mark Cave-Ayland - Senior Technical Architect<br>
PostgreSQL - PostGIS<br>
Sirius Corporation plc - control through freedom<br>
<a href="http://www.siriusit.co.uk" target="_blank">http://www.siriusit.co.uk</a><br>
t: +44 870 608 0063<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br>
</div></div></blockquote></div><br>