Monday, 24 October 2016

postgis - Web mapping software for a huge raster time series?


I'm an ArcGIS Desktop user who is stepping into the world of web mapping for the first time. Following advice I found here on GIS.SE, I started with the free tutorials from OpenGeo.


However, I began to realize that most of the demos and examples were geared towards vector data. My main project involves the display of a 300 frame time series of 5000 x 5000 pixel rasters. On my desktop computer these are stored in a single 5000x5000x300 16-bit integer BIP binary, which totals around 8GB. My goal is to be able to click on a cell (of a single raster in the time series) and have a graph pop up showing the values of that pixel in the 300-element time series. The raster data used for each time series graph must be stored losslessly, though the overlay maps that are clicked on can be lossy caches.


Is there anything that may be better suited for this project (for a novice web GIS developer) than OpenGeo? Or should I just keep going with this setup?


For reference, I have programming experience in Python, Java, and PHP. I don't have much experience with SQL. This is an open-ended project so I have plenty of time to learn new languages if need be. I already have a web server, though I'll probably have to switch hosts because GoDaddy doesn't seem to support PostgreSQL without getting a VPS.


Thanks for your help!


EDIT: (Jan 13) I'm still seeking information on exactly how best to store a 3 dimensional 16-bit integer BIP raster and be able to efficiently query a single z-axis "column" of data. I don't want to convert it to a 32-bit format (because that would double its file size from its current 16-bit form).



Answer





EDIT: (Jan 13) I'm still seeking information on exactly how best to store a 3 dimensional 16-bit integer BIP raster and be able to efficiently query a single z-axis "column" of data. I don't want to convert it to a 32-bit format (because that would double its file size from its current 16-bit form).



Querying such a raster should not really pose large problems. You can read binary data directly using all program languages, and access is fast. Just make sure that you store your data in a file format which has all metadata in a seperate file. BIP is such a format


eg in php, assuming that the file is row major order (otherwise switch x and y), with $x and $y the position in your grid(counting from 0), $nx, $ny and $nz the number of pixels in each dimension and $nb the number of bytes per gridcell:


$fp = fopen('yourfile.bil', 'r');

fseek ($fp, $nz*$nb*($y*$nx +$x))//this is a very fast operation
// read some data
$data = fread($fp, $nz*nb);//this is also very fast


Just make sure that you access the right pixel: does counting start from top left or not, ...


Some extra info: After reading the data, you should convert it to floats. E.g.:


$dataf=unpack("f*", $data);
print_r($dataf);

In case your host does not support uploading large files, you could eg split up your bip file in eg 8 bip files.


Some more info on how I would do the rest of the website: since your data is static, you could generate a small mapviewer using gdal2tiles and openlayers. http://www.gdal.org/gdal2tiles.html In fact, since you say that "I don't really need scalability--this project is mostly to enable a few peer researchers to have easier access to my data than sending an 8GB file and loading it in ENVI."you could maybe even do without using a webgis toolbox: just let your users click on the image and catch the coordinates: http://www.emanueleferonato.com/2006/09/02/click-image-and-get-coordinates-with-javascript/


(though you should find a way to present your 5000x5000 image nicely)


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...