TransWikia.com

What is the proper convention for storing rasters in PostgreSQL database?

Geographic Information Systems Asked by JWB on October 13, 2020

Just starting to implement PostgreSQL at work and want to make sure I’m building something that will be efficient down the road. Let’s say I have a raster of surface temperature for every hour of every day for the past 10 years. What is the best way to store this? Could I do multiple hourly rasters per table? For instance could I store a year’s worth of hourly rasters in each table (10 total tables) or should I just store each hourly raster as its own table (87,600 total tables)? Does anyone have any resources on the theoretical aspects of creating a database?

In the future I will be referencing the rasters for mapping, querying, and analysis using python.

2 Answers

All rasters tiled together in the same table with a timestamp column and just do the right query to get what you want.

Answered by Pierre Racine on October 13, 2020

Too long for a comment, but: I'm starting to get the sense that postgis rasters should be treated like any other geometry or other data types in your postgresql database.

In the case above, if the data type was polygon geometry, you would query a single table based on the date in the DATE column, rather than picking a single polygon record out of its own table.

By that method, I would think dumping all your TEMPERATURE (for example) rasters into one TEMPERATURE table and attributing them using a DATE column (and/or any other columns you would want to associate with your data) would be the way to go.

I say all this without having used much raster data in postgis (read:none) but reading people's posts and looking at how postgresql tools operate on the data in addition to the postgis tools, I would consider that a way to go.

Answered by DPSSpatial on October 13, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP