GeoDjango installation instructions correction?

1 view
Skip to first unread message

Wensing, Matthew (CNI-Palm Beach)

unread,
Sep 14, 2007, 11:56:56 AM9/14/07
to django-d...@googlegroups.com
The installation instructions for GeoDjango say:

* Required: PostGIS v1.1.0 and above.
* Recommended: Postgis v1.2.1 PostGIS
<http://postgis.refractions.net/download/> and greater. The latest
version of PostGIS is v1.3.1
<http://postgis.refractions.net/news/20070809/>
* First build & install PostGIS.

If I am understanding things correctly, GeoDjango uses ST_* functions in
PostgreSQL, but these functions weren't added until 1.2.1. I am in the
process of upgrading from 1.1.9 to 1.3.1 because of this. The
documentation for the branch should probably be changed to reflect this,
no? Or am I missing something?

Matt

Justin Bronn

unread,
Sep 14, 2007, 1:49:25 PM9/14/07
to Django developers
> If I am understanding things correctly, GeoDjango uses ST_* functions in
> PostgreSQL, but these functions weren't added until 1.2.1.

I started developing GeoDjango when PostGIS 1.2.1 was the latest. I
believe PostGIS began adding the ST_* routines in 1.2.1, and in 1.3.1
they deprecated any non-ST_* routines (e.g., in versions after 1.3.1
Transform(), GeomFromText(), etc. are completely replaced with their
ST_* counterparts).

I was aiming for compatibility with 1.1.0 and above, and the spatial
ORM automatically prefixes the lookup types with "ST_" if you're
running 1.2.1+. However, I see that I was mistaken in some of my
assumptions. Specifically, I thought that ST_GeomFromText and
ST_Transform were available in 1.1.0 -- which is apparently not the
case (I relied on comments in the SVN version that stated these
functions were introduced in 1.1.0). GeoDjango has hard-coded 'ST_'
references in the following locations:

http://code.djangoproject.com/browser/django/branches/gis/django/contrib/gis/db/backend/postgis/field.py#L107
http://code.djangoproject.com/browser/django/branches/gis/django/contrib/gis/geos/base.py#L204

If you change these lines to delete the 'ST_' prefix, then it should
work. I'll try and patch this issue -- thanks for posting!

-Justin

Wensing, Matthew (CNI-Palm Beach)

unread,
Sep 17, 2007, 12:42:12 PM9/17/07
to django-d...@googlegroups.com
Justin,

This issue inspired me to try upgrading my whole geo stack to PostGIS
1.3.1 and PG 8.2.4, which I have finally managed to do successfully.
Thanks for the patch, anyway, in case someone else comes down the same
path I did.

Matt

Reply all
Reply to author
Forward
0 new messages