georust / tilejson Goto Github PK
View Code? Open in Web Editor NEWLibrary for serializing the TileJSON file format
License: Apache License 2.0
Library for serializing the TileJSON file format
License: Apache License 2.0
I noticed you still have a .travis.yml
I believe free CI on travis-ci.org has been canceled since about June. Also, travis-ci recently had a nasty bug (and a not great response to said bug).
Almost all of the other georust projects are running on GH actions, would you be interested in migrating?
I could help with this if you have questions or lack the time.
๐ Hi @stepankuzmin!
I'm following up on georust/meta#21 โ not sure if you got a chance to read that.
You are the only "user-owner" of the tilejson crate on crates.io, so only you can edit that crate's owners. (edit: ๐คฆ copy-pasta typo)
The tldr; is that a while back, we started adding the georust/core team as a "team-owner" for all georust crates - this gave some redundancy in case the original owner became inaccessible. However, as the org has grown (๐), this has resulted in lots of (probably too many) people having access to publish all crates, so we're scaling back the publishing teams to be just the group of people who are actually publishing that crate.
Since your crate has the distinction of never having added the georust/core team as an owner, there's no cleanup to do.
However, would you still be willing to add a publishing-team as a team owner? It can remain empty for now if there's no one else publishing, but the idea is that georust admins (currently @urschrei and @frewsxcv) could add/remove people to that team if you became inaccessible. Note that "team owners" on crates.io can't themselves edit the owners of the crate, only "user owners".
Step 1: Create your publishing team
Go to https://github.com/orgs/georust/new-team and enter the name tilejson-publishers
and the description "crates.io publishing for the tilejson crate"
Add any additional publishers to the team at this point (or not). If you mark them as team maintainers, they will be able to edit the team themselves in the future.
Step 2: Update crate owners
cd my-crate
cargo owner --add github:georust:tilejson-publishers
# make sure everything looks good ๐
cargo owner --list
Let me know if you have any questions, or you can review georust/meta#21.
The center field is declared as center: Option<Vec<i32>>
, which does not match specification:
OPTIONAL. Array. Default: null.
The first value is the longitude, the second is latitude (both in WGS:84 values), the third value is the zoom level as an integer. Longitude and latitude MUST be within the specified bounds. The zoom level MUST be between minzoom and maxzoom. Implementations MAY use this center value to set the default location. If the value is null, implementations MAY use their own algorithm for determining a default location.
{
"center": [ -76.275329586789, 39.153492567373, 8 ]
}
I think we should use this opportunity to improve the bounds value as well.
center: Option<(f32, f32, u8)>,
bounds: Option<(f32, f32, f32, f32)>,
Per serde-rs/serde#637, uses serde_tuple crate.
#[derive(Serialize_tuple, Deserialize_tuple)]
struct Center {
pub longitude: f32,
pub latitude: f32,
pub zoom: u8,
}
#[derive(Serialize_tuple, Deserialize_tuple)]
struct Bounds {
pub left: f32,
pub bottom: f32,
pub right: f32,
pub top: f32,
}
...
center: Option<Center>,
bounds: Option<Bounds>,
There are two usecases for this lib -- with and without defaults:
maxzoom
to 30 if missing, and takes actions like loading tiles.grids
value, it shouldn't set it to the default [ ]
, but instead not set it at all.Current API actually does the opposite -- the client use-case" serde_json::from_str(str)
ignores tilespec defaults, while the server use case with TileJSON::new()
sets the defaults.
Also, per specification, several fields must be present from the start, so it would make sense to introduce them as arguments:
"tilejson": "3.0.0",
"tiles": [
"http://localhost:8888/admin/1.0.0/world-light,broadband/{z}/{x}/{y}.mvt"
],
When instantiating, tilejson
could still be defaulted to the current version, i.e. 3.0.0
. The tiles
on the other hand MUST be a non-empty array.
impl TileJSONBuilder {
/// create a builder with tilejson = 3.0.0 and tiles = [ source ]
fn new(source: String) -> Self {}
/// create a builder with custom version and possibly multiple sources.
/// If version is None, will use current default.
fn new_ext(sources: Vec<String>, version: Option<String>) -> Self {}
/// generate TileJSON **without** defaults. Breaking change, so new method name.
fn build() -> TileJSON {}
// remove fn tiles(...)
}
impl TileJSON {
/// consume to ensure each optional value has a proper default per spec. Name is TBD
fn with_defaults(self) -> Self {}
}
Note that "vector_layers"
is required conditionally - depending on the type of the tiles, so in our case we could treat it as optional unless we want to perform validation.
Hi @stepankuzmin , are you the only person who publishes this crate to crates.io? I see that github team georust:tilejson-publishers
also has that right, and I was wondering if you want me to participate in that process? I do plan to add a number of other features to this crate, possibly some validation code, etc. Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.