Skip to content

Commit

Permalink
Documentation polish
Browse files Browse the repository at this point in the history
  • Loading branch information
trasch committed Sep 10, 2024
1 parent 337b009 commit fd7459f
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ mvt query Tests/MVTToolsTests/TestData/14_8716_8015.geojson "3.87324,11.53731,10
}
```
---
**Example 3**: Query a tile for properties.
**Example 3**: Query Feature properties in a tile.
```bash
mvt query -p Tests/MVTToolsTests/TestData/14_8716_8015.vector.mvt ".area > 40000 and .class == 'hospital'"
Expand Down Expand Up @@ -346,9 +346,10 @@ mvt query -p Tests/MVTToolsTests/TestData/14_8716_8015.vector.mvt ".area > 40000
}
```
The query language is loosely modeled after the jq query language. Here is an overview.
The query language is very loosely modeled after the jq query language.
The output will contain all features where the query returns `true`.
Example:
Here is an overview. Example:
```
"properties": {
"foo": {"bar": 1},
Expand All @@ -359,13 +360,14 @@ Example:
```
Values are retrieved by putting a `.` in front of the property name. The property name must be quoted
if it is a number or contains any non-alphabetic characters. Elements in arrays can be
accesses either by simply using the array index after the dot, or by wrapping it in brackets.
if it is a number or contains non-alphabetic characters. Elements in arrays can be
accessed either by simply using the array index after the dot, or by wrapping it in brackets.
```
.foo // true, property "foo" exists
.foo.bar // true, property "foo" is a dictionary containing "bar"
."foo"."bar" // true, same as above but quoted
.'foo'.'bar' // true, same as above but quoted
.foo.x // false, "foo" doesn't contain "x"
."foo.bar" // false, property "foo.bar" doesn't exist
.foo.[0] // false, "foo" is not an array
Expand All @@ -385,19 +387,19 @@ Comparisons can be expressed like this:
.value <= 1 // true
.string =~ /[Ss]ome/ // true
.string =~ /some/ // false
.string =~ /some/i // true, case insensitive
.string =~ "^Some" // true
.string =~ /some/i // true, case insensitive regexp
.string =~ "^Some" // true, can also use quotes
```
Conditions (evaluated left to right):
```
.foo.bar == 1 and .value == 1 // true
.foo == 1 or .bar == 2 // false
.foo == 1 or .value == 1 // true
.foo not // true if foo does not exist
.foo and .bar not // true if foo and bar don't exist together
.foo or .bar not // true if neither foo nor bar exist
.foo.bar not // true if "bar" in dictionary "foo" doesn't exist
.foo not // false, true if foo does not exist
.foo and .bar not // true, foo and bar don't exist together
.foo or .bar not // false, true if neither foo nor bar exist
.foo.bar not // false, true if "bar" in dictionary "foo" doesn't exist
```
Other:
Expand Down

0 comments on commit fd7459f

Please sign in to comment.