I am working with some NetCDF data which has multidimensional variables.
- As far as I'm aware, the fields are not mandatory.
- Each variable will have the same fields/attributes.
- Each variable represents a measurement of the atmosphere, in time & space.
Level
represents a pressure level (like a layer of an onion — a thick layer).
For example, a variable
called SO2 (Sulphur Dioxide) may be 4-D: Time
, Level (pressure)
, latitude
, longitude
.
I have about 14 variables that I need to store.
Data retrieval tendencies
Now, I'm going to need to query this data and ask questions like:
- Give me all the rows for
variable
SO2 that fall betweenlatitude
X andlongitude
Y attime
T andlevel
L. - What is the
average temperature
fortime
T atlevel
L? - etc…
Current considerations
I could let each row in my DB be an observation
and have the columns: type
, lat
, long
, time
, level
, value
.
Or, perhaps create a table for each kind of variable
and have the columns: lat
, long
, time
, level
, value
.
I'm not sure which will be more appropriate, or whether there is a better option, so I'd appreciate some advice.
Best Answer
So you have some basic data.
What you want to do is create a point with lat, and long...
Now, we just store that into a table..
This is not how GIS works, because between changes on a sphere. So instead, just use distance. So instead what we do
For this we would have had to store the temperature, assuming we did -- which we didn't. It'd look like this.
As a side note ST_DWithin will use an index.. (as will level and timestamp if you create the indexes). However, if you're new to GIS you create GIS indexes with GIST and not btree.
For a similar question see this answer.
UPDATE
This file is a complex proprietary raster,
You can import it by generating PAM files.
Them remove the
.aux.xml
files withrm *.aux.xml;
And, run this to import them all into the databaseThis gets some kind of raster into the database. Now you have to start learning the PostGIS GDAL raster functions to see what and how you can work with it.. Using ST_MetaData we can see you have a 12 rasters with 90 bands (with
ST_BandMetaData
we can see they're 16bit unsigned).