Il 27/09/2012 05:02, Calvin ha scritto:
Hi
I am a big fan of Web2py and would like to use the DAL for capturing
location specific information. I use MySQL as a back-end and would
like to understand how I could define a table with MySQL's Spatial
Extension data types into the DAL and hopefully be able to access this
with SQLFORM. For instance, how could I get the DAL to define a field
as a WKT point?
as long as I have tested you can:
1) define your table with geometry:
db.define_table('mytab'
Field('geometry_name'),
Field('the_geom', 'geometry()')
)
2) than you can insert geometries in this way:
info = dict(
geometry_name = 'test',
the_geom = 'POINT(0 0)'
)
db.mytab.insert(**info)
I suggest you to manage your geometries using the power of python-gdal
useful for wkt/b conversion and not only
hope it could help
Cheers
Manuele
Many thanks
Calvin
--
--