Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [django]

Django is a high-level Python Web framework

0
votes
1answer
17 views

Django demands to set default. ValueError: String input unrecognized as WKT EWKT, and HEXEWKB

when I try to makemigrate models with Geometry fields to postgres DB I face with next message: You are trying to change the nullable field 'geom' on allotment to non-nullable without a default; we ...
-1
votes
0answers
17 views

Calculate Polygon inside polygon django

I have 2 Models "Building" and "Flood", both are in srid 32651 My purpose are want to calculate how many building get hits by flood, I use : affected = Building.objects.filter(geom__within=Flood.geom)...
0
votes
0answers
24 views

TopoJSON from PostgreSQL database

I already finish input and run all the GeoDjango code, it worked. But time after time my data got bigger and result in big size of GeoJSON. I used this code to read database from PostgreSQL (PostGIS) ...
0
votes
1answer
45 views

Integrate JSON file inputs (specifically latlng) in Leaflet with JS

It's my first time using Leaflet and I wanted to simply put two markers based from my inputs. I managed to connect my JSON file with the JavaScript and the only problem I have is how to dynamically ...
0
votes
0answers
28 views

Django raster, not add raster to BD Postgis

I am new in this world, and I am trying to make Django Raster work, I have already followed all the instructions of: https://django-raster.readthedocs.io/en/stable/installation.html But at the moment ...
1
vote
0answers
42 views

Upload large raster file GeoDjango

I created a GeoDjango model using RasterField(). I have been trying to upload the raster using postgis. Here is how I load the raster raster = GDALRaster('rasters/data/my_image.tif', write = True) r ...
0
votes
0answers
101 views

Seeking equivalent of Google Maps API 'title' for polygons?

I am using Django, GoogleMaps API, and GeoJSON to draw polygons from the spatial database to map. I wanted to add a title so that when you hover over/click on (don't care which) the name or ID of the ...
1
vote
0answers
104 views

geodjango application using spatialite database

i want to create a simple geodjango app with spatialite database but i have this error at migrate django.core.exceptions.ImproperlyConfigured: Unable to load the SpatiaLite library extension. here ...
1
vote
0answers
121 views

Leaflet ImageOverlay Image does not appear

I'm trying to stitch the picture taken from my drone onto the map, and I'm using Django 1.11.14 and latest version leaflet 1.3.4. I tried to use ImageOverlay, there is no error but the image does not ...
1
vote
1answer
103 views

geodango form with geometry field and leaflet map

i use geodjango and leaflet and i want to create a django form where including geometry field with map widget (the user must to put in leaflet map) like as django admin page . i try to follow this ...
1
vote
0answers
52 views

Adding new static page in CartoView / GeoNode? [closed]

I have installed the CartoView with the Windows stable build installer. Then, I try to add a static page to the newly installed CartoView / GeoNode by modifying the urls.py file: urlpatterns = [ # ...
1
vote
2answers
224 views

Calculating distance between a Point and a MultiPolygon PostGIS object

I'm working in a layer with MultiPolygons and I'm trying to calculate the shortest distance between a MultiPolygon and a point which is contained in that MultiPolygon, using Django and PostGIS. At ...
0
votes
0answers
96 views

Display and manage (CRUD) point cloud in (Geo)Django 2

I would like to use GeoDjango to Geolocate the place I will scan. Would start to 3D scans with a DIY lidar based on Arduino/Rpi. So far no worries. Then, The Goal is to save x,y,z as input in ...
0
votes
1answer
74 views

How exactly do I use the GeoDjango Union function?

I have two models in my application: class Organization(models.Model): consortium = models.ForeignKey('Consortium') org_map = models.MultiPolygonField() class Consortium(models.Model): ...
0
votes
0answers
29 views

GeoDjango: Move a Point east by one mile

Given a Point (django.contrib.gis.geos.Point) how do I find another point 1 mile east from that Point object? (A) ---[ 1 mile ]---> (B) My failed attempts: I've considered trying to go hardcode ...
0
votes
1answer
144 views

GeoDjango raster field display on Leaflet

In the new Django version support raster field and I follow this manual for GeoDjango raster field and this question for add raster I have built a simple demo. here the code : settings.py postgis ...
1
vote
1answer
186 views

How to find the area of polygon in geodjango?

I need to calculate the area of the Building (which the coordinates represents). I used transform() to calculate the area, but the calculated area is not accurate. Please help me calculating the area ...
-2
votes
1answer
87 views

Loading LIDAR data to POSTGRES and use it with DJANGO [closed]

I have some project at the Faculty and I don't know from where to begin. I have point cloud data (LIDAR data) and I need to make the website with that data on it and with functions for some sort of ...
1
vote
2answers
415 views

Python 3.6, Django 1.11, Windows 10, Gdal 2.2.4 not working

I've been trying to find a solution to this issue, but couldn't find anything. I've installed OS4GEOW using the Django Docs But I get the following error: File "C:\Python36\lib\site-packages\...
1
vote
1answer
144 views

django-raster rendering raster url

i want to add raster functionality in django using postgis database using django-raster package and this docs. here my code : models.py from django.contrib.gis.db import models class RasterWithName(...
1
vote
2answers
63 views

How to convert the area to feets in GeoDjango?

my geom has // When I am trying to get the area of the polygon geom.area //7.27640644096346e-08 How to get these value in feets. I don't know what is the units of these value I am trying to ...
1
vote
0answers
27 views

Language requesting GeoDjango technical documentation

I am working with a project team that hired a contractor to build a custom GeoDjango webmap application. The application is mature now and the team would like to host it on our network "in-house". I'...
0
votes
1answer
126 views

Why my contained Query doesnot work in spatial coordinates in GeoDjango?

These are my Models. I imported the shapefiles to this Models class Parcel(models.Model): objectid = models.BigIntegerField() apn = models.CharField(max_length=80) lot_size = models....
0
votes
0answers
112 views

Does Turf.js work with geodjango?

I am trying to do a simple buffer around a geojson I created with a model. The buffer does not show up. Here is my code. lyrStores2 = L.geoJSON.ajax("{% url 'stores' %}", { }).addTo(...
0
votes
0answers
1k 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
138 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
427 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
0answers
68 views

problem with django GDALRaster to load ascii grid rasters

I'm trying to load a raster file in format ascii grid to postgresql using postgis. My model: class elevation(models.Model): rast = models.RasterField(srid=3857) filename = models.CharField(...
0
votes
1answer
301 views

Use of leaflet to display raster layers in django

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
60 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
126 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
320 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
298 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
377 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
188 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
91 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 ...
3
votes
1answer
679 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
187 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 ...
0
votes
0answers
147 views

Django GEOS: SRID 4326 vs SRID 32118 to calculate area

I believe that SRID:4326;geography=True is used for representing actual geography (cities, locality, etc.) but when I do polygon.area, I'm getting area of a geometry object. To find out the area in ...
2
votes
0answers
488 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 ...
1
vote
0answers
68 views

Django map permissions

I want to build a site using Django and have a user 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 viewing ...
0
votes
2answers
177 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( ...
1
vote
0answers
190 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 ...
5
votes
1answer
2k 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
226 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({ ...
2
votes
2answers
949 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
206 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
223 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
132 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
404 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 ...