sharedstreets / sharedstreets-js

SharedStreets (Node.js & Javascript)
https://sharedstreets.io
MIT License
78 stars 25 forks source link

Handling undefined formOfWay? #7

Closed DenisCarriere closed 6 years ago

DenisCarriere commented 6 years ago

@kpwebb Noticed one of the References doesn't include a FormOfWay.

https://github.com/sharedstreets/sharedstreets-pbf/blob/master/test/out/11-602-769.reference.json#L7382-L7400

{
  "id": "944634655577eb8226483308679432ae",
  "geometryId": "2d054651576c33ff932e0ab7b69be8fe",
  "locationReferences": [
    {
      "intersectionId": "936048d4659161202f7cdcda8b59f36e",
      "lon": -74.00621070000001,
      "lat": 40.7499808,
      "outboundBearing": 203,
      "distanceToNextRef": 31813
    },
    {
      "intersectionId": "d630f3adfab0a19e6e83cec87c2ff4f9",
      "lon": -74.003684,
      "lat": 40.748355000000004,
      "inboundBearing": 119
    }
  ]
},

Questions

kpwebb commented 6 years ago

Yeah, just checked. It's undefined and there's no such thing as "required" in proto3 but it's being set to zero in the PBF file. Can we make sure zeros/blanks get converted to undefined?

DenisCarriere commented 6 years ago

Ok! Just fixed it.. An undefined formOfWay will default to the value of 0.

👍

DenisCarriere commented 6 years ago

Can we make sure zeros/blanks get converted to undefined?

Yep! Going to check into that as well.. seems like those values are getting lost (maybe?)