0
votes
1answer
54 views

Programmatically set layer properties Python Init function

Is it possible to set the layer properties Python Init function field programmatically? I've been looking through the qgis 2.2 api but can't seem to find anything on it. Hint, suggestions and ...
0
votes
0answers
23 views

In QGIS Process Modeller, is it possible to automatically run a function on several layers without listing all combinations?

Trying to develop a Model which includes finding any intersections between layers and then merging them all into a single layer. I have 12 layers in total, it's not really efficient to list all the ...
0
votes
1answer
62 views

Layer relations via Python

Is it possible to, through Python, to create the relations that it's possible to create in Layers/Properties/Fields/Relations, and if so how? I first thought these were saved in the styles, but that ...
0
votes
1answer
60 views

How to disable “Simplify geometry” via Python?

After I've loaded a layer from a table in my db I'd like to disable the 'Simplify geometry' (found in Layers/Properties/Rendering) programatically using Python. I've tried several versions of ...
1
vote
0answers
36 views

Changing the symbology of layer when converting from Layer to KML using Python

Is it possible to change the symbology of a layer file using Python? I have a script that creates a layer file and converts it to kml, but every time I run it the symbology color in the kml of the ...
4
votes
1answer
126 views

How can I modify layer order with the QGIS python API

Typically, after a new_layer = addRasterLayer(...) that inserts new_layer before the active layer, I'd like to move it to the top of the table of contents. How to do it? I use an existing QGIS ...
1
vote
1answer
83 views

Delete Turned Off (Unchecked) Layers from Arcmap with Python

I have about 100 figures that have been updated countless times and a lot of the old data was left in each .mxd but was only turned off (unchecked) and not removed. I would like to remove these ...
0
votes
0answers
49 views

QGIS 2.0.1: Changing layer properties with python console

I'm working on a plugin that will aim to ensure that the following steps either "transparent" to the user with one click :   Creating a table with predefined fields Record in this table in postgis, ...
0
votes
1answer
206 views

How to extract list of layers in MXD using ArcGIS Desktop 9.3.1 and Python 2.5?

I have been trying to extract a list of all the layers in my mxd (Arc9.3.1), using Python 2.5. If I could have the source of the layers too that would be even better... But as long as I can get a list ...
4
votes
1answer
453 views

What is Python equivalent of ModelBuilder's Iterate Feature Selection?

My data consists of two featureclasses: Points = points representing trees Polygons = Polygons representing % canopy area by area. Each polygon in the FC has a % canopy measurement in the ...
0
votes
2answers
58 views

Trouble using saveACopy with group layers [closed]

This code works fine on layers in the TOC that are not group layers, but errrors out if there are any group layers in the TOC. import arcpy, re, os arcpy.env.overwriteOutput = True #loop through ...
2
votes
1answer
289 views

ArcGIS 10.0 get sde information out of .mxd

The overall goal here is to iterate through several directories of .mxd files and document which SQL Server instance of SDE they are pointing to, with the database name and feature class names. All ...
0
votes
0answers
98 views

How to create a Layer from a list of points in PyQgis

I`ve developed an algorithm that generated an two dimensional array with points. Each subList of this array must be displayed as an polygon on the map view, and the recently created Vectors should be ...
0
votes
1answer
260 views

Why does arcpy.mapping.Layer give Runtime error: CreateObject Layer invalid data source?

I want to connect an existing .lyr file to a variable defined as lyr2. lyr2 = arcpy.mapping.Layer(r"C:/Iso100Red.lyr") Although its a .lyr file I´ll get this Errorcode: Runtime error : Object: ...
1
vote
1answer
145 views

How to make a virtual layer from ogr geometry?

I know how to do this: nodes = driver.Open(node_nav,0) node_lyr = nodes.GetLayer() node_lyr.SetSpatialFilter(None) But how do can use the layer methods on a geometry I created from scratch? ...
1
vote
2answers
297 views

ArcGIS 10.1: “ERROR 000223: Cannot extract event table properties” when iterating through multiple files/folder

I am trying to convert ~270k csv-files with lat/long-data to layerfiles. The files are split into folders by year, i.e. ~30 folders with ~9k csv-files in each. I have written a script to iterate ...
0
votes
1answer
156 views

How can i select many rows from a table?

I want to create an action that select many rows from PostGIS table to show many lines in QGIS. How can i select many rows from table with python to add these rows in a layer? Thank you
1
vote
1answer
188 views

How can I change SQL query through a layer of an action (python)?

I have three layers from three diferent database tables. When I click in other layer I want to change (with an action) the query of that three layers. How can I do that? Thank you
0
votes
1answer
140 views

Split Map using Python in Qgis

I have a map, in which each region is defined as an attribute of the map (I can select each region from the attribute table). I am trying to create new layers each one containing only 1 region using ...
2
votes
1answer
932 views

Create new polygon layers from postcodes latitude & longitude

First at all, I want to say that I am geocoding enthusiastic but have no formal background on GIS. I'll do my best to use the right wording and make myself clear what I am striving for. Also the only ...
1
vote
0answers
199 views

Hack to change data source of a layer file in ArcGIS 9.3.1 with python?

I'm looking for a way to change the source of my layer file using python. Actually I want to do this because I need to re-use a XSL template which is defined under the tap HTML popup of the layer ...
5
votes
1answer
921 views

Export each layer in map to a separate image

I have a mxd file with multiple layers I have to export to PNG/JPG. I would like to create a script which turns on layers one at the time before they are exported. So far I have come up with the ...
1
vote
1answer
552 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 ...
2
votes
1answer
324 views

How to create new layer within a DXF file?

Using OGR in Python, I'd like to create some geometries within a DXF file, but not in the "0" layer, but in new ones. I tried with: import ogr, os, osr, sys ds = ...
2
votes
1answer
841 views

Add AutoCAD .dwg annotation file to Arcmap using python (Same as +ADD Data button)

I would like to add an AutoCad .dwg file to Arcmap using python the same way that the +ADD Data button does. I can add an Annotation layer with python but only as a feature layer not as an annotation ...
3
votes
1answer
997 views

OGR and DXF files: Is it possible to handle layer names? (only “entities”)

I'm using Python and OGR to extract the layers of a DXF file and convert them into SHP. I began with: import ogr, os, sys driver = ogr.GetDriverByName('DXF') datasource = driver.Open('test1.dxf', 0) ...
2
votes
1answer
623 views

Changing the name of layer using python

I am attempting to change the name of the layer. The following code changes the name of the layer but then removes the layer from the map, and I am not sure why. Note: I don't have any remove layer ...
2
votes
0answers
390 views

Add CAD Drawing Dataset into ArcMap using Python

I am trying to add an CAD Drawing Dataset into ArcMap using Python. Question is how to add a Auto-CAD .dwg file to ArcMap using Python Normally comes in as CAD file within a Group layer with: ...
8
votes
2answers
3k views

How can I iterate over map layers in QGIS python

I'm having trouble figuring out how to iterate over map layers. I can access the currently highlighted layer in the table of contents via iface.activeLayer() but I want my code to operate on all ...