<html style="direction: ltr;">
  <head>
    <meta content="text/html; charset=windows-1255"
      http-equiv="Content-Type">
    <style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
  </head>
  <body style="direction: ltr;"
    bidimailui-detected-decoding-type="preferred-charset"
    bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 09/12/2013 07:11 PM, venerio
      giuseppe anardu wrote:<br>
    </div>
    <blockquote
      cite="mid:1379002288.66457.YahooMailNeo@web172104.mail.ir2.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:arial,
        helvetica, sans-serif;font-size:10pt">Hello to everybody,<br>
        <br>
        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.<br>
        The structure of the attributes table of the point shapefile is
        made of 2 fields: "ID" and "Sample points"<br>
        <br>
        ID<span class="tab">    | </span>Sample points<br>
        <span class="tab">____|____________________</span><br>
        0<span class="tab">     |  1</span><br>
        1<span class="tab">     |  2</span><br>
        2<span class="tab">     |  3</span><br>
        <br>
        The structure of the csv file is made also of 2 fields:
        "Stations" and "Species".<br>
        <br>
        Stations<span class="tab">  |  </span><span class="tab"> S</span><span
          class="tab">pecies<br>
          ________|____________________<br>
          1   </span><span class="tab">   </span><span class="tab">    </span><span
          class="tab">  |  </span><span class="tab"> </span><span
          class="tab"> Barbula unguiculata<br>
          1   </span><span class="tab">    </span><span class="tab">  </span><span
          class="tab">   | </span><span class="tab">  </span><span
          class="tab"> Bryum sp.<br>
          1   </span><span class="tab">    </span><span class="tab"> </span><span
          class="tab">    |</span><span class="tab">   </span><span
          class="tab"> Funaria hygrometrica<br>
          3   </span><span class="tab">   </span><span class="tab">   </span><span
          class="tab">   | </span><span class="tab"> </span><span
          class="tab"> </span><span class="tab"> Barbula unguiculata<br>
          3</span><span class="tab">  </span><span class="tab">    </span><span
          class="tab">   </span><span class="tab">   | </span><span
          class="tab"> </span><span class="tab">  Barbula unguiculata</span><span
          class="tab">   </span><br>
        <br>
        The field to join is "Sample points" and "Stations". <br>
        From properties I made a Join, but the result I obtain is (the
        samples of point 2 are missing dued to draught):<br>
        <br>
        Sample point<span class="tab">  |  </span>Species<br>
        ____________|___________________<br>
        1<span class="tab">   </span><span class="tab">    </span><span
          class="tab">    </span><span class="tab">    </span><span
          class="tab">    </span><span class="tab"> |  Barbula
          unguiculata<br>
          2</span><span class="tab">    </span><span class="tab">    </span><span
          class="tab">    </span><span class="tab">    </span><span
          class="tab">    |  </span><span class="tab">NULL<br>
          3</span><span class="tab">  </span><span class="tab">    </span><span
          class="tab">    </span><span class="tab">    </span><span
          class="tab">    </span><span class="tab"> </span><span
          class="tab"> |  </span><span class="tab">Barbula unguiculata</span><span
          class="tab">   <br>
          <br>
        </span></div>
    </blockquote>
    <br>
    I can recommend using Spatialite for these kinds of DB joins.<br>
    <br>
    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:<br>
    <br>
    CREATE VIEW <span class="tab">Barbula_found AS<br>
      SELECT stations.station_id, stations.geometry, stations.ROWID AS
      ROWID, samples.species<br>
      FROM stations JOIN samples ON
      stations.station_id=samples.sample_point<br>
      WHERE samples.species="</span><span class="tab">Barbula
      unguiculata";<br>
      <br>
      And for </span>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".<br>
    <br>
    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...<br>
    <br>
    <blockquote
      cite="mid:1379002288.66457.YahooMailNeo@web172104.mail.ir2.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:arial,
        helvetica, sans-serif;font-size:10pt"><span class="tab">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?<br>
          With many thanks in advance,<br>
          Giuseppe<br>
        </span>
        <div><br>
        </div>
      </div>
      <br>
      <br>
      This mail was received via Mail-SeCure System.<br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a>
This mail was received via Mail-SeCure System.


</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Micha Silver
GIS Consultant, Arava Development Co.
<a class="moz-txt-link-freetext" href="http://www.surfaces.co.il">http://www.surfaces.co.il</a></pre>
  </body>
</html>