|
On 09/12/2013 07:11 PM, venerio
giuseppe anardu wrote:
Hello to everybody,
I'm a beginner in the study of db and right now I'm co-working
with a team involved in wetlands. I would like to manage a qgis
project of a swamp, joining to a shapefile of the sampling
points a csv file containing the different species of algae
found in each sample point and I would like to do in a simple
way considering the few points and samples I have to manage.
The structure of the attributes table of the point shapefile is
made of 2 fields: "ID" and "Sample points"
ID | Sample points
____|____________________
0 | 1
1 | 2
2 | 3
The structure of the csv file is made also of 2 fields:
"Stations" and "Species".
Stations | Species
________|____________________
1 | Barbula unguiculata
1 | Bryum sp.
1 | Funaria hygrometrica
3 | Barbula unguiculata
3 | Barbula unguiculata
The field to join is "Sample points" and "Stations".
From properties I made a Join, but the result I obtain is (the
samples of point 2 are missing dued to draught):
Sample point | Species
____________|___________________
1 | Barbula
unguiculata
2 | NULL
3 | Barbula unguiculata
I can recommend using Spatialite for these kinds of DB joins.
You can import the stations as a spatial table (with a geometry
column). In spatialite_gui there's a button for importing a
shapefile. THen you can import each of the algae CSV files with the
"found" data as non-spatial data tables. Finally you would create
database "views" for each species with two SQL commands, something
like:
CREATE VIEW Barbula_found AS
SELECT stations.station_id, stations.geometry, stations.ROWID AS
ROWID, samples.species
FROM stations JOIN samples ON
stations.station_id=samples.sample_point
WHERE samples.species="Barbula
unguiculata";
And for seeing the spatial view in QGIS you must add a row
to the spatialite metadata table "views_geometry_columns". The row
must contain the view name "Barbula_found", the geometry columns
"geometry", the ROWID column name "ROWID", and the real feature
"stations".
Once you get the hang of it, you can create many such views, as you
need them, aggregating over time periods, summing totals for
sampling points, and all the other fun and games with a database...
Is there
a way to include in the project all the species for each
sampling point? In wich way the db may be structured and
managed with qgis, maybe using Excel or Access or the
equivalents of Open Office?
With many thanks in advance,
Giuseppe
This mail was received via Mail-SeCure System.
_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user
This mail was received via Mail-SeCure System.
--
Micha Silver
GIS Consultant, Arava Development Co.
http://www.surfaces.co.il
|
_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user