0

I need some guidance on a problem that I'm recently struggling with.

I have a data structure that looks something like this:

latitude longitude color
-25.45896328 -54.50323974 #88CE86
-25.45896328 -54.53023758 #50B56E
-25.4562635 -54.50323974 #88CE86

plus other 10000+ lines

Each line corresponds to an area of n meters in size, defining the resolution of the map. In the example bellow, each "pixel" is 300 meters.

This data should generate an image that looks like this:

wave heights of Itaipu Lake

I tried to plot this data on a map with OpenLayers. I managed to transform the data into a geojson format, where each line is a Point on a FeatureCollection, but I couldn't change the generated circles size, shape or color. Besides that, my browser couldn't handle drawing that much information, and everything got very slow :).

I read somewhere that this should be possible with a tool like GDAL (which I'm not familiar at all), but I have no idea of how this could be done.

The backend of this application will be in PHP, so I think that i could dump this data in a specific format, execute a command line tool (or something like that), and the resulting data (probably a geotiff, I wasn't abble to create such file) would be shown to the user using OpenLayers, Leaflet or other type of map visualization library, like geotiff.js (which I read that can display georeferenced images).

6
  • You could come up with a formula that converts lat/long into x/y and simply draw pixels to a canvas / PHP image. Commented Mar 4, 2022 at 12:25
  • But how could I use this image as a layer on top of a map? This image would need to be georeferenced, so the user could interact with the map? Commented Mar 4, 2022 at 16:57
  • OL seems to support images: openlayers.org/en/latest/examples/static-image.html Commented Mar 5, 2022 at 10:26
  • OpenLayers / your Browser can't handle that many features in an VectorLayer. You could try VectorImageLayer or you could use the webgl Point Layer. However, if you don't need to interact with every point or coordinate you have, you can generate a geotiff with the help of gdal. Gdal is an CLI Tool, if you want to use its features, you would do that on the server side. Openlayers can handle geotiff's. Commented Mar 7, 2022 at 13:55
  • Based on my research, I think a geotiff would be the ideal solution, but I could not figure out how to transform my data into a geotiff image with the GDAL documentation Commented Mar 7, 2022 at 16:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.