Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wondering About GeoDjango and Mapping Services

I'm trying to build my first GIS app with GeoDjango and I have a few questions before I begin:

First: What exactly is GeoDjango for in relation to Google Maps? Is it simply for processing the information, which is then passed to a service like Google Maps?

If this is true, what's the advantage of using GeoDjango vs simply storing lat/long points in a db and passing them to Google Maps?

Assuming all of the above is true, if I suddenly want to change map providers (from Google to Bing, lets say), does GeoDjango make this much easier and more modular?

I'm having a little trouble understanding the relationship between GeoDjango and mapping services, if someone could clarify this for me with some examples, that'd be awesome.

Next: If I have an existing project in GeoDjango that I want to integrate that uses MySQL, should I move everything over to PostgreSQL because GeoDjango doesn't work well with MySQL? What should I do in terms of databases?

like image 358
aroooo Avatar asked Nov 26 '11 06:11

aroooo


1 Answers

As said in documentation:

GeoDjango is an add-on for Django that turns it into a world-class geographic Web framework. GeoDjango strives to make it as simple as possible to create geographic Web applications, like location-based services. Some features include:

  • Django model fields for OGC geometries.
  • Extensions to Django’s ORM for the querying and manipulation of spatial data.
  • Loosely-coupled, high-level Python interfaces for GIS geometry operations and data formats.
  • Editing of geometry fields inside the admin.

You can easily process GeoDjango information to Google Maps via Google Maps Javascript API. Advantages of GeoDjango are special tools for dealing with geometry types of informations. For example such kinds of fields:

  • GeometryField
  • PointField
  • LineStringField
  • PolygonField
  • MultiPointField
  • MultiLineStringField
  • MultiPolygonField
  • GeometryCollectionField

And base-level integration with spacial databases and geospacial libraries:

  • GEOS
  • PROJ.4
  • GDAL
  • GeoIP
  • PostGIS
  • SpatiaLite

If you want to keep ability to change map provider in future it's recommended to use frontend(map) - backend(GeoDjango) architecture. In this case you can change frontend or switch between different maps easily.

I recommend also migrate to postgres because it has a various tools, such GEOS, PROJ.4, PostGIS libraries that may be useful for dealing with spacial data. MySQL has limited functionality as said in documentation.

like image 106
ramusus Avatar answered Oct 17 '22 12:10

ramusus