Difference between revisions of "Example SQL for Stations"
Line 19: | Line 19: | ||
[[Image:SQL_views.png]] | [[Image:SQL_views.png]] | ||
− | The complex database | + | The complex database on the left is the real data storage, which is not an easy thing to read. On the right, is the requirement for the WCS: a flat, simple table listing place, time and data value. |
+ | |||
+ | |||
+ | |||
+ | |||
===Location table=== | ===Location table=== |
Revision as of 07:59, July 8, 2011
Back to WCS Access to netCDF Files
A Real life example how to serve station timeseries point data through WCS data access protocol.
AIRNOW
Daily PM 2.5, PM 10 and Ozone data can be downloaded from date encoded folders:
http://www.epa.gov/airnow/2011/20110705/
The Design of the SQL Database
The most flexible method of storing station time series point data is an SQL database. Typically, the collector of the data designs a schema, that captures all the measured data, metadata of the measurements, station instrument information etc. This typically requires a database with lots of tables and relationships between them. There is no one-size-fits-all design around, because requirements for data collecting systems are different.
Fortunately, relational databases were invented just to solve this standardization problem:
The complex database on the left is the real data storage, which is not an easy thing to read. On the right, is the requirement for the WCS: a flat, simple table listing place, time and data value.
Location table
Parameter tables
Fact - Data Table
Data Views in SQL
the importance of views, flexibility of SQL, snapshot views
creating data views
calculating statistics to filter the location table
Configuring the WCS Service and WFS Service for point data
WFS for locations
WCS for data
using python dictionaries ??