[Qgis-user] Spatial Join

Jonathan Moules jonathanmoules at warwickshire.gov.uk
Thu Aug 8 07:49:20 PDT 2013


Hi,
  (I seem to have lost the list).

Yep, I'm on the weekly build from last week.

Unfortunately it seems I've managed to break "Join attributes by Location"
too. It gets to 15% and then sits there for ages using 100% of a Core and
reading from my HDD at 300MB a second. The shapefiles are 400kb and 5MB
(though that one has 300MB of attributes). This happens repeatedly. Another
ticket. :-)

Also - surely "sum" is different from "count"? That's why I didn't use that
in the first place. Well, I did try "mean", but it broke with a Python
error about data-types (makes sense I guess).

Jonathan




On 8 August 2013 15:27, Illya Santos <illya.sparkes.santos at gmail.com> wrote:

> Jonathan,
>
> Are you on a 1.8+ versoin of QGIS? I am assuming so.....
>
> My apologies, 'Spatial join tool' = 'join attributes by location' if you
> tick the 'sum' option you will get a join count column for each record in
> the resultant shapefile and should be able to do what you need to do, i.e
> get a total for all the joins.
>
>
>
>
> On 8 August 2013 15:07, Jonathan Moules <
> jonathanmoules at warwickshire.gov.uk> wrote:
>
>> Hi Illya,
>>
>>> Counting the number of joins can be done with the 'Spatial join' tool
>>> select 'Count' parameter and you will get a column that you can add up and
>>> find the total number of joins performed in the operation.
>>
>>  Which is the "Spatial Join" tool? It sounds like exactly what I want.
>> If you mean the "join attributes by location", it doesn't have a count
>> parameter, though it does have mean/min/max etc.
>>
>> If you want to know the number of features check out the 'Spatial Query'
>>> tool it will give you the total number of features (layerA > LayerB) for a
>>> range of set overlay operations. You can also save the results out easily.
>>> The interface is very intuitive.
>>
>> This is only able to get the broader overview of comparing the entire
>> datasets against each other rather than individual features compared
>> against their counterparts in the other dataset. Useful, just not for this
>> scenario.
>> Also I am now finding it prone to crashing when one of the datasets is
>> SpatiaLite; I'll report that imminently.
>>
>> I see from another thread you have a grasp of SQL, your query is
>>> also easily is achieved in SQLite or PostGIS.
>>
>> Ah, I'm afraid you give me too much credit; I've not played with the
>> spatial capabilities of any of these. It's on my todo list, but for now I'm
>> trying to stick to QGIS
>>
>> From the ArcGIS 10 manual "If a join feature has a spatial relationship
>>> with multiple target features, then it is counted as many times as it is
>>> matched against the target feature. For example, if a point is WITHIN three
>>> polygons, then the point is counted three times, once for each polygon."
>>
>>
>> In this situation that's exactly what I want. :-)
>>
>> Thanks,
>> Jonathan
>>
>>
>> On 8 August 2013 14:32, Illya Santos <illya.sparkes.santos at gmail.com>wrote:
>>
>>> Jonathan,
>>>
>>> Counting the number of joins can be done with the 'Spatial join' tool
>>> select 'Count' parameter and you will get a column that you can add up and
>>> find the total number of joins performed in the operation.
>>>
>>> If you want to know the number of features check out the 'Spatial Query'
>>> tool it will give you the total number of features (layerA > LayerB) for a
>>> range of set overlay operations. You can also save the results out easily.
>>> The interface is very intuitive.
>>>
>>> I see from another thread you have a grasp of SQL, your query is
>>> also easily is achieved in SQLite or PostGIS.
>>>
>>> N.B My understanding is that "spatial joins" will overcount, as it were,
>>> and should not be used to determine the number of polygons in layer A
>>> intersecting with layer B.
>>>
>>> From the ArcGIS 10 manual "If a join feature has a spatial relationship
>>> with multiple target features, then it is counted as many times as it is
>>> matched against the target feature. For example, if a point is WITHIN three
>>> polygons, then the point is counted three times, once for each polygon."
>>>
>>>
>>>
>>>
>>>
>>
>> This transmission is intended for the named addressee(s) only and may
>> contain sensitive or protectively marked material up to RESTRICTED and
>> should be handled accordingly. Unless you are the named addressee (or
>> authorised to receive it for the addressee) you may not copy or use it, or
>> disclose it to anyone else. If you have received this transmission in error
>> please notify the sender immediately. All email traffic sent to or from us,
>> including without limitation all GCSX traffic, may be subject to recording
>> and/or monitoring in accordance with relevant legislation.
>>
>
>
>
> --
> Email - Illya.sparkes.santos at gmail.com
> Skype - illyadavid
> Mob - 07872908958
>

-- 
This transmission is intended for the named addressee(s) only and may 
contain sensitive or protectively marked material up to RESTRICTED and 
should be handled accordingly. Unless you are the named addressee (or 
authorised to receive it for the addressee) you may not copy or use it, or 
disclose it to anyone else. If you have received this transmission in error 
please notify the sender immediately. All email traffic sent to or from us, 
including without limitation all GCSX traffic, may be subject to recording 
and/or monitoring in accordance with relevant legislation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20130808/0cc19d6b/attachment.html>


More information about the Qgis-user mailing list