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

learn more… | top users | synonyms

1
vote
1answer
505 views

How to drop ArcSDE connection using Python scripting?

I want to be able to control connections to ArcSDE via python. Here is my script so far using ESRI's example. import arcpy from arcpy import env env.workspace = r"SDEConnection" fcList = ...
1
vote
2answers
314 views

Cannot get arcpy.MosiacToNewRaster to work with list

Below I have a snippet of a much larger code that I cannot get to work and I am not sure why. It seems that I always have trouble using arcpy functions with rasters. Can anyone help me get this code ...
1
vote
1answer
241 views

Setting Script Tool Parameters Using Python and ArcGIS 9.3.1

Can't quite figure this out and i'm sure it's a simple fix. I have a script that utilizes the AGSSOM tool. It first stops all published services, allows for databases to be tidied up by ...
1
vote
1answer
243 views

Grid labels in ArcGIS, overlapping issues

I do have 3 grids made by Grids menu in data frame properties. I do need them to display in certain layout and also to behave accordingly to couple of rules (overlapping issues), so I can automate my ...
1
vote
1answer
364 views

installing module in embeded python in qgis

I'm newbie to Quantum GIS and Python. I'm using QGIS in windows platform. How I can install module for python embedded in QGIS? Also, how can I run embedded python from windows directly? Thanks
1
vote
1answer
350 views

ReportLab integration into QGIS returns error message “no module named reportlab”

I want to use ReportLab in my own plugin which I have written for QGIS. I have installed ReportLab for the python versions 2.4, 2.5 and 2.6. The package is respectively installed into the ...
1
vote
2answers
806 views

Arcpy Error in adding input field to field map

hi guys i m doing a script in Arcgis i m new to this, i have to append some field from a table to another, i did this script in python but i have a problem when it want make the Mapping field with a ...
1
vote
1answer
118 views

Selection on Feature layer (geoprocessing)

I have a feature layers with states and counties fields. I want to make a selection tool. Tool dialog should have input for feature layer and two drop downboxes for states and counties. When user ...
1
vote
1answer
557 views

Applying layer file not formating labels in ARCGIS 10

I'm applying layer files in ARCGIS 10 using the ApplySymbologyFromLayer_management command via a python script tool. The symbology part works fine but the lables are not formatting. It is my ...
1
vote
2answers
175 views

Toggle editing option in plugins

I am working on python plugins for QGIS.I developed the plugins same as RT SQL LAYER plugins. When we draw the layers using query builder of "Add Postgis Layer" option,toggle editing option is ...
1
vote
1answer
81 views

Filegeodatabase fanout and Python problem

I have fme wb which does fanout with gdb. It means that in the end as output sets of data I get few new created gdb. But If I start this fme wb within python script It does not do fanout. Just write ...
1
vote
1answer
222 views

Using Python in Arcmap to partition strings [closed]

I have a title "Text that remains Proposed Thing to replace" var_a = New Text I want the output to be "Text that remains Proposed New text" Currently outputs this "(u'Text that ...
1
vote
3answers
919 views

How to connect the selectionChanged signal with pyqt?

Hi I am developing a plugin for Qgis in python, I need to connect the sselectionChanged signal emitted when a feature of the layer is selected, I could not find any examples on internet, here is what ...
1
vote
3answers
2k views

Error when creating insert cursor in arcpy

I've written several scripts that copy data from MS Access db into a new, empty ESRI Geodatabase. I've pretty much copied the code and changed it for each table -- the first two scripts have worked ...
1
vote
1answer
980 views

How to create multipart line and polygon with interior ring in ArcGIS Python?

My objective is to swap X,Y coordinates of feature classes using Python and arcgisscripting. Based on help examples, I managed to write script which reads and writes all geometry types. The problem ...
1
vote
1answer
448 views

Administrative level and coordinates from Yahoo GeoPlanet WOEID

The Yahoo GeoPlanet data can be freely downloaded from: http://developer.yahoo.com/geo/geoplanet/data/. If I understand it correctly, each WOEID corresponds to a unique location on earth, with ...
1
vote
1answer
419 views

Passing parameters to PostGIS SQL queries in Python: weird behaviour

The following code always goes to the except section and I do not understand why..Any help would be much appreciated. l = None c = conn.cursor() try: s = "SELECT ST_NPoints(ST_GeomFromText(%s))" ...
1
vote
1answer
6k views

Python :ImportError: DLL load failed: The specified module could not be found

I am working on Python plugins for QGIS. I set my variables as PATH :=C:\OSGeo4W\apps\qgis;%PATH% PYTHONPATH:=C:\OSGeo4W\apps\qgis\python But when I try to run my .py file in IDLE I get an error ...
1
vote
1answer
226 views

GDAL Tiling, Missing Tiles

i have used gdal2tiles.py for tiling about 100 tiff tiles which i have generated virtual dataset with gdalbuildvrt for my 1:250.000 scaled maps... everything goes well from 15 to 11, but when it ...
1
vote
2answers
471 views

Python Mapscript 6.0.1 layer.getShape API

I am attempting to follow the mapscript example described here - http://trac.osgeo.org/mapserver/wiki/RasterQuery but ran into some trouble with s = layer.getShape(result.shapeindex, ...
1
vote
2answers
600 views

Join/Relate in ArcGIS 9.3.1 ArcEditor through a python script - is it possible?

I'm working on a ArcGIS 9.3.1 ArcEditor and I want to write a python script that will do a Join or Relate. Problem is, that join table\join field are restricted to ARCINFO (higher license), and relate ...
1
vote
1answer
495 views

Win7 GRASS 7 & i.landsat.toar

Hello has anyone got experience running i.landsat.toar ? The output files I get are empty, the command takes but a moment to complete. However when run in verbose mode all the calculations are done, ...
1
vote
2answers
2k views

How do I programmatically update/recreate an ArcSDE feature class from external sql data?

I have an ArcSDE feature class that contains project points based on xy data from an external SQL databaes. (Not a geodb). I am looking for the best way to "recreate" the ArcSDE feature class from the ...
1
vote
1answer
289 views

Can you access ArcScan from a python script?

I'm using a python script with ArcPy in ArcGIS 10, and want to access some ArcScan functions. Is this possible? I can't see anything in the documentation about it, but I can't really find any very ...
1
vote
2answers
527 views

ArcObjects table views or sqlite3 in Python?

Given a larger csv (1000+ points) with attributes, I need to do both attrbute and spatial queries on the data. Would it be faster to read the points into an xy feature class, and do the spatial and ...
1
vote
1answer
21 views

Couldn't load SIP module (QGIS doesn't load Python)

I recently installed QGIS 2.4, but Python does not load. I am running on a Windows 64 bit machine. I receive the error message "Couldn't load SIP module Python support will be disabled". Traceback ...
1
vote
1answer
84 views

How does one modify selected geometry with a function in qgis python console?

My example use-case is that I want to redistribute vertices along lines as in: Redistribute linestring vertices to specified distance How to create points in a specified distance along the line in ...
1
vote
1answer
36 views

Import arcpy using PyScripter or IDLE gives No module named RuntimeError?

I'm trying to figure out this problem. Yesterday I installed PyScripter and since then, scripts doesn't work. When I run any script (in PyScripter or IDLE) which uses "import arcpy", I get this error ...
1
vote
1answer
28 views

How to visualize shortest path that is calculated using Networkx?

I have a graph G (made from a road network shapefile), and a source node S, and a destination node D. I have calculated the length of shortest path using single_source_dijkstra_path_length, but now I ...
1
vote
1answer
39 views

Python Toolbox (.pyt) Tool Output Layer Name

How can I manipulate the TOC display name of my output parameters when using a Python toolbox (.pyt) Tool class. I tried adding a symbology layer, however this has no affect on the TOC name. Is it ...
1
vote
1answer
36 views

How can I do a definition query on a layer and zoom to it?

I am trying to do definition query to a layer and to zoom to the same layer, but I got an error ("SyntaxError: can't assign to operator") ?? dataFrame = arcpy.mapping.ListDataFrames(mxd)[0] # the ...
1
vote
1answer
50 views

How to use the MMQGIS plugin through the Python console?

I know how to make Hub Lines using the GUI, I want to know how to do the same using the Python Console, a tutorial would be great. Thank you
1
vote
2answers
82 views

Conditional Calculate Field Many to One

Anyone have experience calculating a field based on a many to one scenario? I have a feature class in a geodatabase with a field of unique names. Feature Class Table (let's call this ...
1
vote
1answer
46 views

Map project a raster having separate latitude and longitude raster bands

I have a satellite image where one of the channels is a raster having the longitude values, another channel a raster containing the latitude values. What would be the best way for map projecting such ...
1
vote
1answer
60 views

Using pyshp to merge two shapefiles

I am trying to find a fast way to merge two shapefiles and i ran over pyshp which apparently could do the job. However looks like this is not working for me because i receive the following error ...
1
vote
1answer
76 views

Plugin of Multiple buffers in QGIS

I hope to create a plugin to do multiple buffers in QGIS. This is my script: """/*************************************************************************** izisse_test ...
1
vote
1answer
46 views

Python geoJSON module create a FeatureCollection with CRS, QGIS doesn't recognize CRS

I am curious if my geoJSON created with the geoJSON python module has a valid CRS. The manual on github specifies a feature collection like so: from geojson import Feature, Point, FeatureCollection ...
1
vote
2answers
34 views

finding the index of a field with its name using arcpy

I wan to extract the index of a field with its name using arcpy. it seems what I have written is so dumb. is there any simpler method with out using for-loop. import arcpy fieldList = ...
1
vote
1answer
69 views

Problem loading spatialite extension with sqlite3 Python connector

I am trying to load the Spaltialite extension using SQLite3 python module. I am getting the following error when I run my script. EOFError: [Errno 10054] An existing connection was forcibly closed ...
1
vote
1answer
79 views

flatten / collapse one-to-many table and keep the 'many' attributes separate

I have a data set that contains intersection data. Each intersection node has up to 6 links which is identified by IN_LINK and OUT_LINK attributes. I want to create a new dataset that includes the ...
1
vote
1answer
33 views

Problems running grass.mapcalc

I am using the GRASS Python Scripting Library on Ubuntu 14.04 with the packages available from the Universe repository. I have the following block of code: try: ...
1
vote
1answer
63 views

Is there a way to access the GeoProcessing tools in QGIS, in code

Is there a way to access the GeoProcessing tools in QGIS, in code? I want to find the Difference between two layers and make a new shapefile with the result.It can be manually done by selecting ...
1
vote
2answers
51 views

Issues Reading a table from Geodatabase

I have scripted a process to read a CSV file into a file geodatabase. Then, I want to read this imported file and work on it by adding new fields and calculating values. However, while using the ...
1
vote
1answer
49 views

How do you determine when user is clicking the end point of an edit sketch using ArcObjects?

I am using vb.net working on ArcObjects. One requirement is to pop up a toolbox once the user click the end point (double click the point under editing status). So I want to know how can I know when ...
1
vote
1answer
95 views

Creating grid polygons from coordinates using R or Python

I have locational data with north-south and east-west coordinates, with a resolution of 100 meters squares. Each data point's location is somewhere within the 100 meters square which centre is given ...
1
vote
1answer
84 views

ToolBar icon images missing

very early build ~ zip file I am getting blank outputs for button images in a custom toolbar. Although the button information populates the dockable toolbar, they lack respective icons [see Fig.1] ...
1
vote
2answers
150 views

Autoincrementing Python Script is over writing all fields versus just fields that are null

Using ArcMap and the Field Calculator I have a python script that should autoincrement the FacilityID field if it is null. It works the first time through but the second run causes it to overwrite ...
1
vote
1answer
42 views

Calling QgsProjectionSelector from QGIS Python plugin?

I am trying to create a dialog that allows the user to select a coordinate system from either the recently used projections or a general list of all available projections. This would basically offer ...
1
vote
1answer
47 views

Finding Code in QGIS Select Features Toolset

Can anyone tell me in what directory the pre-installed Python scripts for the QGIS selection tools (i.e., Select by Point, Select by Polygon) are found? I am using on a Windows 7 installation of QGIS ...
1
vote
1answer
76 views

Determine Equal-Area Slope of Longest Water Course in Catchment

I'm still very new to python and need some direction in developing a Arcpy\Python script to determine the Equal-Area Slope of the Longest Water Course within a catchment. The Longest Water Course is a ...