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

learn more… | top users | synonyms

1
vote
1answer
45 views

How to perform If Statement in Field Calculator of ArcGIS for Desktop? (Python or VB)

I've one field "MAXSPEED". I want a Field Calculation that will calculate an additional field ("noise"): If MAXSPEED > 40 then the term: (73.5 + Log ( 25 ) * ( [MAXSPEED] / 50)) should be used to ...
1
vote
2answers
57 views

Add multiple Layer files in subdirectories to mxd using python

I have more than 300 layer files located in many sub-Folders and sub-sub-Folders. All Sub Folders are located in one large directory.I read Use python to add layers to TOC and I try, with arcpy, to ...
3
votes
0answers
13 views

Error writing buffered memory layer to shapefile in QGIS

I have created a memory polygon layerin my QGIS plugin. Then I added a buffer based on a point. I can see the ploygon layer in the map canvas and I can save it to a shapefile from the main GUI. But ...
0
votes
0answers
26 views

qgis python error mac yosemite

This problem started when I installed GRASS. I changed one environment variable and then I tried fixing, then I uninstalled egis, grass gdal, then I upgraded to Yosemite, and I still have the ...
1
vote
1answer
45 views

Algorithm to determinate neighbor's position (N S E W) of parcels?

After my first publicaation Determinate Parcel Neighbors using PYTHON Where i was looking for a faster way to calculate parcel neighbors and position, and after succeeding that, but the result was not ...
1
vote
4answers
163 views

Python Script to Add Fields to Feature Classes

I have to try to add a field called 'Name' to a bunch of different feature classes using python, and then access the name of the feature class to fill in the field. I have no idea how to even start ...
1
vote
0answers
16 views

Determine overlap of rasters in different projection systems

I'm trying to improve a python script I have for doing point-by-point comparison between datasets. It uses osgeo. My first input is a netCDF file: I extract the relevant information and store it as a ...
1
vote
0answers
10 views

How to set -srcwin with python gdalbinding and driver.createcopy

I am using gdal_translate currently to cut a 60000x60000 geotiff into smaller 1000x1000 geotiff files. This works but it takes about 24 hours(and I have 44 of those big images to compute). Im not ...
3
votes
0answers
45 views

Lining attributes up with features when creating shapefile using PyShp?

I used the Python Module Pyshp to select particular census blocks from the Census's shapefiles and package these into a single shapefile. However when I add this data into ArcMap and right click to ...
0
votes
0answers
19 views

.tif image file cropping

following image has black portion on all side which value is [-inf], that what was showing in ENVI. How can I crop this black portion using that [-inf] value?
1
vote
2answers
47 views

Using raw_input python to accept string with a dash (-)

Hello I have the following python input. The user will enter a value with a dash always. E.g. 2015-0001 Var1 = raw_input("Enter the number with dash: ") ...
1
vote
1answer
72 views

How to add fields to shapefile from standalone script?

When I run the following script via OSGEO4W64 Shell, I receive the following error when trying to run the qgis:fieldcalculator algorithm: 'NoneType' object has no attribute 'mapCanvas' I read ...
2
votes
1answer
49 views

Python library for geometrical calculations using with GRASS GIS?

I have to do some geometrical calculations in 2D(point, lines, line segments and intersection points) in Python, and then use it in GRASS GIS. What is the best library to use for it? I'm trying with ...
0
votes
0answers
29 views

Parameters for CreateFishnet

I´m about to create a fishnet. The CreateFishnet tool has several parameters, between them the origin_coord - The starting pivot point of the fishnetl. Data type of this parameter is Point Now there ...
0
votes
1answer
23 views

Help interpret GeoTif pixel value python gdal: connection between pixel value, RGB values and physical concentration?

I was running python script that queries a GeoTiff file at the coordinates of a centroid of blocks and as a result I got a list of pixel values, which I have trouble interpreting. When I run gdalinfo ...
0
votes
1answer
45 views

Connecting to Oracle database on a network in python

There is lots of information out there on how to do this, unfortunately, it all looks like Greek to me. I need a connection to a DB so I can add and use tables and featureclasses contained within ...
1
vote
1answer
35 views

Populating list widget in IntraMaps Roam?

How do I add values (items) in a list widget in IntraMaps Roam (2.3.1 release)? I'm trying to add values (items) to a list widget in a form with Python code (ver. 3.3.2) I have created the form and ...
0
votes
1answer
44 views

Python: TypeError: a float is required

I have a python script with some parameters - see screen. You see the last parameter is of type Double, default Value 0. The code i have this: Ausrichtung = float(arcpy.GetParameterAsText(9)) if ...
1
vote
0answers
36 views

Python loop doesnt work properly for hundreds of Raster files (HDF)!

For generating Time Series, I prepared a python script which are supposed to get all task done through looping. Interestingly, It stops working after 12 HDF file but I need to do loop through all ...
1
vote
2answers
96 views

Problems with plugin/installer manager in QGIS 2.6.1 Debian

An error has occured while executing Python code: Traceback (most recent call last): File "/usr/share/qgis/python/pyplugin_installer/installer_data.py", line 460, in xmlDownloaded if ...
-2
votes
0answers
35 views

How to convert .qgs to .mxd using standalone QGIS and Python?

How to convert .qgs to .mxd using standalone QGIS and Python ?
1
vote
0answers
14 views

Open a NetCDF file with multiple time step on QGIS (using Python console)

How to load a NetCDF-file into QGIS using Python? explains well how to load a NetCDF with PyQgis. However, it did not help me to choose among all the available time steps. Is there a way to import a ...
0
votes
2answers
55 views

Editing tables in ArcGIS for Desktop with Python Parser of Field Calculator?

so I'm trying to edit a table so that the name column will not contain spaces. I just don't know how to write the Python script that should go with it. This is what I have for the Python script ...
2
votes
1answer
59 views

QGIS Python script for creating project file

Is there a way to create QGIS project file(.qgs) using only Python script outside QGIS Python console.I am trying to publish a map using QGIS Web Client using python. For this, I am trying to do below ...
1
vote
0answers
26 views

Modify a Python script to one that uses RasterDomain_3d fuctionality - and writes resulting shapefiles it to one

As I am not very experienced with Python I need your help. I managed to modify a Script (that has been posted here Get boundary of raster image as polygon in ArcGIS Desktop? by ...
1
vote
3answers
40 views

Select Layer by Location problem

i want to create a python scipt query using arpy in arcgis i have one polyline shapefile and one polygon shapefile i want to choose(select) the polygons where contained within in the polylines ...
2
votes
0answers
47 views
+50

filename of current style in QGIS using Python

I get the name of the current style file using layer.styleURI(). Then, I change the style file using layer.loadNamedStyle(different_filename). However, when I call layer.styleURI() again, it returns ...
0
votes
1answer
90 views

Create multiple new shapefiles using information contained in a table

I'm hoping to create a script that creates a new shapefile for each record in a table. My python experience is limited, and it has been a while since I used it, so I'm having a hard time getting ...
0
votes
4answers
70 views

arcpy interate row, in a python script? SQL Select expression not working

I am creating a python script where I am trying to iterate over point feature class. I want to create seperate Feature classes from each individual day. So select daynumber and then export it to a new ...
0
votes
1answer
46 views

Batch arcpy.CopyRaster after arcpy.ASCIItoRaster

I'm new to arcpy and am having trouble running CopyRaster. Do I need a separate for loop for this process like I have below? import os,arcpy, glob filepath = ...
1
vote
1answer
42 views

python expression convert field to string and format with leading zeroes

I would like to create an expression using the field calculator in ArcMap to be able to convert an Int field to a string and add leading zeroes. I am able to do it in a python window with an example ...
1
vote
1answer
36 views

Where should PythonWin be located?

I have a question about PythonWin. Does it come with the DVD when you install it or does it have to be installed manually separately from the ESRI DVD ? On my computer at work, it does not come with ...
2
votes
1answer
122 views

Problem with import qgis.core when writing a stand-alone Python script that uses QGIS

I am trying to write a stand alone python script in windows 7 that uses qgis.core and various other qgis libraries. I have found an old question on this subject here: How to write standalone Python ...
6
votes
2answers
183 views

Cannot run standalone QGIS script

I've been trying, along with this post, to run a script in OSGeo4w Shell, outside of QGIS. But I get the following error: ImportError: No module named qgis.core I have also read the following ...
0
votes
1answer
26 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
0answers
20 views

MakeXYEventLayer_management input problems

I have a huge excel data base and want to make with the tool MakeXYEventLayer_management a new Layer for my coordinates in my table. I found this code on ArcGIS help: try: # Set the local variables ...
0
votes
2answers
53 views

Find duplicates in a field then update another field with a Y or N with Python (ArcGIS)

I am attempting to create a python script (ArcGIS 10.1) that will identify duplicated records within a points shapefile with a Y or N (possibility of over 5000 records). Similar to this: xyCombine | ...
0
votes
0answers
43 views

Training course for Fixing Data Sources

Is there any good training course or literature that pays some attention to automated processes for fixing map documents' data sources? Esri's little documentation on it is not helpful enough for me.
3
votes
2answers
97 views

Obtain coordinates and corresponding pixel values from GeoTiff using python gdal and save them as numpy array

How to obtain projected coordinates as well as the actual pixel values at those coordinates from GeoTiff file and then save them into a numpy array? I have arsenci020l.tif file, and its coordinates ...
0
votes
1answer
71 views

How do I create a projection file using GDAL

I am trying to obtain a buffer from a polyline file using GDAL with the following function def createBuffer(inputfn, outputBufferfn, bufferDist): inputds = ogr.Open(inputfn) inputlyr = ...
0
votes
1answer
50 views

ArcPy Error - 'continue' not properly in loop [closed]

Is there a way to get the continue function to work? Here is my code:
0
votes
1answer
72 views

TypeError: 'NoneType' object is not iterable from Python Scripting for Geoprocessing Workflow exercise?

I am currently taking ESRI's Python Scripting for Geoprocessing Workflows. I have following their step by step however there seem to be a problem that I am getting an error. import arcpy #Set ...
1
vote
0answers
29 views

Why when I use the ReadAsArray() Shell restart in this code?

I want to read the .pix file in the 3 different Array in python and I use this program but when I run that nothing do And shell be restart and program closed . from scipy import ndimage import ...
2
votes
0answers
42 views

Via PyQgis how to refresh a modified CSV layer without having to reopen the file?

UPDATED: With an CSV layer Qgis workspace [loaded as a delimited text layer], an external algorithm is ran; outputting (writing) new values to certain rows in the layers source CSV file. The writing ...
-1
votes
1answer
67 views

ValueError: Layer: Unexpected error from 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 ...
0
votes
1answer
28 views

Layer still in map after running arcpy.mapping.RemoveLayer?

I'm trying to run a script that removes a group layer from a set of map documents, the code runs and the correct zone to be deleted prints out, However, when I check my map documents, the layer is ...
0
votes
1answer
26 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
3answers
36 views

AttributeError: 'unicode' object has no attribute '_arc_object' from arcpy.mapping.ListLayers?

I'm trying to write a script that allows me to list .mxd files in a folder and then list the layers in each map document, however, I keep getting this error: Traceback (most recent call last): ...
0
votes
1answer
44 views

ArcPy saveACopy method saving copy of MXD to wrong path?

I have a script that looks through datasets in a geodatabase and copies a mxd document to a folder. The programs works, however it is saving the map documents to my desktop and not the specified ...
0
votes
4answers
75 views

Python code executes but nothing happens [duplicate]

I'm trying to write a script that looks into a database and lists all the datasets that begin with zone. The script then enters into a for loop and copies a map into each on the datasets listed. The ...