Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 30674

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

1 vote
Accepted

When to use GeometryField?

A GeometryField can hold either a Point, a LineString or a Polygon. An example: Your table holds information about parks in your city. Your data is incomplete - and for some parks the data is a s …
Udi's user avatar
  • 368
2 votes

Convert GIS DB PolygonField to WKT or GeoJson in Django

Try this: for o in TestUnit.objects.all(): print(o.my_poly) print(o.my_poly.geojson) print(o.my_poly.wkt) print() To filter: for o in TestUnit.objects.filter(field1=value1, field2= …
Udi's user avatar
  • 368
5 votes
Accepted

Add buffer around polygon in meters using GeoDjango

this: distance = 5 # distance in meter buffer_width = distance / 40000000.0 * 360.0 buffered = obj.geofence.buffer(buffer_width) Source: https://stackoverflow.com/questions/31940674/optimal-query-in-geodjango-postgis-for-locations-within-a-distance-in-meters …
Udi's user avatar
  • 368
8 votes
Accepted

Splitting Polygon by Linestring in GeoDjango?

wkt.loads(POLY) line = wkt.loads(LINE) merged = linemerge([poly.boundary, line]) borders = unary_union(merged) polygons = polygonize(borders) for p in polygons: print(p) Since GEOS is used by GeoDjango
Udi's user avatar
  • 368
0 votes
Accepted

How to share accurate location with Geodjango

You will need to build two parts to record user locations: A front end solution, probably including a javascript based map (for example, by using leaflet or google maps) and the HTML5 geolocation …
Udi's user avatar
  • 368
2 votes
Accepted

Structure shared raster data across GeoDjango apps?

Apps are usually divided for different functionality and not per geographic regions. An example data model could be: class Zone(models.Model): name = models.CharField(...) # ... other fields …
Udi's user avatar
  • 368
1 vote

Connecting Django to postgresql

os.environ['GDAL_DATA'] = OSGEO4W + r"\share\gdal" os.environ['PROJ_LIB'] = OSGEO4W + r"\share\proj" os.environ['PATH'] = OSGEO4W + r"\bin;" + os.environ['PATH'] Run python manage.py check to verify geodjango
Udi's user avatar
  • 368