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

learn more… | top users | synonyms

0
votes
1answer
188 views

OS X Python vs QGIS Python

I'm wondering why after I updated to Python 2.7.6 on my OS X 10.9 Mac, QGIS Python console says that it is still running the old 2.7.5 version. This is not affecting my work but I'm curious about why ...
1
vote
1answer
128 views

How to build and pass remap for floating point raster without getting Reclassify ERROR 010255?

I am receiving the following message when executing my python script: ERROR 010255: String remap must be used with a string field. My input raster is floating point and I would like to ...
0
votes
1answer
184 views

Shapely Python NameError when using cascaded_union

I am fairly new to Python and therefore my error-solving skills are not much yet developed. I am using Python within a geoprocessing script which is supposed to use ogr (reading/writing shp) and ...
14
votes
4answers
2k views

Is there Python library (other than ArcPy) for geoprocessing such as buffer?

Excluding ArcPy, is there any python library which can do geoprocessing, such as buffer/intersect, with shapefiles?
3
votes
1answer
92 views

What is QGIS equivalent of ArcGIS GetCount for use in Python script?

I have a number of layers in QGIS that I would like to select attributes on, and get the feature count for, within a Python script. In ArcGIS for Desktop I have been using SelectLayerByAttribute ...
2
votes
2answers
397 views

How to add non spatial sqlite table to map using python in qgis?

Is it possible to load pure sqlite 2.0 (without spatial extension) table into qgis using python? I would like to get the same result as in the case of using Add Vector Layer -> All files. I have ...
0
votes
1answer
60 views

Access atributte processing algorithm

I have a doubt. In my plugin I use algorithms from processing sextante. For example: Processing.runAlgorithm("grass:v.to.rast.attribute", None, inputLayer, 0, Indexes, extent, cellSize, -1.0, 0.0001, ...
1
vote
0answers
452 views

How to integrate .NET application in QGIS using Python?

In our company we have developed a .NET application that's now integrated with 3 different GIS platforms. Now we would like to make it work with QGIS but we need some help on getting started. I've ...
2
votes
2answers
441 views

Python Def Query Help for multiple layers

I have Three layers in a .mxd, all three layers have a common value I can use, but a different Label in each Layer. As an example, the Value I want to use is "100" In Layer A, the Value is in [Name] ...
2
votes
2answers
293 views

How can I close the identify result dialog programmatically?

I am trying to close the identify result dialog which appeared when I select to identify a feature from the active layer. Does someone know how can I do it?
2
votes
1answer
1k views

How to convert arcpy.InsertCursor to arcpy.da.InsertCursor in Python code?

I have some working code using arcpy.InsertCursor which I want to convert to arcpy.da.InsertCursor. This I want to do primarily as ESRI claims that da methods are more optimized. The code I have is ...
2
votes
2answers
1k views

How to merge dbf files in Python or arcpy?

I have over one hundred dbf files to merge. Each of files have two columns: ID and another field which differs from one file to another. I want to merge those fields based on ID such that each raw ...
3
votes
1answer
572 views

How can I delete a shapefile using OGR?

In my QGIS Python plugin, I use shapefile layers and I am having a problem rewriting existing shapefiles. Is it possible to delete a shapefile from disk using OGR?
4
votes
1answer
904 views

How to remove all selection from all registered layers using QGIS plugin?

I want to remove all selection from registered layer in QGIS using Python. I tried to clear the map canvas using: self.iface.mapCanvas().clear() self.iface.mapCanvas().refresh() but the ...
2
votes
2answers
1k views

How to programmatically change raster symbology after reclassification?

I have created a code in Python that I will use for a custom tool in ArcGIS, the code will create a Eucledian Distance of 6000m around a point and Reclassify the distance from 0-2000, 2000-4000, ...
4
votes
2answers
2k views

Programmatically load composer from template and generate atlas using pyQgis

I Am trying to build a plugin to load a print composer from file, generate an atlas and export to image. So far I have been successful in loading the template and exporting it to image. I have been ...
-1
votes
2answers
836 views

Export MXDs files to PDFs using Python [closed]

I'm trying to write a python script that will export multiple MXDs to individual PDFs while using a feature class field to rename the pdfs (this can be an optional field, if not check it can copy the ...
2
votes
2answers
915 views

Geopy Error with Reverse Geocoding

I am using Geopy. I get following error for the code. I have using the same code as on https://code.google.com/p/geopy/wiki/ReverseGeocoding from geopy import geocoders g = geocoders.GeoNames() ...
3
votes
1answer
936 views

How to calculate angle of polyline at its midpoint using Python/ArcPy?

Trying to calculate the angle of a line at its mid point using python; this will be used to display flow direction on a water network. I've developed this script, which works in terms of generating ...
3
votes
1answer
366 views

Is there a method to write feature class attributes and counts to an excel workbook in Python? [closed]

I have a feature class with 3 fields that I would like to reference later in an excel workbook. They are all represented in 3 different maps. Essentially, I would like to show the the attribute ...
2
votes
3answers
2k views

How to install Fiona to read Shapefile attributes with OSGeo4W?

I´m developing a plugin in Python and I need to read the shapefile attributes, so I found the Fiona API and dbfpy also but I don't understand how to install these packages because I install the QGIS ...
6
votes
4answers
6k views

How to import qgis.core to python app?

I'm new to Python. I want to create GIS app with Python using QGIS library on Window 7 64bit. The way I do: install QGIS 1.7.0 I set PYTHONPATH=D:\Program Files (x86)\Quantum GIS ...
0
votes
1answer
193 views

How do I use gdal_proximity.py from the QGIS python console?

How do I run gdal_proximity.py from the QGIS python console?
0
votes
2answers
208 views

Adding Python Script to Custom Tool

I am probably making a simple mistake but can't seem to figure it out, only a beginner.The Select By Location Script is working and it exports to excel when it is run from Python GUI, it also works in ...
3
votes
1answer
646 views

pyspatialite: Connot insert geometry

I'd like to insert a row with a point geometry with pyspatialite. The sql looks like this: insert into eqdata(origin_time, url, mag, lat, lon, depth, m_a, region, mt, the_geom) ...
1
vote
4answers
3k views

How do you create a point at the midpoint of a polyline with Python?

I have a polyline shapfile (that contains multiple lines) and am trying to create a point at the midpoint of each line using python. I am currently using the ET Geowizards tool 'PolylineToPoints' ...
0
votes
1answer
71 views

Setting up Raster Calculater for QGIS Python Console: ImportError?

I'm trying to follow the instructions here How to evaluate raster calculator expressions from the console? to set up the python console to to use the raster calculator. I tried: from qgis.analysis ...
3
votes
2answers
526 views

Python Script: Automatically georeference photographs (To be used in ArcMap)

I have 563 photographs that have been taken as part of a site survey. The only location information that I have is a single GPS location (lat,long) at which the photograph was taken. I'm looking for a ...
1
vote
1answer
198 views

Save input in plugin as pdf format file

I m trying to make QGIS plugin with plugin builder that compare 2 map scale with Input1 and Input2 as input scale and show recommendation after clicked recommendation button. I wrote my code like ...
1
vote
1answer
51 views

which feature of toolboxes will be appropriate for building a groundwater model in Model Builder [closed]

I am completely new to ArcGIS Model Builder and also Python scripting. However, I want to build a model to automate groundwater recharge.
3
votes
1answer
122 views

How to Create Feature Layers and Search by Location for all Feature Classes in Geodatabase?

I'm very new to python, but I'm having trouble finding the answer on my own. I need to loop through a given file geodatabase, select any features that intersect a project polygon and then search the ...
0
votes
0answers
46 views

Import processing in qgis 2.0 [duplicate]

I know that this question has already asked but no concrete answer has given!! My environment is Ubuntu 12.04 and I'm using eclipse-pydev as IDE. Thanks in advance for helping me.
1
vote
2answers
2k views

How to terminate Python scripts in Processing framework properly?

I'm writing a Python script to use it in Processing framework. I need to cancel script execution if certain conditions are met (to save user's time). I tried to use sys.exit(arguments) command. The ...
4
votes
1answer
106 views

SpatialLite BulkLoad and Merge

Via the U.S. Census I have downloaded all of the census group shapefiles. These are approximately 19-20GB across 56 shapefiles. I want to merge these to do some testing. Clearly, shape file ...
1
vote
1answer
376 views

gdalbuildvrt error, when using in Python

I am new to python/GDAL and am running into perhaps a trivial issue. This may stem from the fact that I don't really understand how to use GDAL properly in python, or something careless, but even ...
0
votes
0answers
51 views

List attribute values ​​of selected points in the layer

I need to grab the fields in the layer of the selected points in the order they were selected by the user. My code: Connection to the database and display the map on the screen, everything ok: uri ...
5
votes
1answer
392 views

Is there a way to find out which pixel values are around the current pixel?

I would like to write a cycle which takes a current pixel, look at the surrounding pixels, choose the pixel with max/min value and skip to that pixel...and so on. Is there in arcpy such a function ...
8
votes
2answers
718 views

What are mystery green lines in Layout View produced during ArcObjects script execution?

Could any of ArcObjects guru tell me, what are these green lines on my Page Layout and what to do, or not to do, so they do not appear? See image attached. I do used ArcObjects from Python. My script ...
4
votes
3answers
836 views

How to create Where Clause from user input via Python list?

I am trying to perform a query based on values in a Python list. The where clause will then be used in an Update Cursor, so that the rows NOT equal to the values in the list will be deleted. This is ...
5
votes
1answer
352 views

How to create polygons in ArcMap 10.0 using lat/long data from SQL Server 2008 database?

Forgive me if this is very basic, as I'm new to GIS work (though I've been a programmer for 10 years) and so I'm not really sure how to approach this, but here goes... Can I take a table with ...
0
votes
1answer
39 views

How to work with Multivalues in arcgis script?

I am really beginner in arcgis scripting. I was unable to find a solution of my problem, so I'm writing here. My problem: On my input I want some shapefiles. When I load them from ArcGis Tool, I ...
5
votes
1answer
797 views

How to determine using Python whether ArcSDE table is registered with geodatabase?

In an effort to improve my Python skills, I am trying to build code to automate the Compress and Analyze commands for our SQL 2008 R2 SDE database (code below). The Compress code works as does the ...
3
votes
1answer
705 views

Changing attribute and/or text values in Esri metadata using Python

I'm new both to this forum and Python, and I'm having trouble tracking down a solution to my problem. I'm hoping someone can offer some process-improvement advice and/or code to help get my metadata ...
0
votes
0answers
60 views

Need advice on how to use Select Junction by Edge Count at pythot script?

Is There a way to use the tool Select Junction by Edge Count (selecting all junctions (points) in a geometric network by the number of edges to which they connect) at Python script ? or can i use ...
5
votes
0answers
451 views

How to convert a raster (array) to a NetworkX graph and do a * search?

I want to use a slope-raster for a a_star path analysis in NetworkX. I am using Python for this project. My test raster looks like this First I read in the raster with GDAL input_raster = ...
1
vote
1answer
191 views

How to query and display layer using ArcGIS Python script tool? [closed]

I have database which contains point shapefiles and raster files for 3 species. My aim is to develop a script tool that should have a search tab to enter the species name. also, a check box to select ...
4
votes
2answers
1k views

Method for finding circle center points that cover an extent

If I have a geographic extent, is there any way to find all of the center points of all of the 5km circles that would be needed to cover the entire extent? I'm working with an API that will return ...
0
votes
2answers
521 views

Is there a maximum number of feature classes at File GDB?

Is there a maximum number of feature classes at File GDB ? I'm running a script that creates FC's, after around 1000 a get error of a schema lock ERROR 000210: Cannot create output.
7
votes
2answers
221 views

How to identify a FRONT LAND?

I work at a town hall. I need to identify the front of the land. Here in my country we call it of "TESTADA" or "FRENTE DE LOTE". I did not find the exact term in English. THE FRONT OF A LAND is a ...
6
votes
1answer
223 views

Why do ECWs go missing when exporting MXD to PDF with ArcPy?

I'm trying to export some MXD maps to PDF with arcpy (ArcGIS 10.1). Everything works fine and dandy except for ECW images, which don't appear in the PDF. However, when I execute the same code from the ...