Fixed #17448 -- Improved test and documented raw-sql gis query

This commit is contained in:
Claude Paroz 2012-08-25 14:37:00 +02:00
parent e6e01f619d
commit 62e1c5a441
2 changed files with 14 additions and 1 deletions

View file

@ -671,6 +671,17 @@ of abstraction::
__ http://spatialreference.org/ref/epsg/32140/
.. admonition:: Raw queries
When using :doc:`raw queries </topics/db/sql>`, you should generally wrap
your geometry fields with the ``asText()`` SQL function so as the field
value will be recognized by GEOS::
City.objects.raw('SELECT id, name, asText(point) from myapp_city')
This is not absolutely required by PostGIS, but generally you should only
use raw queries when you know exactly what you are doing.
Lazy Geometries
---------------
Geometries come to GeoDjango in a standardized textual representation. Upon