[postgis-users] Raster Pixel Metadata

Jiří Fejfar jurafejfar at gmail.com
Wed Jun 17 23:56:58 PDT 2020

Dear PostGIS users,

we are thinking about the optimal way how to store rasters pixel metadata.
Lets say, we have 2BUI pixel type [1
<https://postgis.net/docs/RT_ST_BandPixelType.html>] and want to use the
following codes:

code 0 as NoData,
1 as forest,
2 as non-forest,
the rest of possible values (value 3) should not be used.

We would like to store somewhere this "mapping" / lookup table [2
between pixel value and its meaning (interpretation). We do not like to put
this information into table comments. We are thinking about a separate
table to store this mapping. Also we would like to create constraints (like
foreign keys) based on used codes (to disable using value 3) maybe with
help of functions like ST_ValueCount [3
<https://postgis.net/docs/RT_ST_ValueCount.html>], ST_SummaryStats [4
<https://postgis.net/docs/RT_ST_SummaryStats.html>]?. Question is, whether
each row (tile) could have different mapping or it should be constant to
all rows / tiles (analogy to other raster properties such as resolution,
number of bands etc. [5

Thank you for any ideas, is there any "best practice"?

Regards, Jiří Fejfar.

[1] https://postgis.net/docs/RT_ST_BandPixelType.html
[3] https://postgis.net/docs/RT_ST_ValueCount.html
[4] https://postgis.net/docs/RT_ST_SummaryStats.html
[5] https://postgis.net/docs/RT_AddRasterConstraints.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20200618/85273e7e/attachment.html>

More information about the postgis-users mailing list