Is there a reason you must use MySQL?  GeoDjango works much better
with PostgreSQL with the PostGIS extensions.

On Mar 31, 11:40 am, Greg_IAP <[EMAIL PROTECTED]> wrote:
> Hi everybody,
>
> I'm working on a image processing pipeline for french astrophysicians
> using web services through django.
> i'm using mysql database with innodb storage engine.I need to use geo
> django because i must be able to locate images taken by telescops in
> the celestial sphere (with mutlipolygon queries).
> I know that geodjango works partially with mysql (only MBR functions,
> and spatial queries reduced to work with myisam tables).
> But what does it mean?
>
> each image is a multipolygon. i have a image table in mysql containing
> a multipolygon field, this multipolygon is computed by reading image's
> header in a python data structure. So i have the structure of the
> multipolygon(the image) and i want to save it in my database .
>
> In my models.py :
> from django.contrib.gis.db import models (and it works, everything is
> imported)
> class Image(...)
>    ...
>    skyfootprint = models.MultiPolygonField()
>    objects = models.GeoManager()
>    ...
>    ...
> But after that , what could i do?
> i have to transform it in a wkt format to save in mysql? how ? is
> geomfromtext function exists with this configuration?
>
> i tried to insert it directly in mysql like that, for testing:
> SET @g = 'MULTIPOLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7, 5
> 5))';
> INSERT INTO spica2_image (skyfootprint) VALUES (GeomFromText(@g));
> nothing works:
> ERROR 1416 (22003): Cannot get geometry object from data you send to
> the GEOMETRY field
>
> what is the right insert expression?
> Can i do it through django and how?
>
> Could anyone have a little experience in this kind of thing?
> Or just a simple example of how it works with mysql?
>
> Really thanks in advance...
>
> Greg
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to