Skip to content
Permalink
Browse files

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
  • Loading branch information
wonder
wonder committed Aug 6, 2009
1 parent cc05d67 commit 8a7b9c472ba694799dbca024a92fa1fb665309fb
@@ -43,7 +43,6 @@ def __init__(self,plugin):

self.plugin=plugin
self.canvas=plugin.canvas
self.pluginName="QGIS OSM v0.4"

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

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

# insert created_by tag of the new point
self.insertTag(nodeId,"Point","created_by",self.pluginName,False)

# finishing
c.close()

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

self.insertTag(nodeId,"Point","created_by",self.pluginName, False)
affected.add((nodeId,'Point'))

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

self.insertTag(lineId,"Line","created_by",self.pluginName, False)

# finishing...
c.close()
feat=QgsFeature(lineId,"Line")
@@ -623,7 +615,6 @@ def createPolygon(self,mapPoints, doCommit=True):
c.execute("insert into node (id,lat,lon,usage,status) values (:nodeId,:lat,:lon,1,'A')"
,{ "nodeId":str(nodeId),"lat":str(lat),"lon":str(lon) })

self.insertTag(nodeId,"Point","created_by",self.pluginName, False)
affected.add((nodeId,'Point'))

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

self.insertTag(polygonId,"Polygon","created_by",self.pluginName, False)

# finish
c.close()
feat=QgsFeature(polygonId,"Polygon")
@@ -917,7 +917,7 @@ def __createChangeset(self):
userCommentBytes=userComment.toUtf8()

# create http request's body (create XML with info about uploaded way)
requestXml=QString("<osm>\n<changeset>\n<tag k=\"created_by\" v=\"qgis plugin\"/>\n<tag k=\"comment\" v=\""+userCommentBytes.data()+"\"/>\n</changeset>\n</osm>")
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>")

# send prepared request
requestBytes=requestXml.toAscii()

0 comments on commit 8a7b9c4

Please sign in to comment.
You can’t perform that action at this time.