Questions tagged [django]

Django is a high-level Python Web framework

Filter by
Sorted by
Tagged with
1
vote
1answer
15 views

Leaflet draw layers disappearing after creation in Django

I implemented leaflet in my Django project, and managed to add the draw functionalities. The thing is after i draw the shape instantly disappears. What should i do to solve the problem? map.html {% ...
0
votes
0answers
28 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
1answer
30 views

Icon not displayed on OpenLayers when using Bootstrap Icons-Font

I'm trying to display Bootstrap Icons as icons on my OpenLayers map. I downloaded the icons css and woff-files into my Django-App and they work fine when referenced from html files. However, when I'm ...
1
vote
1answer
489 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 ...
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
130 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
52 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
21 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: ...
4
votes
0answers
190 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
16 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
38 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
62 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
48 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
29 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
118 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
121 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
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 ...
0
votes
1answer
153 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
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
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
928 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
98 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
130 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
131 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
38 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
218 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
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
350 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
204 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
56 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
471 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
71 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
3k 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
642 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
140 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
319 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
1k 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
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 ...
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
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
909 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
874 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
127 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
875 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
291 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 ...