I am using psycopg2 and haven't modified any code.  Can't explain why I
wasn't getting the '%s' expansions to wrap in the single tick marks.

I ended up side-stepping this issue by hard-coding my default SRID into
the srid keyword arg on __init__ in geos/base.py, which will work for
this project.  I'll try to get you more details eventually.

Matt


-----Original Message-----
From: django-developers@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Justin Bronn
Sent: Wednesday, September 19, 2007 11:10 AM
To: Django developers
Subject: Re: GeoDjango: ST_Transform broken (no SRID on first arg)?


Matt,

I'm having difficulty reproducing this error, as the objects I create
from the admin save ok.

Can you provide the code for your model and/or a more verbose traceback?
Are you using psycopg2?  Have you modified any parts of the code,
especially any GEOS components?

I ask because the GEOS geometries include the the __conform__() and
getquoted() routines which are used to provide the '%s' expansions for
psycopg2.  For example, "POINT(5 23)" would become
"ST_GeomFromText('POINT(5 23)', 4326)" -- and the call you posted is
missing any ST_GeomFromText() references.  While we used to use the
PostGIS canonical EWKT (e.g., "SRID=4326;POINT(5 23)"), I decided to use
the ST_GeomFromText() function because it should be agnostic to spatial
database backends, rather than exclusive to PostGIS.

-Justin





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to