Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 3, 2025

Implementing minimal tile encoder functionality to complement the existing decoder:

  • Understand current decoding flow (VectorTileParser → VectorTileLayer → VectorTileFeature)
  • Create VectorTileEncoder class with Encode method (reverse of Parse)
  • Create GeometryEncoder class (reverse of GeometryParser)
  • Create AttributesEncoder class (reverse of AttributesParser)
  • Add encoder tests to validate round-trip encoding/decoding (5 tests total)
  • Update documentation with encoder usage examples
  • Run all tests to ensure no regressions (28/28 tests pass, 1 network test expected to fail)
  • Request code review (fixed issue with ClosePath command)
  • Run security checks (no vulnerabilities found)
  • Make VectorTileEncoder.Encode return Stream for fluent API

Summary

This PR adds a complete tile encoder to the library, enabling users to create Mapbox vector tiles programmatically. The encoder:

  • Supports all geometry types (Point, LineString, Polygon)
  • Properly encodes attributes with type preservation
  • Uses ZigZag encoding for coordinates
  • Follows the Mapbox Vector Tile specification
  • Has been validated with round-trip tests on real tiles
  • Returns the stream for method chaining and fluent API usage

All 28 tests pass successfully.

Original prompt

This section details on the original issue you should resolve

<issue_title>add tile encoder</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)

@bertt no work has not started on this, better use one of the tools at https://github.com/mapbox/awesome-vector-tiles for encoding tiles @bertt Some discussion on https://github.com//issues/9

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits November 3, 2025 09:37
Co-authored-by: bertt <538812+bertt@users.noreply.github.com>
Co-authored-by: bertt <538812+bertt@users.noreply.github.com>
Co-authored-by: bertt <538812+bertt@users.noreply.github.com>
Co-authored-by: bertt <538812+bertt@users.noreply.github.com>
Copilot AI changed the title [WIP] add tile encoder Add tile encoder to complement existing decoder Nov 3, 2025
Copilot AI requested a review from bertt November 3, 2025 09:46
@bertt
Copy link
Owner

bertt commented Nov 13, 2025

@copilot make vector tile encoder return the stream

Co-authored-by: bertt <538812+bertt@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 13, 2025

@copilot make vector tile encoder return the stream

Done. Changed VectorTileEncoder.Encode() to return the stream instead of void. This allows for fluent API usage. (f3b725f)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • av-build-tel-api-v1.avaloniaui.net
    • Triggering command: dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.1/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.1/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll (dns block)
  • trailview-tiles.maps.komoot.net
    • Triggering command: /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/mapbox-vector-tile-cs/mapbox-vector-tile-cs/tests/bin/Debug/net8.0/mapbox.vector.tile.tests.runtimeconfig.json --depsfile /home/REDACTED/work/mapbox-vector-tile-cs/mapbox-vector-tile-cs/tests/bin/Debug/net8.0/mapbox.vector.tile.tests.deps.json /home/REDACTED/work/mapbox-vector-tile-cs/mapbox-vector-tile-cs/tests/bin/Debug/net8.0/testhost.dll --port 40591 --endpoint 127.0.0.1:040591 --role client --parentprocessid 3862 --telemetryoptedin false (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@bertt bertt marked this pull request as ready for review November 13, 2025 07:28
@bertt bertt merged commit f563f6f into master Nov 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add tile encoder

2 participants