sharedstreets / sharedstreets-js

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

Geometry & Intersection GeoJSON parsed from Pbf #1

Closed DenisCarriere closed 6 years ago

DenisCarriere commented 6 years ago

@kpwebb Was wondering if you can check the output of these GeoJSONs, all of which are being parsed directly from the Pbf files.

SharedStreets Geometry

https://github.com/sharedstreets/sharedstreets-js/blob/master/test/pbf/out/11-602-769.geometry.json

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "HGdvAjtekfDrLFzPevNtf3",
      "properties": {
        "id": "HGdvAjtekfDrLFzPevNtf3",
        "fromIntersectionId": "CnvWEFX8or1vwdEsJ3uMeC",
        "toIntersectionId": "6rmzoG63zZB4y9qTHKVFgk",
        "forwardReferenceId": "VgcQjjseNwVCuQAbJRjzyR",
        "backReferenceId": null,
        "roadClass": "Trunk"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            -74.007568359375,
            40.75239562988281
          ],
          [
            -74.00729370117188,
            40.753089904785156
          ]
        ]
      }
    },
...

SharedStreets Intersection

https://github.com/sharedstreets/sharedstreets-js/blob/master/test/pbf/out/11-602-769.intersection.json

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "GqJezjdNjXCJTe2GF5FRsL",
      "properties": {
        "id": "GqJezjdNjXCJTe2GF5FRsL",
        "osmNodeId": 42436088,
        "inboundReferenceIds": [
          "FC6bbhBJZ6rmGCpSRxMHfK",
          "ATpF4wynJAeRnQoSBi7QXv",
          "3XuKRafKzW1XRQzqEfCk7C",
          "M1TjUUwhyMiT7kY7qjPivF"
        ],
        "outboundReferenceIds": []
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          -74.00909423828125,
          40.72600173950195
        ]
      }
    },
...
kpwebb commented 6 years ago

@DenisCarriere looks good but curious about the References values. Per discussion want to make sure we can decode Pbf v3 references with the "oneof" field modifiers using this PBF lib.

kpwebb commented 6 years ago

Ah, looks like Mapbox PBF does support Oneof:

https://github.com/mapbox/pbf/pull/54

So let's figure out what's happening with the References. Can you post an issue for the problems you're seeing?

DenisCarriere commented 6 years ago

Yep, will do. Right now the error code is very "cryptic", I'll post it.

DenisCarriere commented 6 years ago

Moved to https://github.com/sharedstreets/sharedstreets-js-pbf/issues/1