Search Results

Search found 20 results on 1 pages for 'geodjango'.

Page 1/1 | 1 

  • Rendering spatial data of GeoQuerySet in a custom view on GeoDjango

    - by dmytro
    Hello. I have just started my first project on GeoDjango. As a matter of fact, with GeoDjango powered Admin application we all have a great possibility to view/edit spatial data, associated with the current object. The problem is that after the objects having been populated I need to render several objects' associated geometry at once on a single map. I might implement it as a model action, redirecting to a custom view. I just don't know, how to include the OpenLayers widget in the view and how to render there my compound geometry from my GeoQuerySet. I would be very thankful for any hint from an experienced GeoDjango programmer.

    Read the article

  • display MultiPolygonField data on Geodjango/OpenLayers

    - by Markos Gogoulos
    Hi all, I'm a Geodjango novice and would like to get some help on the following: I have a MultiPolygonField field, for a GeoDjango application, and would like to display it on my view as cool as it gets displayed on django admin Say for example I have def index(request): "Index,main view" border = WorldBorders.objects.get(name='Italy') return render_to_response('world/index.html', {'user': request.user, 'border': border}, context_instance=RequestContext(request)) then on world/index.html, what is the way to display the border, as it would be on django admin? Thanks in advance for all replies!

    Read the article

  • Geodjango: importing data from OSGB_1936, displaying in WGS84?

    - by AP257
    I have some polygon data saved in a PostGIS database with projection SRID 27700. geom = models.MultiPolygonField(srid=27700) I want to display the shapes on OpenStreetMap, i.e. with SRID 900913 (I think?). So, two questions: How do I change the code below to output with the right SRID for OpenStreetMap? How can I change the Django code below to give me a nice json object, ready to display as a polygon? area = get_object_or_404(soa.objects, code=my_code) polygon = area.geom return render_to_response('area.html', { 'area': area }, context_instance = RequestContext(request)) Apologies if this question doesn't make sense - I'm pretty new to GeoDjango.

    Read the article

  • GeoDjango: Exceptions for basic geographic queries

    - by omat
    I am having problems with geographic queries with GeoDjango running on SpatiaLite on my development environment. from django.contrib.gis.db import models class Test(models.Model): poly = models.PolygonField() point = models.PointField() geom = models.GeometryField() objects = models.GeoManager() Testing via shell: >>> from geotest.models import Test >>> from django.contrib.gis.geos import GEOSGeometry >>> >>> point = GEOSGeometry("POINT(0 0)") >>> point <Point object at 0x105743490> >>> poly = GEOSGeometry("POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))") >>> poly <Polygon object at 0x105743370> >>> With these definitions, lets try some basic geographic queries. First contains: >>> Test.objects.filter(point__within=poly) Assertion failed: (0), function appendGeometryTaggedText, file WKTWriter.cpp, line 228. Abort trap And the django shell dies. And with within: >>> Test.objects.filter(poly__contains=point) GEOS_ERROR: Geometry must be a Point or LineString Traceback (most recent call last): ... GEOSException: Error encountered checking Coordinate Sequence returned from GEOS C function "GEOSGeom_getCoordSeq_r". >>> Other combinations also cause a variety of exceptions. I must be missing something obvious as these are very basic. Any ideas?

    Read the article

  • Problem getting started with GeoDjango

    - by akv
    As soon as I add "from django.contrib.gis.db import models" instead of "from django.db import models", Django stops recognizing the app and gives this error: Error: App with label location could not be found. Are you sure your INSTALLED_APPS setting is correct? The error goes away as soon as I comment out "from django.contrib.gis.db import models"... I have added "django.contrib.gis" and the "location" app to the INSTALLED_APPS setting correctly. Any clues why this is happening? I am running using Django v1.1.1 final, on my windows laptop.

    Read the article

  • GeoDjango: is there an out-of-the-box way to generate clusters of points?

    - by vaughnkoch
    Hi, I'm trying to compute clusters on a set of points in Python, using GeoDjango. The problem: Given a set of points, output a set of clusters of those points. (i'm fine specifying # of clusters/cluster size/distance in advance to simplify) There are a few solutions on the web to do clustering, so it's a well known problem. I thought that GeoDjango would handle these types of problems out of the box, but it's not clear how - I've searched the GeoDjango documentation, Google, and a few other places, but couldn't find anything. Before I roll my own clustering solution, I thought I'd ask to see if there's a straightforward way to do this using GEOS or another package within GeoDjango.

    Read the article

  • Is it possible to calculate distance on GeoDjango in a SELECT statement?

    - by alex
    I am using MYSQL. I have a table with 1 column, a Point field. I want to SELECT all rows that have a point with a distance less than 50 meters of my given point. Simple enough, right? Below is how it's done in RAW SQL. But of course, I want to use GeoDjango to do this. cursor.execute("SELECT * FROM project_location WHERE\ (GLength(LineStringFromWKB(LineString(asbinary(utm), asbinary(PointFromWKB(point(%s, %s)))))) < 50)\

    Read the article

  • How to create a HTML world map with GeoDjango ?

    - by pierre-guillaume-degans
    The GeoDjango tutorial explains how to insert world borders into a spatial database. I would like to create a world Map in HTML with these data, with both map and area tags. Something like that. I just don't know how to retrieve the coordinates for each country (required for the area's coords attribute). from world.models import WorldBorders for country in WorldBorders.objects.all(): print u'<area shape="poly" title="%s" alt="%s" coords="%s" />' % (v.name, v.name, "???") Thanks !

    Read the article

  • How can I measure distance with tastypie and geodjango?

    - by Twitch
    Using Tastypie and GeoDjango, I'm trying to return results of buildings located within 1 mile of a point. The TastyPie documentation states that distance lookups are not yet supported, but I am finding examples of people getting it work, such as this discussion and this discussion on StackOverflow, but no working code examples that can be applied. The idea that I am trying to work with is if I append a GET command to the end of a URL, then nearby locations are returned, for example: http://website.com/api/?format=json&building_point__distance_lte=[{"type": "Point", "coordinates": [153.09537, -27.52618]},{"type": "D", "m" : 1}] But when I try that, all I get back is: {"error": "Invalid resource lookup data provided (mismatched type)."} I've been pouring over the Tastypie document for days now and just can't figure out how to implement this. I'd provide more examples, but I know they'd be all terrible. All advice is appreciated, thank you!

    Read the article

  • How hard is it to modify the Django Models?

    - by alex
    I am doing geolocation, and Django does not have a PointField. So, I am forced to writing in RAW SQL. GeoDjango, the Django library, does not support the following query for MYSQL databases (can someone verify that for me?) cursor.execute("SELECT id FROM l_tag WHERE\ (GLength(LineStringFromWKB(LineString(asbinary(utm),asbinary(PointFromWKB(point(%s, %s)))))) < %s + accuracy + %s)\ I don't nkow why GeoDjango library cannot do this in MYSQL database. I hate writing RAW SQL for calculating distances between two points. Is there a way I can create my own library for Django that can handle this? If so, how hard is it?

    Read the article

  • standard geographic tilizing/binning method?

    - by monkut
    I'm trying to learn and understand more about mapping and displaying values on a map. (GIS) At the moment I'M looking to take some values and apply those values to a tile or bin on a map. Ideally I'd like the tile sizes to be uniform, like 100 meters, 500 meters, etc. Is there a standard method for creating uniform tile sizes? Or Are what are common accepted method to deal with this kind of data display? (Currently I'm using geodjango and it's related toolset geos, proj4, etc)

    Read the article

  • Problem creating PostGIS template database

    - by omat
    I am trying to build a template geographic database for PostGIS (1.5) on Mac OS X Snow Leopard (10.6) for my GeoDjango application. I am following: http://docs.djangoproject.com/en/dev/ref/contrib/gis/install/#creating-a-spatial-database-template-for-postgis I've managed to come up to the point where the provided postgis.sql should be run (i.e. psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql) At that point I am getting an error at the first SQL statement that is tried to be run. When I try that on the psql prompt the result is as follows: template_postgis=# CREATE OR REPLACE FUNCTION st_spheroid_in(cstring) RETURNS spheroid AS '/usr/local/pgsql/lib/postgis-1.5','ellipsoid_in' LANGUAGE 'C' IMMUTABLE STRICT; NOTICE: type "spheroid" is not yet defined DETAIL: Creating a shell type definition. ERROR: could not load library "/usr/local/pgsql/lib/postgis-1.5.so": dlopen(/usr/local/pgsql/lib/postgis-1.5.so, 10): Symbol not found: _DatumGetFloat4 Referenced from: /usr/local/pgsql/lib/postgis-1.5.so Expected in: /opt/local/lib/postgresql83/bin/postgres in /usr/local/pgsql/lib/postgis1.5.so Any ideas what might have been messed up?

    Read the article

  • Split or save a subset of a ESRI Shape SHP file to a new file?

    - by Eric Palakovich Carr
    I'm working with shape files in GeoDjango. Right now I'm trying to write a test for code that loads in a shape file and saves it to a database. The shape file currently has a feature count of 64,118. I'd like to reduce this to a handful so the test can quickly load it and confirm everything is right. Since shape files aren't in a text format, is there a free application or library I can use to pluck out a handful of features and save them to a new file? I should mention I don't have a license nor access to any of the ESRI product line.

    Read the article

  • Is this feasbile with GIS?

    - by Gnu Engineer
    I'm just getting myself to familiarize with GIS but i like to know before hand if the following is feasible with current GIS apps/tools... I get the point for an address by geocoding. Easy part. Now if the point falls within a boundary (may be a city/county/state) then i need to get the data (any id/flag) associated with the boundary. Based on the id/flag i then apply some business logic. My question is... How do i define the boundary? What tools should i use for it? How can i store the boundary definition in database in order to check if the point falls within it? This has to be done in the back end and not in visual maps as we don't intend to show/use maps. How do i associate my custom data (id/flag) with the above boundary definition? Hope i'm having right assumption on capabilities of GIS. Most of examples what i see is around people trying to show maps with data which is exactly not what i'm looking for. Also please suggest me some tools/books on this.

    Read the article

  • Filter zipcodes by proximity in Django with the Spherical Law of Cosines

    - by spiffytech
    I'm trying to handle proximity search for a basic store locater in Django. Rather than haul PostGIS around with my app just so I can use GeoDjango's distance filter, I'd like to use the Spherical Law of Cosines distance formula in a model query. I'd like all of the calculations to be done in the database in one query, for efficiency. An example MySQL query from The Internet implementing the Spherical Law of Cosines like this: SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) ) ) ) AS distance FROM stores HAVING distance < 25 ORDER BY distance LIMIT 0 , 20; The query needs to reference the Zipcode ForeignKey for each store's lat/lng values. How can I make all of this work in a Django model query?

    Read the article

  • How should I land my next consulting gig? [closed]

    - by MrOodles
    For the last couple of years, I've been working on speculative projects, expanding my skillset with side work, and paying the bills while having a blast consulting for startups. However, for a number of personal reasons, I need to spend the next 6-9 months maximizing my cash income. I want to put this into effect starting in early August. So that means I have one month to put the necessary client list/portfolio/resume together to start making this happen. As a programmer, I am very proficient in building Django web apps. I can write the necessary SQL, python, javascript, and css to build every part of a Django app, and then do the system administration necessary to deploy on AWS using EC2. I can also rig up a CDN to work seemlessly with the app using S3 and Cloudfront. I have built GIS applications using GeoDjango and PostGIS, and I have constructed social video apps by implementing Encoding.com as a service to prepare raw video files for consumption on the web. I am also moderately proficient in programming PHP, Java, and C#. I have built web apps in PHP, and desktop apps in Java and C#. I have dabbled with Android applications and iPhone apps, but nothing I would show off. I have experience doing SEO, social media marketing, and content marketing. Many of my clients have needed their apps promoted after they were built, and I was always happy to oblige when I could. I have also worked with biometrics technology including fingerprints for government contractors. This was as much a business analyst role as it was a programming gig, as I had to help answer RFPs, make checklists, and work around reems and reems of regulations to build applications that met very large bureaucratic requirements. I only have two real requirements for my next gig(s): 1) Work remotely. I live in North East Ohio, and I don't plan on leaving, but I wouldn't mind traveling one or two weeks out of every month to service clients who need on-site help. 2) $60.00hr-$∞ USD contracting rate. So what should I do for the next 30 days to achieve this? Should I target some large company and learn the requisite buzzwords to impress them? Should I learn some new language or technology? Polish some skill that I already have? Should I build something using my current skillset, or with some new technology? Should I put a website for my consultancy together to market myself? Should I do that using latest technology x, y, and z? Or should I just slap something up on Tumblr? I'm willing to do anything (moral) over the next 4 weeks to put myself into a position to maximize my income, and I'm open to all and every idea Programmers users may have. Let me hear them.

    Read the article

  • Nginx + uWSGI on a fresh Ubuntu install - bind error port 80

    - by knuckfubuck
    I know this is a common problem usually having to do with apache or another service already running on port 80 and I have done a lot of searching and running netstat and still have not figured out why I am getting this error. I rebuilt my slice, did a fresh install of Ubuntu 10.04 and setup nginx + uwsgi. It worked and I was able to see my Django site. I then installed Postgres8.4 and the rest of the stack needed for Geodjango from this link. After that was done I tried to restart nginx and I get this error: sudo /etc/init.d/nginx start Starting nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok configuration file /usr/local/nginx/conf/nginx.conf test is successful [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use) [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use) [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use) [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use) [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use) [emerg]: still could not bind() I have nginx set to listen 80. Here's an output from netstat -l --numeric-ports | grep 80: tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN Output from sudo lsof +M -i4: nginx 2330 root 8u IPv4 3195 0t0 TCP *:www (LISTEN) nginx 2331 www-data 8u IPv4 3195 0t0 TCP *:www (LISTEN) uwsgi 2335 s 4u IPv4 3259 0t0 TCP localhost:8000 (LISTEN) uwsgi 2352 s 4u IPv4 3259 0t0 TCP localhost:8000 (LISTEN) uwsgi 2353 s 4u IPv4 3259 0t0 TCP localhost:8000 (LISTEN) uwsgi 2354 s 4u IPv4 3259 0t0 TCP localhost:8000 (LISTEN) uwsgi 2355 s 4u IPv4 3259 0t0 TCP localhost:8000 (LISTEN) Anyone have any other ideas how I can figure out what is blocking port 80? edit Paste of my /etc/init.d/nginx script here: http://dpaste.com/hold/400937/

    Read the article

1