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

learn more… | top users | synonyms

3
votes
0answers
51 views

Geometric Network for Electric Utilities

I'm not expert in the use of geometric networks nor in Python scripting and I need help with the following problem. I'm using ArcGIS 10.0. I have defined a geometric network for an electric ...
1
vote
1answer
52 views

Run a custom model via ArcPy fails

I'm trying to geocode a few address using a custom model created. When running the model via model builder all runs perfectly. Also when running it via the embedded interactive python console in ...
0
votes
0answers
94 views

convert lat/lon into meters

I have a database of latitude, longitude and radius in the following form: 48180759,11518950,19.0 Both latitude and longitude are expressed in degrees but then multiplied by 1e6 (or 1000000). ...
1
vote
1answer
27 views

ERROR 000358: Invalid expression “Parcelles_class.OBJECTID” = 1 OR “output_table1.src_OBJECTID” = 1 Failed to execute (Select)

I'm executing this code. I don't know if i'm missing something, I'm using Arcpy, Python, Arcgis 10.1 whereclause1 = '"Parcelles_class.OBJECTID" = 1' whereclause2 = '"output_table1.src_OBJECTID" = ...
-1
votes
2answers
56 views

SelectLayerByLocation - arcpy

I have 2 layers: "atikot" and "ways" that located in C:\Project\layers\New File Geodatabase.gdb , and i try to use this code based on "ArcGIS Help 10.2" to select features from "ways" layer: import ...
3
votes
2answers
36 views

Gdal: clipping a raster with another raster

I'm writing a simple utility to crop batches of multi-band geotiff raster files to the same (smaller) area. Using gdalwarp, I can easily crop a file using a single-polygon clipping shapefile: ...
2
votes
2answers
52 views

Query for numeric field against text field that contains a numeric value

In my database, I have one field, Service_Day, formatted as numeric, which contains a single digit number 1 through 7 (for days of week). I want to compare it against another field, called Region, ...
3
votes
1answer
46 views

Confused about ST_DWithin function postgis

First Time here. Anyway, I have a database that I want to use to store user locations. I want to be able to get all the users with in say 15 miles. How do I do this. I'm using PostGIS 2.1. My SQL ...
2
votes
1answer
42 views

Nested SearchCursor functionality

I am trying to ultimately compare the gate height to the corresponding fence height located nearby. So far I have come up with the following: gates = "gate_line" fence = "fence_line" ...
1
vote
0answers
38 views

Unable to call GDAL functionalities from Python

I am trying to call GDAL functionalities from the following script I made in the past. import os, fnmatch from subprocess import call call("dir", shell=True) # define the variables inFolder= ...
0
votes
1answer
32 views

How to round up/down an pixel value of a raster to a pixel value with 2 decimal places?

I have a raster (DTM) with floating points as pixel value. Now i want to round up/down the pixel values (to its next nearest value) to 2 decimal places. I use ArcGIS (with extensions) and tried the ...
2
votes
1answer
50 views

How to format an excel table using python

I am trying to come up with a way to export an attribute table as a formatted excel table in ArcMap 10.2. I am aware that there is a "table to excel tool" in the conversion toolbox, but I am not sure ...
0
votes
1answer
48 views

Replace a feature class in a feature class list

I'm using arcpy with arcgis 10.0. I try a script that erase successively all the feature class of a list depending on a reliability field value. Each time a feature class is erased by an other one, I ...
1
vote
0answers
32 views

Why must I write `geometryType() == 3` for point and polygon shapefiles?

I am asking this question based on the result I received from this earlier post. The following script only works if I set geometryType() == 3 as that is what is being printed out in the Python console ...
2
votes
1answer
36 views

netCDF4 Python climate algorithm

I have been working in Python with the Acaconda Python distribution to create code that accomplishes the following algorithm: I have multiple variable netCDF4 files [NCEP Reanalysis tmax(K), tmin(K), ...
2
votes
0answers
24 views

QGIS Python install question

Apologies for the 101 question; however, in trying to ramp up on python/QGIS I've seen mentioned that python.exe is the key executable in a python install. I have both Python 2.6 and 2.7 installed on ...
0
votes
1answer
61 views

Add CAD feature class to Arcgis using arcpy

I'm trying to add a CAD layer (point, polyline, annotation...etc) into ArcMap by python code, i'm using Arcgis 10.1, IDLE(Python 2.7), I faced many codes but they all gives errors, so i'm blocked ...
1
vote
1answer
60 views

Problem with Nested For Loop in ArcPy

I have two vector layer files, 'hausnummer_cropped5' and 'gebaudepoints_cropped5 - Kopie2'. Both have a point geometry and I am trying to shift the locations of the gebaudepoints_cropped5 points onto ...
2
votes
1answer
35 views

Merge tif files with python

I'm also having problems with running gdal_merge.py within another python script and I cannot run it. I already checked a similar problem here. My example is as follows: First I set my workspace and ...
0
votes
0answers
19 views

Python, KML and Geoserver/MapServer

I have this question: Is it possible to create an script that syncs a Google Drive folder with a MapServer/Geoserver and creates the visualization of an KML/HTML embedded file in Mapserver/Geoserver? ...
1
vote
1answer
25 views

QGIS 2.6 python PlugIn Error : NameError: global name 'QMessageBox' is not defined . any idea ? this use to work in QGIS 2.4

I am wondering why is this code not working ? def run(self): QMessageBox.information(self.iface.mainWindow(),"Ok", "You pressed F7") NameError: global name 'QMessageBox' is not defined ...
0
votes
1answer
41 views

Script giving error accessing field name

In the code below, the line 'alias = dict[fld.name]' always throws an exception. I don't see why; printing out fld.name works just fine. Also, the exception message is the field name printing ...
4
votes
2answers
233 views

How to identify polygon/point shapefiles in python?

I have a script which performs various functions on shapefiles, most of which are polygon-based. However, some shapefiles are point-based and I have to specify where these files are by editing the ...
1
vote
1answer
67 views

Trying to loop if condition at PYTHON code using Arcpy

I'm working with Arcgis 10.1, i'm trying to loop if condition on PYTHON code, but they give me as error : Parsing error IndentationError: unexpected indent (line 18) I don't know what is going wrong. ...
2
votes
1answer
23 views

QGIS - Edit UI - Python Init function localization with QTranslator

I have interaction with layer defined by custom designed UIs. In layer properties the following settings: Edit UI - customline.ui and Python Init function: customline_set.py. #coding: utf8 from ...
3
votes
0answers
24 views

Configuration problem anaconda python in ArcGIS

I used Eclipse with PyDev to create a script in Python (windows 7 x64). My code runs perfect when I start the run in Eclipse, but when I add it as a Tool in ArcGIS 10.1, I have the following problems: ...
3
votes
2answers
35 views

Exporting multiple dataframes as images using ArcPy?

I use this code to export a dataframe to png, and it works. import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] ar = df.extent.height / df.extent.width ...
2
votes
1answer
47 views

Add value to field using arcpy

I calculated the azimuth angle between two points. I'm trying to create a new field where I will store my angle values, but although the field is created it stays empty, no values within! I'm using ...
2
votes
1answer
24 views

Trouble renaming layers using arcpy

Running ArcMap 10.1 So, I have a bunch of layers that all have the same name. I'm trying to rename them so that they have names that actually mean something. Everything runs fine until it is time ...
2
votes
0answers
55 views

Raster to polygon using R [closed]

I am trying to convert a raster object to a polygon object using R but I am running into some problems using my Windows 7 machine. I originally tried to use rasterToPolygons (package: raster) but it ...
1
vote
1answer
69 views

Use row as input to other processes in python

I am new to python and need help. Looked for my answer but don't know if I am even using the correct terminology. I have a model in which I iterated through rows and performed a set of processes on ...
1
vote
1answer
52 views

Bulk insert with Python and cx_Oracle into st_geometry enabled table

I'm trying to make a bulk insert of a CSV file with Python and cx_Oracle into an st_geometry enabled table of an Oracle database with ArcSDE. I could do it with the method execute() of cx_Oracle but ...
4
votes
2answers
52 views

How to check for corrupted raster data?

I am working with thousands of tiled (2km x 2km) 4-band NAIP images. When I diced the images in Erdas, the program corrupted many of the tiles. The screenshot shows an example of one of the ...
2
votes
1answer
34 views

Is there a python version of qTuio? [closed]

Is there a python version of qTuio? qTuio is implemented in C++. However, I am currently trying to use pyqgis due to problems with C++ environment (I cannot even create a raster layer). Any help is ...
1
vote
1answer
30 views

How to use a feature class attribute to look up values in a table and pass them as parameters to a function?

My problem: I have a set of points inside a polygon. My goal is to figure out how long it takes (in days) for each point to move outside the polygon, based on a daily movement which affects all the ...
1
vote
0answers
34 views

Extract layer by attribute and export to new shapefile using arcgis scripting 9.3

I have a n-number of shape files based on attribute i want to extract the layer to export to new shape file, Using feature class to feature class conversion i can do, but i want to check for specific ...
1
vote
0answers
50 views

multiprocessing and the ArcGIS in_memory workspace

I am trying a script that makes use of multiprocessing and a number of tools within arcpy. The script works only if I write all input, intermediate, and output from child multiprocessing executions to ...
0
votes
1answer
37 views

Sort legend items up and down with arcpy

I work with arcmap 10.2.2 and I have 10 mxd's in one folder. I try to sort the legend items with a python code by moving the legend items up\down and i want that the layers in the TOC stay as is. I ...
2
votes
1answer
80 views

How to print 2 maps in the same PDF page using PyQGIS?

I am trying to generate a one-page PDF document containing the following items: 1) On the left half, a full state map (say, New York State). 2) On the top right quadrant, a map that zooms in to one ...
2
votes
1answer
76 views

ArcMap Python Question: Trying to Field Calculate Slope Percent in to Text

I have a layer of polygons that I spatially joined to a raster to point layer of slope percents. My polygons now have the percent of slope in a field called Avg_point. I want to use the field ...
1
vote
0answers
35 views

I can't get fiona to write while copying shapefile

I am trying to debug a function and have narrowed down the issue to a problem with my attempt to use fiona write. After going through the many online resources, I can't seem to find my problem, ...
1
vote
0answers
14 views

How to update the items of qCombox in custom form?

For my project I use a custom form with multiple value relation comboboxes. This works quite fine and I can access the widgets via my script. Init the two comboboxes which are correctly filled ...
0
votes
0answers
23 views

workflow for reading data from a geotif and plot it on a map using python

I have a geotif with 9 different values (0-9). The projection of this is +proj=longlat +datum=WGS84 +no_defs. I want to plot this colors over a map (mercator projection). I tried to use ...
1
vote
1answer
21 views

how to transfer a geotif with WGS84 to a mercator array for ploting it with matplotlib.basemap

I want to plot data from a sensor raster file (tif) to a map using basemap. I have a geotif with 'WGS 84' >>> gtif = gdal.Open("example.tif") >>> print gtif.GetProjectionRef() ...
3
votes
1answer
76 views

How to use QGIS field calculator in python?

I would like to use QGIS Field Calculator in Python to update the existing column based on certain conditions? How can I do this?
0
votes
0answers
28 views

Python Automated Data Driven Pages - Labeling and Symbolizing Errors

I am trying to use a python script to automate the export of the data driven map document. However when I use the python script to run the DDP export some of the labels are not exported and the ...
1
vote
2answers
142 views

Syntax error from Python parser of ArcGIS field calculator if then?

Using ArcMap - I would like to calculate one field based on the value of another field. I want to Update the field 'Date_Class' based on the value in another field 'MIN_YEAR_B'. I was trying to do ...
3
votes
1answer
36 views

Convert Raster into Cell by Cell Table

I'm hoping to run some Python mathematics on a raster, outside of ArcGIS. It's important to have a cell by cell table for the analysis I want to run. I plan to store it in a python dictionary similar ...
2
votes
1answer
44 views

How to geocode a single address in Python Script/ ModelBuilder?

How to geocode a single address (not table of addresses) in ModelBuilder and/or python Script? I want to enter the address and then geocode it. I am using arcgis 10.2.2
0
votes
1answer
38 views

Optimizing script with in_memory selection

I had a problem solved here. I had 2 features: polygons and points, both containing similar attributes(example: street name, number). Each polygon must have equivalent point added(same street name, ...