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

learn more… | top users | synonyms

0
votes
1answer
12 views

Exporting list of tables contained in *.mdb with ArcPy gives Indentation Error?

I'd like to export to excel each of the tables in a .mdb database as separate .xml files. The code works until the last line which gives an unexpected indentation error, and I'm also struggling with ...
0
votes
0answers
9 views

Help with python, import update csv values to feature class fields

I am trying to update a bunch of field values from a csv file where there are existing (incorrect) values in my featureclass. After searching I came across a similar post (Help with Python Update ...
1
vote
1answer
12 views

Install gdal in python on Windows7

I'm having problems installing the gdal library for python. I use a Windows 7 and have WinPython 2.7.9.2 which runs Python 2.7.9. I'd like to use gdal + Python for raster manipulation. I've read ...
1
vote
1answer
17 views

Concatenating fields while also replacing values within certain stings

I am trying to use python to concatenate multiple fields in a polygon layer. Specifically, I am attempting to combine the values of four fields into one: EXPCODE = !MATRIX! & !PLANT! & !PCT! ...
0
votes
0answers
17 views

trying to build world file for images based off extent rectangle generated from centroid in python

I have centroids for map images which I would like to georeference quickly and rougly via python script, using arcpy. I know the dimensions of the images, the dpi, scale, rotation and the coordinate ...
0
votes
1answer
22 views

Create Several Feature Layers and add them to a MXD

Every time I run this script now, I get an error on the line with the MakeFeatureLayer line. Sorry for all the questions! I'm really new to Python. import arcpy, os arcpy.env.workspace = ...
0
votes
1answer
35 views

Alter Fields in multiple feature classes in multiple workspaces

I have 22 geodatabases all in one folder. Each gdb has two feature classes. For each feature class, I need to rename a few of the fields. I've had success with this code, but it only works for each ...
0
votes
0answers
12 views

Mapserver Python Mapscript - Is There An Equivalent to Mapnik's Python Plugin?

I have been developing a sophisticated web mapping app using MapServer in conjunction with the Python MapScript bindings - and it has been working great. However, I am thinking a custom data provider ...
1
vote
2answers
49 views

ArcGIS JS API: parse GP Service messages

I am working on a JS app where the user draws a polygon and then a python-based GP Service task queries the parcels and generates mailing labels. The GP task works great, but once the PDF is created ...
1
vote
0answers
17 views

Running customized script qgis

I want to run a customized script in Qgis (namely that: Ortho Projection produces artifacts). With export PYTHONPATH=$PYTHONPATH:/PATH_TO_FOLDER I set the pythonpath in the folder where the script ...
1
vote
2answers
35 views

Can I plot this “diagram” in matplotlib

I am not sure weather that is the right stackexchange here. I want to grade a diagram like this: http://matplotlib.org/examples/shapes_and_collections/scatter_demo.html Unfortunately, I have no idea ...
0
votes
2answers
34 views

remove values in list using logical operators

Just would like to ask how can I masked or remove the values in my list based on logical operators. Here is the case: I converted an NDVI.img file into a 1 dimensional array. and as part of the ...
0
votes
1answer
37 views

Problems with Geometry collections. (Fiona: write output of Multipoints and Points)

Updated: I am getting the following error on this function: ValueError: Record's geometry type does not match collection schema's geometry type: 'Point' != 'MultiPoint' The problem is that I have ...
0
votes
0answers
16 views

Bulk Converting Ordnance Survey to Google Map lat lng

Apologies if this is a simplistic question, I am learning! I am attempting to use pyproj with Python. The coordinates I wish to convert came from the Ordnance Survey Integrated Transport Layer. I ...
2
votes
2answers
175 views

Running Python script in Task Scheduler— Script will not run

I have a script which I wish to run on a regular monthly basis without me needing to open and run the it. I have referred to every web page I can find on Windows Task Scheduler and followed their ...
1
vote
1answer
50 views

Python encoding error in ArcPy

I am writing a JSON file, as string input, using python, into a .json file in the file system. However I am getting the following error sometimes and I don't know why. Any ideas? ...
0
votes
2answers
45 views

How to measure distance using shapely

Reading the documentation...it looks like I should have this right, but I don't. The example is: Point(0,0).distance(Point(1,1)) 1.4142135623730951 Based on this example I wrote this block ...
0
votes
0answers
16 views

Programmatically Add Layer Definition Files (QGIS Python)

I would like to add the same Layer Definition File to QGIS desktop multiple times with a Python script rather than having to make multiple clicks each time I want to add that layer. Can someone ...
0
votes
1answer
44 views

ArcPy Script to update LYR data source not identifying all layers in folder

I've put together a script that for the most part works as intended - to walk through a series of folders, find SDE layer files and update their data source to direct connects if the layers support ...
2
votes
1answer
32 views

Why does projection WKT differ between osr.SpatialReference and gdalinfo

I am writing a simple geotiff using the GDAL python bindings, but the projection WKT reported by gdalinfo differs from the source. The script from osgeo import gdal, osr import numpy # Create ...
2
votes
0answers
39 views

Converting csv that it can be displayed

I have this Excel sheet here (far to right side there is a box where the file can be downloaded, the very first one). http://www.bafg.de/GRDC/EN/02_srvcs/21_tmsrs/211_ctlgs/catalogues_node.html Im ...
2
votes
2answers
52 views

What is the “best” way to automate the GIS slope and aspect algorithm?

I am currently obtaining slope and aspect of roofs using ArcGIS as follows: Mosaic several Lidar .asc files to new raster Extract by mask using Mastermap building outlines to get hold of just the ...
0
votes
1answer
18 views

ImportError: no module named site

I am developing a standalone app using qgis librarys and run the python inside qgis. I import the librarys with no errors but I have one last error: ImportError: no module named site. I define the ...
2
votes
0answers
47 views

Loop exits after 100 count while creating domains using python

I am trying to create domains on feature class or table class by reading a table which holds all look up information. Following is example code for what I am doing: tableIndex = ...
0
votes
0answers
19 views

Cannot use arcpy in the osgeo4w python Default

I have seen related questions to what I need to achieve: Conflict between ArcPy and GDAL/OGR? How to run OGR in ArcGIS Scripts? Conflict between ArcPy and GDAL/OGR? But they don't suit me at all. ...
2
votes
0answers
43 views

How to use the multiprocessing module on python to execute a spatial join?

I have several shapefiles of the entire Amazon rainforest each with millions of polygons (they are fairly detailed and take some time to draw on ArcMap). I need each of these shapefiles to be ...
1
vote
1answer
32 views

Replicating result of gdalwarp using gdal Python bindings

I am trying to re-project/resample with the GDAL python bindings, but am getting slightly different results compared to those from the command line utility gdalwarp. See update below for shorter ...
1
vote
1answer
42 views

How to call 'shapely' .coords on a fiona filtered list?

I have to filter a shapefile by attribute then compare it to another shapefile using .coords...however I am a bit perplexed how to do this as my filter is returning a list type...(and .coords requires ...
1
vote
2answers
73 views

Using Python to export multiple layers to .pdfs

I have found a solution to the issue below. The problem had to do with coding GetParameterAsText without actually using it as an input in a tool. That was the reason the raster layers wouldn't turn ...
0
votes
3answers
62 views

Using arcpy outside the arcmap

I want to use some arcpy function outside arc map i used following code but it ends up with error no module named arcpy can anyone help import sys sys.path.append("D:\Installed ...
0
votes
0answers
32 views

Arcpy save command giving errors

I've been trying to get this to work but for some reason it just keeps failing. Here is a very simplified version of my script: import arcpy arcpy.CheckOutExtension("spatial") #Spatial Analyst ...
0
votes
1answer
43 views

Print values of a field in arcgis using python [on hold]

I am pretty new at python scripting and I am trying to print values of a field to screen. My code is that import arcpy layer = arcpy.GetParameterAsText(0) arcpy.AddMessage('Layer Name : '+layer) ...
0
votes
0answers
14 views

script to Determine Parcel Neighbors [duplicate]

I have a layer of Plots Urban planner I want to fill the neighborhood north and south, east and west of each piece fields i need script to Determine Parcel Neighbors using PYTHON
1
vote
1answer
44 views

Setting PythonPath

I have a question which might be a little bit odd, but I want to make sure I get that right.... I want to use this script here Ortho Projection produces artifacts (unfortunatley I cannot download the ...
1
vote
0answers
25 views

Kartograph - converted svg not the same as before

I'm using the following script to convert a map from NaturalEarthData. But the result is very sobering. It seems like something went wrong with the scaling, but I got no errors when executing the ...
0
votes
1answer
26 views

Converting JSON to GeoJSON MultiPoint using `ogr.CreateGeometryFromJSON`

I am trying to convert a JSON array to a geom in Python, by first converting it to a GeoJSON. I have point coordinates in a JSON array, [{'lat':100.0, 'lng':0.0},{'lat':101.0, 'lng':1.0'}] that ...
1
vote
1answer
35 views

Parameters not valid in batch Alter field Arcpy

I am trying to perform a batch of Altering field names through a stand alone python script using Arcpy but it seems I am making a basic mistake in my python code. Using a list I refer to the original ...
1
vote
1answer
31 views

The truth value of a raster is ambiguous. Invalid use of raster with Boolean operator or function.

I'm having trouble with an if/else statement in my for loop. I have a raster Vmax with a constant value, another raster V which has a value of 0 in the beginning and will change during execution of ...
0
votes
0answers
20 views

Average cell value within polygon for each raster in a mosaic dataset - ArcGIS

I am working with a mosaic dataset that has the following properties and attributes... It consists of 365 rasters, each representing a day of the year. I am needing to get the average of the ...
0
votes
2answers
51 views

Model Builder Error: Python cannot be found

Building some models in Model Builder for a training session, and it's not working out so well. Model Builder can't seem to find Python. Model Builder Error 000574: Python 2.7 is not installed ...
1
vote
0answers
17 views

QGIS plugin : connect to polygonselect Maptool signals

Working on a new plugin I am trying to connect a custom function to the mouse right-clic signal while using the polygon selecting maptool. I have activated the maptool through : def run(self): ...
0
votes
0answers
23 views

How to read Sentinel-1 tiff images from ESA scihub with Python (and GDAL)?

I can read georeferenced tif images of Sentinel-1 downloaded from PolarView with Python / GDAL but I cannot read the SAFE format from ESA. I need it because PolarView (very nice web interface) keeps ...
2
votes
1answer
47 views

Python tool won't stop running— Not an infinite loop issue

I'm having trouble with a python script. It is essentially a near duplicate of another script which is running fine-- it is using different files, but apart from that the tools used and the order in ...
-1
votes
0answers
58 views

Creating multiple rows from entries in a single field?

This is probably an easy fix but I have a problem where I would like to use a script or model to export the contents of a feature class's attribute table into a separate table. The separate table ...
2
votes
2answers
56 views

Script to convert line segments to equally spaced points based the duration between points as specified in another field

I have a single file containing several hundred line segments created through connecting points collected detailing animal movement patterns. Each segment has a "seconds" field and a "uniqueID" ...
1
vote
1answer
38 views

Qgis raster calculator not giving output

I want to calculate some result using QgisRasterCalculator and using the code mentioned below.Problem is i am not getting any output raster also if i use this formula in raster calculator it gives ...
0
votes
0answers
13 views

Creating raster from points that conforms to a reference geometry using PostGIS, python, QGIS

Please forgive my ignorance, I'm fairly new to processing GIS data. My bread and butter is statistics but I'm now working on a project that requires more data preprocessing and cleaning than I've ...
0
votes
1answer
38 views

ArcPy Update Cursor Issue [closed]

I have a script that creates a date field and I would like to use an update cursor to populate it. My snippet is below and the error that I receive is AttributeError: Row: Error in parsing ...
0
votes
3answers
70 views

How to get the python code for a ArcToolbox call

I was wondering if it is possible to get the exact python code corresponding to a specific run of a tool in ArcToolbox? The reason I ask is that I want to replicate the function in a Tool in Python, ...
1
vote
2answers
51 views

Using Python to count records and show differnce

I'm trying to find an example of a python script for ArcGIS 10.1 that will get count of a FC in my SDE and get count of a FC in an incoming FGDB update and then write the difference to a log file. We ...