Skip to main content

Questions tagged [django]

Django is a high-level Python Web framework

Filter by
Sorted by
Tagged with
0 votes
0 answers
7 views

Numerous errors migrating SpataLite database with GeoDjango

On a Windows machine, I am trying to run GeoDjango's makemigrations, but receiving numerous errors from a models.py file created from GeoDjango's inspectdb. The error block looks like: ...
jwx's user avatar
  • 713
0 votes
1 answer
19 views

GeoDjango fails to load SpatiaLite, but not Jupyter?

I am trying to use SpatiaLite for a GeoDjango application on a Windows 10 machine using Anaconda, but, when I run python manage.py dbshell, I get an error "CommandError: You appear not to have ...
jwx's user avatar
  • 713
0 votes
0 answers
45 views

Changing tab order on GeoNode landing page

Is there a practical way to change the tab order (and/or remove one of the tabs if desired) on the GeoNode landing page as shown below?
Melanie's user avatar
  • 159
0 votes
0 answers
27 views

Saving GDALRaster in RasterField using GeoDjango

I want to save a raster using GDALRaster and GeoDjango's RasterField. In my model I defined the field: class SomeModel(models.Model): raster_foo = models.RasterField(null=True) and I have a ...
schja's user avatar
  • 1
1 vote
0 answers
41 views

OpenLayers add GML32 to map doesn't work

I'm new to this forum, but was thinking someone here could probably help me out. I recently moved from using leaflet to using openlayers. For a new project I want to display the content of a gml file ...
valentinooz's user avatar
1 vote
0 answers
181 views

Trouble with clipping a GeoJSON polygon from a PNG raster tile in a Django Python app with rasterio

I am currently working with a Django Python app that is associated with a PostgreSQL database where PostGIS is installed. There's a specific table in the database with a column of the polygon type, ...
ybz's user avatar
  • 11
0 votes
1 answer
2k views

django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library via Homebrew

Django 4.1.5 on M1 Ventura 13.3.1 (22E261) failing to detect GDAL installation even when enumerated per the documentation. Is this a version error or a pointer error? I don't really understand what ...
DisplayName's user avatar
2 votes
1 answer
163 views

Save a GDAL dataset to Django file field

I am processing a raster image inside my Django app. From a GeoTIFF file I am converting it to a COG. I am using gdal.Translate for the operation. I want to save the processed image without saving it ...
Nikko's user avatar
  • 611
1 vote
2 answers
215 views

Math error when trying to calculate the distance between two coordinates in python

I'm not sure if this is the right place but I am trying to develop a Django site that (among other things) shows public projects within 30 km of a given French commune. It mostly works fine but for ...
Ash_Crow's user avatar
1 vote
0 answers
208 views

Print Leaflet map in PDF using django-wkhtmltopdf

I have a Django app I am trying to print a Leaflet map in PDF using django-wkhtmltopdf, but the map is not rendering correctly. I even try to give more time to the 'javascript-delay' parameter but is ...
Ernesto Ruiz's user avatar
2 votes
1 answer
185 views

Hot to add buttons (links) to Geonode Menu bar using geonode-project 4.1.x?

I just install Geonode-project 4.1.x and try to follow the official documentation (https://docs.geonode.org/en/4.x/devel/workshops/index.html#customize-the-look-and-feel) to customize the look and add ...
Ernesto Ruiz's user avatar
3 votes
2 answers
3k views

Problem installing gdal with conda

I am on Ubuntu 21.04 with system level gdal 3.0.4 as verified by gdalinfo --version. My conda environment was created using the command conda create -n dev python=3.7. I then used pip to install my ...
Josh Kocur's user avatar
0 votes
1 answer
204 views

Calculate direction in PostGIS & Django (GeoDjango)

Is it possible to calculate direction to detect if users are moving in "similar" direction having a few of their last coordinates (Points) using PostGIS + Django (https://docs.djangoproject....
Yulian Rudenko's user avatar
1 vote
0 answers
175 views

Serializing Charfields to Point GeoDjango

I have two CharField in my model (longitude and latitude), I want serialize them with GeoJSON serializer and serve as API so I can use on Leaflet to show points on map, but GeoJSON serializer only ...
gorkemye's user avatar
1 vote
1 answer
230 views

Query GeoServer WFS layer attributes with form

How can I set up a form in HTML to query the attributes in my GeoServer WFS layer? I assume it has something to do with the action attribute but I'm not sure how it will work. Something like <form ...
Brad's user avatar
  • 11
1 vote
0 answers
85 views

Mixing JSON and GeoJSON in a Django answer

I want to retrieve two separate GeoJSON created from a PostGIS database with Django as well as some valuable information. Here is an example of what I would like to send back to the front end : ...
BFlat's user avatar
  • 394
1 vote
0 answers
108 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. ...
Ahsan Mukhtar's user avatar
2 votes
0 answers
141 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'] . ...
ayça tabakoğlu's user avatar
1 vote
1 answer
316 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 ...
ferus89's user avatar
  • 329
0 votes
1 answer
172 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....
SharmaPN's user avatar
1 vote
1 answer
470 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 ...
kysevenle's user avatar
1 vote
1 answer
749 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 {% ...
unfamousfox's user avatar
0 votes
1 answer
825 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 ...
johajippijupp's user avatar
7 votes
1 answer
13k 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 ...
swamper's user avatar
  • 73
1 vote
0 answers
258 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" ...
TheWang's user avatar
  • 11
8 votes
0 answers
1k 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 ...
Sigo van der Linde's user avatar
2 votes
0 answers
668 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, ...
aba2s's user avatar
  • 191
1 vote
1 answer
158 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(...
Ugnius Malūkas's user avatar
1 vote
0 answers
237 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 ...
treesajane's user avatar
1 vote
1 answer
632 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 ...
shadow's user avatar
  • 113
1 vote
0 answers
163 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 ...
MajorLazer's user avatar
0 votes
1 answer
449 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 ...
MajorLazer's user avatar
7 votes
3 answers
6k 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 ....
GISUser9's user avatar
  • 825
0 votes
0 answers
344 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): ...
Henhuy's user avatar
  • 906
6 votes
0 answers
327 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):...
Muser's user avatar
  • 225
3 votes
1 answer
1k 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 ...
GISUser9's user avatar
  • 825
0 votes
1 answer
52 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 ...
dyve's user avatar
  • 133
1 vote
0 answers
681 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. ...
Sandeep Prasad Kushwaha's user avatar
0 votes
0 answers
115 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=...
Sarthak  tiwari's user avatar
0 votes
0 answers
835 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: ...
Mahdi Nazari Ashani's user avatar
2 votes
0 answers
326 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 ...
David's user avatar
  • 129
0 votes
0 answers
63 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 ...
Sergey N's user avatar
  • 309
1 vote
0 answers
76 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....
whirish's user avatar
  • 111
1 vote
1 answer
31 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 -...
Olivier Pons's user avatar
1 vote
1 answer
963 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 ...
MaxDragonheart's user avatar
6 votes
2 answers
11k 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 ...
gacero's user avatar
  • 123
4 votes
2 answers
103 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 ...
neogeomat's user avatar
  • 8,380
1 vote
2 answers
4k 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 ...
Flynnpc's user avatar
  • 163
7 votes
1 answer
1k 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 ...
neferpitou's user avatar
2 votes
1 answer
844 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....
Nabat Farsi's user avatar