<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.italic1
        {mso-style-name:italic1;
        font-style:italic;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=WordSection1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>The WKT string that you have posted does not pass:
SOD_UTIL.VALIDATE_WKTGEOMETRY. I do not know what version of Oracle you are
using but if my  memory serves the WKT functions and procedures were/are very
limiting. I do not believe that the 10g versions support curves. In addition I
thing the syntax is somewhat different than AGF/FGF. <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>From the Oracle docs:<o:p></o:p></span></p>

<p><span lang=EN style='font-family:"Tahoma","sans-serif";color:black'>To be
valid, the input geometry must be in the well-known text (WKT) format, as
defined by the Open Geospatial Consortium and the International Organization
for Standardization (ISO).<o:p></o:p></span></p>

<p><span lang=EN style='font-family:"Tahoma","sans-serif";color:black'>This
function is patterned after the SQL Multimedia recommendations in <span
class=italic1>ISO 13249-3, Information technology - Database languages - SQL
Multimedia and Application Packages - Part 3: Spatial</span>.<o:p></o:p></span></p>

<p><span lang=EN style='font-family:"Tahoma","sans-serif";color:black'>To
validate a geometry in the well-known binary (WKB) format, use the <a
href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14255/sdo_util.htm#BJEJIBCC">SDO_UTIL.VALIDATE_WKBGEOMETRY</a>
function.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>mahpooya<br>
<b>Sent:</b> Monday, May 23, 2011 6:39 AM<br>
<b>To:</b> mapguide-users@lists.osgeo.org<br>
<b>Subject:</b> [mapguide-users] Re: how to convert agf to wkt?<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'>Let me introduce my code<br>
I use php and oracle database.<br>
I have an AGF geometry string ($geometryString in below code) that contain a <a
href="http://en.wikipedia.org/wiki/File:Circle_arc.svg" target="_top">circular
sector </a>;<br>
But oracle is not support AGF text format.<br>
Oracle have &quot;SDO_UTIL.FROM_WKTGEOMETRY&quot; that input geometry from wkt.<br>
I want to convert AGF to WKT and insert it to database.<br>
How can i convert it?<o:p></o:p></p>

<div style='border:solid #D0D0D0 1.0pt;padding:0in 0in 0in 0in'>

<p class=MsoNormal style='background:#F0F0F0'><span style='font-family:"Courier New";
color:#000088'>$geometryString</span><span style='font-family:"Courier New";
color:#339933'>=</span><span style='font-family:"Courier New";color:blue'>&quot;CURVEPOLYGON
((67.894181638047 32.989785090909 (LINESTRINGSEGMENT (70.229107873737
33.852692612795), CIRCULARARCSEGMENT (70.38340259381948 32.973385371885676 ,
70.2175355016466 32.096187451063344))))&quot;</span><span style='font-family:
"Courier New";color:#339933'>;</span><span style='font-family:"Courier New";
color:#000066'><br>
<br>
</span><span style='font-family:"Courier New";color:#000088'>$conn</span><span
style='font-family:"Courier New";color:#000066'> </span><span style='font-family:
"Courier New";color:#339933'>=</span><span style='font-family:"Courier New";
color:#000066'> oci_pconnect</span><span style='font-family:"Courier New";
color:#009900'>(</span><span style='font-family:"Courier New";color:blue'>'gis'</span><span
style='font-family:"Courier New";color:#339933'>,</span><span style='font-family:
"Courier New";color:#000066'> </span><span style='font-family:"Courier New";
color:blue'>'123456'</span><span style='font-family:"Courier New";color:#339933'>,</span><span
style='font-family:"Courier New";color:#000066'> </span><span style='font-family:
"Courier New";color:blue'>'127.0.0.1:1521/orcl'</span><span style='font-family:
"Courier New";color:#009900'>)</span><span style='font-family:"Courier New";
color:#339933'>;</span><span style='font-family:"Courier New";color:#000066'><br>
<br>
</span><span style='font-family:"Courier New";color:#B1B100'>if</span><span
style='font-family:"Courier New";color:#000066'> </span><span style='font-family:
"Courier New";color:#009900'>(</span><span style='font-family:"Courier New";
color:#339933'>!</span><span style='font-family:"Courier New";color:#000088'>$conn</span><span
style='font-family:"Courier New";color:#009900'>)</span><span style='font-family:
"Courier New";color:#000066'> </span><span style='font-family:"Courier New";
color:#009900'>{</span><span style='font-family:"Courier New";color:#000066'><br>
&nbsp; &nbsp; </span><span style='font-family:"Courier New";color:#000088'>$e</span><span
style='font-family:"Courier New";color:#000066'> </span><span style='font-family:
"Courier New";color:#339933'>=</span><span style='font-family:"Courier New";
color:#000066'> oci_error</span><span style='font-family:"Courier New";
color:#009900'>()</span><span style='font-family:"Courier New";color:#339933'>;</span><span
style='font-family:"Courier New";color:#000066'><br>
&nbsp; &nbsp; </span><span style='font-family:"Courier New";color:#990000'>trigger_error</span><span
style='font-family:"Courier New";color:#009900'>(</span><span style='font-family:
"Courier New";color:#990000'>htmlentities</span><span style='font-family:"Courier New";
color:#009900'>(</span><span style='font-family:"Courier New";color:#000088'>$e</span><span
style='font-family:"Courier New";color:#009900'>[</span><span style='font-family:
"Courier New";color:blue'>'message'</span><span style='font-family:"Courier New";
color:#009900'>]</span><span style='font-family:"Courier New";color:#339933'>,</span><span
style='font-family:"Courier New";color:#000066'> </span><b><span
style='font-family:"Courier New";color:#009900'>ENT_QUOTES</span></b><span
style='font-family:"Courier New";color:#009900'>)</span><span style='font-family:
"Courier New";color:#339933'>,</span><span style='font-family:"Courier New";
color:#000066'> </span><b><span style='font-family:"Courier New";color:#009900'>E_USER_ERROR</span></b><span
style='font-family:"Courier New";color:#009900'>)</span><span style='font-family:
"Courier New";color:#339933'>;</span><span style='font-family:"Courier New";
color:#000066'><br>
</span><span style='font-family:"Courier New";color:#009900'>}</span><span
style='font-family:"Courier New";color:#000066'><br>
</span><span style='font-family:"Courier New";color:#000088'>$sql</span><span
style='font-family:"Courier New";color:#339933'>=</span><span style='font-family:
"Courier New";color:blue'>'INSERT INTO &quot;GIS&quot;.&quot;P&quot;
(&quot;ID_AUTO&quot;, &quot;MYINT&quot;, &quot;MYSTR&quot;,
&quot;GEOMETRY&quot;) VALUES (1, 123, \'asd\', SDO_UTIL.FROM_WKTGEOMETRY(\''</span><span
style='font-family:"Courier New";color:#339933'>.</span><span style='font-family:
"Courier New";color:#000088'>$geometryString</span><span style='font-family:
"Courier New";color:#339933'>.</span><span style='font-family:"Courier New";
color:blue'>'\') )'</span><span style='font-family:"Courier New";color:#339933'>;</span><span
style='font-family:"Courier New";color:#000066'><br>
<br>
</span><span style='font-family:"Courier New";color:#000088'>$stid</span><span
style='font-family:"Courier New";color:#000066'> </span><span style='font-family:
"Courier New";color:#339933'>=</span><span style='font-family:"Courier New";
color:#000066'> oci_parse</span><span style='font-family:"Courier New";
color:#009900'>(</span><span style='font-family:"Courier New";color:#000088'>$conn</span><span
style='font-family:"Courier New";color:#339933'>,</span><span style='font-family:
"Courier New";color:#000066'> </span><span style='font-family:"Courier New";
color:#000088'>$sql</span><span style='font-family:"Courier New";color:#009900'>)</span><span
style='font-family:"Courier New";color:#339933'>;</span><span style='font-family:
"Courier New";color:#000066'><br>
<br>
</span><span style='font-family:"Courier New";color:#000088'>$r</span><span
style='font-family:"Courier New";color:#000066'> </span><span style='font-family:
"Courier New";color:#339933'>=</span><span style='font-family:"Courier New";
color:#000066'> oci_execute</span><span style='font-family:"Courier New";
color:#009900'>(</span><span style='font-family:"Courier New";color:#000088'>$stid</span><span
style='font-family:"Courier New";color:#339933'>,</span><span style='font-family:
"Courier New";color:#000066'> OCI_NO_AUTO_COMMIT</span><span style='font-family:
"Courier New";color:#009900'>)</span><span style='font-family:"Courier New";
color:#339933'>;</span><span style='font-family:"Courier New";color:#000066'><br>
</span><span style='font-family:"Courier New";color:#B1B100'>if</span><span
style='font-family:"Courier New";color:#000066'> </span><span style='font-family:
"Courier New";color:#009900'>(</span><span style='font-family:"Courier New";
color:#339933'>!</span><span style='font-family:"Courier New";color:#000088'>$r</span><span
style='font-family:"Courier New";color:#009900'>)</span><span style='font-family:
"Courier New";color:#000066'> </span><span style='font-family:"Courier New";
color:#009900'>{</span><span style='font-family:"Courier New";color:#000066'><br>
&nbsp; &nbsp; </span><span style='font-family:"Courier New";color:#000088'>$e</span><span
style='font-family:"Courier New";color:#000066'> </span><span style='font-family:
"Courier New";color:#339933'>=</span><span style='font-family:"Courier New";
color:#000066'> oci_error</span><span style='font-family:"Courier New";
color:#009900'>(</span><span style='font-family:"Courier New";color:#000088'>$stid</span><span
style='font-family:"Courier New";color:#009900'>)</span><span style='font-family:
"Courier New";color:#339933'>;</span><span style='font-family:"Courier New";
color:#000066'><br>
&nbsp; &nbsp; oci_rollback</span><span style='font-family:"Courier New";
color:#009900'>(</span><span style='font-family:"Courier New";color:#000088'>$conn</span><span
style='font-family:"Courier New";color:#009900'>)</span><span style='font-family:
"Courier New";color:#339933'>;</span><span style='font-family:"Courier New";
color:#000066'> </span><i><span style='font-family:"Courier New";color:#666666'>//
rollback changes</span></i><span style='font-family:"Courier New";color:#000066'><br>
&nbsp; &nbsp; </span><span style='font-family:"Courier New";color:#990000'>trigger_error</span><span
style='font-family:"Courier New";color:#009900'>(</span><span style='font-family:
"Courier New";color:#990000'>htmlentities</span><span style='font-family:"Courier New";
color:#009900'>(</span><span style='font-family:"Courier New";color:#000088'>$e</span><span
style='font-family:"Courier New";color:#009900'>[</span><span style='font-family:
"Courier New";color:blue'>'message'</span><span style='font-family:"Courier New";
color:#009900'>])</span><span style='font-family:"Courier New";color:#339933'>,</span><span
style='font-family:"Courier New";color:#000066'> </span><b><span
style='font-family:"Courier New";color:#009900'>E_USER_ERROR</span></b><span
style='font-family:"Courier New";color:#009900'>)</span><span style='font-family:
"Courier New";color:#339933'>;</span><span style='font-family:"Courier New";
color:#000066'><br>
</span><span style='font-family:"Courier New";color:#009900'>}</span><span
style='font-family:"Courier New";color:#000066'><o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div class=MsoNormal>

<hr size=2 width=300 style='width:225.0pt' align=left>

</div>

<p class=MsoNormal>View this message in context: <a
href="http://osgeo-org.1803224.n2.nabble.com/how-to-convert-agf-to-wkt-tp6391716p6393870.html">Re:
how to convert agf to wkt?</a><br>
Sent from the <a
href="http://osgeo-org.1803224.n2.nabble.com/MapGuide-Users-f1803227.html">MapGuide
Users mailing list archive</a> at Nabble.com.<o:p></o:p></p>

<div>

<div class=MsoNormal align=center style='text-align:center'>

<hr size=2 width="100%" align=center>

</div>

<p class=MsoNormal>Email Scan by McAfee <o:p></o:p></p>

</div>

</div>

</body>

</html>