Skip to content

Commit 8a7b9c4

Browse files
author
wonder
committed
Update to OSM plugin from Lukas Berka:
-displaying recommended tag keys and values for easier tags editing -created features now doesn't have created_by tag automatically (coz it's deprecated) -eh, names of some dockwidget elements are shorter now :) git-svn-id: http://svn.osgeo.org/qgis/trunk@11283 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent cc05d67 commit 8a7b9c4

File tree

4 files changed

+812
-343
lines changed

4 files changed

+812
-343
lines changed

python/plugins/osm/DatabaseManager.py

-11
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def __init__(self,plugin):
4343

4444
self.plugin=plugin
4545
self.canvas=plugin.canvas
46-
self.pluginName="QGIS OSM v0.4"
4746

4847
self.dbConns={} # map dbFileName->sqlite3ConnectionObject
4948
self.pointLayers={}
@@ -420,7 +419,6 @@ def createPoint(self,mapPoint,snapFeat,snapFeatType,doCommit=True):
420419
c=self.getConnection().cursor()
421420
c.execute("insert into node (id,lat,lon,usage,status) values (:nodeId,:lat,:lon,0,'A')"
422421
,{"nodeId":str(nodeId),"lat":str(mapPoint.y()),"lon":str(mapPoint.x())})
423-
self.insertTag(nodeId,"Point","created_by",self.pluginName,False)
424422
c.close()
425423

426424
if doCommit:
@@ -470,9 +468,6 @@ def createPoint(self,mapPoint,snapFeat,snapFeatType,doCommit=True):
470468
elif snapFeatType=='Polygon':
471469
self.changePolygonStatus(snapFeat.id(),"N","U")
472470

473-
# insert created_by tag of the new point
474-
self.insertTag(nodeId,"Point","created_by",self.pluginName,False)
475-
476471
# finishing
477472
c.close()
478473

@@ -541,7 +536,6 @@ def createLine(self,mapPoints, doCommit=True):
541536
c.execute("insert into node (id,lat,lon,usage,status) values (:nodeId,:lat,:lon,1,'A')"
542537
,{ "nodeId":str(nodeId),"lat":str(lat),"lon":str(lon) })
543538

544-
self.insertTag(nodeId,"Point","created_by",self.pluginName, False)
545539
affected.add((nodeId,'Point'))
546540

547541
# insert record into table of way members
@@ -556,8 +550,6 @@ def createLine(self,mapPoints, doCommit=True):
556550
c.execute("insert into way (id,wkb,membercnt,closed,min_lat,min_lon,max_lat,max_lon,status) values (?,?,?,0,?,?,?,?,'A')"
557551
,(str(lineId),sqlite3.Binary(""),str(cnt),str(minLat),str(minLon),str(maxLat),str(maxLon)))
558552

559-
self.insertTag(lineId,"Line","created_by",self.pluginName, False)
560-
561553
# finishing...
562554
c.close()
563555
feat=QgsFeature(lineId,"Line")
@@ -623,7 +615,6 @@ def createPolygon(self,mapPoints, doCommit=True):
623615
c.execute("insert into node (id,lat,lon,usage,status) values (:nodeId,:lat,:lon,1,'A')"
624616
,{ "nodeId":str(nodeId),"lat":str(lat),"lon":str(lon) })
625617

626-
self.insertTag(nodeId,"Point","created_by",self.pluginName, False)
627618
affected.add((nodeId,'Point'))
628619

629620
# insert record into table of way members
@@ -638,8 +629,6 @@ def createPolygon(self,mapPoints, doCommit=True):
638629
c.execute("insert into way (id,wkb,membercnt,closed,min_lat,min_lon,max_lat,max_lon,status) values (?,?,?,1,?,?,?,?,'A')"
639630
,(str(polygonId),sqlite3.Binary(""),str(cnt),str(minLat),str(minLon),str(maxLat),str(maxLon)))
640631

641-
self.insertTag(polygonId,"Polygon","created_by",self.pluginName, False)
642-
643632
# finish
644633
c.close()
645634
feat=QgsFeature(polygonId,"Polygon")

python/plugins/osm/DlgUploadOSM.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ def __createChangeset(self):
917917
userCommentBytes=userComment.toUtf8()
918918

919919
# create http request's body (create XML with info about uploaded way)
920-
requestXml=QString("<osm>\n<changeset>\n<tag k=\"created_by\" v=\"qgis plugin\"/>\n<tag k=\"comment\" v=\""+userCommentBytes.data()+"\"/>\n</changeset>\n</osm>")
920+
requestXml=QString("<osm>\n<changeset>\n<tag k=\"created_by\" v=\"QGIS OSM v0.4\"/>\n<tag k=\"comment\" v=\""+userCommentBytes.data()+"\"/>\n</changeset>\n</osm>")
921921

922922
# send prepared request
923923
requestBytes=requestXml.toAscii()

0 commit comments

Comments
 (0)