I am a newbie in GIS and want to implement something like a vehicle tracker wherein I will get a series of coordinates in a database.

I have no idea how to go about it, I mean what should my process consist of? I have found something about GeoJSON, but since I'm using GWT should I be really using it? I guess I can directly interact with the Java data structure.

Apart from that, how to initiate the loop for animation? I have seen rotate and move methods in openlayers, but would they suffice in case of a complex motion like vehicular movement.

  • 2
    Can you try to explain what data sources you have available, and exactly what your requirements are? – BradHards Jan 7 '13 at 8:59
  • 2
    I've seen a question like what you're asking if you intend to animate movements with openlayers,check gis.stackexchange.com/questions/26546/… – Myra Jan 7 '13 at 9:01
  • the databases are suppose to contain the coordinates of the vehicles at a particular instance... I guess that should be sufficient.. a tuple (time, lonlat) – Vineet Menon Jan 7 '13 at 9:02
  • Sorry, I meant "what do you have to show". Storing the data is trivial ("INSERT INTO..."). The hard part is presenting it in a way that solves the business requirement, and integrating the real time feeds in a secure way. – BradHards Jan 7 '13 at 9:03
  • okay, what I want is something like this, simcity.vasile.ch/sbb.. I want to show the location of vehicles (with or without trace) in the map. with trace seems a bit easy since, you don't have to redraw the vector layer each time(?).. – Vineet Menon Jan 7 '13 at 9:20

Many GeoDatabases such as PostGIS allow you to serve out your data as GeoJSON, GML, KML and so forth. The lightest is probably GeoJSON.

If you have a geodatabase that allows you to do this, then add a vector layer which pulls this data. By using a refresh strategy on that layer, you can pull the data on an interval like your example does.

This way you don't need to worry about looping. You simply create a backend handler (in PHP, C#, or whatever) which returns the latests GeoJSON from the database. Point the layer to that handler as a source and give it the refresh strategy with an interval.

You could also use something like GeoServer or MapServer as an application layer between your database and your map that serves out your data in an OGC standardized format that your map can consume. This can act as your handler as well. But it could slow things down a bit. If you can call the database to return GeoJSON, that will be fastest.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.