diff --git a/README.md b/README.md index c92b15f6..f2c09422 100755 --- a/README.md +++ b/README.md @@ -33,6 +33,14 @@ A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2. +## Goals + +Making GIS data easy to parse and work with. One of the biggest issues in GIS right now is how segmented various niche tools are. The other issue is how most solutions to read GIS data are half baked, deprecated, or partially parse results that need to be transformed one more time to use them. + +So this tool exists to make GIS tools simple to use, various data fast to parse, and transformed to usable projections without having to worry about the details. + +Lastly the goal is for all code to be accessible to both the browser and locally. An example was the shapefile reader where it can pull from online data or handle extremely large data as well. + ## Install ```bash diff --git a/assets/badges/angles-brotli.svg b/assets/badges/angles-brotli.svg index 9bc0d19a..7f44ffdb 100644 --- a/assets/badges/angles-brotli.svg +++ b/assets/badges/angles-brotli.svg @@ -1 +1 @@ -brotli: 911 Bytesbrotli911 Bytes \ No newline at end of file +brotli: 934 Bytesbrotli934 Bytes \ No newline at end of file diff --git a/assets/badges/angles-file.svg b/assets/badges/angles-file.svg index 0887f5d2..bdc20530 100644 --- a/assets/badges/angles-file.svg +++ b/assets/badges/angles-file.svg @@ -1 +1 @@ -bundle: 2.453 kBbundle2.453 kB \ No newline at end of file +bundle: 2.48 kBbundle2.48 kB \ No newline at end of file diff --git a/assets/badges/angles-gzip-cover.svg b/assets/badges/angles-gzip-cover.svg index a630e245..03d65b34 100644 --- a/assets/badges/angles-gzip-cover.svg +++ b/assets/badges/angles-gzip-cover.svg @@ -1 +1 @@ -gzip: 1.009 kBgzip1.009 kB \ No newline at end of file +gzip: 1.036 kBgzip1.036 kB \ No newline at end of file diff --git a/assets/badges/angles-gzip.svg b/assets/badges/angles-gzip.svg index bceff984..c6e4470a 100644 --- a/assets/badges/angles-gzip.svg +++ b/assets/badges/angles-gzip.svg @@ -1 +1 @@ -gzip: 1.009 kBgzip1.009 kB \ No newline at end of file +gzip: 1.036 kBgzip1.036 kB \ No newline at end of file diff --git a/assets/badges/csv-gzip-cover.svg b/assets/badges/csv-gzip-cover.svg index 50c5fe27..13a668dc 100644 --- a/assets/badges/csv-gzip-cover.svg +++ b/assets/badges/csv-gzip-cover.svg @@ -1 +1 @@ -gzip: 887 Bytesgzip887 Bytes \ No newline at end of file +gzip: 888 Bytesgzip888 Bytes \ No newline at end of file diff --git a/assets/badges/csv-gzip.svg b/assets/badges/csv-gzip.svg index 26eafdb1..ca638595 100644 --- a/assets/badges/csv-gzip.svg +++ b/assets/badges/csv-gzip.svg @@ -1 +1 @@ -gzip: 887 Bytesgzip887 Bytes \ No newline at end of file +gzip: 888 Bytesgzip888 Bytes \ No newline at end of file diff --git a/assets/badges/dataTile-brotli.svg b/assets/badges/dataTile-brotli.svg index 4dd25e35..d6c0c883 100644 --- a/assets/badges/dataTile-brotli.svg +++ b/assets/badges/dataTile-brotli.svg @@ -1 +1 @@ -brotli: 1.171 kBbrotli1.171 kB \ No newline at end of file +brotli: 4.014 kBbrotli4.014 kB \ No newline at end of file diff --git a/assets/badges/dataTile-file.svg b/assets/badges/dataTile-file.svg index 5965614d..b9044098 100644 --- a/assets/badges/dataTile-file.svg +++ b/assets/badges/dataTile-file.svg @@ -1 +1 @@ -bundle: 2.584 kBbundle2.584 kB \ No newline at end of file +bundle: 12.012 kBbundle12.012 kB \ No newline at end of file diff --git a/assets/badges/dataTile-gzip-cover.svg b/assets/badges/dataTile-gzip-cover.svg index bdf665d5..d0f46302 100644 --- a/assets/badges/dataTile-gzip-cover.svg +++ b/assets/badges/dataTile-gzip-cover.svg @@ -1 +1 @@ -gzip: 1.267 kBgzip1.267 kB \ No newline at end of file +gzip: 4.432 kBgzip4.432 kB \ No newline at end of file diff --git a/assets/badges/dataTile-gzip.svg b/assets/badges/dataTile-gzip.svg index 356c3c73..715b90cb 100644 --- a/assets/badges/dataTile-gzip.svg +++ b/assets/badges/dataTile-gzip.svg @@ -1 +1 @@ -gzip: 1.267 kBgzip1.267 kB \ No newline at end of file +gzip: 4.432 kBgzip4.432 kB \ No newline at end of file diff --git a/assets/badges/datum-brotli.svg b/assets/badges/datum-brotli.svg index 7e31178b..5b0b88fe 100644 --- a/assets/badges/datum-brotli.svg +++ b/assets/badges/datum-brotli.svg @@ -1 +1 @@ -brotli: 1.97 kBbrotli1.97 kB \ No newline at end of file +brotli: 1.96 kBbrotli1.96 kB \ No newline at end of file diff --git a/assets/badges/datum-file.svg b/assets/badges/datum-file.svg index 45ab1176..8b2f3e12 100644 --- a/assets/badges/datum-file.svg +++ b/assets/badges/datum-file.svg @@ -1 +1 @@ -bundle: 5.115 kBbundle5.115 kB \ No newline at end of file +bundle: 5.123 kBbundle5.123 kB \ No newline at end of file diff --git a/assets/badges/datum-gzip-cover.svg b/assets/badges/datum-gzip-cover.svg index 587d2deb..0ebc5e6a 100644 --- a/assets/badges/datum-gzip-cover.svg +++ b/assets/badges/datum-gzip-cover.svg @@ -1 +1 @@ -gzip: 2.142 kBgzip2.142 kB \ No newline at end of file +gzip: 2.151 kBgzip2.151 kB \ No newline at end of file diff --git a/assets/badges/datum-gzip.svg b/assets/badges/datum-gzip.svg index 6af046bf..a2b7f929 100644 --- a/assets/badges/datum-gzip.svg +++ b/assets/badges/datum-gzip.svg @@ -1 +1 @@ -gzip: 2.142 kBgzip2.142 kB \ No newline at end of file +gzip: 2.151 kBgzip2.151 kB \ No newline at end of file diff --git a/assets/badges/delaunator-gzip-cover.svg b/assets/badges/delaunator-gzip-cover.svg index 4559c14d..deb473ba 100644 --- a/assets/badges/delaunator-gzip-cover.svg +++ b/assets/badges/delaunator-gzip-cover.svg @@ -1 +1 @@ -gzip: 2.96 kBgzip2.96 kB \ No newline at end of file +gzip: 2.958 kBgzip2.958 kB \ No newline at end of file diff --git a/assets/badges/delaunator-gzip.svg b/assets/badges/delaunator-gzip.svg index 667de204..865a90b7 100644 --- a/assets/badges/delaunator-gzip.svg +++ b/assets/badges/delaunator-gzip.svg @@ -1 +1 @@ -gzip: 2.96 kBgzip2.96 kB \ No newline at end of file +gzip: 2.958 kBgzip2.958 kB \ No newline at end of file diff --git a/assets/badges/externalSort-brotli.svg b/assets/badges/externalSort-brotli.svg index 4bcdd9f4..5b91318b 100644 --- a/assets/badges/externalSort-brotli.svg +++ b/assets/badges/externalSort-brotli.svg @@ -1 +1 @@ -brotli: 2.319 kBbrotli2.319 kB \ No newline at end of file +brotli: 2.311 kBbrotli2.311 kB \ No newline at end of file diff --git a/assets/badges/externalSort-file.svg b/assets/badges/externalSort-file.svg index f40a92a3..060c8c4c 100644 --- a/assets/badges/externalSort-file.svg +++ b/assets/badges/externalSort-file.svg @@ -1 +1 @@ -bundle: 6.161 kBbundle6.161 kB \ No newline at end of file +bundle: 6.126 kBbundle6.126 kB \ No newline at end of file diff --git a/assets/badges/externalSort-gzip-cover.svg b/assets/badges/externalSort-gzip-cover.svg index 878c83e4..aaf44cf2 100644 --- a/assets/badges/externalSort-gzip-cover.svg +++ b/assets/badges/externalSort-gzip-cover.svg @@ -1 +1 @@ -gzip: 2.544 kBgzip2.544 kB \ No newline at end of file +gzip: 2.539 kBgzip2.539 kB \ No newline at end of file diff --git a/assets/badges/externalSort-gzip.svg b/assets/badges/externalSort-gzip.svg index 37e18e6f..45d5a43b 100644 --- a/assets/badges/externalSort-gzip.svg +++ b/assets/badges/externalSort-gzip.svg @@ -1 +1 @@ -gzip: 2.544 kBgzip2.544 kB \ No newline at end of file +gzip: 2.539 kBgzip2.539 kB \ No newline at end of file diff --git a/assets/badges/gbfs-brotli.svg b/assets/badges/gbfs-brotli.svg index cd07f853..d4a5a4ff 100644 --- a/assets/badges/gbfs-brotli.svg +++ b/assets/badges/gbfs-brotli.svg @@ -1 +1 @@ -brotli: 1.309 kBbrotli1.309 kB \ No newline at end of file +brotli: 1.798 kBbrotli1.798 kB \ No newline at end of file diff --git a/assets/badges/gbfs-file.svg b/assets/badges/gbfs-file.svg index e84133b5..df987429 100644 --- a/assets/badges/gbfs-file.svg +++ b/assets/badges/gbfs-file.svg @@ -1 +1 @@ -bundle: 6.08 kBbundle6.08 kB \ No newline at end of file +bundle: 7.537 kBbundle7.537 kB \ No newline at end of file diff --git a/assets/badges/gbfs-gzip-cover.svg b/assets/badges/gbfs-gzip-cover.svg index 8b2a8564..c7c41d23 100644 --- a/assets/badges/gbfs-gzip-cover.svg +++ b/assets/badges/gbfs-gzip-cover.svg @@ -1 +1 @@ -gzip: 1.511 kBgzip1.511 kB \ No newline at end of file +gzip: 2.052 kBgzip2.052 kB \ No newline at end of file diff --git a/assets/badges/gbfs-gzip.svg b/assets/badges/gbfs-gzip.svg index 3006fa55..beb69746 100644 --- a/assets/badges/gbfs-gzip.svg +++ b/assets/badges/gbfs-gzip.svg @@ -1 +1 @@ -gzip: 1.511 kBgzip1.511 kB \ No newline at end of file +gzip: 2.052 kBgzip2.052 kB \ No newline at end of file diff --git a/assets/badges/geotiff-brotli.svg b/assets/badges/geotiff-brotli.svg index 24ef3d51..7ef2f904 100644 --- a/assets/badges/geotiff-brotli.svg +++ b/assets/badges/geotiff-brotli.svg @@ -1 +1 @@ -brotli: 21.006 kBbrotli21.006 kB \ No newline at end of file +brotli: 20.922 kBbrotli20.922 kB \ No newline at end of file diff --git a/assets/badges/geotiff-file.svg b/assets/badges/geotiff-file.svg index d5dc9dea..9d3c945b 100644 --- a/assets/badges/geotiff-file.svg +++ b/assets/badges/geotiff-file.svg @@ -1 +1 @@ -bundle: 64.233 kBbundle64.233 kB \ No newline at end of file +bundle: 64.266 kBbundle64.266 kB \ No newline at end of file diff --git a/assets/badges/geotiff-gzip-cover.svg b/assets/badges/geotiff-gzip-cover.svg index 3d563ccb..4c068bb1 100644 --- a/assets/badges/geotiff-gzip-cover.svg +++ b/assets/badges/geotiff-gzip-cover.svg @@ -1 +1 @@ -gzip: 23.951 kBgzip23.951 kB \ No newline at end of file +gzip: 23.963 kBgzip23.963 kB \ No newline at end of file diff --git a/assets/badges/geotiff-gzip.svg b/assets/badges/geotiff-gzip.svg index da037c89..56d05b05 100644 --- a/assets/badges/geotiff-gzip.svg +++ b/assets/badges/geotiff-gzip.svg @@ -1 +1 @@ -gzip: 23.951 kBgzip23.951 kB \ No newline at end of file +gzip: 23.963 kBgzip23.963 kB \ No newline at end of file diff --git a/assets/badges/grib2-brotli.svg b/assets/badges/grib2-brotli.svg index 6a2d272e..e8cdb82f 100644 --- a/assets/badges/grib2-brotli.svg +++ b/assets/badges/grib2-brotli.svg @@ -1 +1 @@ -brotli: 45.13 kBbrotli45.13 kB \ No newline at end of file +brotli: 45.076 kBbrotli45.076 kB \ No newline at end of file diff --git a/assets/badges/grib2-gzip-cover.svg b/assets/badges/grib2-gzip-cover.svg index ccc37172..c972fa62 100644 --- a/assets/badges/grib2-gzip-cover.svg +++ b/assets/badges/grib2-gzip-cover.svg @@ -1 +1 @@ -gzip: 54.694 kBgzip54.694 kB \ No newline at end of file +gzip: 54.689 kBgzip54.689 kB \ No newline at end of file diff --git a/assets/badges/grib2-gzip.svg b/assets/badges/grib2-gzip.svg index 4205afa2..5225207a 100644 --- a/assets/badges/grib2-gzip.svg +++ b/assets/badges/grib2-gzip.svg @@ -1 +1 @@ -gzip: 54.694 kBgzip54.694 kB \ No newline at end of file +gzip: 54.689 kBgzip54.689 kB \ No newline at end of file diff --git a/assets/badges/gtfs-brotli.svg b/assets/badges/gtfs-brotli.svg index dd1051ea..d48f901d 100644 --- a/assets/badges/gtfs-brotli.svg +++ b/assets/badges/gtfs-brotli.svg @@ -1 +1 @@ -brotli: 8.151 kBbrotli8.151 kB \ No newline at end of file +brotli: 7.349 kBbrotli7.349 kB \ No newline at end of file diff --git a/assets/badges/gtfs-file.svg b/assets/badges/gtfs-file.svg index 070c388e..a8f2e964 100644 --- a/assets/badges/gtfs-file.svg +++ b/assets/badges/gtfs-file.svg @@ -1 +1 @@ -bundle: 39.041 kBbundle39.041 kB \ No newline at end of file +bundle: 34.849 kBbundle34.849 kB \ No newline at end of file diff --git a/assets/badges/gtfs-gzip-cover.svg b/assets/badges/gtfs-gzip-cover.svg index cd3b7b4d..54910df1 100644 --- a/assets/badges/gtfs-gzip-cover.svg +++ b/assets/badges/gtfs-gzip-cover.svg @@ -1 +1 @@ -gzip: 9.125 kBgzip9.125 kB \ No newline at end of file +gzip: 8.213 kBgzip8.213 kB \ No newline at end of file diff --git a/assets/badges/gtfs-gzip.svg b/assets/badges/gtfs-gzip.svg index f0f28cda..6ffe5448 100644 --- a/assets/badges/gtfs-gzip.svg +++ b/assets/badges/gtfs-gzip.svg @@ -1 +1 @@ -gzip: 9.125 kBgzip9.125 kB \ No newline at end of file +gzip: 8.213 kBgzip8.213 kB \ No newline at end of file diff --git a/assets/badges/id-brotli.svg b/assets/badges/id-brotli.svg index ec210c72..efe380da 100644 --- a/assets/badges/id-brotli.svg +++ b/assets/badges/id-brotli.svg @@ -1 +1 @@ -brotli: 2.531 kBbrotli2.531 kB \ No newline at end of file +brotli: 2.65 kBbrotli2.65 kB \ No newline at end of file diff --git a/assets/badges/id-file.svg b/assets/badges/id-file.svg index ba54c703..8a825033 100644 --- a/assets/badges/id-file.svg +++ b/assets/badges/id-file.svg @@ -1 +1 @@ -bundle: 6.8 kBbundle6.8 kB \ No newline at end of file +bundle: 7.109 kBbundle7.109 kB \ No newline at end of file diff --git a/assets/badges/id-gzip-cover.svg b/assets/badges/id-gzip-cover.svg index c4774c58..a72416d8 100644 --- a/assets/badges/id-gzip-cover.svg +++ b/assets/badges/id-gzip-cover.svg @@ -1 +1 @@ -gzip: 2.771 kBgzip2.771 kB \ No newline at end of file +gzip: 2.907 kBgzip2.907 kB \ No newline at end of file diff --git a/assets/badges/id-gzip.svg b/assets/badges/id-gzip.svg index 7efe2cb2..b743ec4a 100644 --- a/assets/badges/id-gzip.svg +++ b/assets/badges/id-gzip.svg @@ -1 +1 @@ -gzip: 2.771 kBgzip2.771 kB \ No newline at end of file +gzip: 2.907 kBgzip2.907 kB \ No newline at end of file diff --git a/assets/badges/interpolators-brotli.svg b/assets/badges/interpolators-brotli.svg index 64f0cd85..bc2c0a16 100644 --- a/assets/badges/interpolators-brotli.svg +++ b/assets/badges/interpolators-brotli.svg @@ -1 +1 @@ -brotli: 1.935 kBbrotli1.935 kB \ No newline at end of file +brotli: 2.597 kBbrotli2.597 kB \ No newline at end of file diff --git a/assets/badges/interpolators-file.svg b/assets/badges/interpolators-file.svg index aaf8f0be..8cd7e59e 100644 --- a/assets/badges/interpolators-file.svg +++ b/assets/badges/interpolators-file.svg @@ -1 +1 @@ -bundle: 5.507 kBbundle5.507 kB \ No newline at end of file +bundle: 8.51 kBbundle8.51 kB \ No newline at end of file diff --git a/assets/badges/interpolators-gzip-cover.svg b/assets/badges/interpolators-gzip-cover.svg index 587d2deb..f8d50c91 100644 --- a/assets/badges/interpolators-gzip-cover.svg +++ b/assets/badges/interpolators-gzip-cover.svg @@ -1 +1 @@ -gzip: 2.142 kBgzip2.142 kB \ No newline at end of file +gzip: 2.925 kBgzip2.925 kB \ No newline at end of file diff --git a/assets/badges/interpolators-gzip.svg b/assets/badges/interpolators-gzip.svg index 6af046bf..9e142e00 100644 --- a/assets/badges/interpolators-gzip.svg +++ b/assets/badges/interpolators-gzip.svg @@ -1 +1 @@ -gzip: 2.142 kBgzip2.142 kB \ No newline at end of file +gzip: 2.925 kBgzip2.925 kB \ No newline at end of file diff --git a/assets/badges/jpeg-brotli.svg b/assets/badges/jpeg-brotli.svg index f3eea55f..e4e757d6 100644 --- a/assets/badges/jpeg-brotli.svg +++ b/assets/badges/jpeg-brotli.svg @@ -1 +1 @@ -brotli: 4.618 kBbrotli4.618 kB \ No newline at end of file +brotli: 4.612 kBbrotli4.612 kB \ No newline at end of file diff --git a/assets/badges/jpeg-gzip-cover.svg b/assets/badges/jpeg-gzip-cover.svg index aad2e8a7..d5078d55 100644 --- a/assets/badges/jpeg-gzip-cover.svg +++ b/assets/badges/jpeg-gzip-cover.svg @@ -1 +1 @@ -gzip: 5.197 kBgzip5.197 kB \ No newline at end of file +gzip: 5.198 kBgzip5.198 kB \ No newline at end of file diff --git a/assets/badges/jpeg-gzip.svg b/assets/badges/jpeg-gzip.svg index 6832da29..74b97b00 100644 --- a/assets/badges/jpeg-gzip.svg +++ b/assets/badges/jpeg-gzip.svg @@ -1 +1 @@ -gzip: 5.197 kBgzip5.197 kB \ No newline at end of file +gzip: 5.198 kBgzip5.198 kB \ No newline at end of file diff --git a/assets/badges/jpeg2000-brotli.svg b/assets/badges/jpeg2000-brotli.svg index a43e517f..5fb84105 100644 --- a/assets/badges/jpeg2000-brotli.svg +++ b/assets/badges/jpeg2000-brotli.svg @@ -1 +1 @@ -brotli: 8.833 kBbrotli8.833 kB \ No newline at end of file +brotli: 8.815 kBbrotli8.815 kB \ No newline at end of file diff --git a/assets/badges/jpeg2000-gzip-cover.svg b/assets/badges/jpeg2000-gzip-cover.svg index 192a17c0..5917fdb4 100644 --- a/assets/badges/jpeg2000-gzip-cover.svg +++ b/assets/badges/jpeg2000-gzip-cover.svg @@ -1 +1 @@ -gzip: 10.023 kBgzip10.023 kB \ No newline at end of file +gzip: 10.024 kBgzip10.024 kB \ No newline at end of file diff --git a/assets/badges/jpeg2000-gzip.svg b/assets/badges/jpeg2000-gzip.svg index 23ebb0aa..8b6031bd 100644 --- a/assets/badges/jpeg2000-gzip.svg +++ b/assets/badges/jpeg2000-gzip.svg @@ -1 +1 @@ -gzip: 10.023 kBgzip10.023 kB \ No newline at end of file +gzip: 10.024 kBgzip10.024 kB \ No newline at end of file diff --git a/assets/badges/json-brotli.svg b/assets/badges/json-brotli.svg index 6f7f27de..c36ec47e 100644 --- a/assets/badges/json-brotli.svg +++ b/assets/badges/json-brotli.svg @@ -1 +1 @@ -brotli: 1.125 kBbrotli1.125 kB \ No newline at end of file +brotli: 1.663 kBbrotli1.663 kB \ No newline at end of file diff --git a/assets/badges/json-file.svg b/assets/badges/json-file.svg index 7bc1a68f..17f36a10 100644 --- a/assets/badges/json-file.svg +++ b/assets/badges/json-file.svg @@ -1 +1 @@ -bundle: 3.304 kBbundle3.304 kB \ No newline at end of file +bundle: 4.826 kBbundle4.826 kB \ No newline at end of file diff --git a/assets/badges/json-gzip-cover.svg b/assets/badges/json-gzip-cover.svg index dac92f8c..26b6b7a4 100644 --- a/assets/badges/json-gzip-cover.svg +++ b/assets/badges/json-gzip-cover.svg @@ -1 +1 @@ -gzip: 1.239 kBgzip1.239 kB \ No newline at end of file +gzip: 1.82 kBgzip1.82 kB \ No newline at end of file diff --git a/assets/badges/json-gzip.svg b/assets/badges/json-gzip.svg index 5392ae22..8d207f52 100644 --- a/assets/badges/json-gzip.svg +++ b/assets/badges/json-gzip.svg @@ -1 +1 @@ -gzip: 1.239 kBgzip1.239 kB \ No newline at end of file +gzip: 1.82 kBgzip1.82 kB \ No newline at end of file diff --git a/assets/badges/kd-brotli.svg b/assets/badges/kd-brotli.svg index bd9dc769..b3021571 100644 --- a/assets/badges/kd-brotli.svg +++ b/assets/badges/kd-brotli.svg @@ -1 +1 @@ -brotli: 562 Bytesbrotli562 Bytes \ No newline at end of file +brotli: 550 Bytesbrotli550 Bytes \ No newline at end of file diff --git a/assets/badges/kv-brotli.svg b/assets/badges/kv-brotli.svg index 72b41754..f13882db 100644 --- a/assets/badges/kv-brotli.svg +++ b/assets/badges/kv-brotli.svg @@ -1 +1 @@ -brotli: 163 Bytesbrotli163 Bytes \ No newline at end of file +brotli: 181 Bytesbrotli181 Bytes \ No newline at end of file diff --git a/assets/badges/kv-file.svg b/assets/badges/kv-file.svg index 454a9d3e..77ed03fa 100644 --- a/assets/badges/kv-file.svg +++ b/assets/badges/kv-file.svg @@ -1 +1 @@ -bundle: 263 Bytesbundle263 Bytes \ No newline at end of file +bundle: 279 Bytesbundle279 Bytes \ No newline at end of file diff --git a/assets/badges/kv-gzip-cover.svg b/assets/badges/kv-gzip-cover.svg index 6395a303..e884025d 100644 --- a/assets/badges/kv-gzip-cover.svg +++ b/assets/badges/kv-gzip-cover.svg @@ -1 +1 @@ -gzip: 190 Bytesgzip190 Bytes \ No newline at end of file +gzip: 198 Bytesgzip198 Bytes \ No newline at end of file diff --git a/assets/badges/kv-gzip.svg b/assets/badges/kv-gzip.svg index 0c3e9d0c..a6c3d738 100644 --- a/assets/badges/kv-gzip.svg +++ b/assets/badges/kv-gzip.svg @@ -1 +1 @@ -gzip: 190 Bytesgzip190 Bytes \ No newline at end of file +gzip: 198 Bytesgzip198 Bytes \ No newline at end of file diff --git a/assets/badges/lanczos-brotli.svg b/assets/badges/lanczos-brotli.svg index a3af1590..e49638f8 100644 --- a/assets/badges/lanczos-brotli.svg +++ b/assets/badges/lanczos-brotli.svg @@ -1 +1 @@ -brotli: 1.126 kBbrotli1.126 kB \ No newline at end of file +brotli: 1.118 kBbrotli1.118 kB \ No newline at end of file diff --git a/assets/badges/lanczos-file.svg b/assets/badges/lanczos-file.svg index 22fecbda..0f2bef64 100644 --- a/assets/badges/lanczos-file.svg +++ b/assets/badges/lanczos-file.svg @@ -1 +1 @@ -bundle: 2.525 kBbundle2.525 kB \ No newline at end of file +bundle: 2.531 kBbundle2.531 kB \ No newline at end of file diff --git a/assets/badges/lanczos-gzip-cover.svg b/assets/badges/lanczos-gzip-cover.svg index dac92f8c..dedb5871 100644 --- a/assets/badges/lanczos-gzip-cover.svg +++ b/assets/badges/lanczos-gzip-cover.svg @@ -1 +1 @@ -gzip: 1.239 kBgzip1.239 kB \ No newline at end of file +gzip: 1.238 kBgzip1.238 kB \ No newline at end of file diff --git a/assets/badges/lanczos-gzip.svg b/assets/badges/lanczos-gzip.svg index 5392ae22..74c67d23 100644 --- a/assets/badges/lanczos-gzip.svg +++ b/assets/badges/lanczos-gzip.svg @@ -1 +1 @@ -gzip: 1.239 kBgzip1.239 kB \ No newline at end of file +gzip: 1.238 kBgzip1.238 kB \ No newline at end of file diff --git a/assets/badges/lonlat-brotli.svg b/assets/badges/lonlat-brotli.svg index 5b569151..8fddf205 100644 --- a/assets/badges/lonlat-brotli.svg +++ b/assets/badges/lonlat-brotli.svg @@ -1 +1 @@ -brotli: 373 Bytesbrotli373 Bytes \ No newline at end of file +brotli: 400 Bytesbrotli400 Bytes \ No newline at end of file diff --git a/assets/badges/lonlat-file.svg b/assets/badges/lonlat-file.svg index 81ee6149..60c5c719 100644 --- a/assets/badges/lonlat-file.svg +++ b/assets/badges/lonlat-file.svg @@ -1 +1 @@ -bundle: 666 Bytesbundle666 Bytes \ No newline at end of file +bundle: 729 Bytesbundle729 Bytes \ No newline at end of file diff --git a/assets/badges/lonlat-gzip-cover.svg b/assets/badges/lonlat-gzip-cover.svg index 4157e449..4d296220 100644 --- a/assets/badges/lonlat-gzip-cover.svg +++ b/assets/badges/lonlat-gzip-cover.svg @@ -1 +1 @@ -gzip: 400 Bytesgzip400 Bytes \ No newline at end of file +gzip: 428 Bytesgzip428 Bytes \ No newline at end of file diff --git a/assets/badges/lonlat-gzip.svg b/assets/badges/lonlat-gzip.svg index 3f905955..3592ea86 100644 --- a/assets/badges/lonlat-gzip.svg +++ b/assets/badges/lonlat-gzip.svg @@ -1 +1 @@ -gzip: 400 Bytesgzip400 Bytes \ No newline at end of file +gzip: 428 Bytesgzip428 Bytes \ No newline at end of file diff --git a/assets/badges/lzw-brotli.svg b/assets/badges/lzw-brotli.svg index 28d9bbcf..f1c06c4c 100644 --- a/assets/badges/lzw-brotli.svg +++ b/assets/badges/lzw-brotli.svg @@ -1 +1 @@ -brotli: 688 Bytesbrotli688 Bytes \ No newline at end of file +brotli: 683 Bytesbrotli683 Bytes \ No newline at end of file diff --git a/assets/badges/mgrs-brotli.svg b/assets/badges/mgrs-brotli.svg index 9963303d..5255e27e 100644 --- a/assets/badges/mgrs-brotli.svg +++ b/assets/badges/mgrs-brotli.svg @@ -1 +1 @@ -brotli: 2.208 kBbrotli2.208 kB \ No newline at end of file +brotli: 2.223 kBbrotli2.223 kB \ No newline at end of file diff --git a/assets/badges/mgrs-gzip-cover.svg b/assets/badges/mgrs-gzip-cover.svg index 4a9170c2..341f8f34 100644 --- a/assets/badges/mgrs-gzip-cover.svg +++ b/assets/badges/mgrs-gzip-cover.svg @@ -1 +1 @@ -gzip: 2.483 kBgzip2.483 kB \ No newline at end of file +gzip: 2.485 kBgzip2.485 kB \ No newline at end of file diff --git a/assets/badges/mgrs-gzip.svg b/assets/badges/mgrs-gzip.svg index 8c750843..22c38985 100644 --- a/assets/badges/mgrs-gzip.svg +++ b/assets/badges/mgrs-gzip.svg @@ -1 +1 @@ -gzip: 2.483 kBgzip2.483 kB \ No newline at end of file +gzip: 2.485 kBgzip2.485 kB \ No newline at end of file diff --git a/assets/badges/multimap-brotli.svg b/assets/badges/multimap-brotli.svg index e992f171..144fd4e4 100644 --- a/assets/badges/multimap-brotli.svg +++ b/assets/badges/multimap-brotli.svg @@ -1 +1 @@ -brotli: 359 Bytesbrotli359 Bytes \ No newline at end of file +brotli: 274 Bytesbrotli274 Bytes \ No newline at end of file diff --git a/assets/badges/multimap-file.svg b/assets/badges/multimap-file.svg index 62bbb9d3..3f5572e5 100644 --- a/assets/badges/multimap-file.svg +++ b/assets/badges/multimap-file.svg @@ -1 +1 @@ -bundle: 635 Bytesbundle635 Bytes \ No newline at end of file +bundle: 472 Bytesbundle472 Bytes \ No newline at end of file diff --git a/assets/badges/multimap-gzip-cover.svg b/assets/badges/multimap-gzip-cover.svg index 2e015bea..c1337642 100644 --- a/assets/badges/multimap-gzip-cover.svg +++ b/assets/badges/multimap-gzip-cover.svg @@ -1 +1 @@ -gzip: 402 Bytesgzip402 Bytes \ No newline at end of file +gzip: 318 Bytesgzip318 Bytes \ No newline at end of file diff --git a/assets/badges/multimap-gzip.svg b/assets/badges/multimap-gzip.svg index 6a861f7c..414711f7 100644 --- a/assets/badges/multimap-gzip.svg +++ b/assets/badges/multimap-gzip.svg @@ -1 +1 @@ -gzip: 402 Bytesgzip402 Bytes \ No newline at end of file +gzip: 318 Bytesgzip318 Bytes \ No newline at end of file diff --git a/assets/badges/netcdf-brotli.svg b/assets/badges/netcdf-brotli.svg index cbd5e20d..12f44f04 100644 --- a/assets/badges/netcdf-brotli.svg +++ b/assets/badges/netcdf-brotli.svg @@ -1 +1 @@ -brotli: 1.489 kBbrotli1.489 kB \ No newline at end of file +brotli: 1.49 kBbrotli1.49 kB \ No newline at end of file diff --git a/assets/badges/netcdf-gzip-cover.svg b/assets/badges/netcdf-gzip-cover.svg index eb2f0e46..7939d2dc 100644 --- a/assets/badges/netcdf-gzip-cover.svg +++ b/assets/badges/netcdf-gzip-cover.svg @@ -1 +1 @@ -gzip: 1.677 kBgzip1.677 kB \ No newline at end of file +gzip: 1.681 kBgzip1.681 kB \ No newline at end of file diff --git a/assets/badges/netcdf-gzip.svg b/assets/badges/netcdf-gzip.svg index 765c5d08..2730c37a 100644 --- a/assets/badges/netcdf-gzip.svg +++ b/assets/badges/netcdf-gzip.svg @@ -1 +1 @@ -gzip: 1.677 kBgzip1.677 kB \ No newline at end of file +gzip: 1.681 kBgzip1.681 kB \ No newline at end of file diff --git a/assets/badges/orthodrome-brotli.svg b/assets/badges/orthodrome-brotli.svg index 8468eb12..aa820e0a 100644 --- a/assets/badges/orthodrome-brotli.svg +++ b/assets/badges/orthodrome-brotli.svg @@ -1 +1 @@ -brotli: 405 Bytesbrotli405 Bytes \ No newline at end of file +brotli: 408 Bytesbrotli408 Bytes \ No newline at end of file diff --git a/assets/badges/orthodrome-gzip-cover.svg b/assets/badges/orthodrome-gzip-cover.svg index dda3e500..5090a845 100644 --- a/assets/badges/orthodrome-gzip-cover.svg +++ b/assets/badges/orthodrome-gzip-cover.svg @@ -1 +1 @@ -gzip: 462 Bytesgzip462 Bytes \ No newline at end of file +gzip: 465 Bytesgzip465 Bytes \ No newline at end of file diff --git a/assets/badges/orthodrome-gzip.svg b/assets/badges/orthodrome-gzip.svg index db1f5c48..36213a22 100644 --- a/assets/badges/orthodrome-gzip.svg +++ b/assets/badges/orthodrome-gzip.svg @@ -1 +1 @@ -gzip: 462 Bytesgzip462 Bytes \ No newline at end of file +gzip: 465 Bytesgzip465 Bytes \ No newline at end of file diff --git a/assets/badges/osm-brotli.svg b/assets/badges/osm-brotli.svg index 436d340f..1a2f895f 100644 --- a/assets/badges/osm-brotli.svg +++ b/assets/badges/osm-brotli.svg @@ -1 +1 @@ -brotli: 6.447 kBbrotli6.447 kB \ No newline at end of file +brotli: 5.168 kBbrotli5.168 kB \ No newline at end of file diff --git a/assets/badges/osm-file.svg b/assets/badges/osm-file.svg index 6959e5fe..95d08dc5 100644 --- a/assets/badges/osm-file.svg +++ b/assets/badges/osm-file.svg @@ -1 +1 @@ -bundle: 25.525 kBbundle25.525 kB \ No newline at end of file +bundle: 19.883 kBbundle19.883 kB \ No newline at end of file diff --git a/assets/badges/osm-gzip-cover.svg b/assets/badges/osm-gzip-cover.svg index edfb5ff7..65ea1935 100644 --- a/assets/badges/osm-gzip-cover.svg +++ b/assets/badges/osm-gzip-cover.svg @@ -1 +1 @@ -gzip: 7.175 kBgzip7.175 kB \ No newline at end of file +gzip: 5.711 kBgzip5.711 kB \ No newline at end of file diff --git a/assets/badges/osm-gzip.svg b/assets/badges/osm-gzip.svg index 21024ffa..311da9e2 100644 --- a/assets/badges/osm-gzip.svg +++ b/assets/badges/osm-gzip.svg @@ -1 +1 @@ -gzip: 7.175 kBgzip7.175 kB \ No newline at end of file +gzip: 5.711 kBgzip5.711 kB \ No newline at end of file diff --git a/assets/badges/pmtilesReader-brotli.svg b/assets/badges/pmtilesReader-brotli.svg index 76bab186..306104b4 100644 --- a/assets/badges/pmtilesReader-brotli.svg +++ b/assets/badges/pmtilesReader-brotli.svg @@ -1 +1 @@ -brotli: 2.595 kBbrotli2.595 kB \ No newline at end of file +brotli: 2.604 kBbrotli2.604 kB \ No newline at end of file diff --git a/assets/badges/pmtilesReader-gzip-cover.svg b/assets/badges/pmtilesReader-gzip-cover.svg index 9e2a05ee..dcf794b8 100644 --- a/assets/badges/pmtilesReader-gzip-cover.svg +++ b/assets/badges/pmtilesReader-gzip-cover.svg @@ -1 +1 @@ -gzip: 2.903 kBgzip2.903 kB \ No newline at end of file +gzip: 2.91 kBgzip2.91 kB \ No newline at end of file diff --git a/assets/badges/pmtilesReader-gzip.svg b/assets/badges/pmtilesReader-gzip.svg index 4d2581d1..a8183d1e 100644 --- a/assets/badges/pmtilesReader-gzip.svg +++ b/assets/badges/pmtilesReader-gzip.svg @@ -1 +1 @@ -gzip: 2.903 kBgzip2.903 kB \ No newline at end of file +gzip: 2.91 kBgzip2.91 kB \ No newline at end of file diff --git a/assets/badges/pmtilesWriter-brotli.svg b/assets/badges/pmtilesWriter-brotli.svg index 8e4378c8..cc2055e2 100644 --- a/assets/badges/pmtilesWriter-brotli.svg +++ b/assets/badges/pmtilesWriter-brotli.svg @@ -1 +1 @@ -brotli: 2.562 kBbrotli2.562 kB \ No newline at end of file +brotli: 2.571 kBbrotli2.571 kB \ No newline at end of file diff --git a/assets/badges/pmtilesWriter-file.svg b/assets/badges/pmtilesWriter-file.svg index d6b84c9b..1b9a8298 100644 --- a/assets/badges/pmtilesWriter-file.svg +++ b/assets/badges/pmtilesWriter-file.svg @@ -1 +1 @@ -bundle: 8.83 kBbundle8.83 kB \ No newline at end of file +bundle: 8.838 kBbundle8.838 kB \ No newline at end of file diff --git a/assets/badges/pmtilesWriter-gzip-cover.svg b/assets/badges/pmtilesWriter-gzip-cover.svg index a31f5f6e..f81b5021 100644 --- a/assets/badges/pmtilesWriter-gzip-cover.svg +++ b/assets/badges/pmtilesWriter-gzip-cover.svg @@ -1 +1 @@ -gzip: 2.911 kBgzip2.911 kB \ No newline at end of file +gzip: 2.915 kBgzip2.915 kB \ No newline at end of file diff --git a/assets/badges/pmtilesWriter-gzip.svg b/assets/badges/pmtilesWriter-gzip.svg index 29ef584d..2157c624 100644 --- a/assets/badges/pmtilesWriter-gzip.svg +++ b/assets/badges/pmtilesWriter-gzip.svg @@ -1 +1 @@ -gzip: 2.911 kBgzip2.911 kB \ No newline at end of file +gzip: 2.915 kBgzip2.915 kB \ No newline at end of file diff --git a/assets/badges/pointCluster-brotli.svg b/assets/badges/pointCluster-brotli.svg index c1623154..c51314a8 100644 --- a/assets/badges/pointCluster-brotli.svg +++ b/assets/badges/pointCluster-brotli.svg @@ -1 +1 @@ -brotli: 6.159 kBbrotli6.159 kB \ No newline at end of file +brotli: 7.189 kBbrotli7.189 kB \ No newline at end of file diff --git a/assets/badges/pointCluster-file.svg b/assets/badges/pointCluster-file.svg index fe1b5562..448722d8 100644 --- a/assets/badges/pointCluster-file.svg +++ b/assets/badges/pointCluster-file.svg @@ -1 +1 @@ -bundle: 18.39 kBbundle18.39 kB \ No newline at end of file +bundle: 22.487 kBbundle22.487 kB \ No newline at end of file diff --git a/assets/badges/pointCluster-gzip-cover.svg b/assets/badges/pointCluster-gzip-cover.svg index 73368fe9..36864f69 100644 --- a/assets/badges/pointCluster-gzip-cover.svg +++ b/assets/badges/pointCluster-gzip-cover.svg @@ -1 +1 @@ -gzip: 6.782 kBgzip6.782 kB \ No newline at end of file +gzip: 7.969 kBgzip7.969 kB \ No newline at end of file diff --git a/assets/badges/pointCluster-gzip.svg b/assets/badges/pointCluster-gzip.svg index 1e5e74d1..a743e0e2 100644 --- a/assets/badges/pointCluster-gzip.svg +++ b/assets/badges/pointCluster-gzip.svg @@ -1 +1 @@ -gzip: 6.782 kBgzip6.782 kB \ No newline at end of file +gzip: 7.969 kBgzip7.969 kB \ No newline at end of file diff --git a/assets/badges/pointIndex-brotli.svg b/assets/badges/pointIndex-brotli.svg index e4f4fcf5..afc6804e 100644 --- a/assets/badges/pointIndex-brotli.svg +++ b/assets/badges/pointIndex-brotli.svg @@ -1 +1 @@ -brotli: 2.394 kBbrotli2.394 kB \ No newline at end of file +brotli: 2.767 kBbrotli2.767 kB \ No newline at end of file diff --git a/assets/badges/pointIndex-file.svg b/assets/badges/pointIndex-file.svg index 941194b5..762e2aa6 100644 --- a/assets/badges/pointIndex-file.svg +++ b/assets/badges/pointIndex-file.svg @@ -1 +1 @@ -bundle: 6.137 kBbundle6.137 kB \ No newline at end of file +bundle: 7.245 kBbundle7.245 kB \ No newline at end of file diff --git a/assets/badges/pointIndex-gzip-cover.svg b/assets/badges/pointIndex-gzip-cover.svg index 123a355e..63791cc6 100644 --- a/assets/badges/pointIndex-gzip-cover.svg +++ b/assets/badges/pointIndex-gzip-cover.svg @@ -1 +1 @@ -gzip: 2.616 kBgzip2.616 kB \ No newline at end of file +gzip: 3.03 kBgzip3.03 kB \ No newline at end of file diff --git a/assets/badges/pointIndex-gzip.svg b/assets/badges/pointIndex-gzip.svg index 9438183e..72d38eb1 100644 --- a/assets/badges/pointIndex-gzip.svg +++ b/assets/badges/pointIndex-gzip.svg @@ -1 +1 @@ -gzip: 2.616 kBgzip2.616 kB \ No newline at end of file +gzip: 3.03 kBgzip3.03 kB \ No newline at end of file diff --git a/assets/badges/pointIndexFast-brotli.svg b/assets/badges/pointIndexFast-brotli.svg index 0390ed4e..f88ac3b7 100644 --- a/assets/badges/pointIndexFast-brotli.svg +++ b/assets/badges/pointIndexFast-brotli.svg @@ -1 +1 @@ -brotli: 1.893 kBbrotli1.893 kB \ No newline at end of file +brotli: 2.23 kBbrotli2.23 kB \ No newline at end of file diff --git a/assets/badges/pointIndexFast-file.svg b/assets/badges/pointIndexFast-file.svg index 9dc542f4..5b1ec1d5 100644 --- a/assets/badges/pointIndexFast-file.svg +++ b/assets/badges/pointIndexFast-file.svg @@ -1 +1 @@ -bundle: 4.857 kBbundle4.857 kB \ No newline at end of file +bundle: 5.959 kBbundle5.959 kB \ No newline at end of file diff --git a/assets/badges/pointIndexFast-gzip-cover.svg b/assets/badges/pointIndexFast-gzip-cover.svg index 6d1bef06..7240a61a 100644 --- a/assets/badges/pointIndexFast-gzip-cover.svg +++ b/assets/badges/pointIndexFast-gzip-cover.svg @@ -1 +1 @@ -gzip: 2.075 kBgzip2.075 kB \ No newline at end of file +gzip: 2.459 kBgzip2.459 kB \ No newline at end of file diff --git a/assets/badges/pointIndexFast-gzip.svg b/assets/badges/pointIndexFast-gzip.svg index 62f6991f..ab179075 100644 --- a/assets/badges/pointIndexFast-gzip.svg +++ b/assets/badges/pointIndexFast-gzip.svg @@ -1 +1 @@ -gzip: 2.075 kBgzip2.075 kB \ No newline at end of file +gzip: 2.459 kBgzip2.459 kB \ No newline at end of file diff --git a/assets/badges/polylabel-gzip-cover.svg b/assets/badges/polylabel-gzip-cover.svg index fac21446..b9f893c5 100644 --- a/assets/badges/polylabel-gzip-cover.svg +++ b/assets/badges/polylabel-gzip-cover.svg @@ -1 +1 @@ -gzip: 1.06 kBgzip1.06 kB \ No newline at end of file +gzip: 1.057 kBgzip1.057 kB \ No newline at end of file diff --git a/assets/badges/polylabel-gzip.svg b/assets/badges/polylabel-gzip.svg index 67d4630b..7ebb650c 100644 --- a/assets/badges/polylabel-gzip.svg +++ b/assets/badges/polylabel-gzip.svg @@ -1 +1 @@ -gzip: 1.06 kBgzip1.06 kB \ No newline at end of file +gzip: 1.057 kBgzip1.057 kB \ No newline at end of file diff --git a/assets/badges/priorityQueue-brotli.svg b/assets/badges/priorityQueue-brotli.svg index f371d9a0..6f48055b 100644 --- a/assets/badges/priorityQueue-brotli.svg +++ b/assets/badges/priorityQueue-brotli.svg @@ -1 +1 @@ -brotli: 361 Bytesbrotli361 Bytes \ No newline at end of file +brotli: 362 Bytesbrotli362 Bytes \ No newline at end of file diff --git a/assets/badges/protobuf-brotli.svg b/assets/badges/protobuf-brotli.svg index 349e57d9..cc27a55a 100644 --- a/assets/badges/protobuf-brotli.svg +++ b/assets/badges/protobuf-brotli.svg @@ -1 +1 @@ -brotli: 2.286 kBbrotli2.286 kB \ No newline at end of file +brotli: 996 Bytesbrotli996 Bytes \ No newline at end of file diff --git a/assets/badges/protobuf-file.svg b/assets/badges/protobuf-file.svg index 8255892f..61302ff5 100644 --- a/assets/badges/protobuf-file.svg +++ b/assets/badges/protobuf-file.svg @@ -1 +1 @@ -bundle: 9.622 kBbundle9.622 kB \ No newline at end of file +bundle: 3.97 kBbundle3.97 kB \ No newline at end of file diff --git a/assets/badges/protobuf-gzip-cover.svg b/assets/badges/protobuf-gzip-cover.svg index d797c21e..424a3c8b 100644 --- a/assets/badges/protobuf-gzip-cover.svg +++ b/assets/badges/protobuf-gzip-cover.svg @@ -1 +1 @@ -gzip: 2.523 kBgzip2.523 kB \ No newline at end of file +gzip: 1.097 kBgzip1.097 kB \ No newline at end of file diff --git a/assets/badges/protobuf-gzip.svg b/assets/badges/protobuf-gzip.svg index ab4879eb..5024319e 100644 --- a/assets/badges/protobuf-gzip.svg +++ b/assets/badges/protobuf-gzip.svg @@ -1 +1 @@ -gzip: 2.523 kBgzip2.523 kB \ No newline at end of file +gzip: 1.097 kBgzip1.097 kB \ No newline at end of file diff --git a/assets/badges/s2-brotli.svg b/assets/badges/s2-brotli.svg index bba3b06d..e44143b5 100644 --- a/assets/badges/s2-brotli.svg +++ b/assets/badges/s2-brotli.svg @@ -1 +1 @@ -brotli: 2.578 kBbrotli2.578 kB \ No newline at end of file +brotli: 2.741 kBbrotli2.741 kB \ No newline at end of file diff --git a/assets/badges/s2-file.svg b/assets/badges/s2-file.svg index 4b1a9d53..7d64db5d 100644 --- a/assets/badges/s2-file.svg +++ b/assets/badges/s2-file.svg @@ -1 +1 @@ -bundle: 7.316 kBbundle7.316 kB \ No newline at end of file +bundle: 7.803 kBbundle7.803 kB \ No newline at end of file diff --git a/assets/badges/s2-gzip-cover.svg b/assets/badges/s2-gzip-cover.svg index 10a4b0e9..db507f76 100644 --- a/assets/badges/s2-gzip-cover.svg +++ b/assets/badges/s2-gzip-cover.svg @@ -1 +1 @@ -gzip: 2.857 kBgzip2.857 kB \ No newline at end of file +gzip: 3.013 kBgzip3.013 kB \ No newline at end of file diff --git a/assets/badges/s2-gzip.svg b/assets/badges/s2-gzip.svg index 62bec84f..a0d9134b 100644 --- a/assets/badges/s2-gzip.svg +++ b/assets/badges/s2-gzip.svg @@ -1 +1 @@ -gzip: 2.857 kBgzip2.857 kB \ No newline at end of file +gzip: 3.013 kBgzip3.013 kB \ No newline at end of file diff --git a/assets/badges/sat-brotli.svg b/assets/badges/sat-brotli.svg index 8a551209..580fc022 100644 --- a/assets/badges/sat-brotli.svg +++ b/assets/badges/sat-brotli.svg @@ -1 +1 @@ -brotli: 9.085 kBbrotli9.085 kB \ No newline at end of file +brotli: 9.093 kBbrotli9.093 kB \ No newline at end of file diff --git a/assets/badges/sat-gzip-cover.svg b/assets/badges/sat-gzip-cover.svg index 9da03519..25d90ab9 100644 --- a/assets/badges/sat-gzip-cover.svg +++ b/assets/badges/sat-gzip-cover.svg @@ -1 +1 @@ -gzip: 10.664 kBgzip10.664 kB \ No newline at end of file +gzip: 10.67 kBgzip10.67 kB \ No newline at end of file diff --git a/assets/badges/sat-gzip.svg b/assets/badges/sat-gzip.svg index e0b3a848..4b42e23e 100644 --- a/assets/badges/sat-gzip.svg +++ b/assets/badges/sat-gzip.svg @@ -1 +1 @@ -gzip: 10.664 kBgzip10.664 kB \ No newline at end of file +gzip: 10.67 kBgzip10.67 kB \ No newline at end of file diff --git a/assets/badges/shapefile-brotli.svg b/assets/badges/shapefile-brotli.svg index 78068b99..d423806f 100644 --- a/assets/badges/shapefile-brotli.svg +++ b/assets/badges/shapefile-brotli.svg @@ -1 +1 @@ -brotli: 1.473 kBbrotli1.473 kB \ No newline at end of file +brotli: 1.471 kBbrotli1.471 kB \ No newline at end of file diff --git a/assets/badges/shapefile-file.svg b/assets/badges/shapefile-file.svg index c966f6e3..daf51f11 100644 --- a/assets/badges/shapefile-file.svg +++ b/assets/badges/shapefile-file.svg @@ -1 +1 @@ -bundle: 3.572 kBbundle3.572 kB \ No newline at end of file +bundle: 3.581 kBbundle3.581 kB \ No newline at end of file diff --git a/assets/badges/shapefile-gzip-cover.svg b/assets/badges/shapefile-gzip-cover.svg index 38cc7587..7d0a6b0e 100644 --- a/assets/badges/shapefile-gzip-cover.svg +++ b/assets/badges/shapefile-gzip-cover.svg @@ -1 +1 @@ -gzip: 1.631 kBgzip1.631 kB \ No newline at end of file +gzip: 1.629 kBgzip1.629 kB \ No newline at end of file diff --git a/assets/badges/shapefile-gzip.svg b/assets/badges/shapefile-gzip.svg index 9f2e4081..49951b7f 100644 --- a/assets/badges/shapefile-gzip.svg +++ b/assets/badges/shapefile-gzip.svg @@ -1 +1 @@ -gzip: 1.631 kBgzip1.631 kB \ No newline at end of file +gzip: 1.629 kBgzip1.629 kB \ No newline at end of file diff --git a/assets/badges/tileReader-brotli.svg b/assets/badges/tileReader-brotli.svg index 9f8e6a5e..031c9036 100644 --- a/assets/badges/tileReader-brotli.svg +++ b/assets/badges/tileReader-brotli.svg @@ -1 +1 @@ -brotli: 1.851 kBbrotli1.851 kB \ No newline at end of file +brotli: 1.846 kBbrotli1.846 kB \ No newline at end of file diff --git a/assets/badges/tileReader-file.svg b/assets/badges/tileReader-file.svg index 618e8890..8f69d821 100644 --- a/assets/badges/tileReader-file.svg +++ b/assets/badges/tileReader-file.svg @@ -1 +1 @@ -bundle: 5.053 kBbundle5.053 kB \ No newline at end of file +bundle: 5.057 kBbundle5.057 kB \ No newline at end of file diff --git a/assets/badges/tileReader-gzip-cover.svg b/assets/badges/tileReader-gzip-cover.svg index cfd087ad..d6717e56 100644 --- a/assets/badges/tileReader-gzip-cover.svg +++ b/assets/badges/tileReader-gzip-cover.svg @@ -1 +1 @@ -gzip: 2.032 kBgzip2.032 kB \ No newline at end of file +gzip: 2.033 kBgzip2.033 kB \ No newline at end of file diff --git a/assets/badges/tileReader-gzip.svg b/assets/badges/tileReader-gzip.svg index 396cb73a..46616405 100644 --- a/assets/badges/tileReader-gzip.svg +++ b/assets/badges/tileReader-gzip.svg @@ -1 +1 @@ -gzip: 2.032 kBgzip2.032 kB \ No newline at end of file +gzip: 2.033 kBgzip2.033 kB \ No newline at end of file diff --git a/assets/badges/toJSON-brotli.svg b/assets/badges/toJSON-brotli.svg index c2502c13..440b14de 100644 --- a/assets/badges/toJSON-brotli.svg +++ b/assets/badges/toJSON-brotli.svg @@ -1 +1 @@ -brotli: 3.264 kBbrotli3.264 kB \ No newline at end of file +brotli: 3.328 kBbrotli3.328 kB \ No newline at end of file diff --git a/assets/badges/toJSON-file.svg b/assets/badges/toJSON-file.svg index c4209913..4d44e442 100644 --- a/assets/badges/toJSON-file.svg +++ b/assets/badges/toJSON-file.svg @@ -1 +1 @@ -bundle: 10.078 kBbundle10.078 kB \ No newline at end of file +bundle: 10.222 kBbundle10.222 kB \ No newline at end of file diff --git a/assets/badges/toJSON-gzip-cover.svg b/assets/badges/toJSON-gzip-cover.svg index 1efceeb9..ef13d26b 100644 --- a/assets/badges/toJSON-gzip-cover.svg +++ b/assets/badges/toJSON-gzip-cover.svg @@ -1 +1 @@ -gzip: 3.587 kBgzip3.587 kB \ No newline at end of file +gzip: 3.647 kBgzip3.647 kB \ No newline at end of file diff --git a/assets/badges/toJSON-gzip.svg b/assets/badges/toJSON-gzip.svg index cae6b597..1e2bb784 100644 --- a/assets/badges/toJSON-gzip.svg +++ b/assets/badges/toJSON-gzip.svg @@ -1 +1 @@ -gzip: 3.587 kBgzip3.587 kB \ No newline at end of file +gzip: 3.647 kBgzip3.647 kB \ No newline at end of file diff --git a/assets/badges/toTiles-brotli.svg b/assets/badges/toTiles-brotli.svg index d1f9d8cc..3f281db6 100644 --- a/assets/badges/toTiles-brotli.svg +++ b/assets/badges/toTiles-brotli.svg @@ -1 +1 @@ -brotli: 17.718 kBbrotli17.718 kB \ No newline at end of file +brotli: 18.812 kBbrotli18.812 kB \ No newline at end of file diff --git a/assets/badges/toTiles-file.svg b/assets/badges/toTiles-file.svg index 294b2099..4cefecea 100644 --- a/assets/badges/toTiles-file.svg +++ b/assets/badges/toTiles-file.svg @@ -1 +1 @@ -bundle: 64.058 kBbundle64.058 kB \ No newline at end of file +bundle: 68.979 kBbundle68.979 kB \ No newline at end of file diff --git a/assets/badges/toTiles-gzip-cover.svg b/assets/badges/toTiles-gzip-cover.svg index ca4fdfec..909d4d0b 100644 --- a/assets/badges/toTiles-gzip-cover.svg +++ b/assets/badges/toTiles-gzip-cover.svg @@ -1 +1 @@ -gzip: 19.987 kBgzip19.987 kB \ No newline at end of file +gzip: 21.328 kBgzip21.328 kB \ No newline at end of file diff --git a/assets/badges/toTiles-gzip.svg b/assets/badges/toTiles-gzip.svg index d2e23f03..0284bea4 100644 --- a/assets/badges/toTiles-gzip.svg +++ b/assets/badges/toTiles-gzip.svg @@ -1 +1 @@ -gzip: 19.987 kBgzip19.987 kB \ No newline at end of file +gzip: 21.328 kBgzip21.328 kB \ No newline at end of file diff --git a/assets/badges/tools-brotli.svg b/assets/badges/tools-brotli.svg index 4c86bad9..b9c5a4c6 100644 --- a/assets/badges/tools-brotli.svg +++ b/assets/badges/tools-brotli.svg @@ -1 +1 @@ -brotli: 6.339 kBbrotli6.339 kB \ No newline at end of file +brotli: 6.453 kBbrotli6.453 kB \ No newline at end of file diff --git a/assets/badges/tools-file.svg b/assets/badges/tools-file.svg index 48af2dd4..11c5d038 100644 --- a/assets/badges/tools-file.svg +++ b/assets/badges/tools-file.svg @@ -1 +1 @@ -bundle: 19.52 kBbundle19.52 kB \ No newline at end of file +bundle: 19.786 kBbundle19.786 kB \ No newline at end of file diff --git a/assets/badges/tools-gzip-cover.svg b/assets/badges/tools-gzip-cover.svg index b309682b..85456bf8 100644 --- a/assets/badges/tools-gzip-cover.svg +++ b/assets/badges/tools-gzip-cover.svg @@ -1 +1 @@ -gzip: 7.093 kBgzip7.093 kB \ No newline at end of file +gzip: 7.212 kBgzip7.212 kB \ No newline at end of file diff --git a/assets/badges/tools-gzip.svg b/assets/badges/tools-gzip.svg index 7f518ccb..25ee3112 100644 --- a/assets/badges/tools-gzip.svg +++ b/assets/badges/tools-gzip.svg @@ -1 +1 @@ -gzip: 7.093 kBgzip7.093 kB \ No newline at end of file +gzip: 7.212 kBgzip7.212 kB \ No newline at end of file diff --git a/assets/badges/transformer-brotli.svg b/assets/badges/transformer-brotli.svg index 6bd4111d..1f833a8d 100644 --- a/assets/badges/transformer-brotli.svg +++ b/assets/badges/transformer-brotli.svg @@ -1 +1 @@ -brotli: 8.88 kBbrotli8.88 kB \ No newline at end of file +brotli: 8.919 kBbrotli8.919 kB \ No newline at end of file diff --git a/assets/badges/transformer-file.svg b/assets/badges/transformer-file.svg index b6b02bd7..79b8efe1 100644 --- a/assets/badges/transformer-file.svg +++ b/assets/badges/transformer-file.svg @@ -1 +1 @@ -bundle: 25.713 kBbundle25.713 kB \ No newline at end of file +bundle: 25.715 kBbundle25.715 kB \ No newline at end of file diff --git a/assets/badges/transformer-gzip-cover.svg b/assets/badges/transformer-gzip-cover.svg index e356107a..44bce057 100644 --- a/assets/badges/transformer-gzip-cover.svg +++ b/assets/badges/transformer-gzip-cover.svg @@ -1 +1 @@ -gzip: 10.011 kBgzip10.011 kB \ No newline at end of file +gzip: 10.01 kBgzip10.01 kB \ No newline at end of file diff --git a/assets/badges/transformer-gzip.svg b/assets/badges/transformer-gzip.svg index 3cc042c4..159c9aa1 100644 --- a/assets/badges/transformer-gzip.svg +++ b/assets/badges/transformer-gzip.svg @@ -1 +1 @@ -gzip: 10.011 kBgzip10.011 kB \ No newline at end of file +gzip: 10.01 kBgzip10.01 kB \ No newline at end of file diff --git a/assets/badges/vector-brotli.svg b/assets/badges/vector-brotli.svg index cce1caa3..19970072 100644 --- a/assets/badges/vector-brotli.svg +++ b/assets/badges/vector-brotli.svg @@ -1 +1 @@ -brotli: 220 Bytesbrotli220 Bytes \ No newline at end of file +brotli: 203 Bytesbrotli203 Bytes \ No newline at end of file diff --git a/assets/badges/vector-file.svg b/assets/badges/vector-file.svg index b7fee757..7b5f56de 100644 --- a/assets/badges/vector-file.svg +++ b/assets/badges/vector-file.svg @@ -1 +1 @@ -bundle: 380 Bytesbundle380 Bytes \ No newline at end of file +bundle: 339 Bytesbundle339 Bytes \ No newline at end of file diff --git a/assets/badges/vector-gzip-cover.svg b/assets/badges/vector-gzip-cover.svg index 4aafcb7c..c9398d95 100644 --- a/assets/badges/vector-gzip-cover.svg +++ b/assets/badges/vector-gzip-cover.svg @@ -1 +1 @@ -gzip: 249 Bytesgzip249 Bytes \ No newline at end of file +gzip: 238 Bytesgzip238 Bytes \ No newline at end of file diff --git a/assets/badges/vector-gzip.svg b/assets/badges/vector-gzip.svg index 79990ade..9c52741b 100644 --- a/assets/badges/vector-gzip.svg +++ b/assets/badges/vector-gzip.svg @@ -1 +1 @@ -gzip: 249 Bytesgzip249 Bytes \ No newline at end of file +gzip: 238 Bytesgzip238 Bytes \ No newline at end of file diff --git a/assets/badges/wkt-brotli.svg b/assets/badges/wkt-brotli.svg index 6ede45eb..62c99aa8 100644 --- a/assets/badges/wkt-brotli.svg +++ b/assets/badges/wkt-brotli.svg @@ -1 +1 @@ -brotli: 2.375 kBbrotli2.375 kB \ No newline at end of file +brotli: 2.378 kBbrotli2.378 kB \ No newline at end of file diff --git a/assets/badges/wm-brotli.svg b/assets/badges/wm-brotli.svg index c6037639..443d74fc 100644 --- a/assets/badges/wm-brotli.svg +++ b/assets/badges/wm-brotli.svg @@ -1 +1 @@ -brotli: 3.829 kBbrotli3.829 kB \ No newline at end of file +brotli: 3.877 kBbrotli3.877 kB \ No newline at end of file diff --git a/assets/badges/wm-file.svg b/assets/badges/wm-file.svg index 1cddef1d..8605ccc7 100644 --- a/assets/badges/wm-file.svg +++ b/assets/badges/wm-file.svg @@ -1 +1 @@ -bundle: 10.68 kBbundle10.68 kB \ No newline at end of file +bundle: 10.722 kBbundle10.722 kB \ No newline at end of file diff --git a/assets/badges/wm-gzip-cover.svg b/assets/badges/wm-gzip-cover.svg index f12feced..2fe7411a 100644 --- a/assets/badges/wm-gzip-cover.svg +++ b/assets/badges/wm-gzip-cover.svg @@ -1 +1 @@ -gzip: 4.195 kBgzip4.195 kB \ No newline at end of file +gzip: 4.245 kBgzip4.245 kB \ No newline at end of file diff --git a/assets/badges/wm-gzip.svg b/assets/badges/wm-gzip.svg index 115a22a0..11d6cbf6 100644 --- a/assets/badges/wm-gzip.svg +++ b/assets/badges/wm-gzip.svg @@ -1 +1 @@ -gzip: 4.195 kBgzip4.195 kB \ No newline at end of file +gzip: 4.245 kBgzip4.245 kB \ No newline at end of file diff --git a/bun.lockb b/bun.lockb index b4da94fa..9aca65f1 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 261f3188..775d714f 100755 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "build:zig:bin": "zig build", "build:zig:optimize": "wasm-opt -Oz -o zig-out/bin/optimized-uint64.wasm zig-out/bin/uint64.wasm", "build:zig:strip": "wasm-strip zig-out/bin/optimized-uint64.wasm", + "build:badges": "bun run tools/buildBundles.ts", "cleanCoverage": "rm -rf coverage && mkdir coverage", "types:bundle": "bun run types:build && node scripts/types.mjs", "prepublishOnly": "bun run lint+build+test+docs", @@ -72,10 +73,10 @@ "devDependencies": { "@skypack/package-check": "^0.2.2", "@types/all-the-cities": "^3.1.3", - "@types/bun": "^1.1.16", - "@types/node": "^22.10.6", + "@types/bun": "^1.1.18", + "@types/node": "^22.10.7", "@types/tmp": "^0.2.6", - "@webgpu/types": "^0.1.52", + "@webgpu/types": "^0.1.53", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "all-the-cities": "^3.1.0", @@ -84,8 +85,8 @@ "esbuild": "^0.24.2", "eslint": "^9.18.0", "eslint-config-prettier": "^10.0.1", - "eslint-plugin-jsdoc": "^50.6.1", - "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-jsdoc": "^50.6.2", + "eslint-plugin-prettier": "^5.2.3", "eslint-plugin-tsdoc": "^0.4.0", "geotiff": "^2.1.3", "kdbush": "^4.0.2", @@ -99,12 +100,12 @@ "typedoc": "^0.27.6", "typedoc-plugin-coverage": "^3.4.1", "typescript": "^5.7.3", - "typescript-eslint": "^8.20.0" + "typescript-eslint": "^8.21.0" }, "dependencies": { "earclip": "^1.1.1", - "open-vector-tile": "^1.7.2", - "pbf-ts": "^1.0.3", + "open-vector-tile": "^1.7.4", + "pbf-ts": "^1.1.0", "s2-tilejson": "^1.9.5", "s2json-spec": "^1.7.3", "sharp": "^0.33.5" diff --git a/src/converters/toTiles/index.ts b/src/converters/toTiles/index.ts index c58a3be7..3979b62d 100644 --- a/src/converters/toTiles/index.ts +++ b/src/converters/toTiles/index.ts @@ -12,11 +12,15 @@ import type { SourceType, } from 's2-tilejson'; import type { + ClusterGridOptions, ClusterOptions, + ClusterRasterOptions, FeatureIterator, + InterpolationMethod, MValue, Properties, RGBA, + TileReader, TileStoreOptions, TileWriter, VectorFeatures, @@ -62,16 +66,8 @@ export interface RasterLayer< > extends BaseLayer { /** describes how the image will be stored */ outputType: ImageExtensions; - /** - * The type of interpolation to use for downsampling to parent tiles from children. - * Options: - * - average: average of the reference points - * - nearest: nearest neighbor interpolation - * - idw: Inverse Distance Weighted interpolation - * - lanczos: Lanczos 3 interpolation - * [default: lanczos] - */ - interpolation?: 'average' | 'nearest' | 'idw' | 'lanczos'; + /** Raster clustering guide */ + rasterGuide: ClusterRasterOptions; } /** Guide to building Raster layer data where the onFeature is stringified to ship to workers */ export interface StringifiedRasterLayer extends Omit { @@ -85,20 +81,8 @@ export interface GridLayer< D extends MValue = Properties, P extends Properties = Properties, > extends BaseLayer { - /** Method of accessing the value of interest. Defaults to the point's "z" value */ - getValue?: GetPointValue; - /** - * The type of interpolation to use for downsampling to parent tiles from children. - * Options: - * - average: average of the reference points - * - nearest: nearest neighbor interpolation - * - idw: Inverse Distance Weighted interpolation - * - lanczos: Lanczos 3 interpolation - * [default: lanczos] - */ - interpolation?: 'average' | 'nearest' | 'idw' | 'lanczos'; - /** Specify the tile buffer size in pixels. [default: 1] */ - bufferSize?: number; + /** Grid clustering guide */ + gridGuide: ClusterGridOptions; /** Extent at which the layer is storing its data */ extent: Extents; } @@ -239,6 +223,8 @@ export interface RasterBuildGuide > { /** Specify the image type. e.g. 'png', 'jpg', 'webp', etc. */ extension: ImageExtensions; + /** Used by cell search to specify the type of interpolation to use [default: 'lanczos'] */ + interpolation: InterpolationMethod; /** The description of the data */ description?: string; /** User defined minimum zoom level */ @@ -284,7 +270,7 @@ export async function toVectorTiles(buildGuide: BuildGuide): Promise { * @param rasterBuildGuide - the user defined guide on building the vector tiles */ export async function toRasterTiles(rasterBuildGuide: RasterBuildGuide): Promise { - const { description, minzoom, maxzoom, extension, onFeature } = rasterBuildGuide; + const { description, minzoom, maxzoom, extension, onFeature, interpolation } = rasterBuildGuide; // setup worker and layer const rasterLayer: RasterLayer = { sourceName: 'raster', @@ -297,6 +283,11 @@ export async function toRasterTiles(rasterBuildGuide: RasterBuildGuide): Promise drawTypes: [DrawType.Raster], shape: {}, }, + rasterGuide: { + search: 'cell', + getInterpolationValue: 'rgba', + interpolation, + }, onFeature, }; const buildGuide: BuildGuide = { @@ -308,6 +299,16 @@ export async function toRasterTiles(rasterBuildGuide: RasterBuildGuide): Promise await toVectorTiles(buildGuide); } +/** + * TODO: Merge tiles together + * @param _tileReaders - the tile readers to merge + * @param _tileWriter - the tile writer to write to + */ +export async function mergeTiles( + _tileReaders: TileReader[], + _tileWriter: TileWriter, +): Promise {} + /** * STEP 1: Convert all features to tile slices of said features. * @param buildGuide - the user defined guide on building the vector tiles diff --git a/src/dataStructures/pointCluster.ts b/src/dataStructures/pointCluster.ts index 0f4a6682..993b6add 100644 --- a/src/dataStructures/pointCluster.ts +++ b/src/dataStructures/pointCluster.ts @@ -58,7 +58,7 @@ export type ClusterStore = VectorStoreConstructor export type ClusterSearch = 'radial' | 'cell'; /** Options for point clustering */ -export interface ClusterOptions { +export interface BaseClusterOptions { /** type of store to use. Defaults to an in memory store */ store?: ClusterStore; /** projection to use */ @@ -79,10 +79,38 @@ export interface ClusterOptions { getInterpolationValue?: 'rgba' | GetInterpolateValue; /** Used by the cell search to specify the tile buffer size in pixels. [default: 0] */ bufferSize?: number; - /** Grid size, assumed pixel ratio. [default: 512] */ + /** Grid size, assumed pixel ratio. */ gridSize?: number; } +/** Options for point clustering */ +export interface ClusterOptions extends BaseClusterOptions { + /** search must be `radial` */ + search: 'radial'; +} + +/** Options for grid clustering */ +export interface ClusterRasterOptions extends BaseClusterOptions { + /** search must be `cell` */ + search: 'cell'; + /** Used by cell search to specify the type of interpolation to use. [Recommend: 'lanczos'] */ + interpolation: InterpolationMethod; + /** Used by cell search to specify the interpolation function to use */ + getInterpolationValue: 'rgba'; +} + +/** Options for grid clustering */ +export interface ClusterGridOptions extends BaseClusterOptions { + /** search must be `cell` */ + search: 'cell'; + /** Used by cell search to specify the type of interpolation to use. [Recommend: 'lanczos'] */ + interpolation: InterpolationMethod; + /** Used by cell search to specify the interpolation function to use. */ + getInterpolationValue: GetInterpolateValue; + /** Used by the cell search to specify the tile buffer size in pixels. [default: 0] */ + bufferSize: number; +} + /** An export of the data as a grid */ export interface TileGrid { name: string; @@ -155,7 +183,7 @@ export class PointCluster { */ constructor( data?: JSONCollection, M, M>, - options?: ClusterOptions, + options?: BaseClusterOptions, maxzoomStore?: VectorStore>>, ) { this.projection = options?.projection ?? 'S2'; @@ -320,6 +348,7 @@ export class PointCluster { /** * Cell clustering + * TODO: We build a catagorized cell of size x size with buffer * @param zoom - the zoom level * @param queryIndex - the index to query * @param currIndex - the index to insert into @@ -336,12 +365,13 @@ export class PointCluster { point: { m: clusterData }, } = clusterPoint; const parentID = parent(cell, zoom); + const [minParent, maxParent] = range(parentID); const parentPoint = toS2Point(parentID); // get all cells in parentID who haven't been visited yet. maxzoom does a radial search const cellPoints = ( maxzoom === zoom ? await queryIndex.searchRadius(parentPoint, this.#getLevelRadius(zoom)) - : await queryIndex.searchRange(parentID, parentID) + : await queryIndex.searchRange(minParent, maxParent) ).filter(({ point }) => point.m!.visited); // use interpolation if (cellPoints.length > 0) { @@ -412,7 +442,7 @@ export class PointCluster { const cellData = await this.getCellData(id); if (cellData === undefined) return; - // TODO: Organize all the cell data into a grid of gridSize. Then flatten if RGBA. Ship off. + // TODO: Organize all the cell data into a grid of gridSize. Then flatten if RGBA. return { name: layerName, diff --git a/src/dataStructures/pointIndex.ts b/src/dataStructures/pointIndex.ts index 8668bace..9c3ca31c 100644 --- a/src/dataStructures/pointIndex.ts +++ b/src/dataStructures/pointIndex.ts @@ -28,7 +28,7 @@ export interface PointShape { * * ## Description * An index of cells with radius queries - * Assumes the data is compatible with {@link Properties} + * Assumes the data is compatible with {@link https://open-s2.github.io/s2json/types/Properties.html} * * ## Usage * ```ts diff --git a/src/dataStructures/pointIndexFast.ts b/src/dataStructures/pointIndexFast.ts index ab81b68f..92db27de 100644 --- a/src/dataStructures/pointIndexFast.ts +++ b/src/dataStructures/pointIndexFast.ts @@ -29,7 +29,7 @@ const RAD = 0.017453292519943295; // Math.PI / 180; * * ## Description * An index of cells with radius queries - * Assumes the data is compatible with {@link Properties} + * Assumes the data is compatible with {@link https://open-s2.github.io/s2json/types/Properties.html} * Because of the nature of low level language like Javascript, using u64 is slow. This index * uses f64 which Number supports. So it is fast and efficient. * diff --git a/src/readers/gtfs/realtime/alert.ts b/src/readers/gtfs/realtime/alert.ts index e99a627a..fc05721f 100644 --- a/src/readers/gtfs/realtime/alert.ts +++ b/src/readers/gtfs/realtime/alert.ts @@ -1,6 +1,6 @@ import { GTFSRealtimeEntitySelector, GTFSRealtimeTranslatedString } from '.'; -import type { Pbf as Protobuf } from '../..'; +import type { PbfReader } from '../..'; /** Severity of this alert. */ export const enum GTFSRealtimeSeverityLevel { @@ -114,7 +114,7 @@ export class GTFSRealtimeAlert { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readAlert, this, end); } @@ -123,7 +123,7 @@ export class GTFSRealtimeAlert { * @param alert - The alert to mutate * @param pbf - The Protobuf object to read from */ - #readAlert(tag: number, alert: GTFSRealtimeAlert, pbf: Protobuf) { + #readAlert(tag: number, alert: GTFSRealtimeAlert, pbf: PbfReader) { if (tag === 1) alert.activePeriods.push(new GTFSRealtimeTimeRange(pbf, pbf.readVarint() + pbf.pos)); else if (tag === 5) @@ -175,7 +175,7 @@ export class GTFSRealtimeTimeRange { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readTimeRange, this, end); } @@ -184,7 +184,7 @@ export class GTFSRealtimeTimeRange { * @param timeRange - The timeRange to mutate * @param pbf - The Protobuf object to read from */ - #readTimeRange(tag: number, timeRange: GTFSRealtimeTimeRange, pbf: Protobuf) { + #readTimeRange(tag: number, timeRange: GTFSRealtimeTimeRange, pbf: PbfReader) { if (tag === 1) timeRange.start = new Date(pbf.readVarint() * 1000); else if (tag === 2) timeRange.end = new Date(pbf.readVarint() * 1000); else throw new Error('GTFSRealtimeTimeRange: unknown tag: ' + tag); diff --git a/src/readers/gtfs/realtime/entity.ts b/src/readers/gtfs/realtime/entity.ts index 7ca9b5bc..23180b63 100644 --- a/src/readers/gtfs/realtime/entity.ts +++ b/src/readers/gtfs/realtime/entity.ts @@ -8,7 +8,7 @@ import { GTFSRealtimeVehiclePosition, } from '.'; -import type { Pbf as Protobuf } from '../..'; +import type { PbfReader } from '../..'; /** The type of the message. */ export type GTFSRealtimeMessageType = @@ -60,7 +60,7 @@ export class GTFSRealtimeEntity { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readEntity, this, end); } @@ -83,7 +83,7 @@ export class GTFSRealtimeEntity { * @param entity - The entity to mutate * @param pbf - The Protobuf object to read from */ - #readEntity(tag: number, entity: GTFSRealtimeEntity, pbf: Protobuf): void { + #readEntity(tag: number, entity: GTFSRealtimeEntity, pbf: PbfReader): void { if (tag === 1) entity.id = pbf.readString(); else if (tag === 2) entity.isDeleted = pbf.readBoolean(); else if (tag === 3) @@ -125,7 +125,7 @@ export class GTFSRealtimeEntitySelector { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readEntity, this, end); } @@ -134,7 +134,7 @@ export class GTFSRealtimeEntitySelector { * @param entitySel - The entitySel to mutate * @param pbf - The Protobuf object to read from */ - #readEntity(tag: number, entitySel: GTFSRealtimeEntitySelector, pbf: Protobuf): void { + #readEntity(tag: number, entitySel: GTFSRealtimeEntitySelector, pbf: PbfReader): void { if (tag === 1) entitySel.agencyId = pbf.readString(); else if (tag === 2) entitySel.routeId = pbf.readString(); else if (tag === 3) entitySel.routeType = pbf.readSVarint(); diff --git a/src/readers/gtfs/realtime/header.ts b/src/readers/gtfs/realtime/header.ts index 5edee166..d95ed7c0 100644 --- a/src/readers/gtfs/realtime/header.ts +++ b/src/readers/gtfs/realtime/header.ts @@ -1,4 +1,4 @@ -import type { Pbf as Protobuf } from '../..'; +import type { PbfReader } from '../..'; /** * Determines whether the current fetch is incremental. Currently, @@ -43,7 +43,7 @@ export class GTFSRealtimeHeader { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readHeader, this, end); } @@ -52,7 +52,7 @@ export class GTFSRealtimeHeader { * @param layer - The layer to mutate * @param pbf - The Protobuf object to read from */ - #readHeader(tag: number, layer: GTFSRealtimeHeader, pbf: Protobuf): void { + #readHeader(tag: number, layer: GTFSRealtimeHeader, pbf: PbfReader): void { if (tag === 1) layer.gtfsRealtimeVersion = pbf.readString(); else if (tag === 2) layer.incrementality = pbf.readVarint() as Incrementality; else if (tag === 3) layer.timestamp = new Date(pbf.readVarint() * 1000); diff --git a/src/readers/gtfs/realtime/index.ts b/src/readers/gtfs/realtime/index.ts index c1b288df..98a708f2 100644 --- a/src/readers/gtfs/realtime/index.ts +++ b/src/readers/gtfs/realtime/index.ts @@ -1,6 +1,6 @@ import { GTFSRealtimeEntity } from './entity'; import { GTFSRealtimeHeader } from './header'; -import { Pbf as Protobuf } from 'pbf-ts'; +import { PbfReader } from 'pbf-ts'; export * from './stop'; export * from './trip'; @@ -17,7 +17,7 @@ export * from './vehiclePosition'; * * ## Description * The input is a Uint8Array that has encoded protobuffer messages. - * @see {@link Protobuf}. + * See {@link https://open-s2.github.io/pbf/classes/PbfReader.html}. * * The contents of a feed message. * A feed is a continuous stream of feed messages. Each message in the stream is @@ -48,8 +48,8 @@ export class GTFSRealtimeReader { * @param data - the input data to parse * @param end - the size of the data, leave blank to parse the entire data */ - constructor(data: Uint8Array, end = 0) { - const pbf = new Protobuf(data); + constructor(data: ArrayBuffer | Uint8Array, end = 0) { + const pbf = new PbfReader(data); pbf.readFields(this.#readMessage, this, end); } @@ -59,7 +59,7 @@ export class GTFSRealtimeReader { * @param message - the GTFSRealtime object to modify * @param pbf - the Protobuf to pull the appropriate data from */ - #readMessage(tag: number, message: GTFSRealtimeReader, pbf: Protobuf): void { + #readMessage(tag: number, message: GTFSRealtimeReader, pbf: PbfReader): void { if (tag === 1) { message.header = new GTFSRealtimeHeader(pbf, pbf.readVarint() + pbf.pos); } else if (tag === 2) { diff --git a/src/readers/gtfs/realtime/position.ts b/src/readers/gtfs/realtime/position.ts index 686f111e..16e728cf 100644 --- a/src/readers/gtfs/realtime/position.ts +++ b/src/readers/gtfs/realtime/position.ts @@ -1,4 +1,4 @@ -import type { Pbf as Protobuf } from '../..'; +import type { PbfReader } from '../..'; /** A Position is a point on the Earth's surface. */ export class GTFSRealtimePosition { @@ -23,7 +23,7 @@ export class GTFSRealtimePosition { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readTripDescriptor, this, end); } @@ -32,7 +32,7 @@ export class GTFSRealtimePosition { * @param position - The position to mutate * @param pbf - The Protobuf object to read from */ - #readTripDescriptor(tag: number, position: GTFSRealtimePosition, pbf: Protobuf) { + #readTripDescriptor(tag: number, position: GTFSRealtimePosition, pbf: PbfReader) { if (tag === 1) position.latitude = pbf.readFloat(); else if (tag === 2) position.longitude = pbf.readFloat(); else if (tag === 3) position.bearing = pbf.readFloat(); diff --git a/src/readers/gtfs/realtime/shape.ts b/src/readers/gtfs/realtime/shape.ts index 0fe3518a..f05d7c48 100644 --- a/src/readers/gtfs/realtime/shape.ts +++ b/src/readers/gtfs/realtime/shape.ts @@ -1,4 +1,4 @@ -import type { Pbf as Protobuf } from '../..'; +import type { PbfReader } from '../..'; /** * Describes the physical path that a vehicle takes when it's not part of the (CSV) GTFS, @@ -29,7 +29,7 @@ export class GTFSRealtimeShape { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readShape, this, end); } @@ -38,7 +38,7 @@ export class GTFSRealtimeShape { * @param shape - The shape to mutate * @param pbf - The Protobuf object to read from */ - #readShape(tag: number, shape: GTFSRealtimeShape, pbf: Protobuf): void { + #readShape(tag: number, shape: GTFSRealtimeShape, pbf: PbfReader): void { if (tag === 1) shape.shapeId = pbf.readString(); else if (tag === 2) shape.encodedPolyline = pbf.readString(); else throw new Error(`GTFSRealtimeShape: Unexpected tag: ${tag}`); diff --git a/src/readers/gtfs/realtime/stop/index.ts b/src/readers/gtfs/realtime/stop/index.ts index c06f835b..9f2b288a 100644 --- a/src/readers/gtfs/realtime/stop/index.ts +++ b/src/readers/gtfs/realtime/stop/index.ts @@ -1,6 +1,6 @@ import { GTFSRealtimeTranslatedString } from '..'; -import type { Pbf as Protobuf } from '../../..'; +import type { PbfReader } from '../../..'; export * from './timeEvent'; export * from './update'; @@ -36,7 +36,7 @@ export class GTFSRealtimeStop { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readStop, this, end); } @@ -45,7 +45,7 @@ export class GTFSRealtimeStop { * @param stop - The stop to mutate * @param pbf - The Protobuf object to read from */ - #readStop(tag: number, stop: GTFSRealtimeStop, pbf: Protobuf): void { + #readStop(tag: number, stop: GTFSRealtimeStop, pbf: PbfReader): void { if (tag === 1) stop.stopId = pbf.readString(); else if (tag === 2) stop.stopCode = new GTFSRealtimeTranslatedString(pbf, pbf.readVarint() + pbf.pos); diff --git a/src/readers/gtfs/realtime/stop/timeEvent.ts b/src/readers/gtfs/realtime/stop/timeEvent.ts index 2d59f94f..1886a525 100644 --- a/src/readers/gtfs/realtime/stop/timeEvent.ts +++ b/src/readers/gtfs/realtime/stop/timeEvent.ts @@ -1,4 +1,4 @@ -import type { Pbf as Protobuf } from '../../..'; +import type { PbfReader } from '../../..'; /** * Timing information for a single predicted event (either arrival or @@ -42,7 +42,7 @@ export class GTFSRealtimeStopTimeEvent { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readstopTimeUpdate, this, end); } @@ -51,7 +51,7 @@ export class GTFSRealtimeStopTimeEvent { * @param stopTimeEvent - The stopTimeEvent to mutate * @param pbf - The Protobuf object to read from */ - #readstopTimeUpdate(tag: number, stopTimeEvent: GTFSRealtimeStopTimeEvent, pbf: Protobuf) { + #readstopTimeUpdate(tag: number, stopTimeEvent: GTFSRealtimeStopTimeEvent, pbf: PbfReader) { if (tag === 1) stopTimeEvent.delay = pbf.readSVarint(); else if (tag === 2) stopTimeEvent.time = pbf.readSVarint(); else if (tag === 3) stopTimeEvent.uncertainty = pbf.readSVarint(); diff --git a/src/readers/gtfs/realtime/stop/update.ts b/src/readers/gtfs/realtime/stop/update.ts index e5c40523..15c5b6ae 100644 --- a/src/readers/gtfs/realtime/stop/update.ts +++ b/src/readers/gtfs/realtime/stop/update.ts @@ -1,6 +1,6 @@ import { GTFSRealtimeOccupancyStatus, GTFSRealtimeStopTimeEvent } from '..'; -import type { Pbf as Protobuf } from '../../..'; +import type { PbfReader } from '../../..'; /** The relation between the StopTimeEvents and the static schedule. */ export const enum GTFSRealtimeScheduleRelationshipUpdate { @@ -73,7 +73,7 @@ export class GTFSRealtimeStopTimeUpdate { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readstopTimeUpdate, this, end); } @@ -82,7 +82,7 @@ export class GTFSRealtimeStopTimeUpdate { * @param stopTimeUpdate - The stopTimeUpdate to mutate * @param pbf - The Protobuf object to read from */ - #readstopTimeUpdate(tag: number, stopTimeUpdate: GTFSRealtimeStopTimeUpdate, pbf: Protobuf) { + #readstopTimeUpdate(tag: number, stopTimeUpdate: GTFSRealtimeStopTimeUpdate, pbf: PbfReader) { if (tag === 1) stopTimeUpdate.stopSequence = pbf.readVarint(); else if (tag === 2) stopTimeUpdate.arrival = new GTFSRealtimeStopTimeEvent(pbf, pbf.readVarint() + pbf.pos); @@ -129,7 +129,7 @@ export class GTFSRealtimeStopTimeProperties { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readStopTimeProps, this, end); } @@ -138,7 +138,7 @@ export class GTFSRealtimeStopTimeProperties { * @param stopTimeProp - The stopTimeProp to mutate * @param pbf - The Protobuf object to read from */ - #readStopTimeProps(tag: number, stopTimeProp: GTFSRealtimeStopTimeProperties, pbf: Protobuf) { + #readStopTimeProps(tag: number, stopTimeProp: GTFSRealtimeStopTimeProperties, pbf: PbfReader) { if (tag === 1) stopTimeProp.assignedStopId = pbf.readString(); else throw new Error('GTFSRealtimeStopTimeProperties: unknown tag: ' + tag); } diff --git a/src/readers/gtfs/realtime/trip/descriptor.ts b/src/readers/gtfs/realtime/trip/descriptor.ts index 16d9c42b..8d625408 100644 --- a/src/readers/gtfs/realtime/trip/descriptor.ts +++ b/src/readers/gtfs/realtime/trip/descriptor.ts @@ -1,6 +1,6 @@ import { parseGtfsDate } from '../../utils'; -import type { Pbf as Protobuf } from '../../..'; +import type { PbfReader } from '../../..'; /** * The relation between this trip and the static schedule. If a trip is done @@ -138,7 +138,7 @@ export class GTFSRealtimeTripDescriptor { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readTripDescriptor, this, end); } @@ -147,7 +147,7 @@ export class GTFSRealtimeTripDescriptor { * @param tripDescriptor - The tripDescriptor to mutate * @param pbf - The Protobuf object to read from */ - #readTripDescriptor(tag: number, tripDescriptor: GTFSRealtimeTripDescriptor, pbf: Protobuf) { + #readTripDescriptor(tag: number, tripDescriptor: GTFSRealtimeTripDescriptor, pbf: PbfReader) { if (tag === 1) tripDescriptor.tripId = pbf.readString(); else if (tag === 2) tripDescriptor.startTime = pbf.readString(); else if (tag === 3) tripDescriptor.startDate = parseGtfsDate(pbf.readString()); @@ -189,7 +189,7 @@ export class GTFSRealtimeModifiedTripSelector { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readMTS, this, end); } @@ -198,7 +198,7 @@ export class GTFSRealtimeModifiedTripSelector { * @param tripDescriptor - The tripDescriptor to mutate * @param pbf - The Protobuf object to read from */ - #readMTS(tag: number, tripDescriptor: GTFSRealtimeModifiedTripSelector, pbf: Protobuf) { + #readMTS(tag: number, tripDescriptor: GTFSRealtimeModifiedTripSelector, pbf: PbfReader) { if (tag === 1) tripDescriptor.modificationsId = pbf.readString(); else if (tag === 2) tripDescriptor.affectedTripId = pbf.readString(); else if (tag === 3) tripDescriptor.startTime = pbf.readString(); diff --git a/src/readers/gtfs/realtime/trip/modifications.ts b/src/readers/gtfs/realtime/trip/modifications.ts index 59011fb7..76b515d6 100644 --- a/src/readers/gtfs/realtime/trip/modifications.ts +++ b/src/readers/gtfs/realtime/trip/modifications.ts @@ -1,4 +1,4 @@ -import type { Pbf as Protobuf } from '../../..'; +import type { PbfReader } from '../../..'; /** NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future. */ export class GTFSRealtimeTripModifications { @@ -23,7 +23,7 @@ export class GTFSRealtimeTripModifications { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readTripMods, this, end); } @@ -32,7 +32,7 @@ export class GTFSRealtimeTripModifications { * @param tripMods - The tripMods to mutate * @param pbf - The Protobuf object to read from */ - #readTripMods(tag: number, tripMods: GTFSRealtimeTripModifications, pbf: Protobuf) { + #readTripMods(tag: number, tripMods: GTFSRealtimeTripModifications, pbf: PbfReader) { if (tag === 1) tripMods.selectedTrips.push(new GTFSRealtimeSelectedTrips(pbf, pbf.readVarint() + pbf.pos)); else if (tag === 2) tripMods.startTimes.push(pbf.readString()); @@ -85,7 +85,7 @@ export class GTFSRealtimeModification { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readMod, this, end); } @@ -94,7 +94,7 @@ export class GTFSRealtimeModification { * @param mod - The mod to mutate * @param pbf - The Protobuf object to read from */ - #readMod(tag: number, mod: GTFSRealtimeModification, pbf: Protobuf) { + #readMod(tag: number, mod: GTFSRealtimeModification, pbf: PbfReader) { if (tag === 1) mod.startStopSelector = new GTFSRealtimeStopSelector(pbf, pbf.readVarint() + pbf.pos); else if (tag === 2) @@ -122,7 +122,7 @@ export class GTFSRealtimeStopSelector { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readStopSelector, this, end); } @@ -131,7 +131,7 @@ export class GTFSRealtimeStopSelector { * @param stopSelector - The stopSelector to mutate * @param pbf - The Protobuf object to read from */ - #readStopSelector(tag: number, stopSelector: GTFSRealtimeStopSelector, pbf: Protobuf) { + #readStopSelector(tag: number, stopSelector: GTFSRealtimeStopSelector, pbf: PbfReader) { if (tag === 1) stopSelector.stopSequence = pbf.readVarint(); else if (tag === 2) stopSelector.stopId = pbf.readString(); else throw new Error(`GTFSRealtimeStopSelector: Unexpected tag: ${tag}`); @@ -153,7 +153,7 @@ export class GTFSRealtimeSelectedTrips { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readSelectedTrips, this, end); } @@ -162,7 +162,7 @@ export class GTFSRealtimeSelectedTrips { * @param selectedTrips - The selectedTrips to mutate * @param pbf - The Protobuf object to read from */ - #readSelectedTrips(tag: number, selectedTrips: GTFSRealtimeSelectedTrips, pbf: Protobuf) { + #readSelectedTrips(tag: number, selectedTrips: GTFSRealtimeSelectedTrips, pbf: PbfReader) { if (tag === 1) selectedTrips.tripIds.push(pbf.readString()); else if (tag === 2) selectedTrips.shapeId = pbf.readString(); else throw new Error('GTFSRealtimeSelectedTrips: unknown tag: ' + tag); @@ -191,7 +191,7 @@ export class GTFSRealtimeReplacementStop { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readReplacementStop, this, end); } @@ -200,7 +200,7 @@ export class GTFSRealtimeReplacementStop { * @param replaceStop - The replaceStop to mutate * @param pbf - The Protobuf object to read from */ - #readReplacementStop(tag: number, replaceStop: GTFSRealtimeReplacementStop, pbf: Protobuf) { + #readReplacementStop(tag: number, replaceStop: GTFSRealtimeReplacementStop, pbf: PbfReader) { if (tag === 1) replaceStop.travelTimeToStop = pbf.readSVarint(); else if (tag === 2) replaceStop.stopId = pbf.readString(); else throw new Error('GTFSRealtimeReplacementStop: unknown tag: ' + tag); diff --git a/src/readers/gtfs/realtime/trip/properties.ts b/src/readers/gtfs/realtime/trip/properties.ts index 4905db25..1614aa2e 100644 --- a/src/readers/gtfs/realtime/trip/properties.ts +++ b/src/readers/gtfs/realtime/trip/properties.ts @@ -1,6 +1,6 @@ import { parseGtfsDate } from '../../utils'; -import type { Pbf as Protobuf } from '../../..'; +import type { PbfReader } from '../../..'; /** * Defines updated properties of the trip, such as a new shape_id when there is a detour. Or defines the @@ -54,7 +54,7 @@ export class GTFSRealtimeTripProperties { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readTripUpdate, this, end); } @@ -63,7 +63,7 @@ export class GTFSRealtimeTripProperties { * @param props - The props to mutate * @param pbf - The Protobuf object to read from */ - #readTripUpdate(tag: number, props: GTFSRealtimeTripProperties, pbf: Protobuf) { + #readTripUpdate(tag: number, props: GTFSRealtimeTripProperties, pbf: PbfReader) { if (tag === 1) props.tripId = pbf.readString(); else if (tag === 2) props.startDate = parseGtfsDate(pbf.readString()); else if (tag === 3) props.startTime = pbf.readString(); diff --git a/src/readers/gtfs/realtime/trip/update.ts b/src/readers/gtfs/realtime/trip/update.ts index a26bab82..e542906a 100644 --- a/src/readers/gtfs/realtime/trip/update.ts +++ b/src/readers/gtfs/realtime/trip/update.ts @@ -5,7 +5,7 @@ import { GTFSRealtimeVehicleDescriptor, } from '../../..'; -import type { Pbf as Protobuf } from '../../..'; +import type { PbfReader } from '../../..'; /** * Realtime update of the progress of a vehicle along a trip. @@ -98,7 +98,7 @@ export class GTFSRealtimeTripUpdate { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readTripUpdate, this, end); } @@ -107,7 +107,7 @@ export class GTFSRealtimeTripUpdate { * @param update - The update to mutate * @param pbf - The Protobuf object to read from */ - #readTripUpdate(tag: number, update: GTFSRealtimeTripUpdate, pbf: Protobuf) { + #readTripUpdate(tag: number, update: GTFSRealtimeTripUpdate, pbf: PbfReader): void { if (tag === 1) update.trip = new GTFSRealtimeTripDescriptor(pbf, pbf.readVarint() + pbf.pos); else if (tag === 2) update.stopTimeUpdate.push(new GTFSRealtimeStopTimeUpdate(pbf, pbf.readVarint() + pbf.pos)); diff --git a/src/readers/gtfs/realtime/util.ts b/src/readers/gtfs/realtime/util.ts index 7f8dc6f1..615acd71 100644 --- a/src/readers/gtfs/realtime/util.ts +++ b/src/readers/gtfs/realtime/util.ts @@ -1,4 +1,4 @@ -import type { Pbf as Protobuf } from '../..'; +import type { PbfReader } from '../..'; /** * An internationalized message containing per-language versions of a snippet of @@ -20,7 +20,7 @@ export class GTFSRealtimeTranslatedString { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readTranslations, this, end); } @@ -29,7 +29,7 @@ export class GTFSRealtimeTranslatedString { * @param translations - The translations to mutate * @param pbf - The Protobuf object to read from */ - #readTranslations(tag: number, translations: GTFSRealtimeTranslatedString, pbf: Protobuf): void { + #readTranslations(tag: number, translations: GTFSRealtimeTranslatedString, pbf: PbfReader): void { if (tag === 1) translations.translations.push(new GTFSRealtimeTranslation(pbf, pbf.readVarint() + pbf.pos)); else throw new Error(`GTFSRealtimeTranslatedString: Unexpected tag: ${tag}`); @@ -49,7 +49,7 @@ export class GTFSRealtimeTranslation { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readTranslation, this, end); } @@ -58,7 +58,7 @@ export class GTFSRealtimeTranslation { * @param trans - The trans to mutate * @param pbf - The Protobuf object to read from */ - #readTranslation(tag: number, trans: GTFSRealtimeTranslation, pbf: Protobuf): void { + #readTranslation(tag: number, trans: GTFSRealtimeTranslation, pbf: PbfReader): void { if (tag === 1) trans.text = pbf.readString(); else if (tag === 2) trans.language = pbf.readString(); else throw new Error(`GTFSRealtimeTranslation: Unexpected tag: ${tag}`); diff --git a/src/readers/gtfs/realtime/vehiclePosition.ts b/src/readers/gtfs/realtime/vehiclePosition.ts index 845bd2be..346301c0 100644 --- a/src/readers/gtfs/realtime/vehiclePosition.ts +++ b/src/readers/gtfs/realtime/vehiclePosition.ts @@ -1,6 +1,6 @@ import { GTFSRealtimePosition, GTFSRealtimeTripDescriptor } from './..'; -import type { Pbf as Protobuf } from '../..'; +import type { PbfReader } from '../..'; /** Status of the vehicle relative to the stop */ export const enum VehicleStopStatus { @@ -147,7 +147,7 @@ export class GTFSRealtimeVehiclePosition { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readVehiclePosition, this, end); } @@ -156,7 +156,7 @@ export class GTFSRealtimeVehiclePosition { * @param vehicle - The vehicle to mutate * @param pbf - The Protobuf object to read from */ - #readVehiclePosition(tag: number, vehicle: GTFSRealtimeVehiclePosition, pbf: Protobuf): void { + #readVehiclePosition(tag: number, vehicle: GTFSRealtimeVehiclePosition, pbf: PbfReader): void { if (tag === 1) vehicle.trip = new GTFSRealtimeTripDescriptor(pbf, pbf.readVarint() + pbf.pos); else if (tag === 2) vehicle.position = new GTFSRealtimePosition(pbf, pbf.readVarint() + pbf.pos); @@ -216,7 +216,7 @@ export class GTFSRealtimeVehicleDescriptor { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readDescriptor, this, end); } @@ -225,7 +225,7 @@ export class GTFSRealtimeVehicleDescriptor { * @param descriptor - The multi carriage details to mutate * @param pbf - The Protobuf object to read from */ - #readDescriptor(tag: number, descriptor: GTFSRealtimeVehicleDescriptor, pbf: Protobuf): void { + #readDescriptor(tag: number, descriptor: GTFSRealtimeVehicleDescriptor, pbf: PbfReader): void { if (tag === 1) descriptor.id = pbf.readString(); else if (tag === 2) descriptor.label = pbf.readString(); else if (tag === 3) descriptor.licensePlate = pbf.readString(); @@ -279,7 +279,7 @@ export class GTFSRealtimeMultiCarriageDetails { * @param pbf - The Protobuf object to read from * @param end - The end position of the message in the buffer */ - constructor(pbf: Protobuf, end: number) { + constructor(pbf: PbfReader, end: number) { pbf.readFields(this.#readMultiCarriageDetails, this, end); } @@ -291,7 +291,7 @@ export class GTFSRealtimeMultiCarriageDetails { #readMultiCarriageDetails( tag: number, multiCarriageDetails: GTFSRealtimeMultiCarriageDetails, - pbf: Protobuf, + pbf: PbfReader, ): void { if (tag === 1) multiCarriageDetails.id = pbf.readString(); else if (tag === 2) multiCarriageDetails.label = pbf.readString(); diff --git a/src/readers/osm/blob.ts b/src/readers/osm/blob.ts index 39a79c04..aa442635 100644 --- a/src/readers/osm/blob.ts +++ b/src/readers/osm/blob.ts @@ -1,6 +1,6 @@ import { decompressStream } from '../../util'; -import type { Pbf as Protobuf } from 'pbf-ts'; +import type { PbfReader } from 'pbf-ts'; // headers have a max size of 64KB export const OSM_MAX_HEADER_SIZE = 65536; // 64 * 1024; @@ -19,7 +19,7 @@ export class BlobHeader { datasize = 0; /** @param pbf - the Protobuf object to read from */ - constructor(pbf: Protobuf) { + constructor(pbf: PbfReader) { pbf.readFields(this.#readLayer, this, 0); } @@ -28,7 +28,7 @@ export class BlobHeader { * @param blobHeader - the blobHeader to modify * @param pbf - the Protobuf object to read from */ - #readLayer(tag: number, blobHeader: BlobHeader, pbf: Protobuf): void { + #readLayer(tag: number, blobHeader: BlobHeader, pbf: PbfReader): void { if (tag === 1) blobHeader.type = pbf.readString(); else if (tag === 2) blobHeader.indexdata = pbf.readBytes(); else if (tag === 3) blobHeader.datasize = pbf.readVarint(); @@ -43,7 +43,7 @@ export class Blob { data: Uint8Array | Promise = new Uint8Array(0); /** @param pbf - the Protobuf object to read from */ - constructor(pbf: Protobuf) { + constructor(pbf: PbfReader) { pbf.readFields(this.#readLayer, this, 0); } @@ -52,7 +52,7 @@ export class Blob { * @param blob - the blob to modify * @param pbf - the Protobuf object to read from */ - #readLayer(tag: number, blob: Blob, pbf: Protobuf): void { + #readLayer(tag: number, blob: Blob, pbf: PbfReader): void { // no compression if (tag === 1) blob.data = pbf.readBytes(); else if (tag === 2) blob.raw_size = pbf.readVarint(); diff --git a/src/readers/osm/headerBlock.ts b/src/readers/osm/headerBlock.ts index 96c733e1..560b64e1 100644 --- a/src/readers/osm/headerBlock.ts +++ b/src/readers/osm/headerBlock.ts @@ -1,5 +1,5 @@ import type { BBox } from '../../geometry'; -import type { Pbf as Protobuf } from 'pbf-ts'; +import type { PbfReader } from 'pbf-ts'; /** OSM Header Block */ export interface OSMHeader { @@ -42,7 +42,7 @@ export class HeaderBlock { osmosis_replication_base_url?: string; /** @param pbf - the Protobuf object to read from */ - constructor(pbf: Protobuf) { + constructor(pbf: PbfReader) { pbf.readMessage(this.#readLayer, this); } @@ -79,7 +79,7 @@ export class HeaderBlock { * @param header - the header object to modify * @param pbf - the Protobuf object to read from */ - #readLayer(tag: number, header: HeaderBlock, pbf: Protobuf): void { + #readLayer(tag: number, header: HeaderBlock, pbf: PbfReader): void { if (tag === 1) header.bbox = pbf.readMessage(header.bbox.readLayer, header.bbox); else if (tag === 4) header.required_features.push(pbf.readString()); else if (tag === 5) header.optional_features.push(pbf.readString()); @@ -109,7 +109,7 @@ export class HeaderBBox { * @param bbox - the bbox object to modify * @param pbf - the Protobuf object to read from */ - readLayer(tag: number, bbox: HeaderBBox, pbf: Protobuf): void { + readLayer(tag: number, bbox: HeaderBBox, pbf: PbfReader): void { if (tag === 1) bbox.left = pbf.readVarint(); else if (tag === 2) bbox.right = pbf.readVarint(); else if (tag === 3) bbox.top = pbf.readVarint(); diff --git a/src/readers/osm/index.ts b/src/readers/osm/index.ts index 10138c23..86a7d0de 100644 --- a/src/readers/osm/index.ts +++ b/src/readers/osm/index.ts @@ -1,7 +1,7 @@ import { HeaderBlock } from './headerBlock'; import { KV } from '../../dataStore'; +import { PbfReader } from 'pbf-ts'; import { PrimitiveBlock } from './primitive'; -import { Pbf as Protobuf } from 'pbf-ts'; import { intermediateRelationToVectorFeature } from './relation'; import { intermediateWayToVectorFeature } from './way'; import { mergeRelationIfExists } from './node'; @@ -239,7 +239,7 @@ export class OSMReader implements FeatureIterator { this.#offset = 0; const blobHeader = this.#next(); if (blobHeader === undefined) throw new Error('Header not found'); - const headerBlock = new HeaderBlock(new Protobuf(new Uint8Array(blobHeader.buffer))); + const headerBlock = new HeaderBlock(new PbfReader(new Uint8Array(blobHeader.buffer))); return headerBlock.toHeader(); } @@ -259,8 +259,7 @@ export class OSMReader implements FeatureIterator { const blobHeaderData = reader.slice(this.#offset, this.#offset + length); this.#offset += length; // build a blob header - const pbf = new Protobuf(new Uint8Array(blobHeaderData.buffer)); - const blobHeader = new BlobHeader(pbf); + const blobHeader = new BlobHeader(new PbfReader(new Uint8Array(blobHeaderData.buffer))); // STEP 2: Get blob data const compressedBlobData = reader.slice(this.#offset, this.#offset + blobHeader.datasize); this.#offset += blobHeader.datasize; @@ -275,9 +274,9 @@ export class OSMReader implements FeatureIterator { */ async #readBlob(data: DataView): Promise { // Blob data is PBF encoded and ?compressed, so we need to parse & decompress it first - let pbf = new Protobuf(new Uint8Array(data.buffer)); + let pbf = new PbfReader(new Uint8Array(data.buffer)); const blob = new Blob(pbf); - pbf = new Protobuf(await blob.data); + pbf = new PbfReader(await blob.data); // Parse the PrimitiveBlock and read its contents. // all nodes/ways/relations that can be filtered already are on invocation. return new PrimitiveBlock(pbf, this); diff --git a/src/readers/osm/info.ts b/src/readers/osm/info.ts index 08ffc9e2..fef251c3 100644 --- a/src/readers/osm/info.ts +++ b/src/readers/osm/info.ts @@ -1,5 +1,5 @@ +import type { PbfReader } from 'pbf-ts'; import type { PrimitiveBlock } from './primitive'; -import type { Pbf as Protobuf } from 'pbf-ts'; /** Info Block - decoded into an object */ export interface InfoBlock { @@ -34,7 +34,7 @@ export class Info { */ constructor( public primitiveBlock: PrimitiveBlock, - pbf?: Protobuf, + pbf?: PbfReader, ) { if (pbf !== undefined) pbf.readMessage(this.#readLayer, this); } @@ -107,7 +107,7 @@ export class Info { * @param info - the info object to modify * @param pbf - the Protobuf object to read from */ - #readLayer(tag: number, info: Info, pbf: Protobuf): void { + #readLayer(tag: number, info: Info, pbf: PbfReader): void { if (tag === 1) info.#version = pbf.readSVarint(); else if (tag === 2) info.#timestamp = pbf.readSVarint(); else if (tag === 3) info.#changeset = pbf.readSVarint(); @@ -141,7 +141,7 @@ export class DenseInfo { */ constructor( public primitiveBlock: PrimitiveBlock, - pbf: Protobuf, + pbf: PbfReader, ) { pbf.readMessage(this.#readLayer, this); } @@ -185,7 +185,7 @@ export class DenseInfo { * @param di - the dense info object to modify * @param pbf - the Protobuf object to read from */ - #readLayer(tag: number, di: DenseInfo, pbf: Protobuf): void { + #readLayer(tag: number, di: DenseInfo, pbf: PbfReader): void { if (tag === 1) di.version = pbf.readPackedSVarint(); else if (tag === 2) di.timestamp = pbf.readPackedSVarint(); else if (tag === 3) di.changeset = pbf.readPackedSVarint(); diff --git a/src/readers/osm/node.ts b/src/readers/osm/node.ts index 458a9d2a..462d4f6a 100644 --- a/src/readers/osm/node.ts +++ b/src/readers/osm/node.ts @@ -3,8 +3,8 @@ import { mergeBBoxes } from '../../geometry'; import { DenseInfo, Info } from './info'; import type { OSMReader } from '.'; +import type { PbfReader } from 'pbf-ts'; import type { PrimitiveBlock } from './primitive'; -import type { Pbf as Protobuf } from 'pbf-ts'; import type { Metadata } from './primitive'; import type { BBox, VectorFeature, VectorPoint } from '../../geometry'; @@ -58,7 +58,7 @@ export class Node { constructor( public primitiveBlock: PrimitiveBlock, public reader: OSMReader, - pbf?: Protobuf, + pbf?: PbfReader, ) { this.primitiveBlock = primitiveBlock; if (pbf !== undefined) pbf.readMessage(this.#readLayer, this); @@ -133,7 +133,7 @@ export class Node { * @param node - the node * @param pbf - the Protobuf object to read from */ - #readLayer(tag: number, node: Node, pbf: Protobuf): void { + #readLayer(tag: number, node: Node, pbf: PbfReader): void { const { primitiveBlock: pb } = node; if (tag === 1) this.id = pbf.readVarint(); @@ -206,7 +206,7 @@ export class DenseNodes { constructor( public primitiveBlock: PrimitiveBlock, public reader: OSMReader, - pbf: Protobuf, + pbf: PbfReader, ) { this.primitiveBlock = primitiveBlock; pbf.readMessage(this.#readLayer, this); @@ -251,7 +251,7 @@ export class DenseNodes { * @param denseNodes - the DenseNodes object * @param pbf - the Protobuf object to read from */ - #readLayer(tag: number, denseNodes: DenseNodes, pbf: Protobuf): void { + #readLayer(tag: number, denseNodes: DenseNodes, pbf: PbfReader): void { const { primitiveBlock: pb } = denseNodes; if (tag === 1) denseNodes.ids = pbf.readPackedSVarint(); diff --git a/src/readers/osm/primitive.ts b/src/readers/osm/primitive.ts index e96db8d6..0a835750 100644 --- a/src/readers/osm/primitive.ts +++ b/src/readers/osm/primitive.ts @@ -3,7 +3,7 @@ import { DenseNodes, Node } from './node'; import { Relation, getNodeRelationPairs } from './relation'; import type { IntermediateNodeMember } from './relation'; -import type { Pbf as Protobuf } from 'pbf-ts'; +import type { PbfReader } from 'pbf-ts'; import type { InfoBlock, OSMReader } from '.'; /** The expected metadata in the VectorFeature for all types (node, way, relation) */ @@ -42,7 +42,7 @@ export class PrimitiveBlock { * @param reader - the OSMReader to modify */ constructor( - public pbf: Protobuf, + public pbf: PbfReader, public reader: OSMReader, ) { pbf.readFields(this.#readLayer, this, 0); @@ -77,7 +77,7 @@ export class PrimitiveBlock { * @param pb - the primitive block to modify * @param pbf - the Protobuf object to read from */ - #readLayer(tag: number, pb: PrimitiveBlock, pbf: Protobuf): void { + #readLayer(tag: number, pb: PrimitiveBlock, pbf: PbfReader): void { if (tag === 1) pb.stringtable = new StringTable(pbf); else if (tag === 2) pb.primitiveGroups.push(new PrimitiveGroup(pb, pbf)); else if (tag === 17) pb.granularity = pbf.readVarint(); @@ -97,7 +97,7 @@ export class PrimitiveGroup { */ constructor( public primitiveBlock: PrimitiveBlock, - public pbf: Protobuf, + public pbf: PbfReader, ) { pbf.readMessage(this.#readLayer, this); } @@ -107,7 +107,7 @@ export class PrimitiveGroup { * @param pg - the primitive group to modify * @param pbf - the Protobuf object to read from */ - #readLayer(tag: number, pg: PrimitiveGroup, pbf: Protobuf): void { + #readLayer(tag: number, pg: PrimitiveGroup, pbf: PbfReader): void { const { primitiveBlock } = pg; const { reader } = primitiveBlock; const { skipWays, skipRelations } = reader; @@ -159,7 +159,7 @@ export class StringTable { /** * @param pbf - the Protobuf object to read from */ - constructor(pbf: Protobuf) { + constructor(pbf: PbfReader) { pbf.readMessage(this.#readLayer, this); } @@ -176,7 +176,7 @@ export class StringTable { * @param st - the string table to modify * @param pbf - the Protobuf object to read from */ - #readLayer(tag: number, st: StringTable, pbf: Protobuf): void { + #readLayer(tag: number, st: StringTable, pbf: PbfReader): void { if (tag === 1) st.strings.push(pbf.readString()); else throw new Error(`unknown tag ${tag}`); } diff --git a/src/readers/osm/relation.ts b/src/readers/osm/relation.ts index c4c0fcdb..1fa7f98b 100644 --- a/src/readers/osm/relation.ts +++ b/src/readers/osm/relation.ts @@ -2,7 +2,7 @@ import { Info, InfoBlock } from './info'; import { fromMultiLineString, fromMultiPolygon } from '../../geometry'; import type { OSMReader } from '.'; -import type { Pbf as Protobuf } from 'pbf-ts'; +import type { PbfReader } from 'pbf-ts'; import type { Metadata, PrimitiveBlock } from './primitive'; import type { @@ -158,7 +158,7 @@ export class Relation { constructor( public primitiveBlock: PrimitiveBlock, public reader: OSMReader, - pbf?: Protobuf, + pbf?: PbfReader, ) { this.primitiveBlock = primitiveBlock; if (pbf !== undefined) pbf.readMessage(this.#readLayer, this); @@ -226,7 +226,7 @@ export class Relation { * @param relation - the relation to update * @param pbf - the protobuf to parse from */ - #readLayer(tag: number, relation: Relation, pbf: Protobuf): void { + #readLayer(tag: number, relation: Relation, pbf: PbfReader): void { if (tag === 1) relation.id = pbf.readVarint(); else if (tag === 2) relation.#keys = pbf.readPackedVarint(); else if (tag === 3) relation.#vals = pbf.readPackedVarint(); diff --git a/src/readers/osm/way.ts b/src/readers/osm/way.ts index 53ae61ec..72248a91 100644 --- a/src/readers/osm/way.ts +++ b/src/readers/osm/way.ts @@ -2,8 +2,8 @@ import { Info } from './info'; import { extendBBox } from '../../geometry'; import type { Metadata } from './primitive'; +import type { PbfReader } from 'pbf-ts'; import type { PrimitiveBlock } from './primitive'; -import type { Pbf as Protobuf } from 'pbf-ts'; import type { InfoBlock, OSMReader } from '.'; import type { @@ -86,7 +86,7 @@ export class Way { constructor( public primitiveBlock: PrimitiveBlock, public reader: OSMReader, - pbf: Protobuf, + pbf: PbfReader, ) { pbf.readMessage(this.#readLayer, this); } @@ -188,7 +188,7 @@ export class Way { * @param way - the way to modify * @param pbf - the Protobuf object to read from */ - #readLayer(tag: number, way: Way, pbf: Protobuf): void { + #readLayer(tag: number, way: Way, pbf: PbfReader): void { if (tag === 1) way.id = pbf.readVarint(); else if (tag === 2) way.#keys = pbf.readPackedVarint(); else if (tag === 3) way.#vals = pbf.readPackedVarint(); diff --git a/src/readers/shapefile/file.ts b/src/readers/shapefile/file.ts index 6581b731..e1ba8dc0 100644 --- a/src/readers/shapefile/file.ts +++ b/src/readers/shapefile/file.ts @@ -43,7 +43,7 @@ export async function shapefileFromPath( ): Promise { if (input.endsWith('.zip')) { const gzipData = await readFile(input); - return shapefileFromGzip(gzipData.buffer); + return shapefileFromGzip(gzipData.buffer, defs, epsgCodes); } const path = input.replace('.shp', ''); const shp = `${path}.shp`; @@ -75,15 +75,17 @@ export async function shapefileFromDefinition( ): Promise { const { shp, dbf, prj, cpg } = def; const encoding = cpg !== undefined ? await readFile(cpg, { encoding: 'utf8' }) : 'utf8'; - const transform = - prj !== undefined ? new Transformer(await readFile(prj, { encoding: 'utf8' })) : undefined; - const dbfReader = dbf !== undefined ? new FileReader(dbf) : undefined; - const databaseFile = dbfReader !== undefined ? new DataBaseFile(dbfReader, encoding) : undefined; - - if (transform !== undefined) { + let transform: Transformer | undefined = undefined; + let projection: string | undefined = undefined; + if (prj !== undefined) { + projection = await readFile(prj, { encoding: 'utf8' }); + transform = new Transformer(projection); for (const def of defs) transform.insertDefinition(def); for (const [key, value] of Object.entries(epsgCodes)) transform.insertEPSGCode(key, value); + transform.setSource(projection); } + const dbfReader = dbf !== undefined ? new FileReader(dbf) : undefined; + const databaseFile = dbfReader !== undefined ? new DataBaseFile(dbfReader, encoding) : undefined; return new ShapeFileReader(new FileReader(shp), databaseFile, transform); } diff --git a/src/readers/shapefile/index.ts b/src/readers/shapefile/index.ts index 8f72abd0..9258324f 100644 --- a/src/readers/shapefile/index.ts +++ b/src/readers/shapefile/index.ts @@ -35,13 +35,11 @@ export async function shapefileFromGzip( shpData = await item.read(); } else if (item.filename.endsWith('prj')) { const data = await item.read(); - transform = new Transformer(new TextDecoder('utf8').decode(data)); - if (defs !== undefined) { - for (const def of defs) transform.insertDefinition(def); - } - if (epsgCodes !== undefined) { + transform = new Transformer(); + if (defs !== undefined) for (const def of defs) transform.insertDefinition(def); + if (epsgCodes !== undefined) for (const [key, value] of Object.entries(epsgCodes)) transform.insertEPSGCode(key, value); - } + transform.setSource(new TextDecoder('utf8').decode(data)); } } if (shpData === undefined) throw new Error('Shapefile not found'); @@ -51,11 +49,17 @@ export async function shapefileFromGzip( /** * Assumes the input is pointing to shapefile data or a gzipped folder with .shp, .dbf, .prj, and/or .cpg * @param url - the url to the shapefile + * @param defs - optional array of ProjectionTransformDefinitions to insert + * @param epsgCodes - a record of EPSG codes to use for the transformer if needed * @returns - a Shapefile */ -export async function shapefileFromURL(url: string): Promise { +export async function shapefileFromURL( + url: string, + defs?: ProjectionTransformDefinition[], + epsgCodes?: Record, +): Promise { const data = await fetchShapefile(url); - if (url.endsWith('.zip')) return shapefileFromGzip(data); + if (url.endsWith('.zip')) return shapefileFromGzip(data, defs, epsgCodes); return new ShapeFileReader(new BufferReader(data)); } diff --git a/src/readers/tile/file.ts b/src/readers/tile/file.ts index e2857298..2d8214fb 100644 --- a/src/readers/tile/file.ts +++ b/src/readers/tile/file.ts @@ -3,7 +3,13 @@ import { toMetadata } from 's2-tilejson'; import { RasterS2TileReader, RasterTileReader } from '.'; import { readFile, readdir, stat } from 'fs/promises'; -import type { ElevationConverter, ElevationPoint, S2TileMetadata, TileMetadata } from '.'; +import type { + ElevationConverter, + ElevationPoint, + S2TileMetadata, + TileMetadata, + TileReader, +} from '.'; import type { Face, FeatureIterator, @@ -16,6 +22,8 @@ import type { } from '../..'; import type { Metadata, Metadatas } from 's2-tilejson'; +// TODO: Get encoding from the metadata and decode the data if necessary + /** * # Raster Tiles File Reader * @@ -49,7 +57,9 @@ import type { Metadata, Metadatas } from 's2-tilejson'; * ``` */ export class RasterTilesFileReader - implements FeatureIterator + implements + FeatureIterator, + TileReader { metadata?: Metadata; /** diff --git a/src/readers/tile/index.ts b/src/readers/tile/index.ts index a924b0d6..a31b88d6 100644 --- a/src/readers/tile/index.ts +++ b/src/readers/tile/index.ts @@ -16,11 +16,31 @@ import type { } from '../..'; import type { Metadata, Metadatas } from 's2-tilejson'; +// TODO: Add VectorTileReader + /** Elevation point used by elevation readers */ export interface ElevationPoint extends Properties { elev: number; } +/** Tile Reader Interface */ +export interface TileReader< + M = Record, + D extends MValue = Properties, + P extends Properties = Properties, +> extends FeatureIterator { + getMetadata: () => Promise; + hasTileWM: (zoom: number, x: number, y: number) => Promise; + hasTileS2: (face: Face, zoom: number, x: number, y: number) => Promise; + getTileWM: (zoom: number, x: number, y: number) => Promise | undefined>; + getTileS2: ( + face: Face, + zoom: number, + x: number, + y: number, + ) => Promise | undefined>; +} + /** Tile's metadata */ export interface TileMetadata { zoom: number; @@ -93,7 +113,9 @@ export function convertMapboxElevationData(r: number, g: number, b: number): num * ``` */ export class RasterTilesReader - implements FeatureIterator + implements + FeatureIterator, + TileReader { metadata?: Metadata; /** diff --git a/src/writers/pmtiles/writer.ts b/src/writers/pmtiles/writer.ts index e8240e63..2002814d 100644 --- a/src/writers/pmtiles/writer.ts +++ b/src/writers/pmtiles/writer.ts @@ -155,7 +155,7 @@ export class S2PMTilesWriter implements TileWriter { tileEntries.sort((a, b) => a.tileID - b.tileID); // build metadata const metaBuffer = Buffer.from(JSON.stringify(metadata)); - let metauint8: Uint8Array = new Uint8Array( + let metauint8: Uint8Array = new Uint8Array( metaBuffer.buffer, metaBuffer.byteOffset, metaBuffer.byteLength, @@ -229,7 +229,7 @@ export class S2PMTilesWriter implements TileWriter { tileEntries5.sort((a, b) => a.tileID - b.tileID); // build metadata const metaBuffer = Buffer.from(JSON.stringify(metadata)); - let metauint8: Uint8Array = new Uint8Array( + let metauint8: Uint8Array = new Uint8Array( metaBuffer.buffer, metaBuffer.byteOffset, metaBuffer.byteLength, @@ -387,7 +387,7 @@ async function buildRootsLeaves( compression: Compression, ): Promise { const rootEntries: Entry[] = []; - let leavesBytes: Uint8Array = new Uint8Array(0); + let leavesBytes: Uint8Array = new Uint8Array(0); let numLeaves = 0; let i = 0; diff --git a/tests/readers/shapefile/file.test.ts b/tests/readers/shapefile/file.test.ts index 71625b30..e2306ce2 100644 --- a/tests/readers/shapefile/file.test.ts +++ b/tests/readers/shapefile/file.test.ts @@ -1,3 +1,4 @@ +import { LambertConformalConic } from '../../../src'; import { shapefileFromPath } from '../../../src/file'; import { expect, test } from 'bun:test'; @@ -76,3 +77,9 @@ test('shapefileFromPath', async () => { type: 'FeatureCollection', }); }); + +test('senate - projection change', async () => { + const shp = await shapefileFromPath(`${__dirname}/fixtures/senate.zip`, [LambertConformalConic]); + const features = await Array.fromAsync(shp); + expect(features.length).toEqual(40); +}); diff --git a/tools/builds/readers/protobuf.ts b/tools/builds/readers/protobuf.ts index 3948bcb2..61f7edc4 100644 --- a/tools/builds/readers/protobuf.ts +++ b/tools/builds/readers/protobuf.ts @@ -1 +1 @@ -export { Pbf } from '../../../src'; +export { PbfReader } from '../../../src';