<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello Brian,</p>
    <p>What Gerbrand says is absolutely correct, but taking your
      assumption that crimes occur the same over the total area of the
      ward you would need to work out the crimes/km2 or so first. From
      there on it is a pretty straight forward exercise with QGIS. That
      involves a few steps however:</p>
    <ol>
      <li>Add the two layers to your map</li>
      <li>Set your project projection to Zangi:Zangi:CPNO31 (and area
        units to km2, if that's what you want)</li>
      <li>Then use the vector function "Union" on the two layers to
        create a new polygon layer which essentially is a combination of
        attributes on the two</li>
      <li>The you will notice that there are a few polygons that are not
        "unioned" as they don't overlap (e.g. policing areas outside
        your wards): make the new layer editable and delete those. You
        should then have 367 polygons with "unioned" attributes (I
        noticed that there are a few small ones inside the
        wards/policing areas due to not-adjoining polygons..these should
        be sorted out first!).<br>
      </li>
      <li>Then use the field calculator to create new columns for each
        year category by taking the "number of murders" / $area to get
        the murders per km2 (scary!!)</li>
      <li>Then use the Vector Analysis Tool "Statistics by categories"
        (you are on QGIS 3?) to do a statistic on each of the new year
        columns using the ward ID or number (or both) as Field with
        categories where you would get min, max, mean, etc. but the mean
        is a pretty good assumption in murders/km2 as it is a ratio.<br>
      </li>
      <li>Then you join the Union table with your results for each year
        and save the layer (using selections) to a new table with only
        the columns you want. You could convert the murders/km2 back to
        the total murders in the area (inverse) beforehand.<br>
      </li>
      <li>"Bob's your Uncle"</li>
    </ol>
    <p>Hope his helps!</p>
    <p>Immo<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 03/10/2018 14:20, Gerbrand Mans via
      qgis-za-user wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:5BB4B408020000F6002DDB65@pta-imo.csir.co.za">
      <meta name="Generator" content="Novell Groupwise Client (Version
        14.2.2 Build: 126868)">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <div class="GroupWiseMessageBody"
id="GroupWiseSection_1538568229000_GMans@csir.co.za_265DD78018ED000096CE00142223C9D6_">
        <div>Hi Brian</div>
        <div><br>
        </div>
        <div>You need a proxy variable to predict what the proportional
          contribution from each ward would have been to get to the
          total murder rate for the station area.</div>
        <div><br>
        </div>
        <div>One way will be to use socio-econ profiling, but you do run
          into certain biases which may become problematic when you need
          to explain your method to your users of the output. Else it is
          just going to be a straight proportional redistribution to
          wards based on total population per ward if you assume the
          probability is the same across the police station area.</div>
        <div><br>
        </div>
        <div>Best rgds</div>
        <div>Gerbrand Mans<br>
        </div>
        <div class="GroupWiseMessageBody"
id="GroupWiseSection_1538568229000_GMans@csir.co.za_265DD78018ED000096CE00142223C9D6_"><span
            class="GroupwiseReplyHeader">>>> Brian O'Leary via
            qgis-za-user <a class="moz-txt-link-rfc2396E" href="mailto:qgis-za-user@lists.osgeo.org"><qgis-za-user@lists.osgeo.org></a> 03/10/2018
            12:26 >>><br>
          </span>
          <div>
            <div dir="ltr">Hi Gavin,
              <div><br>
              </div>
              <div>attached are the Durban police station boundaries
                with murder attributes for the last 10 years. Also
                attached are the Ward boundaries. Any advise on how to
                produce an output table with murder by ward would be
                much appreciated.</div>
              <div><br>
              </div>
              <div>Thanks</div>
              <div>Brian</div>
            </div>
            <div><br>
            </div>
            <div class="gmail_quote">
              <div dir="ltr">On Wed, Oct 3, 2018 at 8:53 AM Gavin
                Fleming via qgis-za-user <<a
                  href="mailto:qgis-za-user@lists.osgeo.org"
                  moz-do-not-send="true">qgis-za-user@lists.osgeo.org</a>>
                wrote:<br>
              </div>
              <blockquote class="gmail_quote" style="margin: 0px 0px 0px
                0.8ex; padding-left: 1ex; border-left-color: rgb(204,
                204, 204); border-left-width: 1px; border-left-style:
                solid;">
                <div style="-ms-word-wrap: break-word;">
                  <div>
                    <div class="m_7977297716352025683moz-signature">
                      <div style="text-align: center;">
                        <div>Hi Brian</div>
                        <div><br>
                        </div>
                        <div>Please share a few overlapping station and
                          ward features with the list.</div>
                        <div><br>
                        </div>
                        <div>thanks</div>
                        <div><br>
                        </div>
                        <div>Gavin</div>
                      </div>
                    </div>
                  </div>
                  <div><br>
                    <blockquote type="cite">
                      <div>On 02 Oct 2018, at 10:57, Brian O'Leary via
                        qgis-za-user <<a
                          href="mailto:qgis-za-user@lists.osgeo.org"
                          target="_blank" moz-do-not-send="true">qgis-za-user@lists.osgeo.org</a>>
                        wrote:</div>
                      <br>
                      <div>
                        <div dir="ltr">
                          <div dir="ltr">Dear QGis SA,
                            <div><br>
                            </div>
                            <div>I would like to know if there is a QGis
                              tool that can assist with the following
                              task. I want to transfer crime attribute
                              data from SAPS Station boundaries to Ward
                              boundaries, assuming that crime is evenly
                              distributed within the SAPS Station
                              boundary.</div>
                            <div><br>
                            </div>
                            <div>Previously I have done this task in Arc
                              View using a script called DataPart.avx
                              which was written by Jianwei Dou in 2002.
                              The below simplified sketch illustrates
                              what I am trying to do in Qgis. The SAPS
                              Station shape has the data attributes and
                              the Ward shape is the overlay or boundary
                              shape. The output that I need is an
                              attribute table that has calculated the %
                              intersection of the SAPS Station by the
                              ward boundaries and aggregated the crime
                              attributes to a Ward table based on the %
                              intersection. In the below sketch the ward
                              boundaries intersect the SAPS Station
                              boundary by 50% in both cases. As there
                              were 100 crimes in the SAPS Station
                              boundary the output table lists Wards 1
                              and 2 with 50 crimes in each.</div>
                            <div><br>
                            </div>
                            <div>
                              <div><span
                                  id="m_7977297716352025683cid:ii_jmrgqim70"><image.png></span><br>
                              </div>
                            </div>
                            <div>Any advise most welcome.</div>
                            <div><br>
                            </div>
                            <div>Regards</div>
                            <div>Brian O'Leary</div>
                            <div><br>
                            </div>
                            <div><br>
                            </div>
                            <div><br>
                            </div>
                          </div>
                        </div>
                        _______________________________________________<br>
                        qgis-za-user mailing list<br>
                        <a href="mailto:qgis-za-user@lists.osgeo.org"
                          target="_blank" moz-do-not-send="true">qgis-za-user@lists.osgeo.org</a><br>
                        <a
href="http://pta-smg4.csir.co.za:32224/?dmVyPTEuMDAxJiY0ZWYxZTgwMzVkZGIzZDU2Mj01QkI0OUI1Ml8zNjg5NV8xNjE2M18xJiY4MDkyMzZlMjhiOWIzNDc9MTMzMyYmdXJsPWh0dHBzJTNBJTJGJTJGbGlzdHMlMkVvc2dlbyUyRW9yZyUyRm1haWxtYW4lMkZsaXN0aW5mbyUyRnFnaXMtemEtdXNlcg=="
                          target="_blank" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-za-user</a><br>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </div>
                _______________________________________________<br>
                qgis-za-user mailing list<br>
                <a href="mailto:qgis-za-user@lists.osgeo.org"
                  target="_blank" moz-do-not-send="true">qgis-za-user@lists.osgeo.org</a><br>
                <a
href="http://pta-smg4.csir.co.za:32224/?dmVyPTEuMDAxJiY0ZWYxZTgwMzVkZGIzZDU2Mj01QkI0OUI1Ml8zNjg5NV8xNjE2M18xJiY4MDkyMzZlMjhiOWIzNDc9MTMzMyYmdXJsPWh0dHBzJTNBJTJGJTJGbGlzdHMlMkVvc2dlbyUyRW9yZyUyRm1haWxtYW4lMkZsaXN0aW5mbyUyRnFnaXMtemEtdXNlcg=="
                  target="_blank" rel="noreferrer"
                  moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-za-user</a><br>
              </blockquote>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
qgis-za-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:qgis-za-user@lists.osgeo.org">qgis-za-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-za-user">https://lists.osgeo.org/mailman/listinfo/qgis-za-user</a>
</pre>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
      <title></title>
      <div class="moz-signature">
        <div class="moz-signature">
          <p style="background: transparent; border: none; padding: 0in"><strong><font
                color="#000000">Immo F. Blecher</font></strong><strong><font
                color="#808080"><br>
                Street: </font></strong><em><font color="#808080"> 56
                Saffraan Ave., Stellenbosch, 7613, South Africa<br>
              </font></em><em><font color="#808080"><span
                  style="font-style: normal"><b>Postal:</b></span></font></em><em><font
                color="#808080"> PO Box 74, Lynedoch, 7603, South Africa<br>
              </font></em><em><font color="#808080"><span
                  style="font-style: normal"><b>Cell:</b></span></font></em><em><font
                color="#000000"> </font></em><font color="#808080">+27
              83 272 6791 </font><font color="#ff6600">|</font><font
              color="#666666"> </font><font color="#666666"><b>Fax: </b></font><font
              color="#808080">+27 86 736 3302 </font><font
              color="#808080"><b>Email:</b></font><font color="#808080">
            </font><a href="mailto:immo@blecher.co.za"><font
                color="#0000ff"><u>immo@blecher.co.za</u></font></a> <font
              color="#ff6600">| </font><a
              href="mailto:immob19@gmail.com"><font color="#0000ff"><u>immob19@gmail.com</u></font></a><font
              color="#0000ff"><span style="text-decoration: none"> </span></font><font
              color="#ff6600"><span style="text-decoration: none">| </span></font><font
              color="#0000ff"><u><a href="mailto:immob@mymtnmail.co.za">immob@mymtnmail.co.za</a><br>
              </u></font><font color="#666666"><span
                style="text-decoration: none"><b>Internet:</b></span></font><font
              color="#666666"><span style="text-decoration: none"> </span></font><a
              href="http://www.blecher.co.za/"><font color="#0000ff"><span
                  style="text-decoration: none"><u>http://www.blecher.co.za/</u></span></font></a></p>
          <font face="Verdana, Arial, Helvetica, sans-serif"><font
              size="1"><font color="#808080">Contact me: </font> <img
                src="http://images.wisestamp.com/gtalk.png"
                name="graphics2" width="16" border="0" height="16"
                align="BOTTOM"> <a class="moz-txt-link-abbreviated" href="mailto:immob19@gmail.com">immob19@gmail.com</a> <img
                src="http://images.wisestamp.com/skype.png"
                name="graphics3" width="16" border="0" height="16"
                align="BOTTOM"> immoblecher</font></font>
          <div id="WISESTAMP_SIG_9425" dir="LTR">
            <p style="margin-bottom: 0in; border-top: 1px solid #e5e5e5;
              border-bottom: none; border-left: none; border-right:
              none; padding-top: 0.02in; padding-bottom: 0in;
              padding-left: 0in; padding-right: 0in"> <a
                href="http://www.linkedin.com/pub/immo-blecher/30/414/b8"><img
src="http://images.wisestamp.com/apps/buttons/linkedinbutton_option_1.png"
                  name="graphics4" width="160" border="0" height="33"
                  align="BOTTOM"></a></p>
            <table width="100%" cellspacing="2" cellpadding="2">
              <tbody>
                <tr valign="TOP">
                  <td style="border: none; padding: 0in" width="1%">
                    <p style="border-top: none; border-bottom: none;
                      border-left: none; border-right: 1px solid
                      #e5e5e5; padding-top: 0in; padding-bottom: 0in;
                      padding-left: 0in; padding-right: 0.05in"> <img
                        src="http://images.wisestamp.com/widgets/green_32.png"
                        name="graphics5" width="32" border="0"
                        height="32" align="BOTTOM"></p>
                  </td>
                  <td style="border: none; padding: 0in">
                    <p style="border: none; padding: 0in">Please
                      consider your environmental responsibility. Before
                      printing this e-mail message, ask yourself whether
                      you really need a hard copy.</p>
                  </td>
                </tr>
              </tbody>
            </table>
            <p style="margin-bottom: 0in; border-top: 1px solid #808080;
              border-bottom: none; border-left: none; border-right:
              none; padding-top: 0.02in; padding-bottom: 0in;
              padding-left: 0in; padding-right: 0in"> <font
                color="#808080"><font face="Verdana, Arial, Helvetica,
                  sans-serif"><font size="1">IMPORTANT: The contents of
                    this email and any attachments are confidential.
                    They are intended for the named recipient(s) only.
                    If you have received this email by mistake, please
                    notify the sender immediately and do not disclose
                    the contents to anyone or make copies thereof.</font></font></font></p>
            <p style="margin-bottom: 0in"><img
src="http://p1.wisestamp.com/pixel.png?p=mozilla&v=2.9.5&t=1320849250746&u=82e4b3250c4ca423"
                name="graphics6" width="2" border="0" height="2"
                align="BOTTOM"></p>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>