[postgis-devel] Postgis Raster JPEG 2000 (openjpeg)
dustymugs at gmail.com
Tue Apr 8 08:21:31 PDT 2014
Have you given some thought in how this could be implemented in PostgreSQL?
You stated previously that you'd ideally need nested tables, which is
supported in the manner you require.
You still haven't answered my prior question regarding...
"No, each of the packets would be stored in a row in the packet table, and
the raster tile object would have the FK of each of the packets related to
that tile and maintain a ordered lists of the packet tables FK's of each
So, how would a raster query look? Would you have pass in metadata into the
query itself informing the postgis methods where the raster tile's packets
Personally, I can't see how JPEG2000 fits into the PostgreSQL paradigms for
storage and data-access...
My biggest pain points when it comes to PostGIS raster are:
1. TOAST compression/decompression: Beyond just the overhead, this prevents
any performance gains possible from PG_DETOAST_DATUM_SLICE() as slicing
still requires the entire TOAST object to be decompressed.
2. Operational Performance: We need to run an op in parallel on a single
raster tile. PostgreSQL 9.4 introduces dynamic background workers that may
provide the answer to this.
3. Overviews: Easily create, manage, update overviews in the database. I
think a good chuck of this could be done with SQL functions and triggers
4. Metadata: I can't decide if it's better for this to be in the raster
itself or another column in the table. Having the metadata in the raster
seems nice as it travels with the raster. Having the metadata as a column
on the same row is nice as we can index and use standard SQL to query it.
Another request that I occasionally get is the ability to have aliases for
5. Out-db: More out-db capabilities to consume what information is
available in the out-db raster file (metadata, overviews, etc).
As for addressing the pain points...
1. Disable compression in TOAST. Instead the raster format would
selectively compress data (primarily band data) while leaving raster and
band headers alone. Compression/decompression should be loss-less and fast
without an emphasis on compressed size. I'm leaning towards LZ4.
2. Explore dynamic background workers. Before anyone asks, threads are a no
go as per many core PostgreSQL developers.
3. Creating a new overview in the database isn't easy (mostly due to
probable memory issues). Keeping existing overviews in sync with base
rasters can be done with triggers deployed with some maintenance functions.
4. I could see some metadata (band aliases) being in the raster itself but
not others (color-maps, band descriptors).
5. This is a hodge-podge of different efforts such as reading out-db
metadata, registering out-db overview, etc.
On Mon, Apr 7, 2014 at 12:54 PM, Nathaniel Clay <clay.nathaniel at gmail.com>wrote:
> There are two JPEG 2000 specifications that apply that are applicable to
> our needs and fulfill some of the requirements that I came up with.
> 1. JPIP or JPEG 2000 Photo Interactive Protocol (
> This would give us a well thought out index format that would allow us to
> treat our raster blob as a embedded table. With the ability to insert,
> update and union the rasters without decompressing the tiles in their
> entirety and in most cases decompression would not be necessary at all. (
> https://www.dropbox.com/s/59sdg4yo5rpw0a8/10.1.1.136.7762.pdf )
> 2. OSGEO JPEG 2000 GML (
> GML would allow us to annotate raster with vectors and provide spatial and
> temporal reference of the embedded code streams ( tiles).
> PS. Have you collected your thoughts yet on the current short comings?
> Nathaniel Hunter Clay
> On Mon, Mar 24, 2014 at 3:08 PM, Nathaniel Clay <clay.nathaniel at gmail.com>wrote:
>> What I really want is Nested Tables, as far as I can tell Postrgresql
>> doesn't fully support it.....
>> Nathaniel Hunter Clay
>> On Mon, Mar 24, 2014 at 1:37 PM, Bborie Park <dustymugs at gmail.com> wrote:
>>> So not self-contained? For one coverage table containing raster tiles,
>>> you'd have a second hidden table of the packets? How would a function know
>>> where the packet table is?
>>> On Mon, Mar 24, 2014 at 9:41 AM, Nathaniel Clay <
>>> clay.nathaniel at gmail.com> wrote:
>>>> No, each of the packets would be stored in a row in the packet table,
>>>> and the raster tile object would have the FK of each of the packets related
>>>> to that tile and maintain a ordered lists of the packet tables FK's of each
>>>> progression order.
>>>> Nathaniel Hunter Clay
>>>> postgis-devel mailing list
>>>> postgis-devel at lists.osgeo.org
>>> postgis-devel mailing list
>>> postgis-devel at lists.osgeo.org
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the postgis-devel