New answers tagged

0

Using Select as @PolyGeo and @Michael Miles-Stimson say will indeed simplify your code: import arcpy arcpy.env.workspace = r"C:\RS_Data\SHP" arcpy.env.overwriteOutput = True amenities = ['school', 'hospital', 'place_of_worship'] points = r"C:\RS_Data\SHP\OSMpoints.shp" for amenity in amenities: query3 = '"amenity" = ' + "'" + amenity + "'" arcpy....


2

If you want to use some Python, it's pretty simple to extract the day of week. There's some limitations working with csv, but the following should be a good starting point: table = "test.csv" # list of days to extract, starting with Monday at 1 days = [1,2,3,4,5] # First field is unique key field used for select, second is date field # Would be "OID@" if ...


2

It sounds like you'd want something along the lines of: (BLOCK = 100 and LOT = 1) OR (BLOCK = 103 AND LOT = 9) OR (BLOCK = 200 AND LOT = 12) Of course, if those really are string fields, then you would want to put the right side of each equation in single quotes.


1

I found a solution without python and postgis, using the graphical modeller. Here is a summarized explanation. Step 1: extract end nodes with v.to.point give them a unique id give them a new attribute roadtype based on following expression case when highway IN ('path','footway','footpath','steps','cycleway','pedestrian','track','bridleway') ...


1

Presuming iter is something like iter=iface.activeLayer.getFeatures(), behind the loop name_dot contains the name of the last feature returned by the feature iterator. This must be passed to the QgsExpression via string formatting like expr = QgsExpression('"name"=\'%s\'' % name_dot) (Field names in double quotes, string in single quotes) Here is a ...



Top 50 recent answers are included