[mapguide-users] Re: how to convert agf to wkt?

Zac Spitzer zac.spitzer at gmail.com
Mon May 23 07:03:32 EDT 2011


have you looked at the API Docs?

http://mapguide.osgeo.org/files/mapguide/docs/2.0/dd/db3/class_mg_agf_reader_writer.htm
http://mapguide.osgeo.org/files/mapguide/docs/2.0/d5/da0/class_mg_wkt_reader_writer.htm

z

On Mon, May 23, 2011 at 8:38 PM, mahpooya <mahpooya at gmail.com> wrote:
> Let me introduce my code
> I use php and oracle database.
> I have an AGF geometry string ($geometryString in below code) that contain a
> circular sector ;
> But oracle is not support AGF text format.
> Oracle have "SDO_UTIL.FROM_WKTGEOMETRY" that input geometry from wkt.
> I want to convert AGF to WKT and insert it to database.
> How can i convert it?
>
> $geometryString="CURVEPOLYGON ((67.894181638047 32.989785090909
> (LINESTRINGSEGMENT (70.229107873737 33.852692612795), CIRCULARARCSEGMENT
> (70.38340259381948 32.973385371885676 , 70.2175355016466
> 32.096187451063344))))";
>
> $conn = oci_pconnect('gis', '123456', '127.0.0.1:1521/orcl');
>
> if (!$conn) {
>     $e = oci_error();
>     trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
> }
> $sql='INSERT INTO "GIS"."P" ("ID_AUTO", "MYINT", "MYSTR", "GEOMETRY") VALUES
> (1, 123, \'asd\', SDO_UTIL.FROM_WKTGEOMETRY(\''.$geometryString.'\') )';
>
> $stid = oci_parse($conn, $sql);
>
> $r = oci_execute($stid, OCI_NO_AUTO_COMMIT);
> if (!$r) {
>     $e = oci_error($stid);
>     oci_rollback($conn); // rollback changes
>     trigger_error(htmlentities($e['message']), E_USER_ERROR);
> }
> ________________________________
> View this message in context: Re: how to convert agf to wkt?
> Sent from the MapGuide Users mailing list archive at Nabble.com.
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>



-- 
Zac Spitzer
Solution Architect / Director
Ennoble Consultancy Australia
http://www.ennoble.com.au
http://zacster.blogspot.com
+61 405 847 168


More information about the mapguide-users mailing list