Skip to content

Releases: Outdooractive/mvt-tools

v1.8.5

10 Sep 08:01
8a4bdf7
Compare
Choose a tag to compare

Added near(latitude,longitude,tolerance) to the query language.

Examples:

// Features around a coordinate
mvt query -p 14_8716_8015.vector.mvt "near(3.87324,11.53731,1000)"
// With other conditions
mvt query -p 14_8716_8015.vector.mvt ".name =~ /^lac/i and near(3.87324,11.53731,10000)"

v1.8.4

09 Sep 11:51
e58ddd1
Compare
Choose a tag to compare

The command line tool (and the library) can now filter by property.

The query language is loosely modeled after the jq query language. Here is an overview.

Example:

"properties": {
  "foo": {"bar": 1},
  "some": ["a", "b"],
  "value": 1,
  "string": "Some name"
}

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.

.foo       // true, property "foo" exists
.foo.bar   // true, property "foo" is a dictionary containing "bar"
."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
.some.[0]  // true, "some" is an array and has an element at index "0"
.some.0    // true, same as above but without brackets
.some."0"  // false, "0" is a string key but "some" is not a dictionary

Comparisons can be expressed like this:

.value == "bar" // false
.value == 1  // true
.value != 1  // false
.value > 1   // false
.value >= 1  // true
.value < 1   // false
.value <= 1  // true
.string =~ /[Ss]ome/ // true
.string =~ /some/    // false
.string =~ /some/i   // true, case insensitive
.string =~ "^Some"   // true

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

Examples:

// Can use single quotes for strings
mvt query -p 14_8716_8015.vector.mvt ".area > 20000 and .class == 'hospital'"

// ... or double quotes, but they must be escaped
mvt query -p 14_8716_8015.vector.mvt ".area > 20000 and .class == \"hospital\""

// No need to quote the query if it doesn't conflict with your shell
// Print all features that have an "area" property
mvt query -p 14_8716_8015.vector.mvt .area
// Features which don't have "area" and "name" properties
mvt query -p 14_8716_8015.vector.mvt .area and .name not

// Case insensitive regular expression
vt query -p 14_8716_8015.vector.mvt ".name =~ /hopital/i"

// Case sensitive regular expression
mvt query -p 14_8716_8015.vector.mvt ".name =~ /Recherches?/"
// Can also use quotes instead of slashes
mvt query -p 14_8716_8015.vector.mvt ".name =~ 'Recherches?'"

v1.8.3

02 Sep 15:13
6c2f59e
Compare
Choose a tag to compare

mvt info can now print a summary for property values, either with -i property=<property> or -p <property>.

v1.8.2

02 Sep 09:05
207cb09
Compare
Choose a tag to compare

The command line tool mvt got a new option for most commands:

  -d, --drop-layer <drop-layer>
                          Drop the specified layer (can be repeated).

This is the inverse of -l, --layer <layer> Dump the specified layer (can be repeated).

v1.8.1

27 Aug 12:52
f264491
Compare
Choose a tag to compare

Some commands in the mvt command line tool got some new export/output options:

-oC, --compression-level <oC>
                          Output file compression level, between 0=none to 9=best.
-oBe, --buffer-extents <oBe>
                          Output buffer extents for tiles of size 4096.
-oBp, --buffer-pixels <oBp>
                          Output buffer pixels for tiles of size 256. Overrides 'buffer-extents'.
-oSe, --simplify-extents <oSe>
                          Simplify output features using tile extents.
-oSm, --simplify-meters <oSm>
                          Simplify output features using meters. Overrides 'simplify-extents'.

v1.8.0

26 Aug 10:58
a6415a3
Compare
Choose a tag to compare

The command line tool got a complete overhaul. It now works with GeoJSONs and vector tiles and got many new options.
Note: Some commands might behave differently now, please check your scripts.

  • dump: Pretty-prints any GeoJSON or vector tile to the console
  • info: Print some information about GeoJSONs or vector tiles like Feature counts and properties
  • query: Query feature properties or perform a search around a coordinate
  • merge: Merge any number of GeoJSONs or vector tiles into a GeoJSON or vector tile
  • import: Import GeoJSONs into a vector tile
  • export: Export a vector tile as GeoJSON

GeoJSONs can contain a layer name in their Feature properties (default name is vt_layer), and any resulting GeoJSON will automatically include this property.
This can be controlled with the options --property-name (or -P), --disable-input-layer-property (or -Di) and --disable-output-layer-property (or -Do).
Some commands allow limiting the result to certain layers with --layer (or -l), which can be repeated for as many layers as necessary.

v1.7.1

07 Aug 09:14
Compare
Choose a tag to compare

The command line tool mvt can now be installed via Homebrew:

brew install Outdooractive/homebrew-tap/mvt-tools

v1.7.0

02 Jul 12:54
Compare
Choose a tag to compare

Dependency updates

v1.6.2

14 Jun 14:29
Compare
Choose a tag to compare
  • Swift 6 updates
  • Allow to merge tiles with different coordinates, for some weird use cases
  • Various small improvements and tidying up

v1.4.0

08 Apr 12:02
e9f3309
Compare
Choose a tag to compare

Switch from Int ids to UInt ids if overflow happens and the id is not negative (Outdooractive/gis-tools#45) (Thanks @JeffLutzenberger!)