GeoDjango and shapefiles

400 views
Skip to first unread message

Coulson Thabo Kgathi

unread,
Sep 27, 2012, 3:23:43 AM9/27/12
to geod...@googlegroups.com
Hello guys i realy need to create an app that presents data on maps, by placing markers on maps to show locations of places. i want to use geodjango WITHOUT THE INTERNET, but i am struggling to do this, I have just read a document about Spatializing you data with PosyGIS, GeoDjango, and OpenLayers, it seems to have just a bit of what i may want, gone through the GeoDjango tutorial, have been searching online for days and i cant reali find much infor on how to do this application.

Most people tell me about server for maps, but the is not much infor on then relation to GeoDjango

Please, please if you know any source that can be helpful help.

Ariel Nunez

unread,
Oct 4, 2012, 1:41:40 PM10/4/12
to geod...@googlegroups.com
Hey Coulson,

I hope you have been able to solve your problem by now. If not, I would like to recommend you a few things:

#1. To get a map on your page, follow the following instructions:


#2. To get your shapefile into GeoDjango, follow the tutorial here:


#3. Once you have a map, and a spatial table linked to a GeoDjango model, use django templates to create a file like the following, call it:
url( '^data.json', ...)


#4. Install the javascript and css from here https://github.com/danzel/Leaflet.markercluster  and use their examples to load your data.json in the map.

#5 In order to run offline, you may need a base layer. You could use open street map tiles for this, tilemill is a good option for your to generate a base map using open street map data and then dump it into an mbtiles and after that a simple folder in z / x / y format that use can use to serve your data from nginx or apache:




Ariel.


--
You received this message because you are subscribed to the Google Groups "geodjango" group.
To view this discussion on the web visit https://groups.google.com/d/msg/geodjango/-/ez4Bo3-FheEJ.
To post to this group, send email to geod...@googlegroups.com.
To unsubscribe from this group, send email to geodjango+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/geodjango?hl=en.

jabrane

unread,
Oct 8, 2012, 10:46:02 AM10/8/12
to geod...@googlegroups.com
First of all you have to establish a geographic server so you ought to install one of many solution that exist like Mapserver geoserver or arcgis Server if you have money :) and so on

with these servers you can perform OWS requests like WMS/WFS  requests

then with minimal configurations on Openlayers in Geodjango you can have pretty views of maps with you

i hope that is clear for you
feel free to ask in other questions ur welcome ;)

jabrane%

Coulson Thabo Kgathi

unread,
Oct 10, 2012, 10:45:57 AM10/10/12
to geod...@googlegroups.com, ingenie...@gmail.com
Where do i add the following setting, in which file is it the settings file

Spatial extent -------------- You can configure a global spatial extent for your maps, that will automatically center your maps, restrict panning and add reset view and scale controls. (*See advanced usage to tweak that.*) 'SPATIAL_EXTENT' : (5.0, 44.0, 7.5, 46) Default tiles layer ------------------- To globally add a tiles layer to your maps : 'TILES_URL' : 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png' This setting can also be a list of tuples (name, url) ! A layer switcher will then be added automatically. Leaflet version --------------- By default, it runs the last stable version (*0.4.4*) of Leaflet. But it is possible to run the ``legacy`` version (*0.3.1*) or the ``unstable`` under development (*master*). 'LEAFLET_VERSION' : 'legacy' Scale control ------------- Disable scale control with km and miles : 'SCALE' : False

Ariel Nunez

unread,
Oct 11, 2012, 12:29:27 PM10/11/12
to Coulson Thabo Kgathi, geod...@googlegroups.com
Those are not strictly needed.

But if you do add them, they should go in LEAFLET_CONFIG [1].

By the way, I put a wrong link in my original mail, I should have pointed you to LayerMapping in the second item (how to load your shp to postgis). [2]

Reply all
Reply to author
Forward
0 new messages