Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [typeerror]

Python error message that can appear when using GIS Python libraries

0
votes
0answers
18 views

TypeError: object of type 'Polygon' has no len() - When trying to plot from a Dataframe

I need to create a LISA map for my work, and I am having problem when I'm trying to plot using geopandas. My data sources are: map_df # A Dataframe A geopandas series : hh = map_df.loc[(map_df['...
3
votes
1answer
730 views

TypeError: “unsupported operand type(s) for /: 'int' and 'list'” in QGIS?

In a academic project I've produced a small python script for watershed analysis. This script relates shapefiles attributes and generates a .txt file. I am trying to adjust the script to use within ...
0
votes
1answer
34 views

Getting TypeError: <type 'str'> from arcpy.mapping.ListLayers()?

I want to do simple task, using arcpy to turn on the label, I use this code (I'm googling it and change the path with my own mxd path) but it failed and returns an error. import arcpy mxd = arcpy....
1
vote
2answers
35 views

Altering text elements in multiple mxds?

I am trying to make changes to titles on multiple mxds instead of having to open 1 by 1 but keep getting an error. import arcpy.mapping as mapping, os for root, dirs, files in os.walk(r"F:\Final ...
0
votes
1answer
90 views

Concave hull error: not enough arguments

I am trying to run concave hull on a points layer, but I keep running into this error: TypeError: translate(str, str, disambiguation: str = None, n: int = -1): not enough arguments What am I ...
0
votes
1answer
54 views

ArcMap label expression returning NoneType error

I'm trying to create street range labels rounded to the nearest 100 unless a street range is less than 100 I'm using "50". I have a field l_refaddr that is a string with number ranges for a street ...
1
vote
1answer
33 views

Python script in ArcGIS to add field to a feature class in a workspace

I'm facing a difficulty to identify a feature by its name in a workspace and addfield to it. import arcpy arcpy.env.workspace ='C:\DATA_GEO\Bases de données\Vague 2\BOURRHA' fcList = arcpy....
0
votes
0answers
17 views

Data type error in UpdateCursor [duplicate]

My issue is that I am getting an error statement that states the following: row[0] = row[2] / row[1] * 100 TypeError: unsupported operand type(s) for /: 'NoneType' and 'float' Here is the ...
2
votes
2answers
725 views

Transfering from pandas dataframe to Geopandas?

I am not able to transfer a pandas dataframe column with geolocation coordinates into a Geopandas Point format. location = pd.read_csv('City_addresses') print location['Geolocation'].head() Outputs ...
1
vote
1answer
92 views

Using SearchCursor to round in ArcPy?

I'm pretty novice at Python and I'm trying to employ a search cursor to round a field in a table in ArcGIS. cursor = arcpy.SearchCursor(table,'', '', 'Distance') for row in cursor: round(cursor,...
1
vote
1answer
39 views

Copying specific folder into subfolders with ArcPy?

I'm working on Arcgis 10.5 and I am trying to achieve this: On my script, I want to make folders and subfolder, and also I want to copy one specific folder into several subfolders at the same time. ...
0
votes
2answers
94 views

Getting “TypeError: expected raster or layer name” when input is raster [closed]

I have a script that adds output rasters' paths to a list and that list is used to loop through each input in a later module. I am getting the following error: TypeError: expected raster or layer ...
-3
votes
1answer
2k views

Python Error TypeError: cannot concatenate 'str' and 'int' objects

New to python and I keep running into this error Runtime error Traceback (most recent call last): File "", line 5, in TypeError: cannot concatenate 'str' and 'int' objects
0
votes
1answer
153 views

Why is arcpy.ListUsers() not able to open SDE workspace?

I am working with ArcGIS Pro 2.1 and Python 3.6.2. and I am writing a script that involves the arcpy.ListUsers() function and whenever I run the code I receive the following error: The SDE workspace ...
1
vote
1answer
181 views

Using cursor in ArcPy gives TypeError: cannot concatenate 'str' and 'Polygon' objects?

I have been trying to use arcpy.da.seachcursor to rip through a datasets rows and use each in an intersect analysis like so: with arcpy.da.SearchCursor(in_feature, ['SHAPE@', 'NAME']) as cursor: ...
5
votes
1answer
199 views

Calculating Polsby-Popper Score Using ArcGIS Pro Field Calculator gives ERROR 000539?

This operation is using the Field Calculator in ArcGIS Pro 2.1. I am trying to calculate the Polsby-Popper Score for Congressional Districts. I have calculated the Geodesic Area and Geodesic ...
1
vote
3answers
92 views

Using ArcPy to add polygon to FeatureClass?

I want to convert some poins to polygon and then add the polygon to feature class. but this does not work.where this code is wrong. import arcpy array = arcpy.Array([arcpy.Point(0, 0), ...
2
votes
1answer
2k views

'TypeError: 'tuple' object does not support item assignment' when iterating through the rows of a layer

I'm trying to assign a value to the attributes of each feature of a feature layer. To do so I am just iterating through each row using 'arcpy.da.SearchCursor'. #Import geoprocessing. import arcpy #...
0
votes
0answers
619 views

Leaflet Uncaught TypeError: e.target.setStyle is not a function

Update! The problem is in the GeoJSON but I can't seem to find it. The code below should be fine. mondayData is from a .js file that is GeoJSON called at the beginning of the HTML file. I took all of ...
1
vote
1answer
479 views

Display an image on a Leaflet map using geojson attributes

I have a geojson file "test.geojson" which contains image metadata for multiple images, including image url (as browseUrl) and image bounds (as imageBounds). What I want to do is to display a ...
0
votes
2answers
988 views

How can I fix the ArcToolbox error TypeError: cannot concatenate 'str' and 'NoneType' objects?

I am trying to run the ExportHTMLImageMaps tool in ArcGIS 10.3.1 to create HTML image maps to be used as static web geographic navigation maps, but I keep getting the Error TypeError: cannot ...
1
vote
1answer
71 views

Getting difference between field and constant value in ArcPy?

I need to calculate the difference between two input parameters within a table. the first parameter is a field in the table, and the second is a constant i want to subtract from this field, both of ...
4
votes
1answer
108 views

QGIS setSuppress function in python

I am trying to call the setSuppress function I want to set the suppress to 2=SuppressOff by writing in Python Console QgsEditFormConfig.setSuppress(2) but I am receiving the following error: ...
-1
votes
1answer
39 views

Exporting from several MXD files layers to images jpg using ArcPy?

I did a script where I want to export from several MXD's files the layers to images jpg. Each one MXD's file has 5 layers and I want to export each layer to images. This my script: import arcpy, os ...
1
vote
1answer
106 views

From List into ArcPy Feature Class with InsertCursor

I am parsing an NMEA file to be able to import it into an ArcGIS with arcpy. I finalised the parsing part and also created a list with the appropriate form. But if I'm trying to insert the List into ...
3
votes
1answer
207 views

weighted overlay of several rasters

I am trying to create a script that creates a new list of rasters by searching through the file names then using that new list to execute the weighted sum function in spatial analyst. I am having ...
1
vote
1answer
827 views

ArcGIS API for JavaScript won't add graphics to map

var point = new Point(-49.9, 39.3) var symbol = new PictureMarkerSymbol('http://www.prww-weather.com/hurricane/icons/post-tropical-cyclone.png', 50, 50) var graphic = new Graphic(point, symbol); map....
5
votes
3answers
979 views

PyQGIS gives TypeError: QgsExpression.prepare(): argument 1 has unexpected type 'QgsFields'?

This question is very related to the unanswered Retrieve features from QgsFieldExpressionWidget pyqgis I have a layer and I've build a QgsExpression that involves a field of that layer. What I'm ...
2
votes
2answers
1k views

Error TypeError: 'NoneType' object is not iterable

I am trying to batch process KML polygons from a folder into a temp geodatabase. From there, Iif this works and runs then I am trying to Append the polygons to result to a Server connection (Postgres ...
3
votes
1answer
321 views

Python labeling Expression how to change font size?

I have a labeling expression using two attributes I want the first one to be size 14 and the second one to be on a new line and be size 8. This was my attempt so far: "<FNT name='Arial' size='14'&...
0
votes
1answer
29 views

Getting map to save to right place? [duplicate]

I'm doing an internship, and they want me to organize their data. I decided to do a script that would create the folders based on user input and stuff so once I'm gone they'll still be able to use it. ...
1
vote
1answer
572 views

GDAL code does not work on anaconda interpreter

I wrote a code that projects a raster to a new coordinate system. from osgeo import gdal filename = r"C:\Users\rsl\Desktop\New folder\SN228122015_mosaic.tif" input_raster = gdal.Open(filename) ...
1
vote
0answers
97 views

Using QGIS to workaround arcAdvanced license, one sided bufffer

I need to export data from a file gdb to a shapefile or PostGIS format, run a script that will create one-sided buffers in QGIS for the sides of streets whenever a point feature is found on that ...
1
vote
0answers
91 views

Tilestache VecTile Encoding Error

I'm trying to fix what I believe to be an encoding issue with Tilestache and was curious if someone else has seen this issue. Here's an example of the string that gets passed: �9*y��c�ަ��uSA��ٍ�c��'�...
1
vote
0answers
90 views

Does not accept in raster calculator variable s the number QGIS

I'm writing a plugin, where self.dlg.lineEdit_11.text() This number (attached image) gives an error message Traceback (most recent call last): calc = QgsRasterCalculator("rastr_raznica1@1" + s, ...
1
vote
2answers
327 views

Debugging UpdateCursor TypeError?

I am trying to split a field which contains, e.g., 2-10 and get the 2. The print statement produces the value 2 which is what I expect. I am getting a TypeError: TypeError: 'Row' object does not ...
1
vote
4answers
290 views

Unsupported Operand Type for Field Query

Following on from Correct SQL expression for SelectbyAttribute Tool, I have my code: import arcpy plantFile = r"U:\Users\K\Plants.shp" field = "UID" arcpy.MakeFeatureLayer_management (plantFile, "...
0
votes
1answer
81 views

Update & Delete Cursor Functions

In my program: I am selecting only schools of the specified type based on the "FACILITY" field and creating new feature class of the result. Deleting records from the resulting feature class from "...
1
vote
1answer
454 views

Using ArcPy to get length of Polyline created?

I am trying to get the length of Polylines I am creating immediately after I create them. The code I am using: arcpy.Polyline(arcpy.Array([arcpy.Point(firstx, firsty), arcpy.Point(secondx, secondy)])...
3
votes
1answer
485 views

arcpy.NumPyArrayToFeatureClass exception: “TypeError: narray.fields require”

I have a database application that I connect to using SQLAlchemy. In the database, I store coordinates in the fields x_coord and y_coord, with a third field spatial_reference_code that stores the EPSG ...
3
votes
1answer
168 views

ASCIIToRaster_conversion Error

I am fairly new to python scripting. I am attempting to do some batch conversions from ASCII to Raster in order to save myself some time. However I am continually getting issues with my script. My ...
1
vote
1answer
441 views

ArcPy Update Cursor after nested Search Cursor giving tuple assignment error?

I am running ArcMap 10.4.1. I am running a script that uses a DA search cursor nested inside an update cursor to assign variables from values in a table. The script then writes those same variables to ...
2
votes
1answer
253 views

Using arcpy update cursor to populate a field based on subtraction from two other fields

In a counties shapefile, I have two fields named population2001 and population2010. I would like to create a third field with the difference between 2001 and 2010 using arcpy and the update cursor to ...
0
votes
1answer
492 views

Arcpy — TypeError: 'NoneType' object is not iterable — I believe it is a feature class error but not sure how to solve [closed]

I'm somewhat new to Python and am working on automating some of the daily processes we do at my company. In this code example, I'm trying to automate pulling in data from a CSV file, creating buffers ...
0
votes
1answer
181 views

TypeError for openlayers3 measure example of area

I have got the typeerror for the 1. TypeError: helpTooltipElementa is undefined 2. helpTooltipElementa.innerHTML = helpMsga; I have defined the helpTooltipElementa in the code even though i am ...
0
votes
1answer
171 views

Errors when looping through spatial join with python

I am attempting to loop through a list of inputs and create a spatial join for each. My code works as desired for the first object in the list, but then throws an error. Here is my code: # set ...
1
vote
2answers
6k views

TypeError: list indices must be integers, not str when trying to calculate new records in several fields

I am trying to calculate new records in several fields by looping through each field in a list and dividing the value of each record by its shape area. My code is as follows: inFeature = outFeature ...
1
vote
1answer
2k views

Error: 'NoneType' object is not iterable (arcpy.ListRasters)

I am trying to extract a raster through a particular shapefile. import arcpy from arcpy import env from arcpy.sa import * arcpy.CheckOutExtension("Spatial") env.overwriteOutput = True ...
1
vote
2answers
1k views

Calculate Fields with Null Values using arcpy.da.UpdateCursor of ArcGIS for Desktop?

How do you calculate fields with null values? I have multiple fields that may have null values, that aren't being calculated in the third field. import arcpy with arcpy.da.UpdateCursor(r"...gdb\test....
0
votes
1answer
2k views

Arcpy Subtracting rasters error - TypeError: 'unicode' object is not callable

I have a script which subtracts 2 versions of the same raster from each other (one newer than the other) and then extracts the additions & deletions that have happened. I created a simple test ...