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

learn more… | top users | synonyms

0
votes
0answers
166 views

How Can i create a Vector layer from selected features qgis

In my qgis plugin i select dynamically features from a Vector layer. and currently i create a new layer from selection on combining all feature into a new feature: theField = QgsField self.theString ...
0
votes
0answers
67 views

Populate a new field with list of the top 5 values of all fields for that record

I have 15 fields. I would like to add a new field that is populated with the field name and value of the top 5 highest values of the 15 fields for each record in the table. The new field would be a ...
0
votes
0answers
115 views

Calculating distances between boundaries of polygons with Python

I have two sets of shape-files which have to be worked on within a Python Script. Those two Shape Files might differ from each other (same thematic content, but 2 different epochs). If there occurred ...
0
votes
0answers
119 views

Change symbology of layer of unique symbol to unique with python

I have a problem concerning how can I change the symbology of a layer with unique symbole to unique values. I don't know how to update it. I used this code: import arcpy mxd = ...
0
votes
0answers
42 views

How to get data from the selected features and embed to a particular featura class

I am trying to write a Python script for ArcMap 10.2. When the user selects some features I want certain data to go to a certain point file. For example, I have a polygon that contains parcel data. ...
0
votes
0answers
103 views

ArcMap: Append is really slow

I'm writing a Python script for ArcGIS 9.3.1 which is supposed to do the following: Create a new feature class in local FGDB Loop over a set of IDs (~40,000) Select features from an Oracle GDB with ...
0
votes
0answers
194 views

Looking for java (or python) APIs to read shapefiles

Consider a work flow which receives a data field, e.g. “basemap” as shown in the image, and fills polygons with color on the basis of its numeric values. I am interested in java programming to carry ...
0
votes
0answers
64 views

Python running models and output symbology

Trying to run a model using python script. The script is running, the symbology is set up in the model, but the symbology is not displaying in the KMZ output when run as a geoprocessing tool. Works ...
0
votes
0answers
205 views

Calculating area with python qgis

I am a little stumped with determining the area of polygons in the python console. I want the output to be in meters^2, so using: qgis.utils.iface.mapCanvas().setMapUnits(0) ...
0
votes
0answers
113 views

Lock file on shapefile persisting with arcpy.ImportMetadata_conversion

I've got a script that does a number of things to two shapefiles, and it appears that the metadata import step is creating a lock file on only one of the shapefiles that persists even after del arcpy. ...
0
votes
0answers
153 views

Unable to render layers in MapCanvas using PyQGIS/PyQt4

I am trying to get some layers into a MapCanvas and style them. I am following the PyQgis Cookbook info here but my code is just not working. I've been spinning my wheels on this for over a week now ...
0
votes
0answers
35 views

qgis build under ubuntu 12.04, but all the python plugins are not there

All the .so plugin show correctly, only the python plugin do not. I am confused and do not know how to fix this. I think there must be some python problem . The build process is successful.
0
votes
0answers
53 views

Combining two separate shapefiles with undefined projections out of Leica

So this is a mess. When the software outputs I have two shapefiles. The projections aren't defined, but I know one is WGS84 and the other is NAD 83. The NAD 83 includes northing easting and ...
0
votes
0answers
222 views

Change field attribute in one column based on Domain value from another field using Field Calculator

When I am editing a feature class, I want to automatically populate another field base on one column in the table. Here are the fields and data I am working with. Proj_Code, Proj_Name DA, Dawn Lake ...
0
votes
0answers
119 views

Identify segments that share a last vertex with the first vertex of selected segment

This has been marked as a duplicate to Connecting line features and determining the length of the longest line but I believe there are some subtle differences. And to be honest I'm not an advanced ...
0
votes
0answers
89 views

Loop - convert layer to raster coming up blank

I am looping through files, selecting out building footprints one by one and converting the selected building footprint to a raster. The script worked fine for about 2 hours this morning then stopped ...
0
votes
0answers
76 views

QGIS2.0 plugin with freeglut

Has anyone been successful in using QGIS 2.0 plugin which uses freeglut? I have tried all of the below to import freeglut but none of the freeglut functions are recogonized in my plugin. import ...
0
votes
0answers
62 views

In a ROMS model, how can a get the time series data for a parameter using a lat/lon point?

As a follow on question to my initial post here I would like to get point data over a time series from a ROMS model. For example, given the netCDF file hosted via Thredds here: ...
0
votes
0answers
165 views

How can I embed IPython into the QGIS console?

I would like to use Ipython in the console to perform tasks more easily. How can I do that? Thanks a lot!
0
votes
0answers
131 views

How to use the QgsMapToolIdentify in PyQgis?

I'm trying to implement the QgsMapTollIdentify class in a stand alone app but I can not. I am a newbie in Pyqgis and would like to ask how do I implement this class in Python? Thanks! Completing, ...
0
votes
0answers
174 views

Error in Select Numeric type column in pyodbc with ArcCatalog

I created a python script that uses "pyodbc" plugin to connect a SQL Server database and write out data. It was imported in an ArcGIS 10.1 tool and run from there. try: arcpy.AddMessage('FLAG 0') ...
0
votes
0answers
306 views

GDAL/OGR to extract pixel values

I want to use GDAL/OGR to extract pixel values from a raster file. The extraction should be based on polygons, stored in a shapefile. My thought was to iterate over the features in the shapefile, ...
0
votes
0answers
246 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 ...
0
votes
0answers
56 views

QGIS Gazetteer Plugin connection to internal database

A few posts on here mention that the Astun QGIS-Gazetteer-Plugin could be adapted to reference a PostGIS database. Has anyone done this adaptation and could share it? I want to use a gazetteer stored ...
0
votes
0answers
63 views

detect signal where delete polygon in qgis?

I am working with QGIS and i want when i delete a polygon and then i commit this action I detect the signal of this operation and use it in python script, I tryed this but dont work: def delete(): ...
0
votes
0answers
36 views

How to use na.Solve() on layers already created?

I am fairly new to arcpy and I am having troubles recreating the following set of instructions with a python script. Open the KeyChainTest.mxd Enable the Network Analyst extension. Click solve on ...
0
votes
0answers
224 views

Issues when importing line shapefiles into NetworkX

Note that although I am using Python Console from within QGIS for this, I don't think it's a QGIS issue. Below is the difference of how NetworkX is dealing with 2 line layers created by the same ...
0
votes
0answers
72 views

How to export png to file system with python?

I use python to make a plugin that contains shape file,color_bar,time_bar 3 items above now I want to export my result to a png image After I find the method to do it I find a similar way to ...
0
votes
0answers
193 views

SEXTANTE runalg and QgsVectorLayer issue

I'm trying to make a script for converting polygons to lines. But I'm having some issues while generating temporary layers. In this script, I iterate through all the features of the input layer to ...
0
votes
0answers
303 views

Create a polygon shapefile using point as boundary

Following have two problems: I am now have 4 point in a shapefile and I want to set the point's coordinate for boundary of a polygon The points are xmin, xmax, ymin, ymax that can just be a ...
0
votes
0answers
165 views

Dynamically generating data for map tiles from Python function

I'm brand-new to GIS and relatively new to web services. I've found a ton of great resources on the web, but I'm having trouble addressing one specific issue: One of the data layers on my planned map ...
0
votes
0answers
84 views

Sextante script for statistic info

I want to generate a script for getting statistic information window from selected feature. For example i have two layer building(polygon) and railway(linestring). By using this tools i got a window ...
0
votes
0answers
36 views

How to change value of an Line edit dynamically

I create a form in QT4 and compile with pyuic4. it create an form.py I want to modify the value of the line edit dynamiclly with code. I put this code in the form.py but never happen: ...
0
votes
0answers
227 views

python script to calculate and return values based on several conditions

I need to calculate and return the value "continuous" to those records in a polygon feature class with species records aggregated to a UTM grid considering the attributes are species name, grid code, ...
0
votes
0answers
49 views

How specify a corridor minwidth?

I’m trying to make a corridor between two substations with ArcGIS, a macro corridor and a micro corridor. I have two questions in this respect and would be grateful for your suggestions. a) How can ...
0
votes
0answers
72 views

Congressional Redistricting

I have a project coming up where I need to create new congressional district looking at only total population data. I am planning on using the census tract level of data, but I am having some ...
0
votes
0answers
564 views

Problem reading attribute with Python using osgeo.ogr

I am working thru "Python Geospatial Programming" and I have a problem in a program in Chapter 6 that I cannot seem to solve. The small program: import osgeo.ogr shapefile = ...
0
votes
0answers
90 views

Create Vertex and add empty attributes to it

How can I create a vertex(and then a point feature on the vertex) on a polyline and give it some empty attributes(create fields), move an existing vertex, delete vertex? I am in ArcGIS environment and ...
0
votes
0answers
213 views

mapnik error - fatal flex scanner internal error--end of buffer missed

I am using Mapnik 2.0.1rc0 on a Windows 7 with python 2.7 32bits inside a GeoDjango App. I often got this error: fatal flex scanner internal error--end of buffer missed that makes python to crash ...
0
votes
0answers
183 views

Help in GRASS/QGIS/Python

I have Idea about ArcGIS, and a bit of QGIS and zero programming knowledge, which I am trying for thesedays. I saw GRASS GIS and have started working with shapefiles, which are not being loaded... :( ...
0
votes
0answers
282 views

Select record from table attributes in QGIS and Python

Can anyone tell how I can access to the attribute table of a shp and select a record from a specific row and column using Python (with console or a script). I've been looking for in the qgis API, but ...
0
votes
0answers
59 views

Why don't libgrass.so.1.8.0 and libqgissqlantconnection.so.1.8.0 load?

I have compiled Qgis 1.8 at Ubuntu 12.10, but some phyton plugins does'nt work, like sextante. Trying to solve this problem, some files don't have been load. They are: libgrass.so.1.8.0 and ...
0
votes
0answers
287 views

How to use raw_input() in QGIS python console?

I'm hoping to use raw_input() inside a loop to prompt the user when s/he wants to continue running the script. However, I'm getting an error: Traceback (most recent call last): File ...
0
votes
0answers
173 views

using mapnik xml file to render tiles in python

Is it possible to use an xml file in python? without using the bindings for python for mapnik. basically i'm using django/geodjango, postgis and well i decided i'd try and design the map on tilemill ...
0
votes
0answers
608 views

Python package for Google Maps API v3?

I am looking for a Python package that can generate the JavaScript to display Google Maps API v3. I would like to integrate such package into a django website. I know pymaps exists but it's for ...
0
votes
0answers
124 views

How to access the rules of QgsRuleBasedRendererV2 using python?

I can't get access to the rules of rule-based renderer, python says there's no attribute "rootRule", though documentation says it should be (http://www.qgis.org/api/classQgsRuleBasedRendererV2.html) ...
0
votes
0answers
148 views

Can I do full SQL expressions through the “WHERE” clause in UpdateCursor?

Run as a standalone python script for a shapefile in a toolbox on ArcMap. For example: psql_url_pop = '''SELECT shapefile.NAME_# + shapefile.WIKI_URL FROM public.shapefile''' rows = ...
0
votes
0answers
101 views

How to create a pop up attribute table for each crash located on a roadway segment in arcmap

I am trying to create a simple user interface that displays information for each crash located on the routes. I also need to display a graph along with that. I am a beginner in Python with no prior ...
0
votes
0answers
154 views

How to build QGIS with Python on Redhat?

I'm attempting to run QGIS on Redhat 5 64 bit architecture. Version of Python is 2.4.3. Version of QGIS is 1.7.4 (wroclaw). When I run qgis, the splash screen appears, followed by a QMessageBox that ...
0
votes
0answers
161 views

Export Data Driven Pages extents to Kmz

Is it possible to export the extents of DDP to KMZ using arcpy - Map to KML (Conversion)? Alternatively can we export each extent of a single DDP extent to a new mxd and then run arcpy.MapToKML_3d on ...