0
votes
0answers
55 views

PyQgis: How can I “append” features to a Vector Layer instead of “stacking” them?

As I read data from a text file and add points to a QgsVectorLayer (as well as related attributes), each new record gets 'stacked' on top of the previous one in the Attribute Table (and within the ...
1
vote
1answer
59 views

Iterating over selected features in QGIS Processing

I used to be able to iterate over selected features using the following script in v2.0. import processing features = processing.getfeatures(layer) for feature in features: #Do whatever you need ...
1
vote
0answers
119 views

Editing QGIS point layer: retrieve attributes of intersecting line layer

I'm creating a custom editing form using QGIS 2.0 and would like to modify the mouse event when creating a point. I've gotten a start by reading this thread: How to programatically check for a mouse ...
0
votes
0answers
98 views

QGIS: How to reverse vertex ordering in polygons

I am working with an Oracle spatial connection in QGIS through which I am accessing and editing a vector layer. I find that when I edit a geometry, the vertex ordering is reversed (to clockwise in the ...
0
votes
0answers
97 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 ...
6
votes
2answers
352 views

Convert points to lines with Python GDAL

I have a dictionary with points. The points are derived from a raster (see image below). The points are not sorted and are not in order. The dictionary looks for example like this: pointDict = {0: ...
3
votes
0answers
338 views

GDAL polygonize lines

I have a raster file containing roads (left image). I polygonize the raster file with GDAL (see the script below). In the end I like to have vector lines. However GDAL only gives me something like ...
0
votes
0answers
102 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
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 ...
1
vote
1answer
207 views

reclassify vector data from multiple source data fields (ArcGIS) (ModelBuilder)

I am using ArcGIS 10.1 and ModelBuilder. I am not familiar with Python. My question is very similar to ReClassify Vector Data Between Values . However that question is about reclassification using ...
0
votes
0answers
168 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 ...
3
votes
0answers
155 views

How to create a line layer which connects a point layer to a line layer?

In the map shown below, I have manually created the dummy lines (in green). Using python, and without using PostGIS or sextante, I would like to automate the creation of these dummy links between a ...
0
votes
1answer
457 views

How to append a vector layer using Qgis and Python?

I am working on scripting some data processing using Qgis and Python, but I'm running across issues that I need to debug. Since my data is really large, and run-times can be lengthy, I would like to ...
0
votes
0answers
20 views

Drillhole Plan Trace in Arc [duplicate]

I'm struggling to find the math to do what I want. I want to plot a top down view of a drillhole in ArcMAP 10.0. I have the beginning UTM coordinate and then for every place in the hole that was ...
5
votes
1answer
137 views

GDAL/OGR Determine if dataset is raster or vector

I am writing a script using the GDAL/OGR Python bindings and it is possible that the user may provide a raster dataset or a vector dataset as input. If the user provides a vector dataset, the script ...
1
vote
0answers
232 views

How to update polygon field with point count for multiple rows? (Temporal point-in-polygon)

I have a shapefile with several regions. It contains basic info like ID, Code, Name1, Name2, etc. It is overlaid with a shapefile of points (nearly 200k). Each point represents an event with a type ...
3
votes
1answer
672 views

How to remove a vector QgsVectorLayer from QGis python plugin

I managed to add QgsVectorLayer in QGIS through a python plugin, for example: vl = self.iface.addVectorLayer(uri.uri(), layerName, self.dbConn.getProviderName()) But how can I remove it?
10
votes
1answer
1k views

How to access feature classes in file geodatabases with Python and GDAL?

I am trying to access a vector dataset in a ESRI File Geodatabase using Python + GDAL. I have successfully compiled GDAL with the file geodatabase API. The FileGDB driver is working correctly since ...
10
votes
3answers
3k views

How to find and merge duplicate points?

I have two point shapefiles: Red and Blue. Each point shapefile has a z value which represents a radius (i.e. represented as buffers in the example). A duplicate point is defined as a point that ...
1
vote
0answers
142 views

Polygon symmetry detection

I was wondering if there was any way to create main axis (axis of symmetry) lines for polygons. I have polygons that represents buildings. I will want to find main axes (axis of symmetry) for those ...
4
votes
2answers
781 views

Calculate spacing of polylines along transects in ArcGIS

I have a shapefile with a number of roughly parallel lines in it, and I want to calculate the spacing between these lines using a number of transects across the map. How should I go about this? I ...
4
votes
4answers
4k views

Merge overlapping lines in ArcGIS

I have a polyline shapefile containing a number of lines, some of which overlap. By overlap, I mean that they follow exactly the same path for some of their route, but also have bits that are not ...
5
votes
1answer
774 views

Programmable buffers using GDAL and python

Is there a way to programmatically generate buffer layers for vector layers using GDAL and python?
18
votes
7answers
6k views

Nearest neighbor between a point layer and a line layer

I've asked this question several times on stackoverflow and irc between #qgis and #postgis and I also tried to code it or implement it my self in postgis with no real answer. Using programming (most ...