-1

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

  1. Rasterise the point cloud frame-by-frame into a folder of png files (using matplotlib savefig)
  2. Rotate each png file by the angle provided
  3. Expanding/contracting the bounds based on the new dimensions. (step #2 and this is done using PIL's rotate)
  4. Mathematically calculate the new lonlat of where x&y=0 of the new image. (geopy)
  5. Create a rest api so that I can call each image frame as a imagesource in openlayers. (flask)

Here are my questions

  1. Is it possible to rotate an imagelayer in openlayers? (this will remove the need for me to rotate it server-side)
  2. 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?
  3. Otherwise is there a better way to achieve what I want? (Did I miss a simpler solution?)

Some other methods I have tried:

  1. 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)
  2. 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)
alkaliexce
  • 25
  • 3
  • 1
    One option is to define a rotated projection in OpenLayers as in https://codepen.io/mike-000/pen/qBapaBa and https://codesandbox.io/s/reprojection-image-z0uit – Mike Dec 28 '20 at 09:34
  • @Mike Thanks for the suggestion! That approach seems exactly what I am looking for, I never thought of creating a custom projection for it. – alkaliexce Dec 29 '20 at 06:28

1 Answers1

1

You can try to use a GeoImage layer to place an image on a map with a rotation.
See https://viglino.github.io/ol-ext/examples/layer/map.geoimage.html

Viglino Jean-Marc
  • 1,371
  • 8
  • 6