Questions tagged [geodjango]

GeoDjango intends to be a world-class geographic Web framework. Its goal is to make it as easy as possible to build GIS Web applications and harness the power of spatially enabled data.

GeoDjango intends to be a world-class geographic Web framework. Its goal is to make it as easy as possible to build GIS Web applications and harness the power of spatially enabled data.

http://geodjango.org/

1020 questions
19
votes
3 answers

How to assign to a Django PointField model attribute?

Hi I have a Django Model as follows: class Address(models.Model): geoCoords = models.PointField(null=True, blank=True,) Now I create an instance of this model: A = Address() How can I set the coordinates of A's geoCoord field to (5.3, 6.2)? I…
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272
18
votes
3 answers

Calculate point based on distance and direction

I would like to calculate a point based on direction and distance using GeoDjango or GeoPy. For example, If I have a point that is (-24680.1613, 6708860.65389) I would like to find out a point 1KM North, 1KM East, 1KM Sourh and 1KM west using…
LondonAppDev
  • 8,501
  • 8
  • 60
  • 87
17
votes
4 answers

GeoDjango - GDAL library giving error

I am trying to get GeoDjango running on ubuntu and have hit a problem with GDAL. I have downloaded and installed GDAL without problem. I had to add the following line to my project settings: GDAL_LIBRARY_PATH = '/usr/local/lib/libgdal.so.1.15.1' …
Darwin Tech
  • 18,449
  • 38
  • 112
  • 187
17
votes
2 answers

Django AttributeError: 'DatabaseOperations' object has no attribute 'select'

I've got a GeoDjango instance connected to a PostGIS database backend. When I query a table in this database, I get the error in the title: AttributeError: 'DatabaseOperations' object has no attribute 'select' As suggested elsewhere, I checked to…
Adam
  • 3,668
  • 6
  • 30
  • 55
17
votes
2 answers

geodjango using mysql

I have been working on an application using django and mysql, am trying now to work on the tutorial from this here http://docs.djangoproject.com/en/1.2/ref/contrib/gis/tutorial/ but it failed the moment I ran syncdb with the following…
Mo J. Mughrabi
  • 6,747
  • 16
  • 85
  • 143
16
votes
4 answers

GeoDjango can't find geos library

When attempting to fire up the django server, I get the following error: django.core.exceptions.ImproperlyConfigured: Could not import user-defined GEOMETRY_BACKEND "geos". I'm running postgresql8.4 on Mac OS Lion. I've used Macports to install…
wmfox3
  • 2,141
  • 4
  • 21
  • 28
16
votes
10 answers

GeoDjango on Windows: Try setting GDAL_LIBRARY_PATH in your settings

I've done this a dozen times before, but something isn't working this time.. Following the docs: https://docs.djangoproject.com/en/1.11/ref/contrib/gis/install/#windows I'm trying to set up GeoDjango on a Windows machine (this one is a virtual…
Adam Starrh
  • 6,428
  • 8
  • 50
  • 89
16
votes
1 answer

GeoDjango, difference between dwithin and distance_lt?

Using geoDjango, what is the difference between myObj.objects.filter(point__dwithin(...etc.)) and myObj.objects.filter(point__distance_lt(...etc.)) ? Are they the same thing, or are they doing subtly different things?
hendrixski
  • 1,124
  • 1
  • 12
  • 20
15
votes
2 answers

GeoDjango: How to create a circle based on point and radius

I have the following (simplified) Model: class Zone(gismodels.Model): name = gismodels.CharField() poly = gismodels.PolygonField() I want to create and save a polygon that represents a circle, based upon a given point and radius. The only…
MattRowbum
  • 2,162
  • 1
  • 15
  • 20
15
votes
2 answers

How To Find Nearest Point From User Location using geodjango?

I am trying to find the nearest point to a location using geodjango. I tried using the following code: LocationInfo.objects.filter(coordinates__distance_lte=(user_location, D(km=2))) But It only works if the location is within the specified…
sam23
  • 589
  • 2
  • 7
  • 23
14
votes
1 answer

GeoDjango distance filter with distance value stored within model - query

I have an Order model, that has an origin PointField and a range IntegerField. Furthermore, there is an UserProfile model, which has a geo_location PointField. Now, I have an User instance, user. I want to select all Orders, whose distance between…
Daniel Grezo
  • 1,414
  • 1
  • 12
  • 12
14
votes
1 answer

How to debug: Internal Error current transaction is aborted, commands ignored until end of transaction block

Hi Stackoverflow people, I do my first steps with GeoDjango and I am looking for better options to check faulty sql statements. So far, I simply wanted to safe a lng+lat point in my postgresql table. The model is defined with: geolocation =…
neurix
  • 4,126
  • 6
  • 46
  • 71
14
votes
1 answer

Rendering spatial data of GeoQuerySet in a custom view on GeoDjango

I have just started my first project on GeoDjango. As a matter of fact, with GeoDjango powered Admin application we all have a great possibility to view/edit spatial data, associated with the current object. The problem is that after the objects…
Dmitry Lebedev
  • 268
  • 1
  • 3
  • 11
13
votes
2 answers

GeoDjango within a NE, SW box

I'm creating a geo app with Google Maps and I receive bounding box as 2 coordinates: north east south west I have a model with PointField. from django.contrib.gis.db import models class Place(models.Model): name =…
FrEaKmAn
  • 1,785
  • 1
  • 21
  • 47
13
votes
6 answers

How can I query the nearest record in a given coordinates(latitude and longitude of string type)?

I am using GeoDjango with PostGIS. Then I am into trouble on how to get the nearest record from the given coordinates from my postgres db table.
eros
  • 4,946
  • 18
  • 53
  • 78
1
2
3
67 68