I have a database of point data in PostGIS that I'd like to work with as voxel data. For each voxel, the value would be the number of particles within its volume. Let's say for the sake of argument each cell is n degrees lat by n degrees long, m feet high, spanning the globe.

I'm wondering how to set up this database: the first thing that comes to mind is to use a raster where each grid cell is the base for the voxel at that area, then to store the voxel data for each altitude range in bands of the raster.

Another option I'd considered is to make a table of polygons representing all the voxels, then have another table of values and voxel ids.

Is there a standard method for working with 3-dimensional raster data in PostGIS?

  • 1
    Do you want to stick with PostGIS. Otherwise there would be systems which can solve your problem e.g. Rasdaman or GST provided by GiGa infosystems which I work for. – mistapink Nov 6 '18 at 8:30
  • Adding to what @mistapink has said, it depends on what kind of other analysis you wish to perform on the data. If you want 3D functionality, vector/raster overlays, etc, then saving your data as a tiled raster coverage, with the voxel value/s being the additional bands. There is also a pgpointcloud extension, but this might be overkill if your data are regularly structured, which from your question appears to be the case. – John Powell Nov 6 '18 at 9:29
  • Thank you both for the very useful references. From an infrastructure point of view, sticking with postgis is desirable, so perhaps rasdaman is a nice middle ground. It's also good to know that the postgis raster idea passes the smell test – empireryan Nov 6 '18 at 19:13
  • If you are going to be doing much analytical work on rasters, make sure you tile your coverages. It can lead to orders of magnitude improvements in speed. – John Powell Nov 7 '18 at 9:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.