Wednesday, April 25, 2012

Re: Confused about GeoDjango and PostGIS

Create a new spatial database and import the data.  That's by far your easiest option.  You'll need to create a POINT column (look at the PostGIS doc on how to add spatial columns) and then add rows either using the ORM or with a spatial query including something like this as part of the insert:

GeomFromText('POINT(' + x + ' ' + y + ')', 4326) 

where 4326 is the spatial reference system for longitude/latitude.



On Wed, Apr 25, 2012 at 11:17 AM, vishy <vishalsodani@gmail.com> wrote:
Hi,

I need to do spatial queries like find places within 5 miles of a
location given in latitude and longitude. So, I am thinking of
exploring PostGIS and GeoDjango. I have installed both. Now, I already
have a database which has a table for places with latitude and
longitude. Can I enable this db to use postgis and add column to this
table? Or, do I have to create a separate spatial db, create a table
with a column of geometry type and import data into that table (from
places table).? If I can use the existing database, how do I enable it
to use PostGIS?

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.


--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment