I have a time-series point cloud which I wish to animate on Openlayers. The caveat is that the data is not georeferenced (ie, my x & y runs from 0-10km & 0-5km respectively) and the user will need to define the starting point(lonlat of where x&y=0) as well as angle(heading) which pivots around the starting point.
Thus far my solution has been to
- Rasterise the point cloud frame-by-frame into a folder of png files (using matplotlib savefig)
- Rotate each png file by the angle provided
- Expanding/contracting the bounds based on the new dimensions. (step #2 and this is done using PIL's rotate)
- Mathematically calculate the new lonlat of where x&y=0 of the new image. (geopy)
- Create a rest api so that I can call each image frame as a imagesource in openlayers. (flask)
Here are my questions
- Is it possible to rotate an imagelayer in openlayers? (this will remove the need for me to rotate it server-side)
- Step #4 seems rather tedious as I need to calculate the shift in x&y, add the difference to a original lonlat to get a new starting point. Is there a library or function that is normally used for this?
- Otherwise is there a better way to achieve what I want? (Did I miss a simpler solution?)
Some other methods I have tried:
- Creating an animated gif instead. (Did not like this solution since it would introduce more complexity if the user needs to be able to pause or go to specific time)
- Rasterising into a folder of geotiff images instead of png. (Geotiff is significantly larger than PNGs and achieve literally the same functionality with the added step of having to setup a wms server or geoserver)