Linked Questions

3 votes
1 answer
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 ...
landocalrissian's user avatar
1 vote
1 answer
352 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 ...
Chris Rice's user avatar
0 votes
0 answers
34 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 ...
pnkjmndhl's user avatar
  • 794
2 votes
0 answers
33 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', '...
Laura's user avatar
  • 21
16 votes
4 answers
21k 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 = " \"...
jsnider's user avatar
  • 475
3 votes
3 answers
5k 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 ...
vandershraaf's user avatar
7 votes
1 answer
1k views

arcpy.SelectLayerByAttribute 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", "...
valsten's user avatar
  • 73
3 votes
2 answers
6k 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 ...
geogeek's user avatar
  • 4,566
3 votes
4 answers
5k views

Using GetParameterAsText and SelectLayerByAttribute in ArcPy

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 ...
Brian's user avatar
  • 111
5 votes
2 answers
2k 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 ...
Fezter's user avatar
  • 21.9k
0 votes
2 answers
3k 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.GetParameterAsText(...
alaskangraham's user avatar
2 votes
2 answers
683 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" = ...
Rod's user avatar
  • 65
1 vote
1 answer
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 ...
landocalrissian's user avatar
3 votes
2 answers
2k 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 ...
linnea_n's user avatar
0 votes
1 answer
888 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 ...
scuerda's user avatar
  • 429

15 30 50 per page