[Qgis-user] spatialjoin

Bernd Vogelgesang bernd.vogelgesang at gmx.de
Thu Dec 22 16:39:59 PST 2016


Am 22.12.2016, 09:26 Uhr, schrieb Laurent Bourlet  
<laurentbourlet34 at gmail.com>:

>
> Hi at all
>
> i succeed !! thank's at all ...Andrew was right ... but i add an another  
> thing ; i have indicated in the dialogue box , under >"default value" ,  
> in "relational value" the name of the layer B , the right field etc...  
> and now it's ok !
>
> one more time , thank's !!
>
> laurent
Great!
Now it would would be nice if you would post a little walk-trough, so  
"old-fashioned" people like me have a chance to benefit from this a well.

Cheers
Bernd
>
>
> Le 21/12/2016 à 23:32, Andrew a écrit :
>> Regarding the default values option/limitations, I can add that if you  
>> try to use the default values expression dialog >>to build an  
>> expression using geomintersects() the dialog will evaluate the  
>> expression as invalid.  Instead, build the >>expression in the field  
>> calculator and then copy/paste it into default value box and skip using  
>> the expression dialog.
>>
>> Andrew
>>
>> On Wed, Dec 21, 2016 at 1:32 PM, DelazJ <delazj at gmail.com> wrote:
>>> Hi,
>>> Laurent, I can think about different ways you can test to tackle your  
>>> issues, provided you have two spatial layers >>>that overlap (and  
>>> without any intermediate layer creation):
>>> - recent QGIS introduce default values concept  
>>> (http://docs.qgis.org/testing/en/docs/user_manual/working_with_vector/>>>vector_properties.html#common-settings)  
>>> - i'm not really sure about its limitations though
>>> - add a virtual field  
>>> (http://docs.qgis.org/2.14/en/docs/user_manual/working_with_vector/>>>attribute_table.html#editing-attribute-values)  
>>> that you could later recalculate into a simple field
>>> - use the Autofields plugin  
>>> (http://plugins.qgis.org/plugins/AutoFields/)
>>> - use the SpatialJoin plugin  
>>> (http://plugins.qgis.org/plugins/spatialJoin/)
>>>
>>> Except the SpatialJoin plugin option (which is internally based on  
>>> it), you'll need to write an expression likely >>>based on  
>>> refFunctions plugin (e.g, geomintersects) someone mentioned above.
>>>
>>> HTH,
>>> Harrissou
>>>
>>>
>>> 2016-12-21 19:23 GMT+01:00 Laurent Bourlet  
>>> <laurentbourlet34 at gmail.com>:
>>>> Hi,
>>>>
>>>> i thought it was more easy ...
>>>>
>>>> In fact , i don't use a GPS because these points don't need precision  
>>>> : they are only used to identify the parcels >>>>. And i would like  
>>>> to catch their identity ( a number for each parcel and the owner ) if  
>>>> possible with a dynamic >>>>spatialjoin...
>>>>
>>>> With booth data ( number of parcel and name of owner ) , i could talk  
>>>> with the fisc administration :-)
>>>>
>>>> Randy was right ...i didn't have the same EPSG for the two layers .  
>>>> It's now OK ! but without the feature >>>>"dynamic" .
>>>>
>>>> Indeed , i would avoid building many temporaries layers and i thought  
>>>> it existed a plugin for this  " dynamic" >>>>feature.
>>>>
>>>> If no , i will ask my users to make spatialjoins some time to time ...
>>>>
>>>> Waiting , i will try the solution of Bernd...
>>>>
>>>> Thank you anyway !
>>>>
>>>> laurent
>>>>
>>>>
>>>> Le 21/12/2016 à 17:46, Bernd Vogelgesang a écrit :
>>>>> Hi,
>>>>>
>>>>> for me this sounds more like he is getting new points once in a  
>>>>> while and
>>>>> wants to join those attributes to the new points "automatically"  
>>>>> from the
>>>>> parcel layer.
>>>>>
>>>>> The biggest problem for users is to rethink the workflow from the  
>>>>> end to
>>>>> the beginning and to know the limitations.
>>>>>
>>>>> The outcome should be a point layer with the polygons attributes. If  
>>>>> those
>>>>> points (layer A) are from GPS as Randy assumes, they have to be
>>>>> reprojected to the parcels layer (layer B) before being able to join  
>>>>> them
>>>>> spatially(layer C). The spatial join in the toolbox produces layer D.
>>>>>
>>>>> Most probably, the resulting layer D is going to to be edited in  
>>>>> some way
>>>>> (adding notes about size, the progress, classifications, whatever),  
>>>>> so you
>>>>> will have to find a way to preserve those new attribute while being  
>>>>> able to
>>>>> add new points without much trouble.
>>>>>
>>>>> The processing toolbox is a good way to do these steps, though it  
>>>>> produces
>>>>> a lot of temporary files cluttering the project.
>>>>>
>>>>> A better way for all those repetitive tasks, is to use the graphical
>>>>> modeller, to create a workflow which only has to be triggered once  
>>>>> new
>>>>> points come in, and the resulting file can be saved as new a file  
>>>>> e.g.
>>>>> with the current date in the name, so you have kind of an archive  
>>>>> and do not
>>>>> overwrite previous files (and destroy your work in case something  
>>>>> goes
>>>>> wrong).
>>>>>
>>>>> So I can imagine a model with input layer A (new points in WGS84  
>>>>> without attributes) and a parcel layer B (in >>>>>whatever  
>>>>> projection).
>>>>> reproject layer A and C will be created as an intermediate step.
>>>>>
>>>>> Next input layer is the latest result layer D, reprojected and with  
>>>>> attributes.
>>>>> Merge layer C and D -> E. Now delete all columns which are from  
>>>>> layer B (from the last spatial join. >>>>>Unfortunately, you can  
>>>>> only delete one field at a time in the modeller, so you'll will have  
>>>>> to add the command >>>>>several times in a row to the model) -> Fn
>>>>> Do the spatial join of Fn with B.
>>>>>
>>>>> The last result G will now hold all points with the corresponding  
>>>>> parcel info plus additional fields you might >>>>>have added to the  
>>>>> points.
>>>>> G will be the input D in the next run with fresh points.
>>>>>
>>>>> So, do not add new points to the already existing collection of  
>>>>> points in WGS84 (it is never save to edit layers >>>>>without  
>>>>> backup), but just import them as a new input set and then run the  
>>>>> model with the parcel layer and the >>>>>last result layer.
>>>>>
>>>>> The modeller is not as intuitive as it should be, but it can save  
>>>>> you a lot of time once you managed to set up a >>>>>model.
>>>>>
>>>>> Maybe I was completely wrong analysing the problem, but maybe  
>>>>> someone else has the problem that fits to my >>>>>solution ;)
>>>>> Cheers
>>>>> Bernd
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Am 21.12.2016, 14:07 Uhr, schrieb Randal Hale
>>>>> <rjhale at northrivergeographic.com>:
>>>>>
>>>>>> 2 things:
>>>>>>
>>>>>> 1. In QGIS there is a processing toolbox (I assume you are one  
>>>>>> something as new as version 2.14.8). Open it >>>>>>(it's at the top  
>>>>>> -> Processing -> Toolbox). You can search for tools. Search for  
>>>>>> "join" and you should see a >>>>>>"Join Attributes by location".  
>>>>>> This is a spatial join.
>>>>>>
>>>>>> 2. THE MOST IMPORTANT THING. You mentioned you had collected points  
>>>>>> with a GPS. Possibly these points are in >>>>>>EPSG:4326. I'm going  
>>>>>> to guess that your parcel layer isn't. If you right click your  
>>>>>> parcel layer (in the layers >>>>>>panel) it will allow you to  
>>>>>> select properties. On the General Tab you will see the Coordinate  
>>>>>> Reference System >>>>>>mentioned and many times it is something  
>>>>>> like EPSG:xxxx . A Spatial Join must have the layers in the same  
>>>>>> >>>>>>coordinate system.
>>>>>>
>>>>>> If it is different - Right Click on your GPS points and "Save as".  
>>>>>> When the "Save vector layer as...." window >>>>>>comes up. Save it  
>>>>>> as a shapefile and MOST IMPORTANTLY change the CRS to match your  
>>>>>> parcel layer. Click on the >>>>>>small globe (that appears to be  
>>>>>> wearing a hat) and in the filter type in the number you see for  
>>>>>> your parcels. >>>>>>You can then select that projection and Save  
>>>>>> your file. It should save. You can then perform the "join by  
>>>>>> >>>>>>location".
>>>>>>
>>>>>> It should work. You are very close though so don't worry.
>>>>>>
>>>>>> Randy
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 12/21/2016 01:24 AM, Erwan Conseil wrote:
>>>>>>> Hi
>>>>>>> In my layer B , I have the name of the owner and the number of the  
>>>>>>> parcel : this number , a polygon , have a >>>>>>>WKT location .  
>>>>>>> All this is in a SHP . As I grab points in layer A directly in  
>>>>>>> Qgis (2.18) , I have also a SHP >>>>>>>. And i need a dynamic join  
>>>>>>> because I have no desire to make the spatial join each time...
>>>>>>> Regards
>>>>>>> Laurent
>>>>>>>
>>>>>>>> Le 21 déc. 2016 à 01:30, Randal Hale  
>>>>>>>> <rjhale at northrivergeographic.com> a écrit :
>>>>>>>>
>>>>>>>> In your layer B - Do the Names of the Owners have a location  
>>>>>>>> (like a tax parcel) or are they a spreadsheet >>>>>>>>(like  
>>>>>>>> Microsoft Excel)?
>>>>>>>>
>>>>>>>> Randy
>>>>>>>>
>>>>>>>>
>>>>>>>>> On 12/20/2016 06:03 PM, Laurent Bourlet wrote:
>>>>>>>>> Hi at all
>>>>>>>>>
>>>>>>>>> I'm a beginner in Qgis and i would make a dynamic spatialjoin.
>>>>>>>>> In fact , i have created a vector layer ( for example  A) and i  
>>>>>>>>> grab points in it when I'm outdoor >>>>>>>>>( these points are  
>>>>>>>>> buildings unknowned by the government and so these building are  
>>>>>>>>> not taxed ...) . I >>>>>>>>>have also a layer (B) with the name  
>>>>>>>>> of the owners of these lands .
>>>>>>>>> You see what i would ?...
>>>>>>>>> I would have these names transferred as attribut from B to A .
>>>>>>>>> For that , i think about a spatialjoin with a dynamic feature .  
>>>>>>>>> So i have downloaded the two plugins >>>>>>>>>"reffunction" and  
>>>>>>>>> "spatialjoin".
>>>>>>>>> But i have certainly maked something wrong because i don't  
>>>>>>>>> succeed ...
>>>>>>>>>
>>>>>>>>> Is it the good method ?
>>>>>>>>>
>>>>>>>>> And If yes , and if exist a doc about these plugins ...i'll take  
>>>>>>>>> it :-))
>>>>>>>>>
>>>>>>>>> regards
>>>>>>>>>
>>>>>>>>> Laurent
>>>>>>>>>
>>>>>>>>> ( pour les francophones ...je repère et saisis des points  
>>>>>>>>> représentants  des batiments construits et >>>>>>>>>visibles par  
>>>>>>>>> Google Map mais inconnus par le cadastre et donc les impôts  
>>>>>>>>> ...je voudrais donc enrichir la >>>>>>>>>couche de saisie par  
>>>>>>>>> les références des parcelles et les noms des propriétaires par  
>>>>>>>>> une jointure spatiale >>>>>>>>>dynamique ..à chaque point saisi  
>>>>>>>>> , "monte" cette référence )
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> Qgis-user mailing list
>>>>>>>>> Qgis-user at lists.osgeo.org
>>>>>>>>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>>>>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>>>> -- -----------------
>>>>>>>> Randal Hale
>>>>>>>> North River Geographic Systems, Inc
>>>>>>>> http://www.northrivergeographic.com
>>>>>>>> 423.653.3611 rjhale at northrivergeographic.com
>>>>>>>> twitter:rjhale
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Qgis-user mailing list
>>>>>>>> Qgis-user at lists.osgeo.org
>>>>>>>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>>>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>>
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Qgis-user mailing list
>>>> Qgis-user at lists.osgeo.org
>>>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>
>>>
>>> _______________________________________________
>>> Qgis-user mailing list
>>> Qgis-user at lists.osgeo.org
>>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>>
>>
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>



-- 
Bernd Vogelgesang
Siedlerstraße 2
91083 Baiersdorf/Igelsdorf
Tel: 09133-825374
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20161223/ff187276/attachment.html>


More information about the Qgis-user mailing list