i have a traffic data (vehicles gps location(Point)) for every minute in a specific location

sample data : Vehicle_No , Long, Lat

and i need to show the real time traffic for that specific location in openlayers which has to be updated every minute.

one solution is to import traffic data into PostGis and create a new cloumn which use ST_Buffer function to find out how many no. of vehicles are near by each other and can export the table to the openlayers and give them colour (red,orange,blue) according to no. of vehicles (the buffer column produced). - the problem with this approach is that we have to manually do the buffer operations and update the openlayers every minute.

Can someone suggest me some better approach to do this?


Yes, of course you can do this, here are the simple steps:

  • Make a SQL View in Geoserver for St_Buffer PostGIS function or St_Within function.

  • Then, using openlayers call a WFS or WMS request to SQL View in Geoserver, and now you will have either GeoJSON or Raster(png, jpeg etc) output depends on request type.

  • Now, you just need to make a layer and load the response data.

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.