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

learn more… | top users | synonyms

0
votes
0answers
13 views

How to use a wildcard for a field to sort many shp

I want to use a wildcard for a field so as to sort a group of shapefiles. All of them have the same columns but there is one column in each of them with only the first 4 characters common. Is ...
1
vote
1answer
38 views

How do you use Windows folders as acrpy Parameters

I am having problems trying to perform simple folder management operations in an ArcGIS python toolbox. First here's some code snippets (I have left out all of the stuff that does not pertain to this ...
0
votes
0answers
27 views

google geocoding api usage restrictions and other free api options

I would like to use the google geocoding api to geocode a few thousand addresses. I understand the daily limit for a free account is 2,500. I want to retrieve the coordinates and then map them in ...
0
votes
0answers
17 views

Identifying Left and Right Mouse Button Clicks in PyQgis application

I am relatively new to PyQt. I am trying create a custom plugin for Qgis which enables the user to select some features by drawing polygon on the canvas using mouse clicks and then performs ...
0
votes
0answers
18 views

Can I mimic the “open” action with python and manipulate the field content used for the action?

I am using QGIS actions (type: "open") to link ECM searches to objects on the map. The basic syntax is very simple: protocol://searchterm1=[%"field1"%]&searchterm2=[%"field2"%] However, some ...
0
votes
0answers
21 views

Quick way to select by attribute and zoom to selection in QGIS

I need to visually control hundreds of points in a layer on top of aerial photographs. Using the attribute table, selecting (with column filter expression) and zooming manually is cumbersome - so I ...
0
votes
1answer
18 views

Batch Mosaic Rasters: arcpy.MosaicToNewRaster_management (ERROR 000628: Cannot set input into parameter coordinate_system_for_the_raster)

I am trying to batch mosaic rasters using arcpy.MosaicToNewRaster_management in arcpy: #This is for mosaicking a lot of rasters import arcpy from arcpy import env ...
0
votes
0answers
20 views

Importing tif image from PostgreSQL Database to webpage

I am trying to import tif images from PostgreSQL Database to my website. In the website, I need to make a button control which will open the images. I think I have to use Pyhton as a server side ...
4
votes
2answers
105 views

Advanced python labeling in ArcMap - working with null values

I'm trying to label certain features using a specific field (osm_name_58_en). However, when this field is null, I want to label the feature with (som_english_32_name). If both are null then I want ...
1
vote
1answer
25 views

Auto-update a feature class with Python + .csv?

I am hoping to find out how to automatically update a feature class. We have semi-regular updates to an ArcGIS Viewer for Flex website. Looks like a Python script may be the way to go about it (and I ...
2
votes
1answer
57 views

ArcMap 10.3 - Anything Python related causes crash to desktop

Problem: ArcMap crashes to desktop anytime I use a Python related function (Toolboxes, Field Calulator, Etc) How I got to this point: I was trying to gain some familiarity with Python programming ...
0
votes
0answers
41 views

How to create a Shapefile of a subset of input features in PyQGIS?

I'm having some trouble applying my Python skills to develop some scripts in PyQGIS. For me it's far simpler to write it in ArcPy, but then again I wouldn't get that much satisfaction after finishing ...
0
votes
1answer
26 views

QGIS Python Scripting permission denied

I've just started a Python Scripting tutorial on QGIS. The problem arrives right at the end, when I have to use this script: output_file = open('c:/Users/Ujaval/Desktop/airports.txt', 'w') for f in ...
3
votes
4answers
170 views

Removing first and third zeros of a fieldname in label expression

The fieldname only has three characters. I dont want to display zeros in the first and third values. example below. 010 = 1 100 = 10 01Y = 1Y 10Y = 10Y I have figured out how to strip out zeros ...
1
vote
0answers
25 views

GDAL equivalent to ArcGIS Union?

I have a single shapefile full of overlapping polygons. The ArcGIS Union tool will generate individual, non-overlapping polygons with that geometry. Is there a way to do this with GDAL/OGR or another ...
2
votes
2answers
65 views

Cutting a polygon out of another polygon with python [duplicate]

Licence: ArcEditor Version: ArcMap 10.0 i have some issues to separat my data with python. To illustrate the problem, i have simplifyed the data with figures. I want to cut the blue polygon ...
1
vote
0answers
12 views

Cloud and cloud shadow identification with MERIS

I am looking at MERIS images to use for marine applications (Chl-a. SPM) and would like to confidently remove cloud and cloud shadow pixels from the data. I have a few ideas: Using the blue band ...
0
votes
0answers
13 views

Create a list of affected tiles from polygon / Gridding a polygon

Given a projection, a zoom level, a grid definition and a coverage polygon - what is the easiest/fastest way to obtain a list of map tile indexes touched by the polygon? Are there any existing tools, ...
0
votes
1answer
34 views

Can't get the correct version of GDAL installed to use ReadAsArray without getting error in Python

Using the instructions here . . . https://pythongisandstuff.wordpress.com/2011/07/07/installing-gdal-and-ogr-for-python-on-windows/ I downloaded the following files: GDAL-1.11.1.win-amd64-py2.7.msi ...
3
votes
2answers
103 views

Python labeling expression using numeric field not working

I'm trying to label parcels from a shapefile in the Python expression below in ArcGIS 10.2. All parcels should be labeled with the last 8 characters of their [PARCEL_NUM], and parcels 10 acres or ...
0
votes
1answer
44 views

Problem with scripts and tools in ArcGIS 10.X [on hold]

I'm trying to figure out what is going on with my ArcGIS and how to fix it. What has happened: everything was ok, I had 10.3 prerelease installed and I was warking with it. I was writting my srcipt ...
0
votes
1answer
13 views

vector clip based on chronological value

I would like to know if there is any algorithm in python that can clip vector features according to the "date" value? To be more specific the newest date is the dominant value and clipping will start ...
1
vote
1answer
20 views

Multiply two lists of raster from two subfolder

I have two subfolders, which contains rasters for each country but which express different variables. I am trying to figure out a way to Loop a multiplication of each raster into a folder with its ...
0
votes
1answer
32 views

Convert DOY to mm-dd format [closed]

I have a problem with my date format. how can I convert day of year values to mm-dd format? For instance if my doy have a value of 161 this will be converted to 06-10 (June 10 for instance). And this ...
0
votes
0answers
13 views

Set polygon boarders to transparent in python

I am creating automated maps in ArcGIS with a similair Python Code which can be found here: Map automation to iterate through attribute table using ArcPy? I cannot find out on how to set the ...
2
votes
1answer
33 views

Qgis docking plugin - python

I need to create a dock plugin for QGIS using QT designer and Python. I've created a basic plugin in "plugin builder". Then I've changed the .ui so now I dont have standard QDialog box but a ...
1
vote
0answers
55 views

Connect to PostGIS database from Q GIS

I am having trouble connecting to a postgresql database hosed on my local host. I have gotten a python script to connect and connected through the command line, but for the life of me cant connect to ...
0
votes
0answers
25 views

Converting lat,lon & solar data in CSV to raster using Python?

I have a csv file with lat,lon and solar radiation data. I am trying to convert it to a grid/raster format so that it can be used with a raster population data set that is in ascii format. How can ...
0
votes
2answers
32 views

How do I change the color and trasnparency of a layer using arcpy?

I would like to create an arcpy script to change the color and transparency of a collection of layers. The color and transparency would be based on wildcards such as "_dog" or "_chicken". The layer ...
0
votes
0answers
24 views

Convert YYYYMMDD to YYYYJD in Python 2.7.5 [closed]

I'm trying to write a python script to convert a folder of .asc files (365 files for every year in different folders organized by year) that have the yearmonthdate in their filename to have the ...
6
votes
1answer
116 views

PostGIS polygon edge analysis (orientation, edge length)

I am rather new to the world of GIS and especially PostGIS, so please excuse me if the answer seems evident... I would like to do analysis on a number of buildings. One thing I am interested in is ...
-3
votes
0answers
21 views

Is Cokriging in Python to load into ArcGIS Desktop possible? [closed]

Is it possible to perform Co-Kriging Analysis in Python and load it in ArcGIS?
0
votes
1answer
39 views

UnicodeDecodeError: 'utf8' codec- arcpy

I work with arcmap 10.3 and python 2.7.8. I have more than 500 shapefiles that located in many folders and subFolders. All Sub Folders are located in one large directory. I try with arcpy to detect ...
0
votes
1answer
19 views

Query table names

I want to query a table in my postgis table named Seg_060_2009 using psycopg2 and cant seem to get my query to execute. The query will execute if I name the talbe layer. Are there restrictions on ...
3
votes
2answers
84 views

Field Calculator Script

I am looking to check how up-to-date a feature class is by using our latest parcel update. I am wanting to check "owner" field with "Owner_1"...I am using field calculator to grab the last name in ...
1
vote
1answer
26 views

How apply error messages to a python toolbox that prevent my tool from running with bad parameters?

This is a continuation of my question here: Point and Polyline I tried making this question easier to follow. My tool accepts two main parameters - a continuous centerline and a table (or a feature ...
0
votes
2answers
65 views

Create a script to add delimited text layer in QGIS

I'm trying to use QgsVectorLayer() function to add delimited text layer in QGIS. So I have a txt file (T_1999_1_2.txt) in path: "D:\PATRICIA\DOCUMENTOS\ESTACOES METEOROLOGICAS\DADOS METEOROLOGICOS\T" ...
-1
votes
1answer
30 views

I want to reclassify a raster in one folder, rename it and put it in new folder using Python

I've been combing stack exchange and I cannot figure it out. I have a raster "slope_tif_18TXK030910", I want to reclassify it, rename it and put it into a new folder. this is what I have and it works ...
0
votes
1answer
30 views

QGIS / Python: Fill new field with values based on other fields and lookup table

I am trying to use Python for QGIS to add values to new fields in an attribute table based on existing fields and values in a lookup table. Attribute table I wish to modify (with example rows): farm ...
1
vote
1answer
12 views

qgis script in external IDE fails [closed]

I'm new to Qgis. I have a script that runs successfully inside the Qgis editor, but it fails outside. It returns the alghelp, but fails on running the actual tool so it seems I have the external IDE ...
0
votes
1answer
32 views

How to do raster layer stack using QGIS processing? [closed]

I tried to do Layer stacking using QGIS processing with the following code import processing ...
2
votes
1answer
58 views

How to efficiently use a Postgres DB with Python

I have a Postgres DB with a lot of lines that are too long and so now I want to split those lines into smaller ones. This is why I started writing a little python script for that job. Basically it ...
0
votes
0answers
39 views

Printing layers with Python script and QGIS - refresh problem

I have got a series of layers to be printed (grouped by pair). I am using QgsComposerMap. I iterate over the groups to just show the layers of the current group, zoom to its extent et print it. ...
0
votes
1answer
31 views

How to convert date field value returned by REST API to correct date? [closed]

I performed a query on this USGS feature service of Airport locations: Click for query And the value for the field LOADDATE is: LOADDATE: 1411380301000 However, when I pull the layer into ArcMap, ...
2
votes
1answer
117 views

Using Python to select random location from shapefile?

I have multiple shapefiles with bars names and location attributes and I want to create a script which asks the user for the area or shapefile name where they want to go and then prints a random ...
0
votes
0answers
29 views

Making shapefile from Pandas dataframe?

I´d like to construct a shapefile from a Pandas Data Frame using the lon & lat rows. I have got a csv file and I process it with pandas to make a data frame which is easier to handle Is it ...
0
votes
0answers
19 views

Creating a field calculator function that can cast string to a percentage value in a related field?

I am having issues trying to create a field calculator function based on a coded domain string parameter combined with a numeric field to obtain a percentage output. The example in question is as ...
0
votes
0answers
17 views

Automatically export a schematic dataset to a file geodatabase

I'm working with ArcGIS Schematics on a schematic dataset with several diagrams which requires quite a lot of manual editing. Since during testing Schematics managed to utterly destroy the schematic ...
0
votes
1answer
20 views

Batch reclassifying rasters in folder using ArcPy?

I am very new to python. I am using ArcGIS 10.0. I am trying to batch reclassify rasters in a folder and put the outputs into the same folder but with a new name(trying to do this using outputPrefix). ...
-1
votes
1answer
17 views

Load multiple layers into multiple maps - python

import arcpy import arcpy.mapping import os import sys from arcpy import env #import string env.workspace = r"G:\GIS" mxds = arcpy.ListFiles("*.mxd") lyrs = arcpy.ListFiles("*.lyr") for maps in ...