ondrap / mapbox-filter Goto Github PK
View Code? Open in Web Editor NEWUtilities for filtering vector mbitles files according to Mapbox GL styles
License: BSD 3-Clause "New" or "Revised" License
Utilities for filtering vector mbitles files according to Mapbox GL styles
License: BSD 3-Clause "New" or "Revised" License
Hello, this library sounds really useful. I am trying it out but get the following error
mapbox-filter: Parsing mapbox style failed: Error in $.layers[1]: Unknown function name / wrong param count: in CallStack (from HasCallStack): error, called at app/Main.hs:224:20 in main:Main
I think it might be caused by this part in the second layer in my style layers (at index 1 of layers):
"filter": [ "all", [ "in", "class", "residential", "suburb", "neighbourhood" ] ],
I understand not all expressions are supported. Is the 'in' not supported yet?
Thanks!
Hi dear,
I'd appreciate if you add match
expression support.
I use openmaptile styles which has in
and !in
filter statements. I saw that filters
are depricated. So, I changed it to match
expression but unfortunately it's not supported in your app yet.
Thank you!
First of all, thanks for creating and sharing this tool @ondrap :)
I use a style which has a in
filter.
This seems not supported right now.
It would be awesome if you could add this, or tell me how to workaround it.
An example is below. It will currently produce Parsing mapbox style failed: Error in $.layers[X]: Unknown function name / wrong param count: in
"filter": [
"all",
[
"in",
"building",
"cathedral",
"chapel",
"church",
"mosque",
"temple",
"synagogue",
"shrine",
"civic",
"hospital",
"school",
"stadium",
"train_station",
"transportation",
"university"
]
]
Another example:
"filter": [
"all",
[
"in",
"highway",
"primary",
"trunk"
],
[
"==",
"tunnel",
"yes"
]
]
According to the style spec the source is required except for the background layer (which is nothing but a plain color mostly).
Example:
{
"id": "background",
"type": "background",
"layout": {
"visibility": "visible"
},
"paint": {
"background-color": "rgba(235, 237, 215, 1)"
}
}
Currently it will error with Parsing mapbox style failed: Error in $.layers[X]: key "source" not present
Hi buddy!
I have the following filter in my style but I get Comparing unequal things: Fix (UApp "get" (Fix (UStr "subclass"))), Fix (UStr "glacier"): Anyvs. String
error.
"filter": [
"==",
[
"get",
"subclass"
],
"glacier"
],
the same problem exists with !=
expression.
Dear buddy!
I get several errors for paint
attributes. paint['fill-opacity']
, line-width
, fill-translate
and etc. do they affect the shrink process? I'd appreciate if you add support for them (even with simply ignoring them if they aren't effective in the process)
Thanks a lot
Many editors of Mapbox Styles do not care about a difference between number and string for the filters.
So in many style.json there is the following in the filter expression
["==", "layer", 2]
When running filter on such a style one received the error Parsing mapbox style failed: Error in $.layers[X]: Comparing unequal things: Fix (UStr "layer"), Fix (UNum 2.0): Stringvs. Number
As far as I know the styles the number should always be treated as a string here.
It would be amazing to see this being supported.
Dear Ondrej,
I have some filters with to-number
expression as follows:
"filter": [
"all",
[
"==",
[
"to-number",
[
"get",
"admin_level"
]
],
2
],
[
"!=",
[
"to-number",
[
"get",
"maritime"
]
],
1
],
[
"!=",
[
"to-number",
[
"get",
"disputed"
]
],
1
]
],
I'll be so thankful if you add support for it too. ^_^ ๐
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.