Questions tagged [django]

Django is a high-level Python Web framework

Filter by
Sorted by
Tagged with
1
vote
2answers
5k views

Python library or algorithm to generate arc geometry from three coordinate pairs?

I'm trying to write code to generate fixtures for a django/geodjango project. I need to generate geometry for arcs (line string) given three lat/long pairs; start of arc, end of arc and centre of arc. ...
1
vote
1answer
405 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 ...
0
votes
0answers
110 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 ...
1
vote
1answer
813 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 ...
0
votes
0answers
14 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
48 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" ...
0
votes
0answers
107 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 ...
0
votes
0answers
18 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: ...
3
votes
0answers
106 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 ...
3
votes
1answer
167 views

Django map permissions

I want to build a site using Django and have a user authentication system. In that site I want to serve maps and other data, but not to all users. What I am interested in is: can I give the maps some ...
0
votes
1answer
501 views

Contained Query does not work in spatial coordinates in GeoDjango?

These are my Models. I imported the shapefiles to this Models class Parcel(models.Model): objectid = models.BigIntegerField() apn = models.CharField(max_length = 80) lot_size = models....
0
votes
0answers
11 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
1answer
1k 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`. ...
7
votes
1answer
609 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 ...
0
votes
0answers
29 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
40 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
43 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
25 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(...
4
votes
2answers
69 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 ...
1
vote
0answers
107 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 ...
1
vote
1answer
107 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 ...
1
vote
0answers
46 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 ...
5
votes
2answers
780 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 ....
0
votes
1answer
121 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
42 views

Postgis intersection behaves strangely when getting closer to poles

We use Postgis for Django to locate the objects inside a certain viewport. It works great at the equator, but the farther we move, the more distorted the viewport becomes. Here is the result (the red ...
0
votes
0answers
17 views

Visualizing raster files stored in postgresql DB in Openlayers or Openstreetmap Layers [duplicate]

I am relatively new to this domain. I want to make a web app that will show raster data on openstreetmap layers or openlayers. So far I have successfuly managed to upload the files to postgresql. My ...
0
votes
0answers
89 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): ...
0
votes
1answer
38 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 ...
2
votes
0answers
121 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):...
0
votes
1answer
1k 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 ...
1
vote
1answer
117 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 ...
1
vote
0answers
202 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
23 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
1answer
1k views

Use of Leaflet to display raster layers in Django [closed]

I'm using Django to create a webserver that can gather user inputs, produce simulations and output the results with Leaflet. So far I can produce simulations in Farsite using prepared inputs, however ...
0
votes
0answers
329 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: ...
5
votes
1answer
5k 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
414 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
0answers
187 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 ...
0
votes
2answers
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 ...
0
votes
0answers
35 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 ...
1
vote
1answer
452 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
0answers
52 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....
1
vote
1answer
21 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 -...
1
vote
1answer
622 views

django-raster rendering raster url

i want to add raster functionality in django using postgis database using django-raster package and this docs. here my code : models.py from django.contrib.gis.db import models class RasterWithName(...
1
vote
2answers
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 ...
2
votes
1answer
123 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....
2
votes
1answer
303 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 ...
1
vote
0answers
125 views

Adding new static page in CartoView / GeoNode? [closed]

I have installed the CartoView with the Windows stable build installer. Then, I try to add a static page to the newly installed CartoView / GeoNode by modifying the urls.py file: urlpatterns = [ # ...
1
vote
2answers
815 views

How to convert the area to feets in GeoDjango?

my geom has // When I am trying to get the area of the polygon geom.area //7.27640644096346e-08 How to get these value in feets. I don't know what is the units of these value I am trying to ...