Questions tagged [valueerror]

A Python built-in exception. ValueError is raised when a built-in operation or function receives an argument that has the right type but an inappropriate value, and the situation is not described by a more precise exception.

Filter by
Sorted by
Tagged with
0 votes
1 answer
32 views

Rasterio ValueError

I am trying to clip a bunch of Landsat images with vector mask, but the Rasterio keeps hitting me with following error: ValueError: min() arg is an empty sequence I have not been able to resolve it....
Catallena's user avatar
0 votes
1 answer
55 views

Setting a field constraint using PyQGIS

I am trying to set a field constraint for a specific field called 'node_id' for node layer. Below is the code: layer = iface.activeLayer() field_index = layer.fields().indexFromName("node_id"...
BenStone's user avatar
  • 333
0 votes
1 answer
48 views

Using ReplaceDataSource with group layers and ArcPy with ArcMap

I have a script to replace the data source on layer files in an mxd based on a geodatabase input from the user and a feature class with a matching name to the layer. This script works as intended as ...
serena's user avatar
  • 13
1 vote
1 answer
166 views

How iterate with cim.featureTable.fieldDescriptions?

I have the next code: #Importar librerías necesarias import arcpy import pandas as pd #Obtiene el Mapa activo aprx = arcpy.mp.ArcGISProject("CURRENT") current_map = aprx.activeMap ...
Andrea Piedrahita's user avatar
1 vote
1 answer
42 views

ValueError when selecting raster files that overlap an AOI using GeoPandas

I want to select only the raster files that overlap or intersect my AOI. I have a list of 900 raster files, and I calculate their footprints. Besides, I have my AOI. Both, the footprints and the AOI ...
Alexandra Villacis's user avatar
3 votes
1 answer
5k views

'ValueError: Expected object or value' when reading GeoJSON file with Pandas

I tried to read a GeoJSON file with Pandas, but I got a ValueError message: 'ValueError: Expected object or value' Here's the approach I used: import pandas as pd geojsonPath = r"Z:\dems\...
Edudzi's user avatar
  • 99
1 vote
1 answer
808 views

MOLUSCE for QGIS 2.18.28 gives ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

I'm trying to use MOLUSCE Plugin for prediction of Land use expansion, I prepared and added the layers required for it but at 3rd step that is 'Area Changes' when I try to 'Update Table', ValueError ...
salsabeel Fatima's user avatar
3 votes
1 answer
611 views

Adding memory dataset to current active map in ArcGIS Pro using ArcPy

I am using ArcGIS Pro 2.7.2. I'm creating a Python script that creates data in the 'memory' workspace as part of a task. I would then like to add the dataset to the current active map as a manual QC ...
Howeitzer's user avatar
  • 570
0 votes
1 answer
2k views

Attempting to get index value of Geopandas dataframes in list produces ValueError

When looping through a list of Geopandas geodataframes and attempting to get the index value of the current dataframe in the loop, I'm getting ValueError: Can only compare identically-labeled ...
Kristen G.'s user avatar
  • 1,080
0 votes
1 answer
347 views

Adding raster file from file geodatabase to .lyrx file using ArcPy

I have a file from a file geodatabase, which contains all raster files, that I want to save to an already existing layer file. I am using ArcGIS Pro. I am trying this like so: import arcpy import os ...
Stefano Potter's user avatar
1 vote
1 answer
659 views

getLayerExtent() Value Error

I am trying to write a script that accomplishes 2 tasks: change the extent of all map frames using a boundary layer as reference and rotate the map frames by -17 degrees. To complete the first task, I ...
genebean's user avatar
4 votes
1 answer
3k views

ValueError geopandas.sjoin: why does it not read my GeoDataFrame?

I'm working on a spatial join between a polygon from a shapefile and points from a CSV file, using geopandas.sjoin. I want to assign each point with a name of the province it is located in. I do know ...
saQuist's user avatar
  • 716
5 votes
1 answer
2k views

Value Error when adding adding a layer in ArcGIS Pro arcpy script

In a script, I'm creating a feature layer and trying to add it to a map in ArcGIS Pro 2.3.0. When I try to add it though, I get a ValueError. Any ideas why and how to fix it? m is the map object. The ...
recurvata's user avatar
  • 146
0 votes
1 answer
142 views

UpdateCursor giving ValueError: need more than 1 value to unpack?

I am writing a script assigning the ADMINAREA value to the empty LOCALITY fields from TWB_Suburbs to TWB_Property layer. I am getting: ValueError: need more than 1 value to unpack Is anyone able ...
Alex Hunter's user avatar
1 vote
2 answers
1k views

Value Error from arcpy.getLayerExtent

The objective of the following code is to pan the main map to the definition queried point and then zoom or pan the vicinity map to the county the point is contained in. I have working code for other ...
GistofmyBS's user avatar
2 votes
1 answer
292 views

Working with NaN values in channel network in QGIS?

I have downloaded the conditioned 15s HYDROSHEDS dem of asia and after clipping the desired extent proceeded to evaluate the catchment area. However the next step of channel extraction renders NaN ...
vbj's user avatar
  • 183
1 vote
1 answer
8k views

GeoPandas not recognizing geometry type

I am trying to write a point in polygon spatial join to file by county. In my code I read in a GeoJSON object of building polygons for a whole state, grab the centroid and split the centroid points by ...
Fredrik 's user avatar
0 votes
1 answer
222 views

Raster Properties to TextFile using ArcPy?

I have multiple rasters that I want to get the mean of the all the cells. This is what I have: env.workspace = r"C:\Users\pyb609\Desktop\Updated Files\GIS\Dark\Shapefiles\15M" outfile = open(r"C:\...
user3325912's user avatar
1 vote
2 answers
1k views

arcpy Geometry.union(Geometry) ValueError

In this script, I want to extract several polylines from one polyline. The data comes from this link : Lignes aériennes RTE au 22 décembre 2017 INF 45 kV In the flow, I merge the extracted polylines ...
Rudymil1's user avatar
1 vote
0 answers
94 views

replaceDataSource issue when iterating through a loop for multiple map documents

Trying to update data sources across multiple map documents. The first iteration works but fails on the second no mater the order. The input csv is the output from another script that lists unique ...
Clubdebambos's user avatar
  • 1,680
1 vote
1 answer
1k views

Updating Field Based on another Field using UpdateCursor?

I have a feature class in a FGDB called LeasePlans. It contains a field called Property_Ref. I then have a CSV file with a field called SAPNO. For the feature class, I need to check does the value in ...
Dunuts's user avatar
  • 683
2 votes
1 answer
268 views

Getting ValueError while creating VRT using Python

I am trying to create a VRT file using Python (GDAL). I am getting the following error: "ValueError: array larger than output file, or offset off edge". How to solve this error? The code ...
vigna purohit's user avatar
0 votes
1 answer
2k views

Understanding ValueError from folium?

I was trying the following line of codes in python (that I learnt from a tutorial), import folium import pandas data=pandas.read_csv("Volcanoes.txt") lat = list(data["LAT"]) lon = list(data["LON"]) ...
Mehmud's user avatar
  • 591
1 vote
0 answers
60 views

Working with year before 1900 and ArcGIS Space-Time Cube?

I am trying to create a space time cube for 10 years from 1870-1880, but I get this Error: ValueError: year=1873 is before 1900; the datetime strftime() methods require year >= 1900 I tried to ...
iuiu's user avatar
  • 85
2 votes
0 answers
339 views

Converting Numpy array to raster with ArcPy? [duplicate]

I have been trying to convert a numpy array back to raster after doing some calculation on it and i keep running into errors. Basically I am trying to find flooded areas below a certain sea level eg 2 ...
stasha's user avatar
  • 147
1 vote
1 answer
8k views

Python Error: “ValueError: need more than 1 value to unpack”

Can someone help me figure out what is not working in this piece of code: import arcpy import fileinput import os import string from arcpy import env env.workspace = "C:/EsriPress/Python/Data/...
Gabe 's user avatar
  • 127
1 vote
1 answer
2k views

Adding newly created layer to Map in CURRENT project using ArcPy for ArcGIS Pro? [duplicate]

In this script, I create a feature layer from a file geodatabase feature class and wish to add the layer into a map within the current session in ArcGIS Pro 2.0. The script crashes on the last line. ...
spaine's user avatar
  • 490
0 votes
1 answer
162 views

ValueError when setting symbology.valueField on a layer after a join

I know a similar question has been asked elsewhere, but I'm not sure whether the problem I'm having relates to the fact that I'm trying to apply symbology to a layer after a join, or that I'm trying ...
CrowsNose's user avatar
0 votes
1 answer
69 views

Accessing arcpy.mapping .tif layer object?

Can someone tell me why I am getting this value error when attempting to access the Montreal.tif layer object? The first three lines access the object and set the transparency perfectly well, but ...
pyRsq's user avatar
  • 146
1 vote
1 answer
75 views

Accessing values in GIS based on condition using NumPy? [closed]

I wrote the following code for GIS analysis, in which I am trying to find the sum of all pavement area values that meet the condition where Application == "Micro Surface" & CouncilDistrict == 1. ...
vanhorne's user avatar
0 votes
1 answer
140 views

DistanceTo Geometry printing generic error

Tried reading through everything else related to the distanceTo tool on SE, but im still running in to trouble. Basically, my input Feature Class is a collection of polygons with begin/end lat/long. ...
cjl5108's user avatar
  • 11
1 vote
1 answer
263 views

Convert GPlinearunit to float in arcpy

Is it possible that arcpy converts all inputs of the a value registered as GPlinearunit (kilometers, meters, feet, miles, etc) into units of XY coordinates system? I need to perform calculations with ...
Novvier's user avatar
  • 434
3 votes
1 answer
276 views

Numpy Array to ArcGIS GRID gives ValueError?

I have a numpy array saved to disk ( the numpy array is a depth image from a Kinect 360) and I want to convert that numpy array to an ESRI GRID. I have the simple code below to accomplish that task ...
GBG's user avatar
  • 9,604
1 vote
1 answer
338 views

UpdateCursor: Invalid input value for setting

I have a field called "CODE_12" in which the values are strings (3 characters). I have another empty field called "AE" and that I want to fill depending on the value on the "CODE_12" field. For ...
lia's user avatar
  • 83
10 votes
3 answers
14k views

Creating polygon feature class from X,Y coordinates using ArcPy?

I am trying to write a script that creates a new polygon feature class containing a single ( square ) polygon with the following coordinates: ( 0, 0 ), ( 0, 1,000 ), ( 1,000, 0 ), and ( 1,000, 1,000 )....
Staley's user avatar
  • 279
4 votes
1 answer
681 views

Using Feature Dataset with ReplaceDataSource gives ValueError: Layer: Unexpected error

I'm attempting to replace the data source of a unsourced layer with a mxd. The issue I'm having is that the Featureclass "APPL" is contained within a Feature Dataset. When the feature class is outside ...
MikPM's user avatar
  • 237
2 votes
0 answers
1k views

Update Data Driven Pages Index layer via Python [closed]

I am trying to find a way to update the index layer for data driven pages through arcpy. I understand that to access DDP from arcpy.mapping you need to be referencing a MXD that has DDP enabled. My ...
Spencer P's user avatar
3 votes
1 answer
2k views

Getting ValueError from lyr.replaceDataSource()

I'm trying to write a script that allows me to look through map documents and replace each layer's data source in each map document. Everything is working logically I believe, and all my loops are ...
Daimon Nurse's user avatar
1 vote
1 answer
532 views

Extent to xy coordinate- arcpy

I work with arcview 10.3, and i try to extent to xy coordinate with arcpy? I am using this code: import arcpy, os, sys from arcpy import env env.workspace = r"C:\Project" pnt = '178434 ,662446' ...
newGIS's user avatar
  • 4,042
11 votes
1 answer
1k views

PySAL natural breaks from Numpy array

I am attempting to extract natural break values from a raster using Python. The intended process goes: Arcpy raster object to NumPy Array (using RasterToNumPyArray) to natural break values (using ...
phloem's user avatar
  • 4,678
5 votes
2 answers
1k views

ArcPy Report syntax error

I'm working on trying to use arcpy to automate the creation of a report, but I'm running into a problem. >>> arcpy.mapping.ExportReport('2013pp',"C:\reports\2013_Graffiti.rlf","C:\reports\...
David Meek's user avatar
6 votes
3 answers
2k views

Why is an extra field necessary when creating point shapefile from csv files in Python?

I have a Python script that creates a point shapefile from a CSV file within a Python script. This script gives me a ValueError for the longitude field (LON) if there isn't an extra nonsensical field ...
Patty Jula's user avatar
  • 1,083