fix polylines
This commit is contained in:
parent
a998e4b244
commit
b623e279a5
|
@ -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":
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue