# if current edge id already processed -> skip it. NewEdge = QgsFeature(outLayer.pendingFields())ĬurrentPriority = feat.attributes()ĬurrentEdgeId = feat.attributes()ĮdgeIdTrimmed = currentEdgeId.replace('To', '')ĮdgeIdTrimmed = currentEdgeId.replace('From', '') # loop through edges of inLayerEdges and merge OutPriority = outdp.fieldNameIndex(PRIORITY) Outdp.addAttributes([QgsField(EDGEID, QVariant.String), # define attributes and add them to the vector layer # Set the provider to accept the data source OutLayer = QgsVectorLayer('Linestring?crs=' + crs, 'merged_edges', 'memory') # Create output layer and specify geometry type IdxFrom = inLayerEdges.fieldNameIndex(FROM) IdxTime = inLayerEdges.fieldNameIndex(TIME) IdxLength = inLayerEdges.fieldNameIndex(LENGTH) IdxPriority = inLayerEdges.fieldNameIndex(PRIORITY) Id圎dgeId = inLayerEdges.fieldNameIndex(ID) InLayerEdges = processing.getObject(Edges) # and adds two attributes for speed limits on each lane ![]() ![]() # description: merges edges with the same edgeid Here is my python script code: # name : MergeEdges_script ![]() But when I try too set the geometry for the new edge, the python script stopps and I get the error "minidump written to C". I have written a python script which has two input vector layers (one point-layer and one line-layer).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |