I have a task to get the parcel numbers along a specific way. The way is a vector layer with specific points, and the parcel numbers are supported via WMS server. The task is splitted in to two tasks: First is to write down all the parcels that are crossed by the way, second for given parcel write out all of points.


First task: way goes

135/3; 135/5; 503; 333/7; 333/6; 332/2; 499; 613; 498; 303; 302/2

Second task: parcels containing points

135/3 - 19/L-975; 333/7 - 20/L-975; 333/6 - 21/L-975; 332/2 - 22/L-975; 613 - 23/L-975 & 24/L-975

The manual writting down all of the parcels takes much time. And for a large regions is problematic. Is it possible to create some kind of rule or script to extract this data automatically?

enter image description here

  • 2
    Can you get the parcel information in vector format or do you have to use the WMS?
    – underdark
    Dec 18 '16 at 21:39
  • Well I have to use the WMS because the information can change, and also the vide area of ground to cover.
    – MaciejG
    Dec 22 '16 at 20:10

To evaluate if parcels intersect the way vector line you will need the parcel data in either vector format (e.g. shapefile, some-sort of spatial database/table, or WFS). Once you have all the layers in vector format you may use pyqgis .geometry().intersects() method to find parcels that intersect the way layer and also those parcels that have a point feature in them too.

Here is a general code example of this:

for feature1 in layerr1.getFeatures():
  for feature2 in layerr2.getFeatures():
    if feature1.geometry().intersects(feature2.geometry()):
      # continue on with logic
  • there are also GUI tools to select the intersects
    – BillW
    Dec 22 '16 at 8:55
  • Can you pleas tell me the names of these GUI tools? Im a beginer in QGIS and I dont know much for coding in it.
    – MaciejG
    Dec 22 '16 at 20:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.