Wednesday 20 December 2017

Using OpenLayers (with OpenStreetMaps) and PostGis for rendering data acquired from GPS tracking device?


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



Answer



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);

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...