Questions tagged [django]

Django is a high-level Python Web framework

52 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
460 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 ...
4
votes
0answers
171 views

Controlling the visibility of a Featuregroup in Folium with an HTML checkbox

I'm working on a project in Django where I want to show layers on a map by checking or unchecking boxes which I created using bootstrap. I am aware it is possible to use LayerControl to get these ...
4
votes
0answers
117 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
178 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 ...
3
votes
0answers
446 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. ...
3
votes
0answers
337 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 ...
2
votes
0answers
48 views

Load GeoJSON file into GeoDjango database

I am trying to load a GeoJSON file into my database (django.contrib.gis.db.backends.postgis) without success. models.py class Node(models.Model): network = models.ForeignKey(RoadNetwork, ...
2
votes
0answers
128 views

How to get the raster values of a point using Django's ORM (equivalent to ST_Value in PostGIS)?

I am working on a Django project that uses Django ORM to export raster data into PostGIS database. Here is the Django model: from django.contrib.gis.db import models class RasterWithName(models.Model):...
2
votes
0answers
201 views

GeoDjango query raster pixel values in PostGIS

I am building a REST API in GeoDjango that queries pixel values on a multiband raster held in PostGIS (out of db). I have defined the following model to match the raster held on the database: from ...
2
votes
0answers
210 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 ...
2
votes
0answers
33 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'...
2
votes
0answers
319 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 ...
2
votes
0answers
1k 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 ...
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, ...
2
votes
0answers
583 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
400 views

GDAL configuration for Django in mac GDAL_LIBRARY_PATH exception

I tried to install GDAL in macos by the command for django brew install gdal and it successfully installed and I have also used pip install GDAL command and it also installed successfully. But, When I ...
1
vote
0answers
117 views

Error when installing Geonode: cannot find django-geonode-mapstore-client>=2.1.0

I am very new to programming. I am trying to install GeoNode on an AWS Windows EC2 image, according to this tutorial (which is super, by the way!) When I get to the pip install -e geonode stage, the ...
1
vote
0answers
47 views

Query to Display Polygons not Working on Geodjango-Leaftlet Web App

I am currently working on a Geodjango-Leaflet-OpenStreetMap web app. I have around 540000 polygons of property boundaries that were drawn in ArcMap; the polygons will be imported to the web app later ...
1
vote
0answers
217 views

How to plot raster data in leaflet

I'm trying to develop gis based web application. I'm using leaflet for frontend and django for backend. My requirement is to plot raster data in leaflet. I'm using rasterio for reading raster file. ...
1
vote
0answers
53 views

Inaccurate difference operations in GEOS

I've noticed large inaccuracies in the Django GEOS API's difference operation, see the example below. In [3]: geom1 = GEOSGeometry('{ "type": "Polygon", "coordinates": [ [ [ -19.51171875, 37....
1
vote
0answers
86 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
901 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
826 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 ...
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 ...
1
vote
0answers
311 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 ...
1
vote
0answers
353 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 ...
1
vote
0answers
289 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 ...
1
vote
0answers
266 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
350 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 (...
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....
1
vote
0answers
459 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....
1
vote
0answers
61 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
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
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. ...
0
votes
0answers
27 views

Saving Google Earth Engine image into PostGIS database from Django project

I have calculated the NDVI from Google Earth Engine for the required time period now, I am getting all NDVI images for that periods and I want to save all the NDVI images to my PostGIS database. How ...
0
votes
0answers
19 views

Run or include gdal python scipt in Django-geoDjango

I am new to Django. I have a python script that prints the times, X, Y of the dataset in a specific NetCDF file. import gdal netfile = gdal.Open('NETCDF:"E:/Jobs/statr.nc":tm25') print 'Band ...
0
votes
0answers
16 views

Concave Hull and Geodjango

I am starting my first work with GeoDjango and I would like to obtain the concave hull of a series of Points and save the resulting polygon in the model that groups those points. The expected result ...
0
votes
0answers
127 views

ERROR: No matching distribution found for django-geonode-mapstore-client>=4.0.0

I have the same question as the one found here: Error when installing Geonode: cannot find django-geonode-mapstore-client>=2.1.0 it is a duplicate however no answer yet, perharps the two can be ...
0
votes
0answers
51 views

Deleting GeoServer layer with Django

I am trying to delete from the GeoServer using Django with request.delete, however, I get the 401 error. GEOSERVER_URL = f"http://admin:geoserver@GEOSERVER:8080/geoserver/rest/workspaces" ...
0
votes
0answers
20 views

Accessing other Properties of GeoJSON Collection for Binding Details to Popup

I have a GeoJSON collection of coordinates and other properties. I want it so that when each popup is clicked on the map it will show the relevant properties to that marker. I have checked answers to: ...
0
votes
0answers
15 views

How to implement OGRSpatialReference::SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); globally in a django2.2 project

Debian 10, Python 3.7.10, POSTGRESQL 12.1, Django 2.2. To be able to use GRASS and POSTGRESQL 12.1 I should upgrade GDAL from 2.1.2 to 3.2.2 with PROJ 7.2.1. (see this other question) After such ...
0
votes
0answers
35 views

Visualizing serialized GeoJSON data in HTML table

I am using Django and I have serialized data as GeoJSON format. I can visualize that with HTTP response but I want to put these data in table. views.py from django.shortcuts import render from django....
0
votes
0answers
47 views

Using PostGIS ST_Clip to crop raster in Django webapp

I'm currently building a geospatial webapp with Django and PostGIS on the back. Within the Django webapp, users can draw a polygon on a map, which is saved to a Django PolygonField() field. An example ...
0
votes
0answers
42 views

Postgis intersection behaves strangely when getting closer to poles

We use Postgis for Django to locate the objects inside a certain viewport. It works great at the equator, but the farther we move, the more distorted the viewport becomes. Here is the result (the red ...
0
votes
0answers
97 views

Django ORM geo function ST_AsMVTGeom always returns type "bytea" not "geometry"

I want to use POSTGIS function ST_AsMVTGeom with django ORM. Therefore I create following geo function: from django.contrib.gis.db.models.functions import Transform, GeoFunc class AsMVTGeom(GeoFunc): ...
0
votes
0answers
25 views

Filter on distance point field and choice field

I have model shop shop class Shop(models.Model): CATEGORY = ( ('BookShop', 'Bookshop'), ('Bakery', 'Bakery'), ('Dairy', 'Dairy'), Shop_category = models.CharField(max_length=200, null=...
0
votes
0answers
344 views

Printing OpenLayers map with vector tile layers has CORS error for GeoServer vector tiles

I want to create a client side printing module for OpenLayers (v6) map. In OpenLayers web site there is a printing example with JSPDF (Export PDF example ). I used this example but there is an error: ...
0
votes
0answers
35 views

CartoView Error

I've installed CartoView on Windows 7 by default instruction. I've changed Postgres to my own DB (It was problem with default DB from install package). CartoView doesn't start with this error: I ...
0
votes
0answers
290 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
521 views

Contained Query does not 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....