Skip to content

Commit

Permalink
refactor: set ID field in layer URI
Browse files Browse the repository at this point in the history
  • Loading branch information
merydian committed Dec 21, 2023
1 parent 5d18d1b commit 40fb090
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions ORStools/gui/ORStoolsDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,8 @@ def _save_vertices_to_layer(self):

if len(items) > 0:
crs = QgsCoordinateReferenceSystem("EPSG:4326")
fields = QgsFields()
fields.append(QgsField("ID", QVariant.Int))
point_layer = QgsVectorLayer("Point?crs=epsg:4326", "Vertices", "memory")
point_layer = QgsVectorLayer("Point?crs=4326&field=ID:integer", "Vertices", "memory")
point_layer.setCrs(crs)
point_layer.dataProvider().addAttributes(fields)
point_layer.updateFields()
for idx, x in enumerate(items):
coords = x.split(":")[1]
Expand Down

0 comments on commit 40fb090

Please sign in to comment.