Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

learn more… | top users | synonyms

3
votes
2answers
435 views

How to fix this spatial query in GeoDjango?

I am new to Geodjango. and I am following the steps given in https://docs.djangoproject.com/en/dev/ref/contrib/gis/tutorial/# and the steps i followed before ...
1
vote
0answers
238 views

How to Modify Polygons in GeoDjango?

Just getting acquainted with GeoDjango. Have Basic Tutorial app created with sample world data. In trying out the admin, I appreciate seeing the polygon on the map and a couple basic tools for adding ...
4
votes
3answers
288 views

How to import an Access database to GeoDjango?

I'm a I've just inherited a pile of institutional geodata that's stored in an MS Access database. I need to pull that data out into a format that I can work with in GeoDjango--so I'm OK with ...
1
vote
1answer
192 views

Best way to exclude 0,0 from geography results (PostGIS, GeoDjango)

Using PostGis and GeoDjango with a model having a Geography field I'm trying to exclude results where the location is 0,0. I get the error PostGIS geography does not support the "exact" lookup. The ...
4
votes
1answer
775 views

Geodjango distance between two points appears incorrect

I want to show you something. I am using django+postgis and I am experiencing wrong distance values between two points. This is my model: class Location(models.Model): name = ...
2
votes
1answer
1k views

Using a geodjango PointField with geography=True, my distance calculations are wrong

Here's my model: class ExchangeArea(models.Model): """ An Exchange Service Area, calculated from a phone exchange and surrounding census tracts. """ coordinates = ...
4
votes
1answer
3k views

Why is my PostGIS query not using a spatial index?

I am having an issue with a spatial query that is not making use of indexes. My schema is: CREATE TABLE geoplanet_place ( woeid integer NOT NULL, "name" character varying(300) NOT NULL, ...
2
votes
1answer
543 views

How do I query for all polygons within a distance from a point?

Call me stupid, but somehow I couldn't figure out how to do the following. I've got a testing shapefile with 18 features, which I successfully imported into GeoDjango (1.3, running on Spatialite). As ...
6
votes
3answers
1k views

Can Polygons be generalized to MultiPolygons in GeoDjango?

I set up a model with models.PolygonField in geodjango, using postgres as database. I try to import shp into postgres. The problem is, shp (compiled with QGIS) mixes polygon and multipolygon, hence it ...
6
votes
2answers
856 views

Generating GeoJSON tiles from GeoDjango - basic overview?

I'm working with the glorious PolyMaps and I want to build a map similar to the population example. I understand that this needs GeoJSON tiles. I have a GeoDjango database, with a bunch of County ...
3
votes
1answer
263 views

How to mix coordinate systems in GeoDjango?

This is a beginner question about working with different coordinate systems in GeoDjango. I've got a GeoDjango object with a polygon field, stored as OSGB coordinates: class Region(models.Model): ...
1
vote
1answer
574 views

How to segmentize/sample a LineString using geodjango (postgis/geos) and/or openlayers?

I'm trying to sample points along a linestring. The goal is to have the distance between 2 consecutive points to be at most X (eg. 50m). I'm drawing linestring in openlayers and sending it to a ...
7
votes
3answers
999 views

Use Esri Geoservices REST as backend for Python web framework (Django?)

I would like to know if it's feasible to use an existing Python web framework such as Django/GeoDjango as a frontend to work with Esri's Geoservices REST API? I envision developing a database engine ...
3
votes
2answers
523 views

PostGIS + pgRouting: Adding dummy links to a road network and performing routing analysis

I'm a beginner when it comes to postgis and pgrouting development. For a project I'm working on and a bit of the algorithm: I have a polygon layer that represents zones I have a line layer that ...
7
votes
1answer
203 views

Optimize GEOSGeometry's spatial operations by avoiding thread-safety checks

A ranking algorithm I'm developing for a Django webapp requires performing spatial operations (within, intersections, sym_difference, etc.) using a query against large number of geometry objects. ...
2
votes
2answers
1k views

Is it possible to do server-side (WMS) rendering / caching of vector data

I have to develop a webapp that will have to display a large number of polygons on a webpage, with complex filtering options. The source data never changes (I will simply reload a new version of the ...
2
votes
1answer
796 views

Area units for GEOS area property?

I'm working with GeoDjango and have a polygon in the WGS84 projection. I need to find its area in square meters. When I call polygon.area, I get some float out and I have no idea what the units of ...
1
vote
2answers
635 views

PostGIS - certain MultiPolygons cause “BOOM! Could not generate outside point!”

I've just posted this at StackOverflow and someone suggested I try here. Original: http://stackoverflow.com/q/5863859/246265 I'm trying to represent a rectangular area which crosses 180 degrees ...
6
votes
1answer
383 views

Is there a GeoDjango tutorial for GeoRSSFeeds?

I'm going through GeoDjango basics right now. Ideally, I'd like to publish a GeoRSS from a set of data I have that is already in Django's database. I know how to get a regular Feed working, but when I ...
5
votes
1answer
866 views

Best GeoDjango MySQL workaround for distance queries

I'm using mysql 5.1.50, so the distance QuerySet method is not available to me. Here is my model: class Location(models.Model): name = models.CharField(max_length='100') point = ...
4
votes
1answer
654 views

GeoDjango: Order by distance for model that has a ForeignKey relation to another model that has a PointField

Model A has a ForeignKey relation to Model B. Model B has a PointField. Is there a way to order Model A objects by distance from a POINT?
4
votes
1answer
328 views

Monster Spatial database server suggestions

I'm going to setup a open Mapserver w/ Openlayers, Geojango, Postgis using Postgresql. And I need some suggestions from people that have been shopping for what I need longer than I have. What would ...
4
votes
1answer
1k views

GeoDjango: order PointField by distance?

I've got a GeoDjango model as follows: class City(models.Model): id = models.IntegerField(primary_key=True) county = models.ForeignKey(County) location = models.PointField(null=True, ...
5
votes
2answers
1k views

Django PolygonField: how to display on map?

Extremely beginner question. I have a GeoDjango model with a MultiPolygonField. How do I retrieve the value of this field and display it as a polygon on a map? class county(models.Model): cd = ...
4
votes
1answer
433 views

Geodjango insert statement: psycopg2.IntegrityError: violates check constraint

Why is the following INSERT statement throwing this error? INSERT INTO domes_place (placeid, structidx, oscode) VALUES ('10', '1', 'POINT(51.121282945772 1.3138398501222)'); psycopg2.IntegrityError: ...
1
vote
2answers
1k views

Error adding data to Geodjango database: parse error… within geometry

I'm trying to insert some values into a Geodjango database, but getting errors. This is the table: class Place(models.Model): placeid = models.IntegerField(primary_key=True) structidx = ...
2
votes
3answers
314 views

UK National Grid references and GeoDjango

Newbie question. I'm trying to insert some UK National Grid references into a Django PointField defined as follows: oscode = models.PointField(srid=27700, null=True, blank=True) My question is ...
6
votes
1answer
596 views

Help simplifying multipolygons in geodjango

I have a few multipolygons that have several hundred points in them. I'm looking to create less complex "thumbnails" polygons. Naturally I'm attempting to use the simplify method, which is supposed ...
2
votes
4answers
3k views

struggling with GeoDjango install: ERROR: could not access file “$libdir/postgis-1.5”: No such file

I'm installing GeoDjango on Mac OSX. I've followed the official Mac install instructions, which all went smoothly, and am now creating a spatial database template for PostGIS. However, when I try to ...
5
votes
5answers
734 views

Getting a square mile bounding box anchored by coordinates?

Let's say I have a lat/lng coordinate pair. I want to determine the coordinates that would create a square mile box. The existing coordintae pair would be the top left of the box, and the coordinate ...