A version of the Python programming language

learn more… | top users | synonyms

0
votes
0answers
61 views

GRASS module g.mapset can't create new mapsets from outside

I use pyscripter to control GRASS from outside. I want to create a new mapset named water. Here's my script to generate new mapset, import os import sys #set up GRASS environment variables ...
1
vote
0answers
47 views

Error in cliping raster with multifeature polygon shape with arcgis9.3 using python

I have raster and I have a multifeatured polygonshape file. I Need to Clip my raster Image. Python code was developed for arcgis 9.3. It was working before and suddenly it stoped working. my codes is: ...
1
vote
1answer
42 views

Extract information of a raster overlayed on another raster with a lower resolution directly in python

I have two aligned rasters with the same extent, one has a resolution of 5 meters and the other of 125 meters. I would like to place the 5 meter one over the 125 meter one and assign to these smaller ...
0
votes
0answers
42 views

Python Error in recognising ENVI file

I am trying to read a .bip AVIRIS file using GDAL in Python. here is the code: from osgeo import gdal from osgeo import ogr from osgeo import osr from osgeo import gdal_array from osgeo.gdalconst ...
1
vote
2answers
160 views

Why my python script of r.watershed has no output?

I type those code in pyscripter, import os import sys #set up GRASS environment variables sys.path.append(os.path.join(os.environ['GISBASE'], 'etc', 'python')) import grass.script as g import ...
0
votes
1answer
34 views

Better ways to check if GRASS r.water.outlet works out fine output

I use my python script to call GRASS module r.water.outlet from outside, and here's my script(I perform this script in pyscripter): import os import sys #set up GRASS environment variables ...
0
votes
1answer
27 views

How to map factors and their relative importance in ArcGIS 10.1 for Desktop?

I want to know how I can calculate a map from a set of factors (in the form of raster layers) and Their relative importance for example: slope 20% lithology 10% . . .
1
vote
2answers
63 views

arcpy 10.0 iterate through shapefile1 clip shapefile2 to shapefile1's polygons

I know that this question has been answered several times before, but for some reason I cant get this script to run...So I was hoping someone could point out where Im going wrong. I have 2 ...
2
votes
1answer
127 views

Field Calculator: return two or more field value

I trying to return three field values in same If Statment and conecate them, but i Get NULL value insted of the conecated fields getClass (!InDiameter! , !OutDiameter! , !TheridDiameter!, ...
0
votes
1answer
47 views

Difference between python IDLE and eclipse on accessing GRASS

I have seen these posts:GRASS and Python, Using Eclipse to develop GRASS Python programs. I used to use python IDLE to control GRASS, but I can't make python and GRASS connected, as I described in ...
0
votes
1answer
175 views

SyntaxError: invalid syntax (<string>) in Pl/Python (PostgreSQL) [closed]

I have python 2.7 and I have weather script which returns temperature infos, I would like to implement this script into PostgreSQL. I always got this error: DETAIL: SyntaxError: invalid syntax ...
0
votes
1answer
307 views

AttributeError: 'module' object has no attribute 'Open'

Hy, I am running the following code which I found on: GDAL - Perform Simple Least Cost Path Analysis which I adapted to my case, but I get the following error when running the code in the python ...
1
vote
1answer
29 views

How to Select by Location and assign attributes using Python?

I have a polygon layer with a 'lot' field, and a points layer. How can I use python to select the points by location (to find what points are contained in what polygons) and assign the value in the ...
0
votes
0answers
39 views

Suggestions on how to create an Owner Index for a Plat Book?

I've been tasked with creating a county wide plat book for publication this june. The cartography portion is fairly straightforward as I am using ESRI's Data Driven pages for ArcInfo 10 to produce the ...
1
vote
1answer
97 views

Is it possible to run qgis through python?

I need to build an app to analyze some raster layers in qgis. I thought it was possible to just write code in python (2.7.6) (IDLE) and let it automatically open QGIS, load some layers, do a distance ...
0
votes
0answers
23 views

Reload Table Cache with Python & ArcGIS 10.1 [duplicate]

I am trying to create a button in arcmap that reloads the table cache. Exactly, like the existing button Table Options > Reload Cache. The button is inside when you open an attribute table. I would ...
2
votes
2answers
73 views

python add fields that may have NULL values

I would like to use python to calculate a field (short integer) using other fields (short integer) present in the table. In some cases these fields may have NULL values for one or more of the fields. ...
3
votes
0answers
82 views

How to extract zipped shapefile and check its shape type using arcpy module without writing on disk

I have a zipped shapefile saved on my disk. I want to extract it in memory and check the shape type. I'm using arcpy module and want to stick to only default modules comes with python installation. I ...
0
votes
0answers
19 views

random point through raster

I've some issue in some task pls help if you can as I've not good python skills. I've a raster with values from 5 to 97 and I want a python script which can scan the raster and generate random points ...
1
vote
1answer
106 views

python dissolve by field error

I would like to dissolve a feature class by a field. When I run the code, I receive an error that says, "invalid topology [out of memory]" I have 16GB of RAM and terabytes available on the hard drive. ...
1
vote
2answers
32 views

Comparing projections of two datasets when SRID not available

Similar to this question: How to test if two GDAL datasets are in the same projection? However, the above does not cover cases where an SRID is not available. It can often be the case that an SRID is ...
5
votes
1answer
316 views

How to do a separate Python installation with ArcGIS?

I see a lot of threads asking how you can have a separate Python installation (e.g. the Anaconda or Python XY distribution) and get it to work with arcpy, while not 'breaking' ArcGIS at the same time. ...
0
votes
1answer
171 views

Plotting 3D Data using Python

I have a Uniform Grid of 1KMx1KM squares as a shapefile with population data in each grid in a specific column as an integer. I would like to extrude each polygon based on the population and export ...
1
vote
1answer
504 views

What might cause “python.exe has stopped working” when closing ArcPy script?

I created a script that take a .tab file and join it to a shapefile. The script works perfectly but when it finish, it gives me an unhandled exception which crashes python. I dont know what might be ...
3
votes
3answers
348 views

Sqlite, Python 2.7 and Spatialite

I am trying to spatially enable my sqlite database: import sqlite3 db = r'c:\temp\mydata.sqlite' conn = sqlite3.connect(db) conn.enable_load_extension(True) cur = conn.cursor() cur.execute(r"SELECT ...
-2
votes
1answer
77 views

How to create a link in the message body of email with Python? [closed]

I want to send an email with python that contains as a link in the body of an email as well. This link is actually a path to a file. If a receiver clicks on link It should open a folder where the file ...
1
vote
3answers
149 views

Append Attribute Table of multiple feature class with same points/ pointID

I used extract by points function to extract values from multiple rasters using a point feature class. The output is a couple hundred point feature classes with values associated with those rasters. ...
0
votes
0answers
76 views

Missing pyexpat on QGIS 2.0.1: pyuic4 fails

I have encountered a problem when trying to develop a custom plugin for QGIS 2.0.1 (Python 2.7.5 with two additional Python installations on the same machine). When I try to compile the UI file ...
2
votes
2answers
361 views

Automatically download Modis image using python script

I need download Modis imagery automatically from the website: https://earthdata.nasa.gov/. I found this link: http://gis-techniques.blogspot.com/2010/06/getting-modis-image-automatically-from.html ...
3
votes
1answer
143 views

Can folder connection in ArcMap Catalog window be added using python?

I have created a set of general scripting tools for map automation etc. in one of my tools a geodatabase is created in the workspace folder the script points to. Just out of curiosity is there any way ...
4
votes
1answer
354 views

Issue on using Pyscripter with ArcGIS 10.2

Can someone please let me know how I can set the Pyscripter 2.5.3.0 x64 works with Python 2.7.3 which comes with ArcGIS? what I did was: 1- I installed the ArcGIS 10.2 2- I installed Pyscripter ...
0
votes
1answer
108 views

Copying Network Analysis Layer - Service Area Polygon in Python Script

I have built a geoprocessing tool using arcpy modules in python. Screenshot shown below: In this tool I am creating Service Area Polygons and selecting census boundaries within those Service Area ...
1
vote
2answers
120 views

How to Project a point on feature in PyQgis?

In Arcgis IProximityOperator.QueryNearestPoint Method was available to get the nearest point. Similarly Is there any function available in pyQgis? Thanks in Advance.
3
votes
1answer
140 views

Using update cursor in a while loop to perform analysis on individual polygons gets stuck on first row

I am working through an open courseware project from PSU found at https://www.e-education.psu.edu/geog485/node/145 I am trying to use an update cursor in a while loop to perform an analysis on ...
4
votes
0answers
80 views

How can I create a form so the user has to be authenticated to access a project?

I have a login form in QGIS and when it is loaded, python gives me an error for, apparently, not recognizing the findchild part. This is due to the fact that the form isn't loaded before the script is ...
1
vote
1answer
98 views

3D roof polygon creation from polylines in ARCGIS 10.1

I am Working in arcgis 10.1,I would like to create roof polygons from lines, the lines are captured with photogrammetry technique. As per my requirement I have found tool "3D Building Generator ...
1
vote
0answers
126 views

Why do I get different results running a script in PyWin and loading it to the Python shell in ArcGIS? [closed]

I've been trying to teach myself Python scripting for ArcGIS and have gotten frustrated on multiple occasions when I try to debug my script endlessly, only to later find out that it actually works ...
0
votes
2answers
51 views

How to use coding for auto-comparing two different fields in ArcGIS for Desktop?

I want to compare two group fields in attribute table, which are related to the name of villages. The name of these villages (in both field) are the same but they have in some cases differentiation ...
1
vote
0answers
77 views

Why does Describe function fail on annotation layer with RuntimeError: Object: Describe input value is not valid type?

I am accessing layers in an mxd programatically and also accessing the layer properties using the Describe function lyr =arcpy.mapping.ListLayers(mxd) # gets me the list of layers in mxd desc= ...
4
votes
1answer
200 views

Why does ArcGIS 10.1 Upgrade Geodatabase tool throw ERROR 999999: Error executing function?

I am trying to upgrade File Geodatabases using a Python script that runs fine until the step where it runs the Upgrade Geodatabase tool. The error is: "ERROR 999999: Error executing ...
2
votes
1answer
59 views

ArcGIS 10.1 Upgrade Geodatabase Check Version

Hi I am trying to check the version of filegeodatabase before upgrading to 10.1, I have a list of file geodatabases and some of them are already in 10.1. Can anyone suggest me how to update only those ...
2
votes
1answer
297 views

Python getting area of multipart features with SearchCursor()

I am tasked with programatically getting the area of each individual part of a multi-part feature. I have a script already to read each individual part and print its XY coordinates and it works fine ...
0
votes
1answer
56 views

populating one field value based on another field value

I have a feature class in a personal geodatabase with 2 fields. They both have domains set up to ease the editing process for my users. If my WaterType field is set as "Not Irrigated" (or code 4) then ...
2
votes
1answer
230 views

pyQgis in stand alone script, vector loading error

I am trying to use the Qgis functions in a stand alone Python script. I m running Mountain Lion OS, 2.7 Python & the Qgis 2.0.1 Dufour. My main problem is that I cannot get started - I cannot ...
0
votes
1answer
104 views

GDAL command lines on windows [duplicate]

I am trying to get started with GDAL on a windows machine using Python2.7. I have tried commands such as: gdalinfo RasterFileName.TIF and gdal_translate.py -projwin ulx uly lrx lry -of GTiff ...
1
vote
1answer
98 views

Fiona: won't install in Debian7.x-64bits/Python2.7

I need to install Fiona in my Debian7.x-64bits/Python2.7 machine. I already installed GDAL/OGR, pip, virtualenv, and six. I am using Python 2.7 so argparse is also installed. The installation protocol ...
-2
votes
1answer
110 views

“Open Source Routing Machine” querying and parsing

What I have in Python: import requests url_osrm = 'http://router.project-osrm.org/viaroute?loc=50.12345,8.12345&loc=50.23456,8.23456' print url_osrm proxies = {"http": "http://YOUR-PROXY:8080"} ...
0
votes
0answers
91 views

SOLVED: “Open Source Routing Machine” works with browser but not with Python

What I have in Python: import requests url_osrm = 'http://router.project-osrm.org/viaroute?loc=50.12345,8.12345&loc=50.23456,8.23456' print url_osrm osrm = requests.get(url_osrm) # print ...
2
votes
1answer
43 views

How to determine if a raster has rowattributes?

I have a raster file which is the result of extract by mask geoprocessing tool. If it has no rows then I take it as no overlap between input raster and shapefile. Following is the way I am reading it ...
4
votes
1answer
90 views

ArcGIS 10.1 Anyway to make a script tool run immediatly upon opening

I have a script tool that creates an ArcSDE connection folder and copies data from the server to a new folder on the users computer. The tool has no parameters runs fine but when you open the tool it ...