Skip to content

Commit

Permalink
fix #16066
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Jan 23, 2025
1 parent f3d7f72 commit 9485604
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 2 additions & 4 deletions tools/edgesInDistricts.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,10 @@ def parse_args(args=None):
"taz only.")
dec = DistrictEdgeComputer(sumolib.net.readNet(nets[0]))
tazFiles = nets + options.taz_files.split(",")
polyReader = sumolib.shapes.polygon.PolygonReader(True)
for tf in tazFiles:
parse(tf, polyReader)
polygons = sumolib.shapes.polygon.read(tazFiles, includeTaz=True)
if options.verbose:
print("Calculating")
dec.computeWithin(polyReader.getPolygons(), options)
dec.computeWithin(polygons, options)
if options.verbose:
print("Writing results")
dec.writeResults(options)
11 changes: 7 additions & 4 deletions tools/sumolib/shapes/polygon.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ def getPolygons(self):
return self._polys


def read(filename, includeTaz=False):
polys = PolygonReader(includeTaz)
parse(filename, polys)
return polys.getPolygons()
def read(filenames, includeTaz=False):
pr = PolygonReader(includeTaz)
if isinstance(filenames, str):
filenames = [filenames]
for fn in filenames:
parse(miscutils.openz(fn), pr)
return pr.getPolygons()

0 comments on commit 9485604

Please sign in to comment.