API
ElevationProvider(color_provider::Union{Nothing, AbstractProvider}=TileProviders.Esri(:WorldImagery); cache_size_gb=5)
Provider rendering elevation data from arcgis. This provider is special, since it uses a second provider for color information, which also means you can provide a cache size, since color tile caching has to be managed by the provider. When set to nothing
, no color provider is used and the elevation data is used to color the surface with a colormap directly. Use Map(..., plot_config=Tyler.PlotConfig(colormap=colormap))
to set the colormap and other surface
plot attributes.
GeoTilePointCloudProvider(subset="AHN1_T")
The PointCloud provider downloads from geotiles.citg.tudelft, which spans most of the netherlands. You can specify the subset to download from, which can be one of the following:
AHN1_T (default): The most corse dataset, but also the fastest to download (1-5mb compressed per tile)
AHN2_T: More detailed dataset (~70mb per tile)
AHN3_T: ~250mb per tile
AHN4_T: 300-500mb showing much detail, takes a long time to load each tile (over 1 minute per tile). Use
max_plots=5
to limit the number of tiles loaded at once.
Interpolator <: AbstractProvider
Interpolator(f; colormap=:thermal, options=Dict(:minzoom=1, :maxzoom=19))
Provides tiles by interpolating them on the fly.
f
: an Interpolations.jl interpolator or similar.colormap
: ASymbol
orVector{RGBA{Float32}}
. Default is:thermal
.
Map(extent, [extent_crs=wgs84]; kw...)
Map(map::Map; ...) # layering another provider on top of an existing map
Tylers main object, it plots tiles onto a Makie.jl Axis
, downloading and plotting more tiles as you zoom and pan. When layering providers over each other with Map(map::Map; ...)
, you can use toggle_visibility!(map)
to hide/unhide them.
Arguments
-extent
: the initial extent of the map, as a GeometryBasics.Rect
or an Extents.Extent
in the projection of extent_crs
. -extent_crs
: Any GeoFormatTypes
compatible crs, the default is wsg84.
Keywords
-size
: The figure size. -figure
: an existing Makie.Figure
object. -crs
: The providers coordinate reference system. -provider
: a TileProviders.jl Provider
. -max_parallel_downloads
: limits the attempted simultaneous downloads, with a default of 16
. -cache_size_gb
: limits the cache for storing tiles, with a default of 5
. -fetching_scheme=Halo2DTiling()
: The tile fetching scheme. Can be SimpleTiling(), Halo2DTiling(), or Tiling3D(). -scale
: a tile scaling factor. Low number decrease the downloads but reduce the resolution. The default is 0.5
. -plot_config
: A PlotConfig
object to change the way tiles are plotted. -max_zoom
: The maximum zoom level to display, with a default of TileProviders.max_zoom(provider)
. -max_plots=400:
The maximum number of plots to keep displayed at the same time.
Map(m::Map; kw...)
Layering constructor to show another provider on top of an existing map.
Example
lat, lon = (52.395593, 4.884704)
delta = 0.01
ext = Rect2f(lon - delta / 2, lat - delta / 2, delta, delta)
m1 = Tyler.Map(ext)
m2 = Tyler.Map(m1; provider=TileProviders.Esri(:WorldImagery), plot_config=Tyler.PlotConfig(alpha=0.5, postprocess=(p-> translate!(p, 0, 0, 1f0))))
m1
PlotConfig(; preprocess=identity, postprocess=identity, plot_attributes...)
Creates a PlotConfig
object to influence how tiles are being plotted.
preprocess(tile_data): Function to preprocess the data before plotting. For a tile provider returning image data, preprocess will be called on the image data before plotting.
postprocess(tile_data): Function to mutate the plot object after creation. Can be used like this:
(plot)-> translate!(plot, 0, 0, 1)
.plot_attributes: Additional attributes to pass to the plot
Example
using Tyler, GLMakie
config = PlotConfig(
preprocess = (data) -> data .+ 1,
postprocess = (plot) -> translate!(plot, 0, 0, 1),
color = :red
)
lat, lon = (52.395593, 4.884704)
delta = 0.1
extent = Extent(; X=(lon - delta / 2, lon + delta / 2), Y=(lat - delta / 2, lat + delta / 2))
Tyler.Map(extent; provider=Tyler.TileProviders.Esri(:WorldImagery), plot_config=config)