fix polylines

This commit is contained in:
Milan Pässler 2020-02-14 16:57:09 +01:00
parent a998e4b244
commit b623e279a5
2 changed files with 7 additions and 8 deletions

View file

@ -27,13 +27,12 @@ proc parseLegPart(common: CommonData, lp: JsonNode): LegPart =
proc mkParseLeg*(common: CommonData): proc =
proc parseLeg(l: JsonNode): Leg =
if l{"polyG"}{"polyX"}.getElems().len() > 0:
result.polyline = Polyline(
type: "FeatureCollection"
)
for n in l{"polyG"}{"polyX"}.getElems():
result.polyline.features &= common.polylines[n.getInt()].features
echo pretty(%result.polyline)
if l{"jny"}{"polyG"}{"polyXL"}.getElems().len() > 0:
result.polyline = some(Polyline(
type: "FeatureCollection",
))
for n in l{"jny"}{"polyG"}{"polyXL"}.getElems():
result.polyline.get.features &= common.polylines[n.getInt()].features
let typeStr = l{"type"}.getStr()
if typeStr == "JNY":

View file

@ -69,7 +69,7 @@ type
cancelled*: bool
departure*: LegPart
arrival*: LegPart
polyline*: Polyline
polyline*: Option[Polyline]
distance*: Option[int] # required for isWalking or isTransfer
tripId*: Option[string] # required for not isWalking and not isTranfer
line*: Option[Line] # required for not isWalking and not isTranfer