mz_vector_tiles: Request vector tile data

Description Usage Arguments Details Value See Also Examples

View source: R/vector-tiles.R

Description

From https://mapzen.com/documentation/vector-tiles/: "Vector tiles are square-shaped collections of geographic data that contain the map feature geometry, such as lines and points."

Usage

1
mz_vector_tiles(tile_coordinates, ...)

Arguments

tile_coordinates

an mz_tile_coordinates object, or something that can be coerced to one (including the output of mz_bbox)

...

Arguments passed on to as.mz_tile_coordinates.

Details

Multiple tiles are stitched together and returned as one object. Individual layers can be converted to sf or sp, making it possible to draw each layer with custom styles.

Value

A list of tile layers (such as "water", "buildings", "roads", etc.). Each layer is an object of class mapzen_vector_layer, which can be converted to sf or sp using as_sf or as_sp

See Also

mz_tile_coordinates

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
# vector tile at x = 19293, y = 24641, and zoom level 16
mz_vector_tiles(mz_tile_coordinates(19293, 24641, 16))

# multiple contiguous tiles will be stitched together
# this returns the result of stitching together 4 tiles
mz_vector_tiles(mz_tile_coordinates(19293:19294, 24641:24642, 16))

# can also use a bounding box:
mz_vector_tiles(mz_rect(min_lon = -122.2856,
                        min_lat = 37.73742,
                        max_lon = -122.1749,
                        max_lat = 37.84632))

# mz_bbox returns a bounding box for any Mapzen object
mz_vector_tiles(mz_bbox(oakland_public))

# bounding boxes are automatically converted to tile coordinates,
# with the zoom level based on the desired size in pixels of the final map
mz_vector_tiles(mz_bbox(oakland_public), height = 750, width = 1000)

## End(Not run)

tarakc02/rmapzen documentation built on Oct. 8, 2018, 12:20 a.m.