Skip to content

Commit 13478e2

Browse files
use new uv transform (#107)
* use new uv transform * trigger ci via git * remove entry to doc --------- Co-authored-by: Lazaro Alonso <lazarus.alon@gmail.com>
1 parent c6c38f9 commit 13478e2

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ HTTP = "1"
4141
ImageIO = "0.6"
4242
LRUCache = "1"
4343
LinearAlgebra = "1"
44-
Makie = "0.21"
44+
Makie = "0.21.6"
4545
MapTiles = "1"
4646
OrderedCollections = "1"
4747
Proj = "1"

docs/src/map-3d.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ delta = 0.3
2424
ext = Rect2f(lon - delta / 2, lat - delta / 2, delta, delta)
2525
cfg = Tyler.PlotConfig(
2626
preprocess=pc -> map(p -> p .* 2, pc),
27-
shading=FastShading,
27+
shading=FastShading, colorrange=(2000, 5000),
2828
colormap=:alpine
2929
)
3030
m = Tyler.Map3D(ext; provider=ElevationProvider(nothing), plot_config=cfg)

src/provider/elevation/elevation-provider.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ function fetch_tile(provider::ElevationProvider, dl::PathDownloader, tile::Tile)
4343
mini = -450
4444
maxi = 8700
4545
elevation_img = collect(reverse(band; dims=2))
46-
elevation_img .= Float32.(elevation_img) # .* (maxi - mini) .+ mini
46+
elevation_img .= Float32.(elevation_img)
4747
if isnothing(provider.color_provider)
4848
return Tyler.ElevationData(elevation_img, Matrix{RGBf}(undef, 0, 0), Vec2d(mini, maxi))
4949
end
5050
foto_img = get!(provider.tile_cache, path) do
5151
dl = provider.downloader[Threads.threadid()]
5252
fetch_tile(provider.color_provider, dl, tile)
5353
end
54-
return Tyler.ElevationData(elevation_img, rotr90(foto_img), Vec2d(mini, maxi))
54+
return Tyler.ElevationData(elevation_img, foto_img, Vec2d(mini, maxi))
5555
end

src/tile-plotting.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,12 @@ function create_tileplot!(config::PlotConfig, axis::AbstractAxis, data::Elevatio
197197
# not so elegant with empty array, we may want to make this a bit nicer going forward
198198
color = isempty(data.color) ? (;) : (color=data.color,)
199199
mini, maxi = extrema(bounds)
200+
uv_transform = isempty(data.color) ? Makie.automatic : Mat{2,3,Float32}(0, 1, 1, 0, 0, 0)
200201
p = Makie.surface!(
201202
axis.scene,
202203
(mini[1], maxi[1]), (mini[2], maxi[2]), data.elevation;
203204
color...,
205+
uv_transform = uv_transform,
204206
shading=Makie.NoShading,
205207
inspectable=false,
206208
colorrange=data.elevation_range,
@@ -230,7 +232,8 @@ function create_tileplot!(config::PlotConfig, axis::AbstractAxis, data::ImageDat
230232
mini, maxi = extrema(bounds)
231233
plot = Makie.image!(
232234
axis.scene,
233-
(mini[1], maxi[1]), (mini[2], maxi[2]), rotr90(data);
235+
(mini[1], maxi[1]), (mini[2], maxi[2]), data;
236+
uv_transform=Mat{2,3,Float32}(0, 1, 1, 0, 0, 0),
234237
inspectable=false,
235238
config.attributes...
236239
)
@@ -241,11 +244,10 @@ function update_tile_plot!(plot::Makie.Image, ::PlotConfig, axis::AbstractAxis,
241244
mini, maxi = extrema(bounds)
242245
plot[1] = (mini[1], maxi[1])
243246
plot[2] = (mini[2], maxi[2])
244-
plot[3] = rotr90(data)
247+
plot[3] = data
245248
return
246249
end
247250

248-
249251
############################
250252
#### PointCloudData Data plotting
251253
####
@@ -317,7 +319,6 @@ function update_tile_plot!(plot::Makie.MeshScatter, ::MeshScatterPlotconfig, ::A
317319
end
318320

319321

320-
321322
############################
322323
#### Debug tile plotting (image only for now)
323324
####

0 commit comments

Comments
 (0)