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

Convert raster to txt in XYZ format

Hello friends, I need to convert a raster to a txt file but XYZ format. * ASCII TO RASTER tool does not help because it does in another format. Know if there are processes supported by python can do?...

View Article


Query Map Service From Python

I've got access to a map service, which has one layer in it with a bunch of polygons. In my python script I want to intersect one polygon feature class with this map service and spatially join the...

View Article


Polygon Centroid

I am attempting to create a script that zooms to a polygon centroid. I want the polygon centroid to be based on a Subd attribute field. Location is a feature class and I intend to use the SHAPE@XY to...

View Article

Is it possible to Edit Standard Annotation with python

I have created standard annotations which are simply text on the map and i need to edit the text contained within. I though that these text annotations would be stored as text elements in the MXD,...

View Article

Is it possible to sort a text file before creatinga dictionary?

I am using a txt file to create a dictionary. However the dictionary is not sorted according to the txt file no matter the sequence of values in the txt file. Is there a way to sort the file or to sort...

View Article


for loop not iterating for every file in list for CostDistance

Hello! I've been trying to automate CostDistance and eventually create corridors. I've finally got a code to actually work sort of. I checked my results and realized that only one of the shapefiles...

View Article

AddField for multiple fields in one table

Hi, Im a newbie....Ugh I am trying to use the AddField function to add a bunch of fields to one attribute table. I can get my script to work for ONE field. But I want it to work for Many fields....I...

View Article

Remove first 2 characters using if statement

Hi, I would like to have this code remove and XY or RR (if they are the first 2 characters) in a field with values XY2365541 RR1247884 8965445 would be: 2365541 1247884 8965445 Writing a query is...

View Article


Image may be NSFW.
Clik here to view.

Has anyone modified UniqueValuesSymbology’s Lyr.symbology.classLabels...

Hi every guys,I want to modify a mxd file’s ”Lyr.symbology.classLabels”(see in Figure1),The main steps as follows: First,According to Layer‘s name and Checks whether the property of the Layer is...

View Article


Problems with "OBJECTID" in AddRastersToMosaicDataset_management

Hi Friends, I am creating automatic raster so, they are updated every 24 hrs to do use the tools "arcpy.RemoveRastersFromMosaicDataset_management" and then "arcpy.AddRastersToMosaicDataset_management"...

View Article

Create a copy of an existing attribute table field

What I am attempting to do is create a copy of an attribute field in a feature class. I want the values of both fields to be exactly the same, but I want their titles to be different. I think I'm close...

View Article

10.2 SearcCursor Doesn't recognize file path

Hey everyone, In 10.1, if I ran the script below and had no issues. Since my upgrade to 10.2, I am getting an error. I simply created a .xlsx file from Excel 2007. I created one field called...

View Article

Hatch expression help

This is driving me crazy and I'm sure its something really simple but I can't find examples to show me what to do so I'm hoping someone here can help me out. I have a route with measures that I'm...

View Article


several simple label expressions into a single expression

Could you help with combining several simple label expressions into a single expression? I've made stabs at it but here it is with comments. Lables are determined by three fields: [NAME],...

View Article

How to export to PNG with transparent background

Hi there, I used the following line of code to export an mxd to PNG 8 bit (i am creating tiles)... BUT i cant seem to set the background to transparent (or No Color)... any clue as to what parameter i...

View Article


can anyone help by showing me how to turn these into pythons

scenario 1 build a stock portfolio manager. The manager program will consist of 3 dictionaries. 1.The first dictionary, called Names, maps the stock symbol to the company name (example: "GM" maps to...

View Article

Move Map in Cardinal Directions

I want to move the map by entering the distance. For example, I want to move the data frame 5 Feet North. I am using an if elif else statment to provide a statement that moves the map. The script...

View Article


How to use arcpy.RemoveToolbox (toolbox) using the toolbox alias

The help documentation says that the tool "Removes the specified toolbox, either by specifying its path or referencing its alias." The example in the help shows how to use the tool with the full...

View Article

Distributed Database -Schema changes

Hi, I'm using python to export schema from the master replica to about three different replicas. The way the code is structured in python you need to specify each separate replica to export the XML...

View Article

Image may be NSFW.
Clik here to view.

If Then Else in model builder

Hi all, I have a model which iterates through feature classes in a geodatabase (image attached) For each feature class, it runs the check Geometry tool. I then use the "Get Count" tool to count the...

View Article
Browsing all 2485 articles
Browse latest View live