1

I am building a map application in which I have a Postgis database with point features. I import the database into Geoserver as a layer and I show the WFS layer using Openlayers. My point features have a timestamp and I was wondering if it is possible to build something like a time lapse function, which will accept a range of time (date) and then start importing the features one by one on the map. I searched but I didn't find a similar example online. Have you done/see something like this?

John Powell
  • 12,253
  • 6
  • 59
  • 67
user1919
  • 3,818
  • 17
  • 62
  • 97
  • Could you explain a little more what you are trying to do. An animation, a slider, or just a gradual loading of features. – John Powell Dec 22 '14 at 12:20
  • Hi. Thnaks for your comment. Ideally I want to have a gradual loading of features. By selecting two dates (start/end) and clicking a button then to be able to add gradually features (based on the date). I hope its quite clear what I am trying to explain. – user1919 Dec 22 '14 at 14:49

1 Answers1

2

I wouldn't bother with Geoserver, but would try something like this: + create a service that returns the points as geojson from Postgresql. + Get that Geojson via Ajax + In Openlayers create a vector layer + In JavaScript write a function that adds the points to the vector layers with some sort of timer

Sorry I can't provide code samples - I'm posting from my mobile - but each element I've listed above is pretty straightforward.

mlinth
  • 2,968
  • 6
  • 30
  • 30
  • Hi. I see. Can you please describe the first part of your workflow: "create a service". I guess you don't mean to create an algorithm in PHP or Python to get the data from the db, right? What you describe is very straightforward but as I already use Geoserver I was thinking if I can integrate this functionality. – user1919 Dec 23 '14 at 21:59
  • Yes, i mean write a bit of PHP (or asp.net). It's easy - you can pass the start and end dates in the server call, psql can output json so you can just return your query result. Geoserver is great, but I suspect it won't give you the fine control you need i.e. the wcf layer will appear all at once. – mlinth Dec 24 '14 at 10:37