New answers tagged

1

You should be able to just paste the code below into your ArcMap Python console window for it to work, unless you are using a geodatabase in which case you'll need to change the "uniqueIdFieldName" to match your input table's unique id field (like OBJECTID). Like @dslamb said, you will need a field name for a "unique id" in your table. If one "group" has ...


1

You'll need a unique id for each row to distinguish between GEBID's and their area. You could use FID, but this is subject to change when a featureclass is edited (assuming this is a featureclass and not a table of some sort). Assuming you have this unique row ID. You could do something like this. import arcpy gebids = {} #using searchcursor from the da ...


1

I think the confusion lies with the OUTPUT parameter where the algorithm does not require this as you're only selecting attributes from the same layer. Remove this from your algorithm (this should also be removed from the documentation in my opinion). So your algorithm should look like: ...


1

Actually ignore this - I misinterpreted the question.


1

Run the data through the SORT tool, sorting by your random number field, sorting in an ascending sequence, send the output into IN_MEMORY. For example input data is: The sort tool creates an FID field which is sequential, so all you need to so is select rows where FID <= 10 as shown below: If you need the lowest 20 then select FID <= 20. This ...


2

You've swapped usage of quotes in your Python snippet. Instead of passing in a quoted field name, you've supplied a string literal, ie "KOD5" <> 'KOD5_1'. You need to change the quoting so that the second field name is quoted with double quotes instead: # select areals without no change if change == "Exclude": where_clause = '"' + field_initial + ...


3

A few things... filter is a reserved name in Python (it's a builtin function) so you shouldn't use that as a variable name. your where clause is already a string as you are using GetParameterAsText() to return it as a string, so no need to put it inside quotes. You should try something like this: reference your where clause like this: where = ...


0

With the new virtual layer you can now use SQL on any layer in QGIS, for example the airport Shapefile from the QGIS sample data: To count the number of airports by USE type and compute the average elevation use: The results are loaded as a new layer:


0

If you want to use model builder probably the simplest approach would be to expose some of your inputs as parameters and turn your whole model into a tool. If it were me: I would expose the the whereclause of a select by attribute tool which allows you to enter the code for a county. Apply this selection process on feature class A and B. You now have two ...



Top 50 recent answers are included