Python is an open source interpreted programming language used in many GIS programs.

learn more… | top users | synonyms

0
votes
4answers
89 views

Subsetting a x,y,z into a text file from a large xyz text file

I have a large txt file with x,y,z format. The file size is almost 8 GB. So I don’t want to process in ArcMAP. What I wanted to do is, I have a end coordinates for polygon shapefile and i have ...
0
votes
2answers
55 views

Check layer data type in gdb

I have path to layer or feature C:\base.gdb\test How to check is table or feature class by arcpy?
0
votes
1answer
229 views

How to write output from subprocess to disk (using multiprocessing)

This code was developed from another question I posted about how to kill an arcpy tool if it takes longer than a specified time. See How to cancel tool execution in python. Using the multiprocssing ...
0
votes
2answers
447 views

Export Raster Data to TIFF, BMP, or PNG File Using Python

I am writing a Python script to export a Raster Dataset to a TIFF, BMP, or PNG file, as I would manually by right-clicking on the layer, choosing Data | Export Data, and then make my choices in the ...
0
votes
1answer
205 views

Summing column values in table using arcgisscripting?

I need to create a python script that sums a column's values in a table. Thereafter, the script is supposed to get the percentage of each individual row in that column and populate this percentage ...
0
votes
1answer
99 views

Using os.walk to update broken links and save mxd

I've got code to walk through an entire directory and sub-directories repair broken links in each mxd and save the mxd. It works for the mxd's in the top directory but fails when trying to enter any ...
0
votes
2answers
187 views

How to make a routable graph from a Point and a Line shapefile, using Networkx?

I have one shapefile which consists of all the streets in the study area, and another shapefile which has points representing origins and destinations. I would like to know if it's possible to find ...
0
votes
1answer
98 views

Changing $id in a shapefile in QGIS

I need to change the id (feature.id() in the python API or $id in the field calculator) of for features in shapefile layers in qgis, and I need to do it in Python. Is there a way? I tried something ...
0
votes
1answer
151 views

Parsing field in field calculator using Python

I have field1 which has a values of "A_B" (example). I created two fields out of this, values to the left of the underscore go in fielda and to the right of the underscore go in fieldb. I used the ...
0
votes
1answer
86 views

Updating Arc Toolbox paramaters with validation script

I'm simply trying to disable parameter 1 if parameter 0 if entered. I modified the following, but it does not work, do I need to return anything? def updateParameters(self): """Modify the values ...
0
votes
2answers
825 views

How to plot geoJSON using Python?

I have huge geojson file that I am working on: [{ "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ ...
0
votes
2answers
117 views

Python script to check node / edge coincidence

I have written a script with arcpy to test node and edge coincidence. Each edge (line) should have a node (point) at either end. If this is true, the script does not write anything. If there is node ...
0
votes
1answer
105 views

How to get from Lat/Lon to this format?

I have twitter data with coordinates such as: [-7.2377761, 112.73091137] I'm working with a python geo library called osgeo. The sample code indicates creating a point like this. point = ...
0
votes
2answers
274 views

How to use Field Value from arcpy.GetParameterAsText()?

I want to to is have a user select a feature class, which then populates the fields that can be selected (this works), create a new field in that feature (works), and then populate the new field with ...
0
votes
2answers
88 views

Is it possible to alter raster values without Arcpy? [closed]

I'd like to be able to alter raster values, through fairly simple equations, without using the module Arcpy. Is that possible? It seems like gdal, numpy, and rasterlang might make this possible but ...
0
votes
2answers
180 views

Is there a maximum number of feature classes at File GDB?

Is there a maximum number of feature classes at File GDB ? I'm running a script that creates FC's, after around 1000 a get error of a schema lock ERROR 000210: Cannot create output.
0
votes
1answer
252 views

Python: Using re and update cursor over three columns [closed]

I'm working on this code and got a little to excited...only to find out it wasn't perfect! I'm trying to eliminate the suffix (row1) of roadnames(row0) and parse just the roadname to a new ...
0
votes
2answers
170 views

Adding Python Script to Custom Tool

I am probably making a simple mistake but can't seem to figure it out, only a beginner.The Select By Location Script is working and it exports to excel when it is run from Python GUI, it also works in ...
0
votes
1answer
92 views

How can i stop rendering Qgis

In my python plugin ,i select features from a vector layer dynamically using a loop and executing : VectorLayer.select(feature.id()) when i start the loop, the selection become very slow because ...
0
votes
2answers
521 views

Find longitude for point between two coordinates with pyproj?

I've written a function to get the longitude of a point of known latitude between two known points (might not be working correctly yet), but I feel like there must be a better way of using pyproj to ...
0
votes
1answer
328 views

How to set up parameters in Python toolbox tools?

I build a model builder and export it to python. How can I define parameters for python script in python properties? May you explain about Data type in script proprties? thanks alot
0
votes
2answers
1k views

Date Time format in ArcGIS 10.1

I have a Date column in my feature class and I want the date to appear in "dd MMM yyyy" format as a label to a polygon. I am using Arc Map 10.1. I tried taking Jscript. var Dt = new Date(); Dt = ...
0
votes
2answers
210 views

What causes ERROR 000732 from MosaicToNewRaster?

I'm trying to run the MosaicToNewRaster tool as part of a python script. This is my code: input_rasters = arcpy.GetParameterAsText(5), arcpy.GetParameterAsText(6), arcpy.GetParameterAsText(7), ...
0
votes
2answers
271 views

“ERROR 000840 | The value is not a Relationship Class”

I'm stumped here. I've seen this error in other posts but not quite in the same context. I'm trying to run the arcpy.management.CreateRelationshipClass() tool in ArcGIS 10.0. Absolutely everything ...
0
votes
1answer
527 views

How to run an AML in Python?

I am trying to run an AML in a python program I am writing and haven't been having much luck figuring out the correct way to run the AML. The AML requires ArcInfo Workstation to be from the GRID ...
0
votes
1answer
535 views

Python Script for shape file to layer conversion

What is the python Script for Shape file to Layer Conversion? I tried the following... import arcpy from arcpy import env env.workspace="working path" ...
0
votes
2answers
769 views

How to install Shapely, but got stuck into Python language

I have a MAC OSX 10.7.5 and am trying to learn how to use QGIS. Following a couple of tutorials I came to know I have to install shapely. I followed the instructions by the multi-cited ...
0
votes
2answers
704 views

Python module “shapely.wkb” missing

I am trying to follow a tutorial from here http://qgistips.spatialthoughts.com/2012/12/find-neighbor-polygons-in-layer-in-qgis.html#more I have downloaded the relevant python script and edited it as ...
0
votes
1answer
399 views

Parsing list object file paths for file name

I am trying to automate a naming process that takes the file name from a list of file paths to name other folders, geodatabases, zipfiles, etc. The problem I'm running into is that, I assume, I am ...
0
votes
1answer
585 views

Error : keyword can't be an expression

I am getting "keyword can't be an expression" error while running the following code: >>> import arcpy >>> arcpy.MakeFeatureLayer_management("Point","P1","Layer" = 'WM-VALVE-ID') ...
0
votes
4answers
412 views

Resolving Arcpy “GetObject not point” Error

I'm new to Python (v 2.6.5) and am trying to write an ArcMap (10) script that reads the vertex coordinates of a polygon shapefile which includes a small hole (doughnut polygon). I've been working ...
0
votes
1answer
31 views

Using arcpy to separate surface objects mixed into one file into different shapefiles

I'm trying to do some elementary tasks with arcpy and ArcGIS, namely separate some information in a file into separate shapefiles based on values for a field. My initial file has a field called ...
0
votes
1answer
31 views

Collect last word from varied length string for filtering, auto labeling and column population? [closed]

I have been looking and reading for a few days about how to collect the last word from a varied length string. I have found lots of postings about how to collect/split the last word, but none of the ...
0
votes
1answer
44 views

ArcGIS Spatial Analyst in arcpy - FATAL ERROR (INFDEF) DIRECTORY FULL

I have been running into this error in several geoprocessing scripts I've written lately. When I call a spatial analyst function I return this error: FATAL ERROR (INFDEF) DIRECTORY FULL import ...
0
votes
1answer
40 views

GetParameterAsText(arcpy) does not work

I am new in this area. I was practicing the function GetParameterAsText(). I know that when you run the code (for example in PythonWin) it works like the function raw_input(), therefore it should ...
0
votes
2answers
51 views

Field calculator to copy numeric values from other fields

FieldA contains text: both numeric(123) and alpha-numeric(123a, 2-3, 3/2, '). FieldB is longstring. I want to use field calculator and codeblock on FieldB to bring from Field A only the numeric ...
0
votes
1answer
28 views

Code of _gdal.pyd

I want a deeper understanding of how gdal_polygonize.py works. It uses gdal.Polygonize and gdal.Polygonize refers to _gdal.pyd. Where can I see the actual algorithm where the actual polygonization ...
0
votes
1answer
90 views

AssertionError: Invalid MXD filename from arcpy.mapping.MapDocument()?

I'm trying to write a script that allows me to list the layers of each map document in a folder. However I keep getting this error after it displays the layers in the first map document: Traceback ...
0
votes
1answer
70 views

Basic Python Reclass question in Field Calculator

I'm trying to reclass values in field calculator using Python. I want any value >= '5' to remain the same (return same value). Anything else to be = '0'. Yes, DIST_EDGE are numbers. I'm getting an ...
0
votes
1answer
55 views

Search layer in MXDs

I work on arcview 10.3 and i try to find layer called "ways" in several mxds. i try this code but it does not work. anyone know how to do it?: import arcpy,os,sys,string import arcpy.mapping from ...
0
votes
1answer
46 views

Ignoring group layers when iterating through layers

I have this nice code that goes through each dataframe in the current MXD, and through each layer in the dataframe, and generates a list containing the name of the dataframe, the name of the layer, ...
0
votes
1answer
61 views

Loop stops before expected without error message

I try to run a script that clips all the feature class of a geodatabase by the successive features of a clip layer (named pochoir). Thank to support here and here, the test of the intersection is ...
0
votes
1answer
24 views

Python OGR Geometry changes Floating Points

I'm creating a Polygon in OGR and adding coordinates to it in Python. It is a must that my coordinates aren't allowed to change when adding, however they do and I don't understand why. Here is my ...
0
votes
2answers
318 views

Convert shapely polygon coordinates

I am trying to work with a shapefile using shapely, fiona and python. The original coordinate system is in latitude and longitude that I am trying to convert to state plane system. So I want an ...
0
votes
1answer
68 views

Using Field Calculator to fill out a list of unit numbers

I am adding address points for individual units in trailer/RV parks and I would like to be able to use the Field Calculator to assign the unit numbers. Is it possible to tell the Field Calculator a ...
0
votes
1answer
73 views

Needed either python or VB Script to write right indent

Question : I have a field column that is has numbers with percent. The field properties are string and 50 in length. I ran it in an expression using round([T_Acres]/207 * 100,0) + "%" in VB script . ...
0
votes
1answer
34 views

osm2pgsql doesn't run in a QGis plugin

I have a problem with osm2pgsql when it runs in a qgis plugin. The function i use looks like this: osm2pgsql = "osm2pgsql -s -d {databaseName} -U {databaseUser} -H {databaseHost} -E ...
0
votes
1answer
648 views

'List indices must be integers not tuple' Error

I'm using an insert cursor to write rows to a destination feature class where the input Shapefile field names do not match the destination FC names. To accomplish this, I'm trying to use the indices ...
0
votes
1answer
112 views

Field Calculator If/Then in ArcGis 10.1

I've been looking through these threads, i found something similar and thought it could be the answer, but it doen't seem to work for me... I could do this the slow way with Select By Attributes, but ...
0
votes
2answers
519 views

MultiLineString to separate individual lines using Python with GDAL/OGR, Fiona, Shapely

There are lots of MultiLineString features in a polyline shapefile. The problem is to split these lines into separate individual lines. There is a similar question with PostGIS, but I need to code in ...