Questions tagged [django]

Django is a high-level Python Web framework

Filter by
Sorted by
Tagged with
0
votes
0answers
12 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
60 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
44 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
17 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: ...
3
votes
0answers
37 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 ...
0
votes
0answers
10 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
29 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....
2
votes
0answers
38 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, ...
0
votes
0answers
38 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 ...
1
vote
1answer
23 views

django.contrib.gis.gdal.CoordTransform does not work

I want to convert EPSG:7844 toEPSG:4326 by using django.contrib.gis.gdal. I define CoordTransform in this way: from django.contrib.gis.gdal import CoordTransform, SpatialReference ct = CoordTransform(...
1
vote
0answers
91 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
1answer
97 views

Google Maps satellite view footprints not congruent to street map view

I am trying to draw the layout of a building and project them to a web map using Django and Leaflet. I am using a satellite image to get the correct latitude and longitude and then I send the ...
1
vote
0answers
45 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 ...
0
votes
1answer
110 views

Search & Display Function for Geodjango-Leaflet Web Map

I am trying to add a search function into my Geodjango-Leaflet-Openstreetmap web map. I have around 540000 polygons of property boundaries that were drawn in Arcmap; the polygons will be imported to ...
0
votes
0answers
40 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
17 views

Visualizing raster files stored in postgresql DB in Openlayers or Openstreetmap Layers [duplicate]

I am relatively new to this domain. I want to make a web app that will show raster data on openstreetmap layers or openlayers. So far I have successfuly managed to upload the files to postgresql. My ...
5
votes
2answers
677 views

From uploaded zipped shapefile to Geopandas DataFrame in Django Application

I'm trying to get to a point where I can quickly filter thousands of points in a shapefile. My Django application asks for a zipped shapefile to upload, where the zipped file contains at least the ....
0
votes
0answers
81 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): ...
2
votes
0answers
115 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):...
1
vote
1answer
109 views

Can I create a geospatial PDF in Python without using GIS software?

I have a Django web app that produces a couple different PDFs. One just displays tabular data, but another one needs to display geometries out of a PostGIS database, along with tabular data. In my web ...
0
votes
1answer
36 views

Difference in area size calculation since update packages

On my mac I use brew to install PostGIS and all dependencies, including geos. Since month or so, I have a failing test in my Python code. A polygon that is entered in WGS84 (srid 4326), the converted ...
1
vote
0answers
185 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. ...
0
votes
0answers
22 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
300 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: ...
2
votes
0answers
182 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 ...
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 ...
1
vote
0answers
50 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
1answer
21 views

Linux gives different result from Windows after import with osm2pgsql

I've done a blank Django project. Then shared it via git on gitlab. Then downloaded a very small region from geofabrik Then: in Windows I've imported it via: osm2pgsql -c -U xx -d yy -H localhost -W -...
1
vote
1answer
443 views

Rendering polygon from GeoJSON using GeoDjango

I can't render a single polygon from a GeoJSON. I use this model: class AddGeometryBase(models.Model): name = models.CharField(max_length=100) def __str__(self): return self.name ...
5
votes
1answer
5k views

GeoDjango can't find GDAL:

I'm following this tutorial: https://docs.djangoproject.com/en/2.2/ref/contrib/gis/tutorial/, I installed every component necessary. But it seems like Django can't find the gdal module. I have gdal ...
4
votes
2answers
68 views

Running Geonode solr application

I am trying to follow these steps http://www.paolocorti.net/foss4g_2017_geonode_solr/10_customization.html but I installed geonode using the quick start tutorial http://geonode.org/#install. I am not ...
1
vote
2answers
2k views

How do I use Django REST Framework GIS to query GeoJSON

I am trying to write the view that will return a GeoJSON of my model stored in the database. I would like to create an API so that I can use an AJAX request in a JavaScript file I have. I have not ...
7
votes
1answer
582 views

Loading multiple shapefiles in GeoDjango?

I have 3 three shapefiles and would like to upload all of them and project the result in GeoDjango admin. a) state.shp (for the shape of a state) b) boundary.shp (to identify a specific portion in ...
2
votes
1answer
112 views

Exact same code gives different result in server and local host

I have a back end that uses PostGIS to filter points inside a polygon. Backend is in Django, and here is the code that does the filtering: def get_queryset(self): polystr = self.request....
2
votes
1answer
297 views

GeoDjango web mapping application can only view single point at one time?

I am very new to Geodjango and have been running into some issues with a web mapping application. Currently, I am trying to make it so I can view all the schools on a map at once, as well as view ...
0
votes
1answer
1k 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 ...
0
votes
2answers
992 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 ...
1
vote
0answers
78 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 ...
2
votes
0answers
193 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
1answer
1k 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 extensio`. ...
1
vote
0answers
842 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 ...
2
votes
1answer
828 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
121 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
817 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
276 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 ...
1
vote
1answer
405 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
1answer
389 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
796 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
150 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 ...
2
votes
2answers
1k 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\...