Questions tagged [geodjango]

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Filter by
Sorted by
Tagged with
1
vote
1answer
27 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 ...
0
votes
1answer
28 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....
0
votes
0answers
17 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 ...
0
votes
0answers
19 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 ...
0
votes
0answers
12 views

Cluster points in GeoDjango using Leaflet

Am trying to cluster point in Leaflet from the data created in backend geodjango.I have converted to geojson format to be able to visualize. #views.py def data(request): data=serialize('geojson',...
1
vote
1answer
28 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
37 views

Proj Error when trying to save data in PostGIS database from geodjango

I want to store my raster image(tiff) in my PostGIS database I have a Django model ndvitime and I want to store my tiff image from earth engine to my database. The error arises when I want to save the ...
2
votes
1answer
903 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
17 views

GeoDjango how to display distance in meters in this query

GeoDjango how to display distance in meters in this query Right now I'm just displaying them by distance ranking. I would like to get the distance in meters more models.py class Master(models.Model): ...
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
182 views

ImportError: cannot import name 'checksum' from 'modeltranslation when running paver setup to configure Geonode

I am running Windows 10, Geonode 3.1.1, Gdal 3.1.4, Django 3.2.4 and Python 3.9. When running paver setup I get an ImportError: cannot import name 'checksum' from 'modeltranslation.models. See the ...
0
votes
0answers
294 views

GeoDjango PointField | Sending coordinates using JSON

So I have this problem in my app. When I try to create user that have attribute "location" that is a GeoDjango PointField, only value set as 'default' is saved... When I send request with ...
0
votes
0answers
19 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
42 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
86 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
41 views

Generate MVT with POSTGIS and feature tolerance

I have a database which has three geometry tables 'tbl_point, tbl_line, tbl_polygon' with millions of features. Each table has two geometry columns named geom & m_geom for geometries and multi-...
3
votes
0answers
99 views

Layer ordering of ST_ASMVT tiles in Leaflet

I am generating MVT tiles for multiple layers in Django using the following query: WITH bounds AS ( SELECT ST_Segmentize(ST_MakeEnvelope(8247861.100083642, 3551570.082242422, 8252753....
0
votes
1answer
70 views

GeoDjango geometry transform method is swapping x with y

I need to convert a geometry from srid 4326 to srid 3857: myPoint4326 = Point(x=-73,y=40, srid=4326) myPoint3857 = myPoint4326.transform(3857,clone=True) print(myPoint4326.wkt) print(myPoint3857.wkt) ...
0
votes
0answers
56 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
30 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(...
0
votes
0answers
120 views

Finding nearest points based on distance and the user location and display on a Folium or Leaflet map?

I want to display the nearest 'services' points using the distance function on the Folium map. I need to pass the user location from the form and find the nearest services based on the current ...
1
vote
0answers
83 views

How to use a custom CRS in PROJ?

I want to change the CRS of a shapefile which uses EPSG:6257. Unfortunately, I am using Ubuntu 20.04 which comes with PROJ6. This particular CRS was only made available from PROJ7.2 onwards. So, I am ...
1
vote
1answer
32 views

Customising a marker after performing a spatial search query

I'm have a geodjango app that uses leaflet for a front-end. I have integrated the search function on the front-end to be able to search a customer location in real-time, of which the code below does ...
1
vote
0answers
49 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
178 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
50 views

How do I display data from a django rest get request in a react-leaflet using onEachFeature? [duplicate]

I imported shapefiles into my PostgreSQL database with PostGIS extension and created a REST API using Django which has a GET response like this: [ { "objectid": 1, "id_field&...
1
vote
0answers
70 views

Query a region within a larger region with GeoDjango REST API

I have a working Django REST API which can query all the counties in a country. //My model class kenya_counties(models.Model): objectid = models.BigIntegerField() id_field = models.BigIntegerField(...
2
votes
2answers
303 views

Add Geodjango MultiPolygon to Leaflet Map

I'm building a geospatial mapping application with Geodjango. I have created a model which has a MultiPolygonField(): class newJob(models.Model): job_name = models.CharField(max_length=64) ...
0
votes
1answer
42 views

Querying PostgreSQL DB with Google "get.bounds()" coordinates

I am trying to only display markers on a Google Map that are in the current map bounds and then update the markers when the map moves. The difficulty I am running into is querying my database to pull ...
0
votes
0answers
65 views

WFS Layer not displaying in ArcGIS and QGIS, but appears in the browser

I am using django-gisserver to open GIS models to WFS layers. I have configured the view and URLs in my Django project without any issues, and when I check the WFS URL running our Django project ...
3
votes
1answer
221 views

How to dynamically query and visualize PostGIS data using GeoDjango and OpenLayers?

I am trying to implement dynamic query functionality in GeoDjango and OpenLayers. First, I filter the data and return it in GeoJSON format using Django serialize. Then, the return GeoJSON data ...
0
votes
1answer
125 views

Django: how to set all of the model's fields using LayerMapping?

I have a GeoDjango model like below (in "data" app): from django.contrib.gis.db import models class FirstModel(models.Model): data_id = models.IntegerField(blank=True, null=True) ...
1
vote
1answer
272 views

How to add a polygon coodinates field instead of drawing it

I am working on a simple web mapping app using Django framework, and I am trying to add a geometric field where to insert polygon geometry's coordinates instead of drawing it manually (these ...
1
vote
1answer
159 views

How to get most accurate Point-Point distance queries in Europe with Spatialite

I have a GeoDjango app, currently on PostGIS, which I am converting to use Spatialite db instead. I have no specialised knowledge about GIS systems :( The locations table has a Geography column ...
0
votes
2answers
663 views

TypeError: Invalid parameters given for Point initialization.on Django

I am working on a location based poject and what I all want is to show only those pointfields stored in database which are at certain distance from any clicked region of leaflet map.But when I click ...
0
votes
1answer
95 views

Use ST functions in GeoDjango Project

I have a Geo-Django project in which i am using postgres as database. I have a table with geometry column. I am filtering data and getting results which is working fine. Problem is I want the geometry ...
0
votes
0answers
704 views

DoesNotExist: WorldBorder matching query does not exist

I recently started the geodjango tutorial from the django documentation, but I'm currently stuck because I keep getting a DoesNotExist: WorldBorder matching query does not exist error when I run ...
0
votes
1answer
297 views

PostGIS via GeoDjango: function ST_DistanceSphere(geometry, geometry) does not exist

I've been using PostGIS via GeoDjango (Django v3.0.7), happily until just now. I have a query (Django .filter()) that looks like this: .filter(point__distance_lte=(dlPt, D(m=CloseRadius))) when it ...
1
vote
0answers
91 views

Loading selected shapefile from dropdown in Leaflet map having PostgreSQL database using GeoDjango [closed]

My base.html looks like this {% load static %} <!--To load leaflet links--> {% load leaflet_tags%} <!DOCTYPE html> <html> <head> <meta charset="utf-8"> &...
2
votes
0answers
134 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
151 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 ...
2
votes
2answers
742 views

Filtering vector tile layer in OpenLayers map? [closed]

I have GeoDjango application for the visualization of household data with around 10k features. So I have used the vector tile for the visualization of these data. Now I faced the problem with the ...
0
votes
0answers
1k views

Display GeoJSON data on a Leaflet map with a Django app

I wan't to display GeoJSON data on a Leaflet map using Django. Data is from a PostgreSQL database, I have created a view with raw JSON which returns me data but I wan't to add this to a Leaflet map as ...
1
vote
1answer
383 views

Coordinates not consistently reversed (lon,lat interpreted as lat,lon) in Leaflet

I have a polygon layer fed from GeoDjango + PostGIS as GeoJSON. Its original CRS is 3908. It's being drawn as a GeoJSON layer in Leaflet in CRS 4326 (I figure it is transformed on the fly by Django ...
1
vote
0answers
237 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
26 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
2answers
1k views

Getting lat/lon from GeoDjango map/OSMWidget

I'm building a Django app in which I want users to be able to select a location by clicking on a map. That location is then stored in a Postgres database with the PostGIS extension. Displaying the ...
1
vote
0answers
2k views

Installing GDAL for GeoDjango on Windows 10

I have installed Python 3.7 (64 bit version) and added it to PATH variable: C:\Python37 After that, I installed and activated virtualenv via: pip install virtualenv env\Scripts\activate Inside ...
1
vote
0answers
50 views

How to use GeoDjango PostGIS ForceRHR/ForcePolygonCW

I have a model with a field called 'geom' that is a MultiPolygonField. When I query for instances of the model, I'd like the data in this field to follow the right hand rule. Because I am using ...

1
2 3 4 5
7