Questions tagged [django]
Django is a high-level Python Web framework
99
questions
1
vote
0answers
3k views
WinError 193 %1 is not a valid win32 application. Django 2.05 python 3.6.2
I will post the error below. I did the main django tuturoials on the website without a problem. But something happens when I change my ENGINE in settings.py to the postgis version.
This is the ...
2
votes
0answers
280 views
How to get points within boundaries which overlaps the anti meridian
Within my application I have a map and I'm showing markers on the map which represent objects that I get from the database. The objects have latitude and longitude. The objects are selected only if ...
0
votes
1answer
995 views
django leaflet custom popups
I use some django project with PostGIS for database and leaflet map.
I have add simple leaflet popups like this :
and here the snippet code to call popups :
onEachFeature:function (feature,layer) {
...
0
votes
1answer
997 views
Use of Leaflet to display raster layers in Django [closed]
I'm using Django to create a webserver that can gather user inputs, produce simulations and output the results with Leaflet.
So far I can produce simulations in Farsite using prepared inputs, however ...
0
votes
1answer
92 views
Python 2.7.12 not compatible with Django but still cannot be updated
I have installed Python 3.6.4 on my computer. I am trying to set up Django but each time I try to use the command prompt, it tells me that the Python version am using is not compatible. When I check ...
1
vote
0answers
251 views
Tilecache and python (TMS)
I'm working on a Django tile solution to serve thousands of images. So far I have been able to set a Mapscript server with tilecache. Everything seems ok but when loading into Leaflet I got some kind ...
0
votes
0answers
440 views
Django app can't upload multi-band-image
I try to upload a TIFF raster image with 5 bands in Django app and I get error message in form : Upload a valid image. The file you uploaded was either not an image or a corrupted image. I am sure ...
1
vote
0answers
348 views
Geodjango PostgreSQL/PostGIS database question
I have a simple django app using sqlite3. My app is simple I have django user authentication system where the user can be upload spatial raster images and can see that images in user personal HTML ...
0
votes
1answer
496 views
Connecting Django to postgresql
I plan on building a web application using Geodjango. After installing PostgreSQL, PostGIS, OsGeo4W and psycopg. I changed my settings.py db to that of the PostGIS. Each time I run the commmad "python ...
1
vote
0answers
270 views
NetworkX read_shp works on Python 2.7 but not on Python 3?
I was trying to implement the same code in Python 2.7 and Python 3.0 opening the same file from the same directory using NetworkX's read_shp function.
One, using Python 2.7 IDE and the other is ...
4
votes
0answers
112 views
Raster calculator using django
I want to create a web application that takes in 5 images does some calculation and shows the result on a basemap. all these images would be on geotif format single band and with values on pixels, I ...
4
votes
1answer
1k views
Unable to display geojson data on a leaflet map in a Django app
I'm developing a Django application using Django-leaflet and Postgresql / PostGIS. I retrieve the data in views.py and I convert them in GeoJSON format using Django's serializer.
My views.py:
from ...
1
vote
1answer
384 views
Get random point from django PolygonField [closed]
TL,DR; I want to get a random point from a polygon (potentially) using ST_GeneratePoints.
Background
I'm making a GeoDjango webservice and have a collection of UK Postcodes with respective ...
2
votes
0answers
863 views
Uncaught TypeError: a.addEventListener is not a function When using React OpenLayers Wrapper
I am trying to create a web app using a Django back end with React for the front end. I am using a React OpenLayers wrapper on the OpenLayers site and keep getting the Type Error. Can someone please ...
3
votes
1answer
123 views
Django map permissions
I want to build a site using Django and have a user authentication system. In that site I want to serve maps and other data, but not to all users.
What I am interested in is: can I give the maps some ...
1
vote
2answers
409 views
Issue with GEOS not creating buffer correctly for use in Django
Currently in my django I use the following function to take a point, buffer it by 2000 meters, and produce a circle polygon:
updatequery = str("update table_events set event_geo = ST_Multi( ...
5
votes
0answers
393 views
How to use pgRouting together with Django?
I am using pgRouting together with QGIS. Now I want to convert everything into a web-solution. I decided to use Django for that. Creating the data-model and receiving geographical data from the ...
8
votes
1answer
3k views
Splitting Polygon by Linestring in GeoDjango?
In am a Django developer with limited GIS knowledge. In Django I have a polygon and a linestring as follows:
I would like to split the polygon by the linestring to obtain the 4 resulting polygons (or ...
1
vote
1answer
256 views
Styling Vector layer with OpenLayers
I'm using Django and Openlayers to add some data from my PostGIS database to the map but can't seem to work out how to style the vector layer that uses the kml.
var layer = new ol.layer.Vector({
...
3
votes
2answers
2k views
Getting list of all countries using Overpass API?
I'm a developer that's trying to build a django application and trying to incorporate the Overpass API to it. I'm new to the API and OpenStreetMap (and GIS in general), so I thought I would start off ...
1
vote
0answers
257 views
How to display geojson data on browser from mongodb using mongoengine and django rest api
I have stored my geojson data on mongodb.
which contains properties and polygon of a area.
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"Year": 2015,...
1
vote
0answers
309 views
GeoDjango: GDAL library is not available to transform() geometry
I am trying to take points and buffer them to create polygons in my django project. I queried for points and tried to take the geometry of the first point and transform it to a meters based system (...
0
votes
2answers
189 views
I wish to find sites within a distance of a route, using django GEOS filters, by converting a route to a polygon to test model instances within
Python 2.7.12 (default, Jul 1 2016, 15:12:24) [GCC 5.4.0 20160609]
Django (1, 7, 11, 'final', 0)
Postgres [u'PostgreSQL 9.5.5 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16....
1
vote
1answer
805 views
Creating a lineString from another model that has pointField
I'm a beginner in GIS developing and this might be a simple question. I'm using Python Django equipped with GeoDjango. Where I use Django-leaflet and database PostGreSQL with PostGIS.
I already have ...
0
votes
1answer
895 views
GeoDjango - faster way to use polygon.crosses?
I have a polygon and a line segment. I want to know if the line segment is both inside and outsize the polygon. Using "prepared" has helped but it's still no where near fast enough. how can i speed ...
0
votes
1answer
221 views
Geonode custom development
There is not much information in the form of documentation on http://geonode.org/ development. I need to do some custom "App" development for geonode so that my users can have more functionality ...
3
votes
0answers
432 views
Django and Osgeo (closed)
I want to use osgeo tools in a virtualenv with Django. I already followed the directions in the Django manual succesfully on different linux systems. But this time I got stuck while intalling GDAL.
...
1
vote
0answers
2k views
Django/PostGIS: How to insert coordinates in PointField in EPSG:27700, and return EPSG:4236?
I am using Django 1.9 with PostGIS. I have input data that consists of British National Grid eastings and northings, and a table that looks like this:
class Org(models.Model):
name = models....
3
votes
1answer
3k views
GeoDjango, distance filter based on database column
I have a geodjango model with fields
coverage = 10 * 1609.344
reference_point = Point(-72,45) #or some other lat lng
class ServiceArea (geo_models.Model):
center = geo_models.PointField(default=...
2
votes
1answer
1k views
How to display shape files stored in a database into a web page
I'm pretty new to geodjango and python in general. But I would like to display my shapefiles stored in my database into a web pages and present them in layers and retrieve certain information if a ...
14
votes
2answers
24k views
How to calculate the bounding box of a geojson object using python or javascript?
I have django app with leaflet on the frontend and I need to calculate the bbox of a geojson object so that I can pass the coordinates to map.fitBounds()
I have tried some libs as well as trying the ...
1
vote
1answer
133 views
Is there a way to use raw html with the markdown used in odyssey.js?
I use odyssey.js in part of my Django site. The map part of it is all working fine but I need to add some <i-frame> elements. I'm not sure what flavour of markdown it is and can't figure out how ...
2
votes
0answers
436 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 = models....
2
votes
0answers
1k 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 database, ...
1
vote
0answers
60 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
...
1
vote
1answer
1k 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 ...
2
votes
1answer
858 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
0answers
337 views
How to customize and add additional features in GeoNode [closed]
I need some advice on how to start customizing my GeoNode installation. I tried reading up on GeoNode documentations on how to do it but it always boils down to customizing or adding to the Django ...
1
vote
0answers
1k 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, primary_key=...
1
vote
1answer
2k 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
1answer
4k views
Is MongoDB more suitable than PostGIS as backend for geo-enabled Django website? [closed]
I am trying to select a backend for a geo enabled website written in Django.
Is MongoDB an easy possibility or stick with PostGIS?
What are the key considerations to choose one or the other if ...
0
votes
2answers
5k 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. ...
4
votes
1answer
10k 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
2answers
825 views
Data structure: mongoengine to GeoJson
I recently posted my first question on StackOverflow, but I think the question was quite extensive and full of potential errors. So I'd begin again, step-by-step, with a much shorter and simplier ...
3
votes
2answers
1k views
Distance between Paris and San Francisco with PostGis (out of range coordinates?)
SELECT ST_Distance(gg1, gg2) As spheroid_dist, ST_Distance(gg1, gg2, false) As sphere_dist
FROM (SELECT
ST_GeographyFromText('SRID=4326;POINT(37 -122)') As gg1,
ST_GeographyFromText('SRID=4326;...
2
votes
0answers
553 views
GeoDjango with MongoDB
Has anyone had experience successfully deploying GeoDjango with MongoDB? Is it possible? If so, how is it as simple as as installing the non-relational fork of Django and setting MongoDB as the ...
1
vote
1answer
811 views
Load partial shapefile into Postgis / GeoDjango project
I have a shapefile with Canadian postal codes, but am only looking to load a small subset of the data. I can load the entire data file and use SQL or Django queries to prune the data, but the load ...
3
votes
0answers
326 views
What is a good way to retrieve geographic data along with images and mp3 files?
I'm working in the Django backend of an audio guide for tourism with mobile devices. Basically, the client (Phonegap app for Android and iOS) can follow a route over a map (Leaflet client) and see ...
3
votes
2answers
2k views
How to debug third party JavaScript libraries such as openlayers?
I am able to work with web development tools like firebug and dev tools and solve bugs in my javascript files. But when it comes to bugs that produce errors such as "typeError: e is null" which ...