This is not strictly a three.js question but,
I have a 90 Mb TIF file containing elevation data which I want to import into 3js, although not all at once obviously !
Can I randomly access this data say inputting a x,y coordinate and getting the requisite data point from the file ?
The data is on the server so I may have to access it user a server side language like php and return the data using AJAX.
Any hints on how I could do this ?
If you mean
.tiff file - on the server side you can manipulate the image and return only the chunk that you need.
Not sure which libs can help you with that in PHP, but in node you can use jimp or sharp.
Unless I misunderstood your issue, it should be as simple as:
- Send request with x / y coordinates of a tile.
- Open the image on the server, cut out the part you need based on the coordinates in the request.
- Send back the tiles.
Thanks, that’s exactly what I want to do.
Looking at Node.js right now. You hints are very useful.
You could also chop the image into tiles in advance, with a known order. See https://legacy.imagemagick.org/discourse-server/viewtopic.php?t=33108. Then you just need a static file server to host them.