Quantcast
Channel: Forums - Python
Browsing all 2485 articles
Browse latest View live

Exporting GeoTIFF aerials from Bing Maps layer

Posted in the raster and imagery forum, but my question has a lot to do with Python. Any help appreciated! http://forums.arcgis.com/threads/100...ing-Maps-layer

View Article


ZeroDivisionError:

I have a large dataset where I need to run a lot of calculations. it contains roughly 100 fields. I have created a script that runs an update cursor to calculate some new fields based on a few other...

View Article


Invalid parameters on the *second* iteration of a loop; input layer disappears

I'm trying to sort mapbook pages by township. I have a layer of mapbook grids (rectangular polygon layer called "MapbookPages") and a layer of townships (irregular polygon layer with polygons named...

View Article

Image may be NSFW.
Clik here to view.

Polygon from GeoJson to Shp conversion arcpy script is being simplified

I'm trying to make a script that converts the GeoJson format into a shapefile. For the most part, the script in complete, but I'm having an odd issue with the output polygon. The JSON geometry has a...

View Article

Copy_Management not working

In the code below, I'm not getting any errors, but nothing gets copied either. I added the print statements so that I could verify the values in lst_names do in fact have matches in all_names. Any idea...

View Article


Image may be NSFW.
Clik here to view.

Python in Field Calculator - mod function

There are two fields in a topo line feature class, Elev for elevation and LineType10. I want to set LineType10 to 1 if Elev % 10 == 0, and 2 otherwise. The purpose is to be able to symbolize at ten...

View Article

Arcpy 10.1 ListFeatureClasses returns Raster Datasets

I am trying to loop through all the feature classes in an SDE geodatabase and get their name and feature count. When I attempt to get the feature count of each feature class I run into an error because...

View Article

Calculating distance between a table of specific points xy and specific...

Hello, I have a question which I can only solve with a code I guess, so I need your help. Background is, that in a context of population survey, people where asked to tell their zipcode, later one they...

View Article


Select a String Parameter Value

Hi, I am using GetParameterAsText. I want to be able to select a value (i.e. A or B) for my response from a prompted list. How can I code a prompt list to appear with set values? Is this possible...

View Article


New arcpy user needing help with changing attribute fields, and values

Hi So heres my problem: I want to create a tool that will take 2 point shapefiles, Change the title of some of their attribute fields, change the value of attributes from an integer to a string (which...

View Article

Image may be NSFW.
Clik here to view.

ToolValidator code - script tool output type dataset force .dbf extension

I have a tool that takes a table view as input and outputs either a feature class or table, depending on the input. Of course the parameter data type is read only so I can't change that in the...

View Article

Error Handling & Writing to Text File

Hello! I have a script which runs nightly to synchronize multiple replicas. The script creates a txt log. If a synch fails, it writes "failed" to the text file, and "success" otherwise. Recently, one...

View Article

Returning record attributes after inserting record into Oracle/SDE

Python Noob here, but I'm trying to write a script that will insert records from a shapefile into our Oracle/SDE database. Here's the issue...We have an Oracle trigger that creates a unique ID as soon...

View Article


Having trouble with selectbylocation

I'm unzipping a file, adding the shapefile contained within it to my map, and then trying to select by intersection with another layer. The script runs fine but nothing gets selected. Code: import...

View Article

Problem with select by attributes

I've got problem with python to use select by attributes to my layer called "World Cities". I type this script: arcpy.SelectLayerByAttribute_management ("World Cities","NEW_SELECTION","CITY_NAME" =...

View Article


problem with arcpy.mapping.RemoveLayer

I'm trying to remove a layer from my map. this code: Code:     arcpy.AddMessage(str(arcpy.mapping.ListLayers (mxd, "", df)))     arcpy.AddMessage(addstru)     arcpy.mapping.RemoveLayer (df, addstru)...

View Article

Pythonwin does not open in Windows 8.1

No matter what I do, Pythonw.exe (from Arcmap) does not open. I am using Windows 8.1. Does anyone know what to do?

View Article


Change Raster Mosaic Symbology to "Classified"

I have some Python scripting that creates two Raster Mosaic Datasets. The script then proceeds to add a number of surfaces simulating groundwater elevations. All of that is working well, but then I...

View Article

help me with this script please.

Hello group, How can I Find all broken data sources in all map documents in a folder or a hard drive? I'm trying to use this script but i always recieve an error import arcpy.mapping as mapping, os...

View Article

"\\" not parsed correctly

Using ArcGIS Desktop 10.1 A script call to CreatePersonalGDB passing the following parameters: as the folder name: "c:\\data1\\northdata" as the mdb file name to create: "north01" causes error because...

View Article
Browsing all 2485 articles
Browse latest View live