6

I need some advice with GIS file format choice. Here is my problem: I have about 100 stations. At each station water temperature is measured daily for 1 year I want to load this data to QGIS and be able to quickly display a water temperature map for a user-selected day. I came up with following file structure: A shapefile with lat, lon, time, value columns. For each combination of lat, lon, time there is a new point shape. So for each station I have 365 "overlapping shapes". Then I can use the "query" in QGIS to filter out shapes that have the time attribute equal to the selected day. This is OK for 365 days but becomes little inefficient for several years (shapefile becomes huge and QGIS displays it very slowly)

Is there any other GIS format (like Spatialite or Postgis) that I could use to store the time-space data more efficiently and still be able to visualize it in QGIS without extra programming?

3
  • 1
    postgres can control your dates see postgresql.org/docs/8.0/static/functions-datetime.html
    – Mapperz
    Commented Mar 21, 2013 at 15:04
  • 1
    Besides the obvious way of putting it into Postgres, please consider formats like netCDF that are specifically designed to handle large arrays of an arbitrary number of dimensions. Sure, this will pay off only if the format is going to be used by others. Commented Mar 21, 2013 at 19:46
  • Thanks for the netCDF suggestion. I thought that netCDF is for multi-dimensional grid (raster) only. If I have time I will research more on netCDF support in QGIS. Commented Mar 22, 2013 at 8:04

3 Answers 3

11

Uhm, you can work in PostGIS to give a better structure to the database.

  1. Create a table S (stations) with the following fields:

    • StationID
    • Location (a point that specifies the coordinates)
  2. Create another M (measurements) table with the fields:

    • StationID
    • MeasurementDT (date and time of the measurement)
    • Value (measured value)

Now, you can show all the values in a GIS executing the query:

SELECT S.*, M.MeasurementDT, M.Value
FROM M
LEFT JOIN S
ON M.StationID=S.StationID
WHERE... (query conditions, by time or other parameters)
1
  • Thanks, this works. I did not realize that I could do a JOIN query in "load PostGIS layer" in QGIS. Commented Mar 22, 2013 at 7:59
3

Yes, database as PostGIS or SpatialLite would be better choice.

If the points are stationary it is better to create one table with list of measure points, and second table where you enter timecoded measurements and have a foreign key pointing to the measurement point.

3

You should notice a major speed-up by loading your Shapefile into PostGIS and creating an index on the timestamp.

You can split the data into two tables as suggested by the other answers but then you'll need a view to visualize the data in QGIS via Load PostGIS Layer. (Or use one of the plugins that enable you to load the results of a query as a new layer.)

1
  • Thank you, the solution seems to work. I just created the view and tried Load PostGIS layer in QGIS. And in the list of tables it also shows the view. Commented Mar 22, 2013 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.