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

learn more… | top users | synonyms

0
votes
0answers
3 views

How to use SQL within python in ArcGIS Labels

I'm trying to create labels across a one-to many relationship and have tried a simplified version of this method. My version looks like this: def FindLabel ( [NAME_V2] ): import arcpy ...
1
vote
1answer
19 views

Rename output shapefiles in PyQGIS

I have a shapefile which resides in a folder, gets processed and the output is saved in another folder. Before the output, I would like to rename the shapefile slightly differently from the original: ...
0
votes
1answer
36 views

Using pandas in Python window of ArcGIS for Desktop?

How can I import pandas module in ArcGIS at figure. I want to calculate poisson and negative binomial, so I think I need import pandas or other modules. import pandas as pd Runtime error ...
0
votes
0answers
36 views

If expression in Field Calculator [on hold]

I am using ArcGis 10.2. I have a problem with my syntax in field calculator although I have tried a lot. Probably it will be a funny task for many of you but I have spent 1.5 day until now. I have a ...
1
vote
4answers
124 views

Using Loop function with arcpy.Exists()?

I have a code snippet using elif that checks if a file exists and continues to check through the letters of the alphabet (for example _A, _B, _C etc). All works fine but I think there must a better ...
4
votes
1answer
46 views

How to write to a single table via Python multiprocessing

A comment in the post Can multiprocessing with arcpy be run in a script tool? got me thinking, as I often need to do exactly this: Just beware of deadlocking situations (two Insert cursors in the ...
0
votes
2answers
38 views

Convert jpg raster format to tif format

I have 120 rasters( jpg format ) and i want to convert them to tiff format to folder called "OtherFormat" in env.workspace with arcpy. In my code i try to convert all jpg file I read ...
0
votes
1answer
33 views

Script not processing shapefiles from one folder to another

I am working on a script which takes shapefiles from one folder called "Original files", process them and then output the results into another folder named "Processed files. I asked a question on how ...
0
votes
0answers
19 views

How to import osm.pbf file into database with Python Imposm

I want to import a .osm.pbf file with the Python library Imposm. Currently my work flow is the following: import requests import os city_name = 'santiago_chile.osm.pbf' url = ...
2
votes
1answer
49 views

Python code for decreasing polygon size based on percentage?

I would like to decrease the size of polygons by percentage and not by distance in order to implement this into ModelBuilder to loop over a number of polygons. To my knowledge this tool is available ...
0
votes
0answers
31 views

Calculating distance from PointGeometry object to polyline in arcpy

I created a PointGeometry object on ARCPY and I'm trying to measure the distance from that point to the closest point on a polyline table.. The PointGeometry object has an easy function for that ...
3
votes
1answer
56 views

Copy protection via license file for ModelBuilder models?

I've build a large model in the ArcGIS ModelBuilder and I want to share this toolbox with some other people BUT I don´t want to lose control over it. The first step was to set a password to my script, ...
3
votes
0answers
37 views

Jenks Natural Breaks in Python: How to find the optimum number of breaks? [migrated]

I found this Python implementation of the Jenks Natural Breaks algorithm and I could make it run on my Windows 7 machine. It is pretty fast and it finds the breaks in few time, considering the size of ...
0
votes
0answers
31 views

Spatial Interpolation/Resampling of Point Surface Data - Axes @ Different Resolutions

I have a simple set of data points in x,y,z format. This was data collected from a ground penetrating radar over a physical distance of: 45m x 25m With a resulting grid of: 90 x 100 (9000 points) ...
1
vote
1answer
49 views

Where is the python library of QGIS 2.8

where is the Python library for QGIS 2.8 on a mac (10.10)? I cannot find it... sys.path in the QGIS python console gave me some path, but where the interesting part is happening it replaces the ...
1
vote
1answer
39 views

In ArcPy, How to call specific columns of attribute table?

I'm trying to figure out how to spline specific columns of a shapefile attribute table, but my question is intermediate to this-- how do I select a range of columns, e.g. the 20th column to the ...
0
votes
0answers
26 views

Stopping a route using attributed length

I am working in a project where I need to run routes from several points on a route network and have them stop at a specific length. I have worked out their max distance want to use this attribute to ...
0
votes
0answers
39 views

Speed up row-wise point in polygon with Geopandas

I have a geopandas GeoDataframe which contains some attributes and a geometry column which is filled with shapely Point(lon, lat) objects. Moreover, there is a GeoSeries which is equally indexed as ...
1
vote
1answer
20 views

Create Multiple Feature Layer and Add to MXD

I am really stuck with this one and cannot seems to get the code to execute. Every time I do so, I get the error: Input Features: Dataset [u'Test1'.....] does not exist or is not supported. My guess ...
0
votes
1answer
22 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
49 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
30 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
28 views

Concatenating fields while also replacing values within certain stings [on hold]

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
54 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
35 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
44 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
14 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
56 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
2answers
39 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
41 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
40 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
19 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
188 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
60 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
17 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
51 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
38 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
40 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
60 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
22 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 ...
1
vote
0answers
51 views

Loop exits after 100 count while creating domains using python [on hold]

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 = ...
2
votes
0answers
46 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 ...
2
votes
1answer
38 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
44 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
75 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
64 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
38 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
45 views

Print values of a field in arcgis using python [closed]

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