Questions tagged [python]

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

Filter by
Sorted by
Tagged with
5
votes
3answers
2k views

Add 3rd party repositories button not in version 1.8.0 Lisboa

The available manuals and other help sources all refer to the 'Add 3rd Party Repositories button' in Plugins>Fetch Python Plugins and then the Repositories Tab. My problem is that the installation of ...
7
votes
2answers
7k views

How to create reports in ArcGIS using Python?

Does anyone have experience in creating reports from your ArcGIS data (geodatabase, map exports) using a python reporting engine? In my current project, we are using Jasper Reports in the following ...
3
votes
1answer
3k views

How to implement signals on add or modify feature?

I've created a test plug-in in QGIS successfully, but have had a hard time implementing a signal on a vector layer event (add or modify feature). I've add this to my initGUI method: QObject.connect(...
10
votes
1answer
2k views

How to visualize azimuthal data with uncertainties?

I am trying to make a figure showing azimuthal data with a different range of uncertainties at each point. This oldschool figure from a 1991 paper captures the "bowtie plot" idea that I'm aiming for: ...
1
vote
1answer
2k views

Installing module in embedded Python in QGIS

I'm a newbie to Quantum GIS and Python. I'm using QGIS on a Windows platform. How can I install module for Python embedded in QGIS and how can I run embedded Python from windows directly?
5
votes
1answer
1k views

raster algebra in python with rasters of different extents

I am trying to find out how to use GDAL & numpy modules to average a set of rasters....which are Sigma0 values from satellite passes at different times within a year. Each raster has been ...
7
votes
1answer
862 views

Arcpy crashes in loop geoprocessing (general behaviour)

I have several standalone scripts that create a list of shapefiles to process (or coverages in one of the scripts). Sometimes my script crashes after it processes three files, sometimes ten, ...
2
votes
2answers
2k views

Script to extract UTM Zone using Range and Meridian information

I am looking for a python or php script that will accept the Range and Meridian values of a location and use it to identify the UTM zone. I have a table that comprises of Easting, Northing, Range and ...
2
votes
3answers
3k views

An error has occured while executing Python code while doing home range analysis (Qgis 1.8.0)

It keeps appearing: Traceback (most recent call last): File "C:/Users/Worten/.qgis//python/plugins\HomeRange_plugin\HRplugin_dialog.py", line 80, in QObject.connect(self.buttonBox, SIGNAL("...
2
votes
2answers
613 views

Using osgeo modules in ArcGIS10.1 and QGIS 1.8 python shells

This is related to an old question of mine - Issues with osgeo - qgis.core and arcpy modules Now in new versions of all the software QGIS Lisboa (1.8), ArcGIS 10.1 and pyScripter 2.5.3. They all use ...
5
votes
2answers
3k views

arcpy.UpdateCursor for multiple fields

I've hit a wall trying to loop through multiple fields with arcpy.UpdateCursor. I have a list of files (2) with multiple fields (10-15'ish) that have its own error check in SQL, and an error value to ...
3
votes
1answer
534 views

ArcMap 10.1 Python split inconsistent string

I converted a kml file to a feature class. All of the fields from the kml were combined into two fields in the feature class. One of them contains information delimited by "/" and the other contains ...
3
votes
3answers
3k views

Couldn't load SIP Module

After reinstalling QGIS, the desktop program runs but generates the python error "Couldn't load SIP Module Pythin support will be disabled" Because of this error, no plug-ins will load. I found a ...
2
votes
1answer
1k views

Write spatial operations to PostGIS from QGIS or ArcGIS

I need to write my spatial operations to a (new) postgis layer (as the data is to large for a shp file). Can this be done in the QGIS browser or from ArcGIS without SDE? When you go (for example) --> ...
10
votes
3answers
14k views

Obtaining the data of one selected feature in QGIS using Python?

I have a problem/question regarding python and QGIS. Is it possible to get the data of one selected feature in QGIS using python, and if so how? In my example I have a layer which shows some parcels ...
10
votes
1answer
6k views

When iterating over a vector layer with pyqgis, how do I check whether a feature is selected?

While iterating over a vector layer using the following code (summerized from the example in the pyqgis cookbook), is there a way to check whether a feature is selected? provider = vlayer....
1
vote
1answer
405 views

How to store AutoCAD data in ArcSDE database?

Does anyone have an idea how i can create a database instance on my ArcSDE geodatabase to store my .dwg files? I have over 1 million of these files and would be happy to automatically extract and ...
3
votes
1answer
1k views

Calculate bounding box + buffer for rendering a map tile with mapnik library

Mapnik library has a Projection object (I'm using Python bindings): spherical_mercator = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +...
3
votes
1answer
2k views

GeoDjango Changing My Coordinates

I'm running into a problem when saving a coordinate into one of my models in (Geo)Django. My point field is setup as: location = PointField(blank=True, null = True) So while running some tests in ...
2
votes
0answers
68 views

How do I make a path cross the most possible classes in a raster?

I want to create a function and possibly use Arcmap tools to create something similar to Cost Path. Instead of just choosing the LCP, it must cross through the most different integers. Let's say I ...
15
votes
4answers
9k views

Smoothing/reinterpolating raster with GDAL?

Short: I want to change the resolution of a raster and smooth the gray ramp like shown in the images bellow. The preference is to use GDAL, PIL or Numpy. Description: I'm kriging points into rasters ...
10
votes
2answers
2k views

How to catch PostgreSQL/PostGIS errors in GDAL/OGR Python bindings?

Is it possible to catch PostgreSQL output error messages in OGR after a query has failed? For example conn.ExecuteSQL('SELECT * FROM non_existing_table;') In Postgres this returns an error message: ...
1
vote
1answer
400 views

How to integrate external image processing programs within ModelBuilder

I want to use python libraries to do image processing for very large files (over 2GB), but the current python libraries can not read 16 or 32 bit image correctly. At least, I tried Python Image ...
5
votes
1answer
322 views

How to automatically place parcels on suitability map?

I need to make a map that randomly places parcels (groups of pixels or polygons) on a suitability map by first filling the most suitable areas, then the next most suitable and so on, until a pre-...
12
votes
1answer
2k views

Is there a way to properly have GDAL raise exceptions in Python?

I am working with GDAL in Python and have wanted to get GDAL to raise exceptions so that I can do something useful with them. For instance if a file cannot be opened with gdal.Open() I would like to ...
3
votes
4answers
2k views

Arcpy: Calculate new field from user input and existing data

Can't seem to figure out what is wrong with this create fields from a calculation. The code creates the new field in the shapefile as selected by the user but I keep getting a 9999 error on every ...
1
vote
1answer
1k views

Is getting wrong attribute values from a feature in qgis

I make two polylines features(in my example both consists of two points) with the add feature tool. Then I (with code) add some attribute values on the first feature, then changes the geometry of the ...
0
votes
1answer
787 views

Can't find `mapproxy-util` after MapProxy installation

I'm trying to install MapProxy on a Windows machine. My hope is that I can install it and test it on my own computer before moving it to a server. At the moment I can't seem to find mapproxy-util and ...
5
votes
3answers
2k views

Checking for number of shapefiles in directory using Python?

I want to test: to see whether or not ONE AND ONLY ONE shapefile (which will be based on a filename wildcard) exists in a directory. Add these shapefiles to a list Use this list variable as an ...
2
votes
0answers
281 views

produce images with shapefiles and OpenStreetMap

I have a python file http://pastebin.com/jzwE6c6P which iterates over the features of a shapefile and renders a simple image by zooming to the bounding box of each feature. What I need is ...
2
votes
0answers
187 views

Why would an ArcGIS 10 Python custom tool fail without throwing a “failed to execute” or “completed script” message at the end?

I have written a custom tool in Python for ArcGIS that converts in batch SHP files to GML files. It processes one file at a time in a folder, file, or ZIP file and then moves on to the next. If the ...
1
vote
2answers
512 views

Python syntax error…cannot see the error!

I'm very new to python and have created a script for enabling a user to list file types in a workspace making use of the parameters function in ArcGIS so it's more user friendly. However I cannot get ...
4
votes
1answer
3k views

Pass a variable from Modelbuilder into a Python script

I'm new to modelbuilder and python. I have used modelbuilder to iterate through all rows in a shapefile (Points), process them, and produce a seperate output shapefile for each row. The filename is ...
5
votes
1answer
1k views

ogr2ogr when importing from file geodatabase and using in Python?

I want import data from my GDB to PostGIS. It works fine on some datasets (all records -data- is imported or nothing is imported) from a gdb but just doesn't import others. I can't find any ...
0
votes
1answer
202 views

Qgis - Running SDA4PP [duplicate]

Possible Duplicate: How to install SDA4PP plugin for Kriging in QGIS? I'm trying to use the SDA4PP plug-in for QGIS but it doesn't work. The software says to me that I need the rpy2 plugin for ...
3
votes
1answer
752 views

Python: shp file to GML using OGR

I am trying to convert a shapefile to GML 3.1.1 . I am using gdal 1.9.1 however the GML conversion it generates for a geometry feature is GML 2 and it also swaps the long/latitude coordinates. Are ...
5
votes
5answers
6k views

Exporting list of Feature Classes to CSV using ArcPy and Python?

I am successfully using the follow script import arcpy from arcpy import env import os env.workspace = ("WORKSPACE") fcList = arcpy.ListFeatureClasses() print fcList to export feature class names ...
2
votes
1answer
746 views

How to implent a “maketrans” python function on field calculator

i'm traying to implent python string translate function at field calculatore http://www.tutorialspoint.com/python/string_translate.htm in order to fix hebrew imported from cad. here is the code - def ...
7
votes
6answers
6k views

Visualization of satellite image - directly in Python

Is there any way (a package or what not), to visualize a GeoTIFF image directly in Python? I don't want to use ENVI or ArcGIS or anything else.
3
votes
1answer
519 views

Need help translating small code block from VBA to Python

I need help from someone to translate a small piece of code from VBA to Python, due to the fact that the company I am working for has upgraded from ArcGIS 9.3.1 to 10.0 and VBA is no longer supported. ...
3
votes
3answers
2k views

arcpy.Exists not working within standalone script

I have the following code. I want to see if a layer name exists within a map document, not if the shapefile exists in the directory. If I copy paste into the python window within ArcMap works fine. IE....
10
votes
4answers
11k views

Getting elevation at lat/long from raster using python?

I was wondering if anyone has some experience in getting elevation data from a raster without using ArcGIS, but rather get the information as a python list or dict? I get my XY data as a list of ...
6
votes
2answers
2k views

rpy2 installation on Mac OSX. A still unresolved problem on StackExchange and rpy-list [closed]

following lgautier's advice on rpy2 installation on Mac OSX, I posted my request on rpy-list and got in touch with Yair Benita who said he could only install rpy2 through his default Mac OS X python ...
3
votes
1answer
391 views

How to manipulate OpenStreetMap schema to be useful in ArcGIS applications?

I have a shapefile of OSM data. I plan to use the data for an ArcGIS Engine application, and I was wondering if there are any existing solutions to getting the data's schema into your typical GIS ...
9
votes
2answers
1k views

Generate near table for x number of neighbours using arcpy

There are 3 likely scenerios that I am trying to capture near distances for: An interchange subway station, which has 2 or more neighboring stations. That is, the station in question connects 2 or ...
30
votes
9answers
3k views

Value of a Python programming course

I am considering upping my programming skills by taking a python geoprocessing course through ESRI. Before I part with the hefty registration fee, I would like to get your opinion on the value of 24 ...
8
votes
3answers
628 views

Using ESRI geoprocessing services from a non-ESRI client (Python)?

I'm thinking it should be possible to consume an ESRI Geoprocessing service from a python script without invoking ArcPy or needing an ESRI installation on the client machine. For example I create a ...
4
votes
1answer
4k views

Add multiple fields in attribute table

How do I add in multiple fields in the attribute table? In the attribute table I have crop types such as corn, cotton, sorghum....etc (as shown image below), in square meters. I want to generate new ...
0
votes
1answer
2k views

SImple model works, resulting script doesn't

The goal is to convert an XY layer (from Excel) into a feature class. The "MakeXY" portion works flawlessly, the arcpy.FeatureClassToFeatureClass_conversion portion inevitably returns a 999999 "Table ...
3
votes
2answers
6k views

How should I go about calculating the centroid of several lat long points in python, and perl?

Calculating the centroid several time on a number of geographical points. I was wonder is there a perl or python module that could make my life easier when working with large datasets of lat long ...

1
160 161
162
163 164
173