Questions tagged [django]

Django is a high-level Python Web framework

Filter by
Sorted by
Tagged with
1 vote
0 answers
8 views

Django Leaflet Back-end Service for Map Screenshot

I am developing an application in Django using leaflet, i have a questionnaire that when user fill they type the address, and then using google address api, i fetch the address details e.g. lat/long. ...
user avatar
2 votes
0 answers
29 views

How can I display WKT MultiLineString on OpenLayers in DJANGO project [closed]

I want to display WKT in text on HTML. I wanted it on JS variable but i couldn't do that. Python code def showResult(request): start = request.GET['start'] end = request.GET['end'] . ...
user avatar
0 votes
0 answers
38 views

How to display WKT MultiLineString on OpenLayers in DJANGO project

Actually i tried something but just i display WKT in text on HTML. I wanted it on JS variable but i couldn't do that. Python code def showResult(request): start = request.GET['start'] end ...
user avatar
0 votes
0 answers
80 views

How to display GeoJSON on Cesium

I've a Django app that lets you run a spatial query and displays the result in the form of a GeoJSON polygon or geometry on a Leaflet map. Here's how I did it on Leaflet: I store the geometry in an ...
user avatar
0 votes
0 answers
86 views

Using JavaScript to upload GeoJSON to GeoServer as a layer

I have a GeoJSON as a variable in JavaScript. I am trying to programmatically upload this GeoJSON into GeoServer as a layer. The user requirements as such that this data has to be uploaded from memory ...
user avatar
0 votes
0 answers
21 views

Geonode development errors DEBUG=TRUE not working

I am modifying the Geonode Django website. When modifying the views, some errors are not shown. I guess they would be shown if I set DEBUG=TRUE. But even if it set this value, I cannot see the errors. ...
user avatar
1 vote
1 answer
89 views

GeoDjango rendering duplicate geometry in Leaflet

I have a GeoDjango app following this tutorial but substituting World Borders polygon data as included in the standard GeoDjango tutorial. I have created serializers and a django rest api that ...
user avatar
  • 304
0 votes
1 answer
59 views

Adding a custom file type in GeoServer

I am trying to add a non-spatial (user-defined) file type, with a .zzz file extension, into GeoServer. This file type has no spatial content but as per requirements, I need to store as a Geonode layer....
user avatar
0 votes
0 answers
33 views

Adding a new file type as layer into Geonode

I am trying to add a non-spatial (user-defined) file type, with a .zzz file extension as layer into Geonode. This filetype has no spatial content but as per requirements, I need to store as a Geonode ...
user avatar
1 vote
0 answers
62 views

How to set default_lon, default_lat for admin page using GISModelAdmin

How do you set default_lon, default_lat, and default_zoom for a PointField in the django admin page using GISModelAdmin class? With the following code the admin page loads correctly, but with the ...
user avatar
1 vote
1 answer
131 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 {% ...
user avatar
0 votes
0 answers
72 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 ...
user avatar
0 votes
1 answer
143 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 ...
user avatar
2 votes
1 answer
3k 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 ...
user avatar
  • 23
0 votes
0 answers
20 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 ...
user avatar
0 votes
0 answers
21 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 ...
user avatar
0 votes
0 answers
470 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 ...
user avatar
0 votes
0 answers
80 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" ...
user avatar
0 votes
0 answers
49 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: ...
user avatar
5 votes
0 answers
499 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 ...
user avatar
0 votes
0 answers
46 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 ...
user avatar
2 votes
0 answers
185 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, ...
user avatar
  • 195
1 vote
1 answer
40 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(...
user avatar
1 vote
0 answers
141 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 ...
user avatar
1 vote
1 answer
175 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 ...
user avatar
  • 13
1 vote
0 answers
66 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 ...
user avatar
0 votes
1 answer
226 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 ...
user avatar
5 votes
2 answers
1k 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 ....
user avatar
  • 773
0 votes
0 answers
145 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): ...
user avatar
  • 876
3 votes
0 answers
165 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):...
user avatar
  • 185
1 vote
1 answer
244 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 ...
user avatar
  • 773
0 votes
1 answer
43 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 ...
user avatar
  • 133
1 vote
0 answers
306 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. ...
user avatar
0 votes
0 answers
48 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=...
user avatar
0 votes
0 answers
446 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: ...
user avatar
2 votes
0 answers
228 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 ...
user avatar
  • 129
0 votes
0 answers
36 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 ...
user avatar
  • 311
1 vote
0 answers
62 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....
user avatar
  • 111
1 vote
1 answer
23 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 -...
user avatar
1 vote
1 answer
601 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 ...
user avatar
5 votes
1 answer
6k 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 ...
user avatar
  • 113
4 votes
2 answers
78 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 ...
user avatar
  • 8,119
1 vote
2 answers
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 ...
user avatar
  • 63
7 votes
1 answer
832 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 ...
user avatar
2 votes
1 answer
240 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....
user avatar
2 votes
1 answer
369 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 ...
user avatar
0 votes
1 answer
2k 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 ...
user avatar
0 votes
2 answers
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 ...
user avatar
  • 1
1 vote
0 answers
96 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 ...
user avatar
2 votes
0 answers
236 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 ...
user avatar
  • 151