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

learn more… | top users | synonyms

1
vote
0answers
21 views

Is there an equivalent of GeoDjango for Flask or other Python web frameworks?

I have experimented with GeoDjango, but I think nobody would be surprised if I said there's quite a steep learning curve. I prefer Flask, which I also know much more than Django anyway, but I couldn't ...
0
votes
0answers
15 views

show polygon from database in browser in geodjango

I tried to retrieve the polygon which I saved into postgis database. (all polygons) Here is my code: models.py from django.contrib.gis.db import models class MyMap(models.Model): name = ...
2
votes
1answer
23 views

GeoDjango/PostGIS distance lookup not working

I'm building an api to make distance lookups using Django 1.8, GeoDjango, Django REST Framework and PostGIS. Locally I'm using PostGIS 2.1.7, my host (PythonAnywhere) uses 2.1.4... I'm not able to ...
0
votes
0answers
24 views

How do I set up a PostgreSQL database for use with PostGIS and GeoDjango?

The Django docs say to use createdb -T template_postgis geodjango but I already have a database set up. While trying to find out what this actually does and a way to apply it to an existing ...
1
vote
1answer
28 views

Django Postgis Distance from point

I have a point where the objcet is and another point for mylocation. I want to calculate the distance >> object_location <Point object at 0x7f9ceaac7be0> >> mylocation <Point ...
0
votes
0answers
10 views

Trouble Changing Paths for geospatial libraries

I am currently using Python 2.7, Django 1.8 and Windows 7. I am trying to set the Windows environment variables, as per the instructions here . When I try to do this using the Powershell, I get the ...
1
vote
0answers
15 views

Error in Load module in Geodjango

I am following this tutorial https://docs.djangoproject.com/en/1.8/ref/contrib/gis/tutorial/ and did layer mapping. And going along with documentation, I tried the below code from world import load ...
2
votes
0answers
34 views

GeoDjango and bug with bounding box query

Just some context first, I have a postgres database with PostGIS extension, running under a GeoDjango wrapper. I have a weird bug that hopefully someone can shed some light on. I'm running a query ...
1
vote
1answer
77 views

ImportError: cannot import name GEOSGeometry Django 1.7

I am a heroku newbie and I keep getting the said error whenever I try to sync db on heroku. I am using a hobby Dev instance which from this link shows that their is no support for PostGIS on the free ...
0
votes
1answer
37 views

how to custom geodjango admin

Here is what I do in django: class MyModel(models.Model): pass class MyModelAdmin(admin.ModelAdmin): pass admin.site.register(MyModel, MyModelAdmin) But with geodjango I have this: ...
2
votes
1answer
117 views

How to efficiently use a Postgres DB with Python

I have a Postgres DB with a lot of lines that are too long and so now I want to split those lines into smaller ones. This is why I started writing a little python script for that job. Basically it ...
1
vote
1answer
56 views

Creating geodjango model with geometry field that can accept different projections

I am working on web application with GeoDjango and within the model (db table) RoadAxis I have geometry field or more precisely LineStringField where I need to store different polylines (road axis) ...
1
vote
1answer
123 views

GeoDjango Setup: Python 'GDALAllRegister' Attribute Error

I am trying to setup Geodjango 1.8 in a virtualenv with Python 2.7.9 (Win32). I have installed and setup Postgres/PostGis and have my Path setup to my OSGeo4W directory. I have also installed the ...
1
vote
0answers
99 views

GeoDjango: AttributeError: function 'GDALAllRegister' not found [closed]

Im trying to get started with GeoDjango. I am using this https://docs.djangoproject.com/en/1.8/ref/contrib/gis/tutorial/ tutorial. When I run "python manage.py migrate" This error occur: ...
0
votes
0answers
156 views

GeoDjango: Find all points within radius?

I am working in GeoDjango (with a Django 1.7 and PostGIS 2.1.4 backend). I have a model with a PointField in my database and I am trying to find all items within 10km radius of a point. Here is my ...
1
vote
0answers
159 views

Import KML file into GeoDjango

I'm trying to import a KML file into an existing GeoDjango app (using a Postgres 9.3 database). This is my Django model: class PCT(models.Model): code = models.CharField(max_length=3, ...
0
votes
1answer
43 views

What is the best strategy to add a custom constraint to a geo-django table?

What is the best strategy to add a custom constraint to a geo-django table? This is the corresponding sql-statement: ALTER TABLE my_table ADD CONSTRAINT enforce_valid_geom CHECK ...
0
votes
1answer
180 views

How to dispay my PostgGIS geometry on the GeoDjango map widget?

I'm trying to display a custom map feature on a GeoDjango map. The geometry is a multipolygon stored in a PostGIS database backend. And I have trouble to find the correct piece of documentation that ...
1
vote
1answer
221 views

Unable to create Polygon using Geodjango admin interface

I am new to GeoDjango. I have created Admin interface for my Model. It loads correctly. I am also able to draw the Polygon on map(At client side) but when I save It tells me Invalid input and throws ...
2
votes
2answers
68 views

Can you rename the Django GeoManager object instance?

Is it possible to change the name of the GeoManager object from "objects" to something like "geo_objects"? The way I've done it in the code below is supposed to be the default way to configure your ...
0
votes
0answers
96 views

Django with arcpy 10.3: RasterDB.dll problem

I am working on a Django application and I need to be able to work with arcpy for geoprocessing. I have installed the Anaconda python distribution to use as the python for Django, because it has conda ...
2
votes
0answers
81 views

geodjango difficulties with srid

I'm trying to make geodjango app. I'm using SQLite and SpatialLite. I want to add shops, and be able to sort them from closest to furthest from my location. When in my model I have: location = ...
1
vote
0answers
97 views

Create polygons enclosing same number of points on PostGIS

I have a geodatabase on Postgis with points representing customers, what i need is give a number of customers, lets say 100 and it need to generate polygons enclosing 100 clients each one. I only ...
2
votes
1answer
135 views

GeoDjango and Google Maps

I try to calculate distance between two cities and I'm in big confusion because the results are wrong. I have a model in geodjango like this: class Address(geo_models.Model): coordinates = ...
1
vote
1answer
192 views

Draw line overlays and center map

(Apologies if this is a trivial question; I'm completely new to the GIS world.) I have a dataset with start and end points of lines. Columns in the table are unique_line_id, line_start_point_lat, ...
0
votes
1answer
200 views

Spatialite in GeoDjango - “…they do not properly define db_type…”

I've started a new project and choose GeoDjango for it. Because I already developed with Django and sqlite as a DBMS and all worked perfectly fine for me, I found it a great option to use spatialite ...
1
vote
1answer
659 views

GEOS_ERROR: TopologyException: Input geom 1 is invalid: Self-intersection at or near point

I'm using GeoDjango (but I guess this is from the geos library). I have a set of polygons that compose a city surface and I want to merge them into a single one. The code looks like this: polygons = ...
2
votes
1answer
55 views

Python Geospatial Development Error

I'm working through some examples in the Python Geospatial Development book by Erik Westra. On page 439, about setting up a tile map server, he gives the following code for calculating a bounding ...
1
vote
0answers
49 views

Read and Write data with Open Layers3

I'am currently using postGIS/geoDjango/OL3 I need the capability for a user to drop a point on the map, and store that in my database. When any user returns, that point will be shown on the map. ...
1
vote
1answer
56 views

geoDjango point geom field

I can't figure out why the geom field is so long, I can't make heads or tails of the number either. Any help is appreciated
1
vote
0answers
85 views

Clustering the WGS84 point features (projection transformation aspects)

My question is quite trivial and was discussed many times before (like here) but in our case it has the confounding extra requirements... The list of sparsely distributed 2d point features is stored ...
2
votes
1answer
363 views

how to convert kml to wkt using geodjango or python?

in geodjango i found that i can use WKT to insert geometry such as: pnt = GEOSGeometry('POINT(5 23)') but it doesn't show how to do it if the data is KML, as my data is in kml format, so my plan is ...
1
vote
0answers
52 views

GeoDjango WebMapping Application Update

According to the below GIS.SE questions, GeoDjango was the preferred framework for creating simple and quick webmap applications. But these questions are now all 2-3 years old. Can we verify whether ...
2
votes
0answers
109 views

Adding marker on a leaflet map

I'm very new to GIS and for learning I started with building a simple web app with GeoDjango. I am using dango-leaflet. Since I have a very limited knowledge I am facing many challenges. I'm trying to ...
1
vote
1answer
920 views

Geodjango - trying to get points within a polygon

I'm going through the Geodjango tutorial and trying to implement in my own project - I have loaded data from a shapefile into my model/database and I have a separate model that has a PointField. I am ...
1
vote
1answer
211 views

40k+ points from Shapefile, clustering them and populating on Google Maps/Webapp

I just started a new Python/Django webapp job related to GIS (and i'm totally new to GIS). Here is my task and what i have found so far, and i am stuck as to finding out what's the best way or the ...
2
votes
0answers
137 views

GeoDjango order_by('distance') not working as expected?

Using GeoDjango, I am trying to sort a list of users based on the distance from a point. It does generate a list, but its not ordered by distance, though I specify that in my query. This is the query ...
0
votes
0answers
163 views

GDAL Installation help in windows

I'm trying to build a GIS application in Django Framework. I completed the GeoDjango installtion (postresql, spatial libraries). I installed OSgeo4W in my C drive. I also setup environment ...
0
votes
2answers
350 views

Python library or algorithm to generate arc geometry from three coordinate pairs?

I'm trying to write code to generate fixtures for a django/geodjango project. I need to generate geometry for arcs (line string) given three lat/long pairs; start of arc, end of arc and centre of arc. ...
1
vote
0answers
98 views

Geodjango transform introduces large errors

Apologies for the possibly naive question. I'm trying to understand how Geodjango (running on PostGIS) deals with coordinate transformations, and am experiencing some unusual behaviour. Let's say I ...
1
vote
1answer
90 views

Data interoperability json refresh

I am using ArcGIS 10.2.2 with the data interoperability extension. I am also building a web app using python, django and django-rest-framework. I'm building a json api that i can add to arcmap using ...
1
vote
2answers
122 views

Can't get SRS from PostGIS using Proj4 text

I'm having a problem transforming a point from the Australian MGA UTM datum (eg MGA Zone 51 http://spatialreference.org/ref/epsg/28351/) to WGS84 using GeoDjango. I've narrowed that down to a problem ...
2
votes
1answer
2k views

GeoDjango Admin: Adding PointField latitude and longitude to other fields

I've been redesigning my application to allow users to set markers more easily. One thing I need to include for backwards compatibility purposes is that the new model must have a latitude and ...
1
vote
1answer
173 views

Nokia HERE maps SRID

I'm just beginning with GeoDjango and just came across with term SRID. What I've understood so far is that I'd need to know a little something about the map projection to for example calculate ...
0
votes
1answer
1k views

How to use Google Maps projection with GeoDjango/PostGIS

I am building a web service with GeoDjango which involves user submitted events including a location. I created a model field for my location using django.contrib.gis.db: location = ...
1
vote
1answer
159 views

GeoDjango error: Only numeric values of degree units are allowed on geographic DWithin queries

I'm trying to get N points within 5000 meters of a certain point. My database is Postgres(PostGIS). I have a model like this: class Theatre(models.Model): geom = models.PointField(srid=4326, ...
2
votes
1answer
374 views

GeoDjango: transform() not working?

I have a point: pnt = GEOSGeometry('POINT({0} {1})'.format(lon, lat)), and tried pnt.transform(900913), and it gives error: GEOSException: Calling transform() with no SRID set is not supported Then ...
1
vote
1answer
1k views

Getting “Points of LinearRing do not form a closed linestring”

I downloaded the data provided here as KML, exported to ESRI Shapefile format, checked it on QGIS and everything looked fine. Upon trying to use the layermapping utility of Geodjango I am getting ...
2
votes
3answers
365 views

Geodjango read raster files

I am developing a web app in geodjango (django) framework but I need to import raster files. Is it possible a geodjango app read raster files from a directory? Thanks
1
vote
1answer
56 views

GeoDjango Scale/Layers issue?

I've been having issues visualising data from a shapefile in GeoDjango using OpenStreetMaps. I believe it's some sort of a scale issue because of how it appears(as you can see in the screenshot of the ...