Hot answers tagged geodjango
8
GeoDjango also provides a lot of value-added, out-of-the-box features.
Geospatially enabled admin site: This is one of my favorite features of Django in general. Django automatically creates pretty nice looking admin pages. GeoDjango takes this a step further and provides you a way to easily view and edit geospatial data using an Openlayers map.
...
7
Postgresql is quite good handling multi-cores, especially since every connection gets spawned to a new process and thereby gets handled by the OS process scheduler.
I've run large postgresql databases on both windows and linux (ubuntu server) and they both perform very well.
However, most likely your performance will be heavily dependent on how well your ...
7
GeoDjango 1.4 supports PostGIS 2.0 with too many workarounds to make it worth it.
Instead, install GeoDjango 1.5 beta which natively supports PostGIS 2.0 and switch to the official release next month.
6
The tolerance value is specified in map units: if two points are within the snapping tolerance, they are collapsed. So if you have geographic coordinates, simplify(1) would collapse everything to the nearest degree. Try something like simplify(0.0001) to start, or smaller depending on the resolution of your input data.
You may also be interested in this ...
5
The SQL to drop the constraint:
ALTER TABLE myapp_mymodel DROP CONSTRAINT enforce_geotype_mygeom;
Or to alter it to allow both Polygons & MultiPolygons:
ALTER TABLE myapp_mymodel DROP CONSTRAINT enforce_geotype_mygeom;
ALTER TABLE myapp_mymodel ADD CONSTRAINT enforce_geotype_mygeom CHECK (geometrytype(mygeom) = 'POLYGON'::text OR geometrytype(mygeom) ...
5
I'd take your starting coordinate and convert it into a UTM coordinate, choosing the appropriate zone.
Then, go east 1609.344 meters and south 1609.344 meters. Convert back to lat/long.
For completeness I would get all four points from the UTM projection, as your square mile may actually appear to be a trapezoid on your display map.
4
There are some difficulties in calculating such a thing because of earth's curvature. One degree in 0º lat is bigger then in -30º lat.
WARNING: don't take these as real.
1 degree longitude in 0º latitude, corresponds approximately to 111km. You can use trignometry functions to better estimate in other latitudes and calculate this in miles.
There is ...
4
There's a few ways to do this. One is to simply put the geojson of the object into a javascript variable and then render the geometry of the geojson into your map. For example, in your header of county.html you can put something like:
var countyJson = {{county.geom.geojson|safe}};
You may also wish to transform the geometry into epsg:4326 before ...
4
If you have one target geometry with a batch of many test geometries, try using a prepared geometry. See this page for a good description of a prepared geometry.
4
The order of latitude and longitude has been reversed in the call
self.location = Point(self.latitude, self.longitude)
That is because Points expect the x-coordinate (longitude) to be the first argument.
Indeed, the distance between points at latitude -74 degrees and longitudes at 4.6 and 11.0 degrees is approximately 206 kilometers.
4
there are limitid resources for geodjango or you can find only old version of documentation on net .you cant easily find to-date information about geodjango but i can give you very good source for learning it. there is great pdf presentation for it... you can learn main functions and develop your app. with it.
1. Rapid Geographic Web Application with ...
4
As of Shapely version 1.2.14, coordinates are slicable. This looks very similar to GEOSExtractLine, where a subset of the LineString can be extracted.
Here are some examples how you can slice coordinates to extract a new line object:
from shapely.geometry import LineString, Point
# Original LineString used for examples
line = LineString([(30, 50), (60, ...
4
Rather basic answer to your interesting question.
Django is a mature web framework. Geodjango is a set of classes allowing you to edit/save/display geospatial data types via the admin module or your own web pages (by employing openLayer in the background). This is fun/impressive but Geodjango doesn't do very much else per se.
Geoserver is a web mapping ...
4
try to read Improving the Admin from http://blog.adamfast.com/
{% extends "gis/admin/openlayers.js" %}
{% block extra_layers %}
topo_layer = new OpenLayers.Layer.WMS( "USA Topo", "http://terraservice.net/ogcmap.ashx", {layers: 'DRG'} );
{{ module }}.map.addLayer(topo_layer);
nexrad_layer = new OpenLayers.Layer.WMS( "NEXRAD", ...
3
It's entirely possible, but nobody's done it yet. Arc2Earth uses an independent implementation of the Esri REST API to host on Google App Engine. And implementing the REST API makes it possible to do things like expose geoprocessing services and feature layers for analysis in ArcGIS Explorer.
3
It's harder than it sounds. Django Models are, at the moment, pretty tied to a SQL database world and the Admin is, in turn, pretty tied to Django models.
Your best bet is probably to look at something like Django-nonrel
http://www.allbuttonspressed.com/projects/django-nonrel
3
Hekevintran,
Your first query is using an index just not the spatial one. See the Index Scan using geoplanet_place_pkey. So it's more efficient for it to use the id key since you are doing an ORDER by the column and your spatial filter covers the whole table.
The spatial index is not used because your ST_Expand is too big. You have a geometry
but its ...
3
From looking at the documentation on the Geodjango website, it looks like you don't need the , between the numbers, so give this a try:
INSERT INTO domes_place (placeid, structidx, oscode, holding)
VALUES ('10', '1', '1', 'POINT(632000 141000)', 'N');
Looks like the missing , is a WKT(Well-Known Text) convention, never noticed it before.
3
A couple of ways you can solve this: you could switch out your geometry field for a geography field within GeoDjango, then any native area calls should return values in meters which can easily be converted to the units you're interested in.
If you want to stick to storing things in geographic space as plain geometries, then you'll need to do conversion ...
3
Temporal Filter Strategy
Example
Another way to go is using a temporal filter strategy (filter by time). But first you'll need your data exposed in OGC web service form.
Since you're still researching these technologies you might come to realization that it will be beneficial to use something like GeoServer or MapServer in between your PostGIS and ...
3
Your model must be like this:
# Import django module
from django.contrib.gis.db import models
class Point(models.Model):
placename = models.CharField(max_length=50)
geom = models.PointField(srid=4326)
objects = models.GeoManager()
def __unicode__(self):
return '%s %s %s' % (self.name, self.geom.x, self.geom.y)
your view is :
...
3
Reducing fidelity (i.e removing the number of nodes) will help since there is less data to pass to Google Maps.
Nevertheless, I would hope you are not doing this for every request directly in the view and that this is something that you are doing only once (during the first save), or through some asynchronous queue mechanism like Celery.
You can always ...
3
if you use PostGIS Geography Type for your table, you can calculate your area as you calculate on the plane surface.
The geography type provides native support for spatial features
represented on "geographic" coordinates (sometimes called "geodetic"
coordinates, or "lat/lon", or "lon/lat"). Geographic coordinates are
spherical coordinates expressed ...
3
You are right, adding a new model to models.py each time is impossible. And, if it where, you would end up with a lot of unmanageable tables.
One option is to use a schema-less datastore (i.e. a NoSQL database) but then you'd loose the spaial capabilities of PostGIS (or have to use both PostGIS and a NoSQL db, no fun!). And then there's the concept of ...
3
Your QGIS project CRS is set to Google Mercator, which is needed if you want Google or Openstreetmap background by using Openlayers plugin.
The layer CRS can (and should be) different from that, in your case WGS 84 in degrees.
If you want the coordinate display in degrees, but have a Google/OSM background: make a screen copy by File -> Save Picture as, ...
3
I'll offer a perspective: Python is in more widespread use in the geospatial arena. It is the scripting language of choice for ArcGIS and QGIS and there are a wide variety of high quality libraries available for it, plus community.
Python/Django/GeoDjango are a mature combination, with a somewhat slower, steadier development pace than Ruby/Rails/RGeo, which ...
2
It really depends on what you are trying to accomplish. Do you want a rough guess or as accurate as possible. Any which way the result will always have some sort of error associated with it.
Take Lat/Long for example, it would be difficult to determine the mile length in the (X) Longitude Direction, as the curvature latitudes converge as you approach the ...
2
Using ESRI's Projection Engine DLL (bundled with the freely downloadable ArcExplorer) you could use the GeodesicCoordinate function to find a point a specified distance southeast of your given point.
If using in a .NET environment, see Richie Carmichael's blog post.
Only top voted, non community-wiki answers of a minimum length are eligible