A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
0
votes
0answers
27 views

Deploying a GeoDjango project with Apache web server (on Windows system)

I am a newby in deploying web application. I have done a little web-gis app using Django in PyCharm and utilizing Osgeo libraries and drivers with Python37. I have deployed the web server using ...
1
vote
0answers
17 views

Saving TIFF file in database with GeoDjango

I am trying to save a TIFF file in database with GeoDjango, but I get weird errors at dem.save(). Versions: Python: 3.7 PostgreSQL: 11 Django 3.0.2 django.contrib.gis.gdal.gdal_version(): 2.4.0 ...
0
votes
0answers
18 views

Django admin: show line field made of points from another model

I am facing some issues trying to plot some trajectories in django admin. I have two tables: events and trajectory. Each event row has a start and end time and each row on the trajectory table ...
1
vote
0answers
20 views

Intersection between two polygons using GeoDjango

I've three models: class Buffer(models.Model): geom = models.PolygonField() class ImportedPolygons(models.Model): geom = models.MultiPolygonField() class IntersectionOutput(models.Model): ...
3
votes
0answers
32 views

GeoDjango: Inverted coordinates in drawn polygon

I need to draw a polygon using GeoDjango Admin. I can draw it but when I render it on my map I see the coordinates inverted. This polygon represent the Sicily, but is rendered on Eritrea and Ethiopia. ...
1
vote
0answers
35 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 ...
1
vote
1answer
35 views

Loading a shapefile into PostgreSQL using shp2pgsql and outputting geographical coordinates using Django to draw a polygon in Leaflet [closed]

I have been trying to put a shapefile into a PostgreSQL database. I then want to query the database with Django and output coordinates that I can use to draw a polygon in Leaflet. So far I have the ...
0
votes
1answer
19 views

Spatial Analysis: use of buffer function inside GeoDjango's LineString model

I'm trying to make a buffer around a line. I've a model with a LineString field and I would to use the buffer function like this to make my buffer. The aim of this is render the buffer on a webmap ...
1
vote
0answers
27 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....
0
votes
0answers
72 views

Intersecting multipolygon layer with polygon in GeoDjango

I have a Region model (deriving from django.contrib.gis.db.models.Model), with a geom field, which is a django.contrib.gis.db.models.MultiPolygonField. I'd like to compute the intersection of this ...
2
votes
1answer
79 views

OpenLayers: map with popup and marker cluster

I'm trying to create a map with marker cluster and popup using Openlayers 5. I'm be able to show a popup on click as you can see below but when I try to use marker cluster the contents are no longer ...
2
votes
0answers
32 views

JSON file fails to open

I have a file that has no extension. This file resides on an internal web server and it's called by a web map application based on django python. It looks like : > {"crs": {"properties": {"name": ...
0
votes
1answer
27 views

Labeling a GeoJSON with OpenLayers 5

I'm trying to put a label over a polygons. My polygons cames from a GeoJSON serialized by GeoDjango. I'm be able to categorize this polygons using the attribute "type" but I wanto to see the height as ...
1
vote
1answer
104 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 ...
1
vote
1answer
107 views

OpenLayers 5: To display the label for a point

In my project there are two GeoJSON point layer, both has the same attribute 'name'. I would like to use this attribute for labeling all points. I've found this similar question but it is for ...
1
vote
1answer
631 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 ...
1
vote
1answer
61 views

Reproject GeoJSON with OpenLayers 5

I'm using GeoDjango to render many points on a map based on OpenLayers 5. My points have EPSG 4326 and the map has EPSG 3857, I need to reproject the points. On the OpenLayers API I've founded two ...
1
vote
2answers
110 views

Assign the SRID to a serialized GeoJSON

I've created a simple model like this: class AddPoint(models.Model): name = models.CharField(max_length=100) geom = geomodels.PointField(srid=3857) def __str__(self): return self....
2
votes
1answer
56 views

Form returns 'IntegrityError'

I'm trying to create a simple form useful for put a point on a map. models.py from django.contrib.gis.db import models as geomodels from django.db import models class AddPoint(models.Model): ...
0
votes
1answer
61 views

Uncaught ReferenceError: MapWidget is not defined

I'm trying to create a form usefull to add only one single point on a map, I'm doing this for the first time. I use GeoDjango from Django 2.2 and OpenLayers 5. I've created a simple model with only ...
1
vote
1answer
321 views

Putting content of popup into modal using OpenLayers?

I'm trying to put the content of a OpenLayers 5 popup into a Boostrap's modal but I cannot make it. Here the code with popup; it work fine: . . . <div id="popup" class="ol-popup"> <a ...
0
votes
1answer
120 views

OpenLayers 5: this.source.loadFeatures is not a function with Cluster

I'm trying to change the example of the Clustered Feature using my points from geojson layer but there is something wrong. var random_points = new ol.layer.Vector({ title: 'Random Points', source:...
1
vote
1answer
162 views

OpenLayers 5: change the color of the highlighted feature

I've made a little script to highlight a feature on hover the mouse My inspiration comes from here. Now I would like to change the color of the highlighted feature. I can do this using style function ...
1
vote
0answers
123 views

Rendering 3D map in pgAdmin 4 to view Data? [closed]

I found this error 3D geometrics not rendered in view data (pgAdmin 4). In GeoDjango I've updated my PointField model with dim=3. After successful migration, I cannot see my data in map. My Django ...
1
vote
2answers
435 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 ...
5
votes
0answers
193 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 ...
3
votes
1answer
351 views

Loading shapefile in GeoDjango and displaying it in admin section?

I am trying to load a .shp file in GeoDjango Admin. As a newbie I followed their official documentation and based on that I am trying to load my own shapefile. No errors are being shown but I can't ...
0
votes
0answers
17 views

After installing geodjango my app wont migrate

raise ValueError('String input unrecognized as WKT EWKT, and HEXEWKB.') ValueError: String input unrecognized as WKT EWKT, and HEXEWKB.
0
votes
0answers
24 views

In Leaflet is uGeoJSONLayer the correct approach to get smaller amounts of Point data from GeoDjango?

I have a GeoDjango model containing a PointField. There are about 200,000 records spread over a large area. We view these records with Leaflet. The data only has relevance at a small scale (zoom level ...
2
votes
1answer
125 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
373 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
0answers
175 views

GDAL install path issues on Mac OSX High Sierra

trying to run Django (django==1.11.9) in a Python 3.6.3 virtualenv with PostGIS. I've installed postgres, postgis, and gdal2 via homebrew. when I run make, the build signals: CPLUS_INCLUDE_PATH=/...
0
votes
0answers
29 views

GeoDjango vs SQL query gives different results when filtering points in the polygon

I have a Django model with the following field: class PropertyPost(models.Model): ... location=models.PointField(null=True,blank=True) ... I am filtering the objects.locations in PgAdmin against ...
1
vote
1answer
74 views

Filtering points against polygon

I am able to run the following polygon filter against my points and it will correctly filter out my points in POSTGIS="2.4.4 r16526" select propertypost_propertypost.* From propertypost_propertypost ...
0
votes
1answer
830 views

Load multipolygons from GeoJSON into GeoDjango model

I have a simple model: from django.contrib.gis.db import models class CountryShapes(models.Model): geonameid = models.PositiveIntegerField(primary_key=True) geom = models.MultiPolygonField() ...
1
vote
0answers
48 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 ...
3
votes
1answer
409 views

Get exterior ring of a multipolygon using GEOSGeometry or PostGIS

I am trying to get the exterior ring of the multipolygon in the image below using GEOSGeometry (through GeoDjango) or Postgis, but I have not found an easy solution. This is an example of a ...
1
vote
0answers
87 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 ...
1
vote
0answers
418 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`. ...
2
votes
1answer
338 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 ...
2
votes
1answer
344 views

GeoJSON to Leaflet map using Django template

I have a view that returns this GeoJSON data {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-74.6739518440393, 40.7747050657312], [-...
0
votes
1answer
339 views

External GPS feed for HTML5 geolocation API in django-leaflet?

My goal is the following: I'm developing a Django project. The goal is to locate places with a form. I'm using a CreateView generic view (maybe I should create it manually for more customization. 3 ...
0
votes
0answers
161 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 ...
0
votes
1answer
159 views

How exactly do I use the GeoDjango Union function?

I have two models in my application: class Organization(models.Model): consortium = models.ForeignKey('Consortium') org_map = models.MultiPolygonField() class Consortium(models.Model): ...
2
votes
1answer
1k views

leaflet search control not showing up in geodjango app

I have a very basic geodjango app and I am trying to enable search control on it. I have found this question Adding a search box to a Leaflet.js example and the link brought me to what it seems like ...
0
votes
1answer
239 views

GeoDjango raster field display on Leaflet

In the new Django version support raster field and I follow this manual for GeoDjango raster field and this question for add raster I have built a simple demo. here the code : settings.py postgis ...
1
vote
1answer
333 views

How to find the area of polygon in geodjango?

I need to calculate the area of the Building (which the coordinates represents). I used transform() to calculate the area, but the calculated area is not accurate. Please help me calculating the area ...
-2
votes
1answer
120 views

Loading LIDAR data to POSTGRES and use it with DJANGO [closed]

I have some project at the Faculty and I don't know from where to begin. I have point cloud data (LIDAR data) and I need to make the website with that data on it and with functions for some sort of ...
0
votes
2answers
2k views

Error building GEOS on Ubuntu 18.04

Following the directions to install geodjango on linux ubuntu 18.04, so far here are my commands: sudo apt-get install binutils libproj-dev gdal-bin wget http://download.osgeo.org/geos/geos-3.4.2....
3
votes
0answers
73 views

How to dynamically determine a pixel size for raster creation?

I have a GeoDjango web service that allows a user to upload a las file (v1.2). I can derive the extent of the point cloud coverage from the file using laspy: from django.contrib.gis.geos import ...