Linked Questions

3
votes
1answer
1k views

ArcGIS 10.1 Python Script tool wont read string variable in SQL statement [duplicate]

I am working on a simple script tool that selects features from a .shp and creates a new output with only those features. Basically the user specifies(from a drop down list) the county and the ...
1
vote
1answer
316 views

ExecuteError: ERROR 000358 - Using a variable within arcpy.Select_analysis() [duplicate]

I have looked at Including variable in where clause of arcpy.Select_analysis()? and while it is very similar to the question I'm asking I ran into the same issue after implementing its syntax. I feel ...
0
votes
0answers
27 views

Using where clause for arcgis analysis in ArcPy? [duplicate]

I am trying to write a python code for select analysis. FIPS: column in feature nameofinputfeature whose values needs to be compared with OFIPS OFIPS: variable whose value is known each time the ...
2
votes
0answers
22 views

SelectLayerByAttribute over an iterable list - arcpy [duplicate]

I am trying to get arcpy to select features in a shapefile that appear in a list generated from a model output file in a variable called 'died'. The list looks like this: died ['acadian022', '...
12
votes
3answers
15k views

Selecting features by attribute if in Python list?

I am trying to complete a select by attribute in Python but based on the query of whether an attribute is present in a list. Such a query at its simplest should be something like this: qry = " \"...
3
votes
3answers
4k views

SearchCursor() fails to read feature class?

I am very new to ArcPy and Python in general. I want write a script to read attribute table from a feature class and merge some data from a csv file into the table. Right now, I am just playing around ...
2
votes
2answers
5k views

Formatting SQL queries for use in Arcpy?

I have to make an SQL query on a column having not adequat name "type_borne_id", I couldn't make SQL queries using arcpy.Select_analysis neither selectbyattribute, but when I use select_analysis ...
3
votes
4answers
4k views

Get Parameter as Text and select layer by attribute

I have written a python script tool wherein a user specifies a feature class (e.g., Landuse) containing different attributes (e.g., parcel size, landcover etc.), name of the attribute field from which ...
5
votes
2answers
1k views

Problem with the where clause in ArcGIS when dealing with variables

I am writing a python script for ArcGIS. I have an input feature class which contains multiple pipelines which is saved as a variable InputPipeline. I would like to iterate through the pipelines and ...
3
votes
1answer
460 views

arcpy Select Layer By Attribute not working with an integer saved in a variable

I have a long code written and this is the last little bit i need and for whichever reason it does not work. This is the simple code. k=2 arcpy.SelectLayerByAttribute_management("poligon", "...
2
votes
2answers
574 views

Adding raw input to SQL string in ArcPy?

I have this py script for selecting one point. # Within selected features, select only those points of a chosen value arcpy.SelectLayerByAttribute_management("Stations", "NEW_SELECTION", ' "OID" = ...
0
votes
2answers
2k views

How to pass expression to where clause in ArcPy? [duplicate]

I want to pass a user defined variable into a where clause Syntax SelectLayerByAttribute_management (in_layer_or_view, {selection_type}, {where_clause}) #user input MTRsel = arcpy....
1
vote
1answer
2k views

ArcGIS 10.1 Converting a model tool to a script tool

I have recently created a model tool for a class project and my instructor would like it to be converted to a script tool for practice purposes. I have exported the script from my model and loaded it ...
3
votes
2answers
1k views

Why do I lose data after converting from .xlsx to .shp?

I have a fairly large excel file that I need to convert to a shapefile, but everytime I export the data, I lose a bunch of it. The excel file has about 277,000 records, but the shapefile will only ...
0
votes
1answer
857 views

Points in Polygon Count: Error with arcpy.selectLayerByLocation_management

I'm working on generating some multivariate hexbins and am running into a problem with the initial step of counting the number of points (for the first variable) that are within each hex polygon. Here ...

15 30 50 per page