geodjango

Geodjango admin, display pointfield not as map

故事扮演 提交于 2019-12-06 04:39:19
问题 This may be a stupid question but I can't find any clear answers. How do I change the display in the Django Admin so the Pointfield does not show up like a OpenLayer Map but as a regular input field. I need to see the long, lat for debugging.. Do i have to change the field type? Widgets? Thanks! 回答1: Update This is how I managed -at last- to keep separate fields for lattitude and longitude without having to save them in the database since the values are already saved in the PointField. The

How to filter geodjango based on longitude and latitude

寵の児 提交于 2019-12-06 00:28:33
I have an application that has been storing longitude and latitude now i want to integrate it with geodjango the application looks like this. class Location(models.Model): #other fields here lat = models.CharField(blank=True, max_length=100) lng = models.CharField(blank=True, max_length=100) now I will like to filter locations based on a distance say filter all location 1km away from location with pk = 1 using django.contrib.gis.measure import D and GEOSGeometry or should i refactor the model to have point rather than longitude and latitude so i can do something like this : Location.objects

Convert between coordinate systems with GeoDjango

拥有回忆 提交于 2019-12-05 15:22:43
I'm trying to add coordinate information to my database, adding django.contrib.gis support to my app. I'm writing a south data migration that takes the addresses from the database, and asks Google for the coordinates (so far I think my best bet is to use geopy for this). Next I need to convert the returned coordinates from WGS84:4326 , Google's coordinate system, to WGS84:22186 , my coordinate system. I'm lost among the GeoDjango docs trying to find a way to do this. This far, I gather I need to do this: gcoord = SpatialReference("4326") mycoord = SpatialReference("22186") trans =

heroku outputs “error fetching custom buildpack”, but only sometimes

江枫思渺然 提交于 2019-12-05 10:57:34
I have a Django project hosted on Heroku with a buildpack forked from cirlabs/heroku-buildpack-geodjango . Sometimes when I push to Heroku it responds with Counting objects: 16, done. Delta compression using up to 4 threads. Compressing objects: 100% (9/9), done. Writing objects: 100% (9/9), 790 bytes, done. Total 9 (delta 7), reused 0 (delta 0) -----> Heroku receiving push -----> Fetching custom buildpack... failed ! Heroku push rejected, error fetching custom buildpack To git@heroku.com:taplister-staging.git ! [remote rejected] dev -> master (pre-receive hook declined) error: failed to push

Unable to syncdb in GeoDjango App

浪尽此生 提交于 2019-12-05 09:37:25
I am having a real trouble in setting up spatial database and syncing it with GeoDjango. I was able to setup the spatial database as per the geodjango documentation and create a django app but when i run python manage.py sqlall world I am getting this, Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line utility.execute() File "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core

Geo Django mac OS X

淺唱寂寞╮ 提交于 2019-12-04 18:37:37
I am trying to use Geodjango on mac os, i use postgresql and I installed GEOS but i got this error : dlopen(/usr/local/lib/libgeos_c.dylib, 6): no suitable image found. Did find: /usr/local/lib/libgeos_c.dylib: mach-o, but wrong architecture Any idea? Thank you Sebastien Ok, I have my answer. My MAMP uses 32-bit Python and I compiled my library for 64-bit Python. So I recompiled it for 32-bit Python. To do this, I used these commands in my library folder: export CFLAGS=-m32 export CXXFLAGS=-m32 ./configure make make install 来源: https://stackoverflow.com/questions/6564114/geo-django-mac-os-x

Store a Circle in Geodjango + Postgres

空扰寡人 提交于 2019-12-04 15:03:35
Looking to store a circle in a geodjango field so I can use the geodjango query __contains to find out if a point is in the circle (similar to what can be done with a PolygonField). Currently have it stored as a Decimal radius and GeoDjango Point Field, but need a way to query a list of locations in the DB such that these varying circles (point field and radii) contain my search point (long/lat). Hope it makes sense. Mike T Technically speaking, PostGIS supports CurvePolygon and CircularString geometry types, which can be used to store curved geometries. For example, a 2-unit radius around x

Django : is GeoDjango a Good Fit for my Website?

谁都会走 提交于 2019-12-04 14:55:10
问题 I'm building a real estate site in Django and have a Home model, which stores various information including the address. Database backend is using MySQL. Want to create a Yelp like search. A search where users can enter in zip code or city name, then get Home results in that area. Users can also choose the radius(5 mi, 10 mi...) from the point and get more/less results. Search results will be on google map and users can zoom in/out to get new search results within the map. Is Geo Django a

How to return a record with the lowest distance from a point using geodjango?

不问归期 提交于 2019-12-04 12:09:59
问题 I am using geodjango and have a collection of points in my database. To get a queryset of points within a certain area I use this: queryset = Spot.objects.filter(point__distance_lte=(origin, distance_m)) My question is how can I return only one point(the point with the lowest distance )from the point I have passed it? EDIT I should mention that I am passing in coordinates and wanting to create a Point object with them. Then pass that point in as the origin and filter against that. For example

Does google app engine with mysql (Cloud SQL) support GIS?

谁说我不能喝 提交于 2019-12-04 11:21:13
I have tried to find some documentation on this on the app engine and cloud sql sites, but can't find anything referring to it either way. I know that you can perform GIS queries on their custom sql option, and I know mysql supports GIS out of the box, but I also know it requires some C libraries which there is limited support for. More particularly I am interested to know if geo-django using mysql supports gis using an app engine/cloud sql combination. (Or maybe if their custom offering supports geodjango?) GeoDjango with Cloud SQL is not supported. GeoDjango depends on several libraries that