Questions tagged [geodjango]
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
330
questions
0
votes
0
answers
13
views
Loading Data from View to Jazzmin Through GeoDjango
I am new to GeoDjango and Jazzmin. Someone please help me to move from here. I have to get all the properties 100 km surrounding to a location. Initially I developed using geom__dwithin. As below.
...
1
vote
1
answer
36
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 ...
1
vote
1
answer
18
views
Getting Output out of the scope-Geo Django
I have a location and I want all the properties around within 100 km to the location. I tried to follow this(GeoDjango error: Only numeric values of degree units are allowed on geographic DWithin ...
0
votes
0
answers
50
views
Edit and Save MVT tiles Leaflet
I am relatively new to GIS Web Development.
I have a very large vector that I want to display on front end and edit/update in form of a KML file that user uploads. I have managed to save the KML file ...
0
votes
0
answers
103
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 ...
0
votes
0
answers
28
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.
...
0
votes
0
answers
51
views
How to add a custom file-type as layer in Geonode and GeoServer
There is a requirement from our users to store a non-spatial (user-defined) file type, with a .zzz file extension, into Geonode. This file type has no spatial content but as per requirements, I need ...
1
vote
1
answer
114
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
1
answer
63
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
0
answers
37
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 ...
1
vote
0
answers
96
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
0
answers
47
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
1
answer
214
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
0
answers
103
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
1
answer
4k
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
0
answers
26
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
0
answers
44
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
0
answers
25
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
0
answers
371
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
0
answers
506
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
0
answers
57
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 ...
2
votes
0
answers
222
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
0
answers
66
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
0
answers
130
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
1
answer
147
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)
...
1
vote
1
answer
43
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(...
2
votes
1
answer
316
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 location. ...
2
votes
0
answers
158
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
1
answer
43
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
0
answers
75
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
1
answer
256
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
0
answers
67
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
0
answers
102
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
2
answers
537
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
1
answer
81
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 ...
3
votes
1
answer
292
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
1
answer
218
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)
...
2
votes
1
answer
413
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
1
answer
236
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 ...
1
vote
2
answers
945
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
1
answer
171
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
1
answer
413
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
0
answers
135
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">
&...
3
votes
0
answers
189
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
1
answer
286
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
2
answers
1k
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
0
answers
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 ...
2
votes
1
answer
495
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
0
answers
332
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
0
answers
55
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=...