Skip to content

Commit

Permalink
Fix bags
Browse files Browse the repository at this point in the history
  • Loading branch information
mliubimov committed May 21, 2019
1 parent 13060f8 commit 8adc11a
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ __pycache__/
geotiff/

pickle/

settings\.pickle

*.pyc
12 changes: 9 additions & 3 deletions Canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,26 @@ def DeleteLaneFunc(self):
if index is not None:
borderLeft=key.find("Left")
borderRight=key.find("Right")
lane=key.find("lane")
st=key.find("stoplane")
if borderLeft!=-1:
label=key[:borderLeft]
del self.shapes[label+"Left"]
del self.shapes[label]
del self.shapes[label+"Right"]
elif borderRight!=-1:
label=key[:borderRight]
del self.shapes[label+"Right"]
del self.shapes[label]
elif shape.shape_type==shape.LANE:
del self.shapes[label+"Left"]
elif lane!=-1 and st==-1:
del self.shapes[key+"Right"]
del self.shapes[key+"Left"]
key1=key
del self.shapes[key]
else:
del self.shapes[key]
break
del self.shapes[key1]

self.draggableIndex=None
self.draggablePoint=None
self.update()
Expand Down
Binary file removed Canvas.pyc
Binary file not shown.
4 changes: 3 additions & 1 deletion MapCreator.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,9 @@ def createOverlapFunc(self):
self.type=self.OVERLAP
self.addToolBar(Qt.LeftToolBarArea,self.ToolbarOverlap)
self.ToolbarOverlap.setVisible(True)

self.ComboOverlapLanes.clear()
self.ComboOverlapSignal.clear()
self.ComboOverlapStopSign.clear()
self.addObjsToComboBox(self.ComboOverlapLanes,self.Lanes)
self.addObjsToComboBox(self.ComboOverlapLanes,self.Junctions,isFirst=False)
self.addObjsToComboBox(self.ComboOverlapSignal,self.Signals)
Expand Down
Binary file removed OffsetsDialog.pyc
Binary file not shown.
12 changes: 10 additions & 2 deletions Save.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,21 @@ def SaveTxt(self,filename):
continue
for point in shape.points:
obj.points.append([Decimal(point.x())*(self.resizeFactorWidth*Decimal(self.geotiffScale)),Decimal(point.y())*(self.resizeFactorHeight*Decimal(self.geotiffScale))])
bufPoints=[]
for obj in self.Overlaps:

point=obj.pointOverlap
Lanepoints=self.findById(obj.laneOverlapId,self.Lanes).points
print(point)
Lanepoints=self.findById(obj.laneOverlapId,self.Lanes)
if Lanepoints is None:
Lanepoints=self.findById(obj.laneOverlapId,self.Junctions)
Lanepoints=Lanepoints.points
pointMap=[Decimal(point.x())*(self.resizeFactorWidth*Decimal(self.geotiffScale)),Decimal(point.y())*(self.resizeFactorHeight*Decimal(self.geotiffScale))]
Lanepoints.insert(1, pointMap)
line = LineString(Lanepoints[:2])
Lanepoints.remove(pointMap)
dist = line.length
bufPoints.append(obj.pointOverlap)
obj.pointOverlap=dist
for obj in self.Signals:
point=None
Expand Down Expand Up @@ -162,6 +167,9 @@ def SaveTxt(self,filename):
gen=cr.BaseMapGeneration()

gen.start(self.Lanes,self.Junctions,self.Relations,self.Neighbors,self.Overlaps,self.Signals,self.StopSigns,self.offsetX,self.offsetY,self.rotation)
for i in range(0,len(self.Overlaps)):
self.Overlaps[i].pointOverlap=bufPoints[i]




Expand Down
1 change: 1 addition & 0 deletions create_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def start(self,roads,junctions,relations,neighbors,overlaps,signals,stopsigns,of

l = self.make_lanes(lanesxy, map, junction.id, False,junction.direction,int(junction.speed),None,None,None,float(junction.width),lanesxy_left,lanesxy_right,road)
road.add_lanes_to_section(junction.id)
self.addOverlaps(overlaps,l)
self.addRelations(relations,l)
for stopsign in stopsigns:
st=StopLane(stopsign.id,map)
Expand Down
1 change: 1 addition & 0 deletions map_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ def __init__(self, id, map):
self.stop_lane=self.stop_sign.stop_line.add()
self.stop_sign.id.id = id
self.stop_sign.type=2
self._id=id

def add_overlap(self, id):
self.stop_sign.overlap_id.add().id = str(id)
Expand Down
Binary file modified static/stopSmall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8adc11a

Please sign in to comment.