{"id":21678222,"url":"https://github.com/sharedstreets/sharedstreets-pbf","last_synced_at":"2025-04-12T05:14:43.226Z","repository":{"id":57358054,"uuid":"116394788","full_name":"sharedstreets/sharedstreets-pbf","owner":"sharedstreets","description":"SharedStreets PBF Parser","archived":false,"fork":false,"pushed_at":"2018-03-21T20:48:28.000Z","size":12582,"stargazers_count":3,"open_issues_count":0,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-12T05:14:35.273Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sharedstreets.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-05T14:45:04.000Z","updated_at":"2020-08-25T18:10:12.000Z","dependencies_parsed_at":"2022-09-26T16:40:40.097Z","dependency_job_id":null,"html_url":"https://github.com/sharedstreets/sharedstreets-pbf","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharedstreets%2Fsharedstreets-pbf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharedstreets%2Fsharedstreets-pbf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharedstreets%2Fsharedstreets-pbf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharedstreets%2Fsharedstreets-pbf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sharedstreets","download_url":"https://codeload.github.com/sharedstreets/sharedstreets-pbf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248519556,"owners_count":21117761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T14:27:21.240Z","updated_at":"2025-04-12T05:14:43.198Z","avatar_url":"https://github.com/sharedstreets.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SharedStreets PBF Parser\n\n[![npm version](https://badge.fury.io/js/sharedstreets-pbf.svg)](https://badge.fury.io/js/sharedstreets-pbf)\n[![Build Status](https://travis-ci.org/sharedstreets/sharedstreets-pbf.svg?branch=master)](https://travis-ci.org/sharedstreets/sharedstreets-pbf)\n\nReads [SharedStreets Protobuf buffers](https://github.com/sharedstreets/sharedstreets-ref-system/tree/master/proto).\n\n## Install\n\n**In Node.js**\n\n```bash\n$ yarn add sharedstreets-pbf\n```\n\n**CommonJS**\n\n```js\nconst sharedstreetsPbf = require('sharedstreets-pbf');\n```\n\n**Typescript**\n\n```js\nimport * as sharedstreetsPbf from 'sharedstreets-pbf';\n```\n\n## In Browser\n\nFor a full list of web examples, check out [SharedStreets examples](https://github.com/sharedstreets/sharedstreets-examples).\n\n## How to build\n\n\u003e `sharedstreets-pbf` uses submodules, make sure to include `--recursive` when cloning the repo.\n\n```bash\n$ git clone --recursive git@github.com:sharedstreets/sharedstreets-pbf.git\n$ cd sharedstreets-pbf\n$ yarn\n$ yarn build\n$ yarn test\n```\n\n## API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n#### Table of Contents\n\n-   [geometry](#geometry)\n-   [intersection](#intersection)\n-   [reference](#reference)\n-   [metadata](#metadata)\n-   [readBuffer](#readbuffer)\n\n### geometry\n\nGeometry Pbf\n\nParser for SharedStreets Geometry Pbf Buffers\n\n**Parameters**\n\n-   `buffer` **[Buffer](https://nodejs.org/api/buffer.html)** Pbf Buffer\n\n**Examples**\n\n```javascript\nconst buffer = fs.readFileSync('z-x-y.geometry.pbf')\n\nconst geoms = sharedstreetsPbf.geometry(buffer)\ngeoms[0].id // =\u003e '81f666c5e1e4de0f7df4fbd793d909b2'\n```\n\nReturns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;SharedStreetsGeometry\u003e** An Array of SharedStreet Geometry\n\n### intersection\n\nIntersection Pbf\n\nParser for SharedStreets Intersection Pbf Buffers\n\n**Parameters**\n\n-   `buffer` **[Buffer](https://nodejs.org/api/buffer.html)** Pbf Buffer\n\n**Examples**\n\n```javascript\nconst buffer = fs.readFileSync('z-x-y.intersection.pbf')\n\nconst intersections = sharedstreetsPbf.intersection(buffer)\nintersections[0].id // =\u003e '8037a9444353cd7dd3f58d9a436f2537'\n```\n\nReturns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;SharedStreetsIntersection\u003e** An Array of SharedStreet Intersections\n\n### reference\n\nReference Pbf\n\nParser for SharedStreets Reference Pbf Buffers\n\n**Parameters**\n\n-   `buffer` **[Buffer](https://nodejs.org/api/buffer.html)** Pbf Buffer\n\n**Examples**\n\n```javascript\nconst buffer = fs.readFileSync('z-x-y.reference.pbf')\n\nconst references = sharedstreetsPbf.reference(buffer)\nreferences[0].id // =\u003e '41d73e28819470745fa1f93dc46d82a9'\n```\n\nReturns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;SharedStreetsReferencePbf\u003e** An Array of SharedStreet References\n\n### metadata\n\nMetadata Pbf\n\nParser for SharedStreets Metadata Pbf Buffers\n\n**Parameters**\n\n-   `buffer` **[Buffer](https://nodejs.org/api/buffer.html)** Pbf Buffer\n\n**Examples**\n\n```javascript\nconst buffer = fs.readFileSync('z-x-y.metadata.pbf')\n\nconst metadatas = sharedstreetsPbf.metadata(buffer)\nmetadatas[0].geometryID // =\u003e '81f666c5e1e4de0f7df4fbd793d909b2'\n```\n\nReturns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;SharedStreetsMetadata\u003e** An Array of SharedStreet Metadatas\n\n### readBuffer\n\nDecode Delimited buffers using protobufjs\n\n**Parameters**\n\n-   `buffer` **([Buffer](https://nodejs.org/api/buffer.html) \\| [Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array))** Pbf Buffer\n-   `parser` **any** Protobufjs Parser\n\n**Examples**\n\n```javascript\nconst parser = sharedstreetsPbf.SharedStreetsProto.GISMetadata;\nconst results = sharedstreetsPbf.readBuffer(buffer, parser);\n```\n\nReturns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)\u003e** An Array of based on given Protobufjs Parser\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharedstreets%2Fsharedstreets-pbf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharedstreets%2Fsharedstreets-pbf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharedstreets%2Fsharedstreets-pbf/lists"}