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 [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.

0
votes
1answer
20 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 ...
0
votes
1answer
43 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 ...
0
votes
0answers
28 views

Change datasource of layer file object (outside of mxd) to source on SDE

I am creating a number of layer object files outside of an MXD document (the layer is being copied from a separate layer object file outside of an MXD) and attempting to loop through each new lyr ...
2
votes
1answer
55 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 ...
1
vote
1answer
364 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 ...
0
votes
1answer
49 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:\...
1
vote
2answers
197 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 ...
0
votes
0answers
53 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 ...
1
vote
1answer
370 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 ...
1
vote
1answer
109 views

Getting ValueError while creating VRT using python

I am trying to create VRT file using python(GDAL). I am getting "ValueError: array larger than output file, or offset off edge". How to solve this error? Code written for the same is as follows. ...
0
votes
1answer
880 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"]) ...
1
vote
0answers
35 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 ...
2
votes
0answers
168 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 ...
1
vote
1answer
4k 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/...
1
vote
1answer
497 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. ...
0
votes
1answer
96 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 ...
0
votes
1answer
42 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 ...
1
vote
1answer
61 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. ...
0
votes
1answer
75 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. ...
1
vote
1answer
172 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 ...
3
votes
1answer
175 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 ...
1
vote
1answer
175 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 ...
7
votes
2answers
6k 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 )....
4
votes
1answer
507 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 ...
2
votes
0answers
970 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 ...
2
votes
1answer
2k views

ValueError error 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 ...
1
vote
1answer
438 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' ...
10
votes
1answer
650 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 ...
5
votes
2answers
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\...
6
votes
3answers
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 ...