[OpenLayers-Users] WKT insert into database

remi remiglobal at gmail.com
Wed Sep 1 08:08:16 EDT 2010


hi paolo,

you've got to have a database with GIS extension. I use mysql. mysql 4.1 and
above supports GIS and spatial extension.

my application is written in php with mysql. I use phpmyadmin to manage my
db

inserting can be as simple as this
-------------------------------------------------
insert into my_geometries (my_id,geometries) values
('$my_id',GeomFromText('$geometries'))

and retrieving like this
-------------------------------
select AsText(geometries) as geom from my_geometries where my_id='$my_id'

to view geometries from phpmyadmin, please use the latest phpmyadmin
version.

hope that helps,

remi

On Wed, Sep 1, 2010 at 7:10 PM, snuffer892 <paolo_tome at hotmail.com> wrote:

>
> Hello everyone,
> I followed one of the examples provided by openlayer, to allow users to
> draw
> geometries:
>
> http://svn.openlayers.org/sandbox/stvn/arcgis-server/examples/wkt.html
>
> I have, for the geometry designed,  an info window containing the
> coordinates in WKT format;
> Can someone help me understand how to insert geometries in a database?
>
> thanks a lot!
>  Paolo
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/WKT-insert-into-database-tp5486415p5486415.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100901/1924dd9d/attachment.html


More information about the Users mailing list