{"id":13784339,"url":"https://github.com/bertt/mapbox-vector-tile-cs","last_synced_at":"2026-01-22T01:17:02.385Z","repository":{"id":34384151,"uuid":"38310808","full_name":"bertt/mapbox-vector-tile-cs","owner":"bertt","description":"A .NET Standard 2.0 library for decoding a Mapbox vector tile","archived":false,"fork":false,"pushed_at":"2025-11-13T08:59:54.000Z","size":775,"stargazers_count":81,"open_issues_count":0,"forks_count":17,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-11-13T10:25:12.087Z","etag":null,"topics":["mapbox","vector-tiles"],"latest_commit_sha":null,"homepage":"","language":"C#","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/bertt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-06-30T13:28:37.000Z","updated_at":"2025-11-13T08:59:58.000Z","dependencies_parsed_at":"2024-01-18T10:57:15.010Z","dependency_job_id":"c9985e0c-1f26-4888-8171-e4c795d07b3b","html_url":"https://github.com/bertt/mapbox-vector-tile-cs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bertt/mapbox-vector-tile-cs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertt%2Fmapbox-vector-tile-cs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertt%2Fmapbox-vector-tile-cs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertt%2Fmapbox-vector-tile-cs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertt%2Fmapbox-vector-tile-cs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bertt","download_url":"https://codeload.github.com/bertt/mapbox-vector-tile-cs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertt%2Fmapbox-vector-tile-cs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28648641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["mapbox","vector-tiles"],"created_at":"2024-08-03T19:00:40.459Z","updated_at":"2026-01-22T01:17:02.380Z","avatar_url":"https://github.com/bertt.png","language":"C#","readme":"# mapbox-vector-tile-cs \n\n[![NuGet Status](http://img.shields.io/nuget/v/mapbox-vector-tile.svg?style=flat)](https://www.nuget.org/packages/mapbox-vector-tile/) ![.NET 8](https://github.com/bertt/mapbox-vector-tile-cs/workflows/.NET%208/badge.svg)\n\n.NET Standard 2.0 library for encoding and decoding Mapbox vector tiles. \n\n## Dependencies\n\n- protobuf-net https://github.com/protobuf-net/protobuf-net\n\n## Installation\n\n```\n$ Install-Package mapbox-vector-tile\n```\n\n## Usage\n\n### Decoding\n\n```cs\nconst string vtfile = \"vectortile.pbf\";\nvar stream = File.OpenRead(vtfile);\nvar layerInfos = VectorTileParser.Parse(stream);\n```\n\n### Encoding\n\n```cs\n// Create a layer\nvar layer = new VectorTileLayer(\"my_layer\", 2, 4096);\n\n// Create a feature with attributes and geometry\nvar attributes = new List\u003cKeyValuePair\u003cstring, object\u003e\u003e\n{\n    new KeyValuePair\u003cstring, object\u003e(\"name\", \"Example\"),\n    new KeyValuePair\u003cstring, object\u003e(\"value\", 42)\n};\n\nvar coordinates = new[] { new Coordinate(100, 200) };\nvar geometry = new List\u003cArraySegment\u003cCoordinate\u003e\u003e \n{ \n    new ArraySegment\u003cCoordinate\u003e(coordinates) \n};\n\nvar feature = new VectorTileFeature(\"1\", geometry, attributes, Tile.GeomType.Point, 4096);\nlayer.VectorTileFeatures.Add(feature);\n\n// Encode to stream\nvar layers = new List\u003cVectorTileLayer\u003e { layer };\nvar stream = VectorTileEncoder.Encode(layers, new MemoryStream());\n\n// Save to file\nFile.WriteAllBytes(\"output.pbf\", ((MemoryStream)stream).ToArray());\n```\n\nTip: If you use this library with vector tiles loading from a webserver, you could run into the following exception: \n'ProtoBuf.ProtoException: Invalid wire-type; this usually means you have over-written a file without truncating or setting the length'\nProbably you need to check the GZip compression, see also TileParserTests.cs for an example.\n\n## Building\n\n```\n$ git clone https://github.com/bertt/mapbox-vector-tile-cs.git\n$ cd mapbox-vector-tile-cs\n$ dotnet build\n```\n\n## Testing\n\n```\n$ git clone https://github.com/bertt/mapbox-vector-tile-cs.git\n$ cd mapbox-vector-tile-cs/tests/mapbox.vector.tile.tests\n$ dotnet test\nPassed!\nFailed: 0, Passed: 38, Skipped: 0, Total: 38, Duration: 937 ms\n```\n\n## Samples\n\n1] GeoJSON\n\nThe samples folder contains a simple console application that reads a vector tile from a file and converts to GeoJSON file.\n\n2] SkiaSharp Windows Forms Sample\n\nSkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. The samples folder contains a simple Windows Forms GUI application that reads a \nvector tile from a file and draws the geometries using SkiaSharp.\n\n3] Avalonia Sample\n\nThe samples folder contains a cross-platform GUI application built with Avalonia UI that reads a vector tile from a file and draws the geometries using Avalonia's native DrawingContext API. \nThis sample works on Windows, macOS, and Linux.\n\n## Benchmarking\n\nTest performed with Mapbox vector tile '14-8801-5371.vector.pbf'\n\nLayers used:\n\nPoint layer: parks (id=17) - 558 features\n\nLine layer: roads (id=8) - 686 features\n\nPolygon layer: building (id=5) - 975 features\n\n```\n\n| Method                    | Mean     | Error     | StdDev    |\n|-------------------------- |---------:|----------:|----------:|\n| ParseVectorTileFromStream | 1.401 us | 0.0133 us | 0.0125 us |\n```\n\n## History\n\n2025-11-13: release 5.3.0, add encoding vector tile\n\n2025-04-16: Release 5.2.3, updated licence in Nuget package\n\n2025-02-25: Release 5.2.2, nullable enabled\n\n2025-02-24: Release 5.2.1, improved memory handling\n\n2025-02-24: Release 5.2, library is now .NET Standard 2.0\n\n2025-01-29: Release 5.1, upgrading dependencies + remove GeoJSON.NET dependency + adding samples (SkiaSharp, GeoJSON)\n\n2023-11-26: Release 5.0.2, containing .NET 8\n\n2022-10-29: Release 5.0.1, upgrading dependencies \n\n2022-10-29: Release 5.0 containing .NET 6\n\n2018-08-28: Release 4.2 containing .NET Standard 2.0\n\n2018-03-08: Release 4.1 with fix for issue 16 (https://github.com/bertt/mapbox-vector-tile-cs/issues/16 - about serializing attributes)\n\n2017-10-19: Release 4.0 for .NET Standard 1.3\n\n2016-11-03: Release 3.1\n\nChanges: Add support for polygon inner- and outerrings\n\n2016-10-31: Release 3.0\n\nChanges: Add support for multi-geometries \n\n2015-07-08: Release 2.0 \n\n2015-07-07: Release 1.0 \n\n\n","funding_links":[],"categories":["Parsers \u0026 Generators","Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertt%2Fmapbox-vector-tile-cs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertt%2Fmapbox-vector-tile-cs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertt%2Fmapbox-vector-tile-cs/lists"}