API
Tyler.ElevationProvider Type
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.
Tyler.GeoTilePointCloudProvider Type
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.
Tyler.Interpolator Type
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
.
Tyler.Map Type
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 aGeometryBasics.Rect
or anExtents.Extent
in the projection ofextent_crs
.extent_crs
: AnyGeoFormatTypes
compatible crs, the default is wsg84.
Keywords
size
: The figure size.figure
: an existingMakie.Figure
object.crs
: The providers coordinate reference system.provider
: a TileProviders.jlProvider
.max_parallel_downloads
: limits the attempted simultaneous downloads, with a default of16
.cache_size_gb
: limits the cache for storing tiles, with a default of5
.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 is0.5
.plot_config
: APlotConfig
object to change the way tiles are plotted.max_zoom
: The maximum zoom level to display, with a default ofTileProviders.max_zoom(provider)
.max_plots=400:
The maximum number of plots to keep displayed at the same time.
Tyler.Map Method
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
Tyler.PlotConfig Method
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)