Sunday, May 9, 2010

My start with geo web aplications

I spent my whole weekend on trying to create small site geo-enabled site. I wanted to have nice site for tourists, with routes for bike, and for walking. I wanted that users could draw theirs routes or upload theirs tracks from GPS. Additionaly i wanted to have users relations from trips. I designed few views mostly as list of routes. Frontpage view as huge google map with ability to draw on it or search for routes.

I wanted to create it with some cool google apis and languages. I mostly use php, then i thought that it will be interesting experience. First i looked at google map api. First sight, new google maps v3, quicker, lest weighting, profiled for mobile devices. Additionally added support for bicycle routes, traffic routes, and elevations, cool! i want this.

Now we need some frondend application and backend application and some hosting. How about using python and google app engine? nice, but i would like to try also google GWT. Google Web Toolkit has advantage because has library for google maps api. Fine, lets try. I installed google plugin in eclipse and tried to created something at hand. Trying simple projects, take a while. Not such fun as i expected, additional problems with browser plugin on linux and library for maps only supports v2. I will pass. Lets try something else.

If python then maybe Django, i heard lots of good opinions about this framework. Lets try and leave maps support for hand writing. I wanted to try running it on google app engine, some says that it works. First i tried to running it locally, ok, no problems. Lest read how to run it on app engine. This doesn't works, that doesn't works, this also. While reading i started thinking if it is worth of using it, when it doesnt give you all of its power? Better to use webapp framework, dedicated for app engine. But i wanted make it in rapid style with some ready tools.

Frustrated of my failures, i thought that i will use what i know best. PHP and Drupal. I installed drupal, added some useful modules, as views and cck, and others and started looking for good geo module with ability to stores lines and searching with in proximity. At start i had few modules to choose: location, geo, google maps tools. Additionaly i founded some useful modules for importing gps tracks(track, trackfield) and displaying gmaps (gmap). From additional i used trackfield because it allows to upload plenty of track types files. Track module i left because it was incompatible with my drupal. As for gmap i decided that i will write own maps code, with out all this options. From three base geo modules first is location: it provides adding location data to nodes, allows adding additional geo data as cities, provinces, countries, is quite well developed, has good integration with views, provides location API with basic geolocation. All super, but it doesnt support other type of geo data as only points. This one will not lead me anywhere. Second is Google maps tools also nice complex module, with lots of functionality but when i saw list of dependencies i thought it will make my site full of not necessarily needed stuff. Last one was geo module, simple module focused on storing geo spacial data. It adds you possibility to add cck fields as point, or geo spatial data. You can store geo data as string in that field. Additionals submodules allows you to create other cck fields base on data in geo spatial field. You can add map field, elevation chart field, and counted formulas field(max, min, distance, elevation, ...).

I choosed last one, taking from that its most primitive, but it allows to make make what i wanted and as only one support geospatials support in mysql and postgresql. I will create basic fields and add missing functionality on my own.

Summary is that there is a lot of good projects, but finding one that will match with you specification is especially hard. In my opinion we dont need complex use case modules but a set of simple universal functionalities with possibility for quick use and integration.