stadiamaps / cartogrify Goto Github PK
View Code? Open in Web Editor NEWThe cartographic style transmogrifier
License: BSD 3-Clause "New" or "Revised" License
The cartographic style transmogrifier
License: BSD 3-Clause "New" or "Revised" License
This may be a core Tangram issue, but currently generated styles seem to have huge areas where labels are initially rendered but then disappear, presumably due to Tangram's label placement or collision constraints. Additionally, the precedence/priority does not seem to be quite right. This is probably an implementation error on my part.
Here is the source GL JSON style that exhibits the issue: https://tiles.stadiamaps.com/styles/alidade_smooth_dark.json (you can run a server on localhost
to test; see https://docs.stadiamaps.com/ for auth info). Below is an example of such a "hole" at a particular zoom level in Germany.
Currently only the most basic decision expressions are supported. The remaining ones appear to be representable using Tangram functions.
case
coalesce
match
within
Mapbox has a simple format language for specifying a text label in terms of multiple fields (it's very much like a Python f-string). Currently we just ignore this unless the source is just a single field. We shouldn't ;)
Just FYI in case anyone comes across this, I built a similar thing in JavaScript a few years back: https://gitlab.com/stevage/mapbox2tangram
Currently, cartogrify does not generate a fonts
section. However, with a bit of work, we could probably look up many fonts using the Google Fonts API.
First we need to investigate whether this is possible. If yes, we can implement it with the API key as a command line switch. A bit of parsing to separate font families and names out may also be necessary in the process.
Mapbox GL supports stops (for width, colors, etc.) that follow both a linear and exponential progression. Tangram does not appear to support this directly, but cartogrify could reasonably fake it by computing the intermediate stop values.
Current status:
Mapbox supports a few text effects directly that will likely require a bit more work to implement in Tangram.
MBGL allows for icons with a specific symbol placement etc. from a sprite definition file. Some further investigation is needed on my part, but I believe the following is a general rough outline of what needs to happen:
sprites
block from the JSON sprite file referenced in the MBGL JSON stylepoints
drawing layer for any MBGL symbol
layers that have spritestext
drawing layer as necessaryicon-image
expressions (not used in any Stadia Maps styles; can wait unless someone else wants this... see https://docs.mapbox.com/mapbox-gl-js/style-spec/types/#resolvedimage for specifics)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.