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

learn more… | top users | synonyms

0
votes
0answers
20 views

Tool to create triangle buffer using Python in ArcGIS Desktop?

I want to make a tool to create triangle buffer by python script in ArcGIS, like circle buffer that we use it in ArcGIS Desktop? like this:
1
vote
1answer
42 views

Tool to delete all data from a shapefile

I am looking for a tool that deletes the data in the shapefile, and then copy and pastes all the features from a layer into the blank layer. We get updates to our layer from a separate organization, ...
2
votes
0answers
27 views

Overwriting layers in a geodatabase maintaining its position in a feature class list

I'm working with ArcGIS 10. I work on ecological habitat mapping. I have some features classes inside a geodatabase which represent years of data on a specific area. Each has a reliability field with ...
3
votes
1answer
36 views

specifying extent in GDAL's WriteArray

Is it possible to specify the extent when creating an empty raster in GDAL? I looked everywhere, but can't seem to find anything. The portion of my script where I write the raster would look something ...
2
votes
5answers
129 views

Field Calculator expression to replace string only if it occurs

I have two fields (STREET1 & AKA_STREET_TEST1). I'm having a problem creating a simple IF THEN Python statement in the Field Calculator box. I've been searching the threads for a similar ...
1
vote
2answers
40 views

Is it possible to toggle draft mode in ArcGIS with Python?

I'm curious if it is possible to toggle on and off 'draft mode' in layout view in ArcGIS using python scripting. Does anyone have any ideas? Python is preferred, but if there is another solution in a ...
1
vote
0answers
13 views

pymodis download issues

I'm trying to download and process MODIS imagery using pymodis. I have Python 2.7.8 (Spyder), numpy 1.9.1 and gdal 1.11.1. I've also installed WXPython. I originally tried to use the ...
0
votes
1answer
49 views

Python Scripting Error (Adding a Field)

I'm using this code as a python script tool in ArcGIS 10.1: import arcpy, os arcpy.env.workspace = r'W:\S&P\s&p techs\Emily\Errors.gdb' #Looping through dissolved feature classes, adding ...
0
votes
2answers
33 views

Field calculator to copy numeric values from other fields

FieldA contains text: both numeric(123) and alpha-numeric(123a, 2-3, 3/2, '). FieldB is longstring. I want to use field calculator and codeblock on FieldB to bring from Field A only the numeric ...
1
vote
2answers
48 views

How to add 2 layers in qgis and display them at the same time

I added 2 layers in qgis using python but only one layer is shown on canvas. After clicking (anywhere on the canvas) both layers are displayed. layer = ...
2
votes
1answer
27 views

How to plot trajectory points on maps in python

When I read the paper Characterizing Urban Landscapes using Geolocated Tweets, I'm attracted by the figures illustrated in it, like this: And I want to know how to plot these figures for my own ...
1
vote
0answers
28 views

Connect to QGIS 2.6 Python Plugin function via button on custom feature form

I am trying to connect to a QGIS 2.6 Python plugin function via a custom feature form button. On my feature form, I'm attempting to do a few things : enable the updateButton only if the ...
1
vote
1answer
19 views

QGIS 2.6 : Programmatically setting key value pairs for ValueMap widget

Using QGIS 2.6 and Python 2.7 on Windows 7, I am trying to programmatically insert key value pairs into a ValueMap widget via a csv file. Issue is that some of the values are properly inserted and ...
-1
votes
3answers
53 views

Batch Re-projection script syntax error

import arcpy ... sourceWorkspace = "C:\\Users\\tx8p90\\Desktop\\Lesson2" ... targetProjection = "C:\\Users\\tx8p90\\Desktop\\python excercise data\\Lesson1\\contourlines.shp" ... listDataSet = ...
1
vote
0answers
29 views

Difficulty with python package mgrs by Howard Butler

I am developing an app in python and I am trying to import Howard Butler's mgrs package. I am using setuptools to install the package. It does not find the setuptools library module. I have tried ...
1
vote
3answers
36 views

Raster calculator to create single raster with 4 values from two binary rasters

I have two binary rasters showing habitat suitability (0 = unsuitable, 1 = suitable) under current and future climate scenarios. I am trying to create a raster showing: 0 = cells that are not ...
0
votes
0answers
28 views

Restrict text widget to only integer between 0 and 999 in IntraMaps Roam

I have created a form and added an attribute as a Text widget in the Roam manager. Now I'm trying to restrict the input to be an integer between 0 and 999. I want the field to stay "empty" (or ...
0
votes
1answer
51 views

How to show the attribute table of selected features using arcpy?

Is there a way to show the attribute table of selected features using arcpy? Maybe in the mapping module? I would like to be able to select some features and then have an Add-In button that ...
1
vote
1answer
43 views

Load the raster image which is in TIF format using QGIS API

I am quite new inthe field of GIS. I am interested in is to load the raster image which is in TIF format using QGIS API I have followed the steps given the in the follwing link to load shape file ...
1
vote
1answer
26 views

How to reduce area boundaries resolution?

I managed to plot zip codes boundaries for an entire US state using ArcGIS data and python tools such as arcpy and Bokeh. The result: The dataset has high resolution area boundaries so, I have like ...
0
votes
1answer
23 views

equation solving by using python or model builder in arcmap 9.3

I want to solve one formula in arcmap 9.3 by using Python or Model builder. I have one shape file, in that there is in attribute table for field A & B Solve the formula: A*B/Sum(A). where Sum(A) ...
1
vote
1answer
19 views

Couldn't load plugin PRISM due an error when calling its classFactory() method in QGIS1.8 inWin8

When I load a plugin in QGIS ,met some problems : I had tried copy other Python27's files to QGIS's Python 27 file but it still does't work. Couldn't load plugin PRISM due an error when calling ...
2
votes
1answer
35 views

conditional python script to delete records

I am new to python programming. I am wondering if someone could tell me how to write a python script that would find all records in an attribute table that have identical values in one field, then ...
1
vote
2answers
42 views

How do I convert a GeoTiff's neatline metadata from vector format to pixels using GDAL?

I have a GeoTIFF that produces the following when run through gdalinfo: Driver: GTiff/GeoTIFF Files: PAA_1.tif Size is 14400, 6600 Coordinate System is: ...
3
votes
1answer
42 views

Cemetery Grave/Person Locator

I'm a mediocre to intermediate ArcGIS user. I have created several point shapefiles, one for each section of a national cemetery, roughly 200-600 points in each section in a grid. Attached to these ...
0
votes
0answers
27 views

Create polygons enclosing same number of points on PostGIS

I have a geodatabase on Postgis with points representing customers, what i need is give a number of customers, lets say 100 and it need to generate polygons enclosing 100 clients each one. I only ...
3
votes
1answer
45 views

Why the order of imports matters in a standalone PyQGIS processing script?

I've come across a weird issue while running standalone PyQGIS processing scripts. The order of imports in the script affects its normal execution. You can reproduce the problem by opening a Python ...
1
vote
1answer
59 views

Can we no longer reference an ArcMap layer to get the spatial reference?

I'm currently using ArcGIS 10.2.1. In previous custom geoprocessing tools, I've used the following code to create a feature class in-memory, and set the spatial reference using an existing layer in ...
1
vote
0answers
22 views

Trilateration using 3 x,y points and 3 distances, all in cm [on hold]

I want to find out the position (x,y) of a given point, knowing the distance from 3 x,y points. Below you can view the x,y coordinates and their given distances in cm. B1x = 795 B1y = 332 B1d = ...
0
votes
0answers
14 views

Adding features to rtree using multiple generators

I am using the Python Rtree library http://toblerity.org/rtree/ I know you can supply a generator function to the Index/Rtree constructor to insert features. How can I add features to an existing ...
0
votes
0answers
29 views

Batch Georeferencing in arcGIS 10.1.2 [duplicate]

I work for a government utility company. Our maps are broken down into 500x500 square meter grids. We have scanned images (TIFF) of these maps that we need to overlay and digize. The maps and the ...
0
votes
0answers
10 views

Loading Oracle Spatial Layers in standalone python qgis

I used below script to connect to postgres and load layers successfully.I want to aceive this using Oracle Spatial for both vector and raster loading.How can I achieve that?In other words what is the ...
1
vote
1answer
36 views

Write GeoJson into a .geojson file with Python

I want to write a geosjon object with the type <class 'geojson.feature.Feature'> into a .geosjon file. Therefore I tried to use with open(test.geosjon, 'w') as outfile: ...
1
vote
2answers
22 views

How can I disable logs being created in standalone python script?

When I run the following script in QGIS 2.6.1, it produces a folder called 'processing', which contains a log, in the directory it reads files from. And since the script reads files from several ...
0
votes
1answer
23 views

Add multiple GDB files in subdirectories to mxd using python

I have GDB files located in many sub-Folders and sub-sub-Folders. All Sub Folders are located in one large directory i asked it for layer file in Add multiple Layer files in subdirectories to mxd ...
0
votes
2answers
32 views

Python column checker-comparing 2 fields

One problem I am having is the following: I want to create an automatic program to see how well the automozation has been with comparing the results of 2 columns to each other in the same column. In ...
1
vote
1answer
19 views

Debugging ArcPy ImportToolBox AttributeError: Object: Tool or environment <ConcatenateRowValues_AA> not found?

First post here. I am trying to use the ConcatenateRowValues tool provided by ESRI. My overall code for my script is working fine except when it tries to use the ConcantenateRowValues Tool. I start ...
0
votes
0answers
29 views

Python scripting error (merge)

I've been trying to use this code to add a field to, merge, and sort multiple feature classes: import arcpy, os arcpy.env.workspace = r'W:\S&P\s&p ...
2
votes
1answer
45 views

How to get shapefile extent from standalone script?

I am trying to obtain the extent of a polygon in a shapefile. I am running a standalone script which will create a grid based on the extent of the polygon. I have tried 2 methods: one from the ...
0
votes
1answer
27 views

Merging multiple feature classes into one using Python

So I have feature classes from an ArcGIS database that I renamed using this Python code: But now I have to merge all the feature classes that are output from this into one feature class named ...
3
votes
1answer
31 views

How to add a column/feature with PyQGIS 2.x?

I'm using PyQgis 2.2 and I'm creating a plugin. I want to add one feature/column to a shapefile. But I get error.. I've tried to do this as it's shown in Cookbook: if caps & ...
1
vote
1answer
44 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
52 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
22 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
161 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
9 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 ...