Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm researching and planing to acquire data from GPS device and store them in postGIS database, then use geodjango to process/work them out and finally chart them on a map with OpenLayers.

Will these technologies be enough for my plan, since I don't want my maps, I want to use OpenStreetMap and plot my points on an OpenLayers' vector layer.

I also want to implement real time tracking on a map, I'll query the PostGIS database in realtime using AJAX and then recreate objects on a map. I just can't find any good examples to do this with OpenLayers. Can I use Jquery for this and combine it with OpenLayers since I'm good at using Jquery's AJAX methods.

P.S. Please bear in mind that I'm still researcing these technologies, but OpenLayers/geodjango/postGIS seems like a great combo for my needs. I found literature for almost everything that I'm interested in these 3, only that I lack the examples of real time charting and refreshing objects on OpenLayers' vector layer.

TIA

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Check out the rotate features OpenLayers example.

Moving a features works in the same way but using move, e.g.:

var vectorLayer = new OpenLayers.Layer.Vector("Simple Geometry");
// create a point feature
var point = new OpenLayers.Geometry.Point(-110, 45);
pointFeature = new OpenLayers.Feature.Vector(point, null, style_blue);

map.addLayer(vectorLayer);
map.setCenter(new OpenLayers.LonLat(point.x, point.y), 5);
vectorLayer.addFeatures([pointFeature]);

// move the point one unit up and redraw            
window.setInterval(function() {
    pointFeature.geometry.move(0, map.getResolution() * 1);
    pointFeature.layer.drawFeature(pointFeature);
}, 100);
share|improve this answer
    
Thanks for your answer. It's helpful, and in the meantime I found examples of combining Jquery with OpenLayers so I'll now try to work through some examples. –  D00de Feb 15 '12 at 14:58

Temporal Filter Strategy

Example

Another way to go is using a temporal filter strategy (filter by time). But first you'll need your data exposed in OGC web service form.

Since you're still researching these technologies you might come to realization that it will be beneficial to use something like GeoServer or MapServer in between your PostGIS and OpenLayers. This is so your PostGIS data can be exposed as web services in OGC Standards such as WFS, WMS, etc. OpenLayers can take advantage of this is many ways and you'll be thanking me later.

Once you have your data exposed via a Map Server like GeoServer you'll be able to use the temporal filter strategy.

share|improve this answer
    
This is really helpful comment. Since I'm still in research and reading phase I still can't see the benefits of using mapserver between OpenLayers and PostGIS. I'm taking the easier way of charting data straight from PostGIS to OpenLayers. I'm now trying to place mapserver between them so that I can learn benefits from it that may come in handy later. And you are right, I'll probably have to thank you later when I learn mapserver features. –  D00de Feb 15 '12 at 14:57
    
No problem. One other thing: i believe Geoserver is easier to install and setup than mapserver if you just want to try it out. –  CaptDragon Feb 15 '12 at 15:02
    
Yesterday I read about Geoserver, mapserver, featureServer and tilecaching. I was trying to find obvious advantages of using mapserver between my frontend and backend, but I couldn't find them. My application will work like a common GPS tracker, so its basic features will be drawing objects, drawing paths, moving objects and other simple mapping tasks. I was planning to use OSM as a base layer in my OpenLayers interface, and there I have a vector layer above where I can chart the various objects. I still can't predict what would be the benefit of map server in my tracking app. –  D00de Feb 16 '12 at 8:01
    
Well there's no reason to add another layer of complexity if you don't need it. Especially if you're using PostGIS. It's so good at returning GML, KML, WKT and sorts of formats. –  CaptDragon Feb 16 '12 at 14:17
    
Thanks for your advices. –  D00de Feb 16 '12 at 14:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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