New answers tagged

0

Thank you so much for your answer: However, I don't understand and I don't know how I use arcgis.rand() and pythons random. Please, Can you teach me step by step thoguh Field Calculator or Select by attributes? Like this picture... I think this in vbscript The idea is to do random selections in COD_MOD variable (0515012, 4789512, 4563728, etc). In addition,...


0

You could create a Python Geoprocessing tool and use the arcpy.MakeFeatureLayer_management function (see http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/make-feature-layer.htm) to create a layer and then use the arcpy.SelectLayerByAttribute_management function (see http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/...


0

I'm assuming your habitats are regions, too. In that case you might need to split the habitat regions with your admin regions in order to get the exact area within each region. The good thing is that you can do all this in a single SQL Select statement: Select ADMIN_NAME, Sum(CartesianArea(Overlap(ADMIN.obj, HABITATS.obj), "hectare")) "Summed_Areas_Ha" ...


3

As it's not working, take it back a step and print yourlayer2QRY to see what is being passed to your arcpy.MakeFeatureLayer_management() - you'll see it's currently trying to query literally on "ID IN " + ZoneTuple + " AND " + "Labelr="+"'ZoneB'" whereas you want it to query on ID IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) AND Labelr = 'ZoneB' Once you get ...


2

You've got some weird quoting going on. I find it helpful to print out the query being used in cases like this. In your case, the value of layer2QRY is literally: ' "ID IN " + ZoneTuple + " AND " + "Labelr="+"\'ZoneB\'" ' You've used triple quotes, which means everything between them is a string literal. Your first attempt may have been closer to ...



Top 50 recent answers are included