Skip to content

Commit

Permalink
Merge branch 'master' into as/basemap
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 authored Sep 1, 2024
2 parents bc8fc9f + 13478e2 commit ffc0d48
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/Documenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ jobs:
- name: Pull Julia cache
uses: julia-actions/cache@v2
- name: Install documentation dependencies
run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev xsettingsd x11-xserver-utils
- name: Install custom documentation dependencies
run: DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=docs -e 'using Pkg; pkg"dev ."; Pkg.instantiate(); Pkg.precompile(); Pkg.status()'
#- name: Creating new mds from src
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
Expand Down
17 changes: 12 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name = "Tyler"
uuid = "e170d443-b9d6-418a-9ee8-061e966341ef"
authors = ["SimonDanisch <sdanisch@gmail.com>", "Lazaro Alonso <lazarus.alon@gmail.com>", "Martijn Visser <mgvisser@gmail.com>", "Rafael Schouten <rafaelschouten@gmail.com>"]
version = "0.1.5"
version = "0.2.0"

[deps]
ArchGDAL = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
Extents = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Expand All @@ -29,20 +28,28 @@ ThreadSafeDicts = "4239201d-c60e-5e0a-9702-85d713665ba7"
TileProviders = "263fe934-28e1-4ae9-998a-c2629c5fede6"

[compat]
ArchGDAL = "0.10"
Colors = "0.12"
Downloads = "1"
Extents = "0.1.2"
FileIO = "1"
GeoFormatTypes = "0.4"
GeoInterface = "1"
GeometryBasics = "0.4"
GeometryOps = "0.1"
HTTP = "1"
ImageIO = "0.6"
LRUCache = "1"
LinearAlgebra = "1"
Makie = "0.21"
Makie = "0.21.6"
MapTiles = "1"
OrderedCollections = "1"
Proj = "1"
Scratch = "1"
PointClouds = "0.3"
Statistics = "1"
ThreadSafeDicts = "0.1"
TileProviders = "0.1"
ImageIO = "0.6"
FileIO = "1"
julia = "1"

[extras]
Expand Down
2 changes: 1 addition & 1 deletion docs/src/map-3d.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ delta = 0.3
ext = Rect2f(lon - delta / 2, lat - delta / 2, delta, delta)
cfg = Tyler.PlotConfig(
preprocess=pc -> map(p -> p .* 2, pc),
shading=FastShading,
shading=FastShading, colorrange=(2000, 5000),
colormap=:alpine
)
m = Tyler.Map3D(ext; provider=ElevationProvider(nothing), plot_config=cfg)
Expand Down
2 changes: 1 addition & 1 deletion src/Tyler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ using Makie: AbstractAxis
using LinearAlgebra, GeometryBasics
using GeometryBasics
using Proj
using Statistics, DelimitedFiles
using Statistics
using PointClouds
using ArchGDAL
import GeoFormatTypes as GFT
Expand Down
4 changes: 2 additions & 2 deletions src/provider/elevation/elevation-provider.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ function fetch_tile(provider::ElevationProvider, dl::PathDownloader, tile::Tile)
mini = -450
maxi = 8700
elevation_img = collect(reverse(band; dims=2))
elevation_img .= Float32.(elevation_img) # .* (maxi - mini) .+ mini
elevation_img .= Float32.(elevation_img)
if isnothing(provider.color_provider)
return Tyler.ElevationData(elevation_img, Matrix{RGBf}(undef, 0, 0), Vec2d(mini, maxi))
end
foto_img = get!(provider.tile_cache, path) do
dl = provider.downloader[Threads.threadid()]
fetch_tile(provider.color_provider, dl, tile)
end
return Tyler.ElevationData(elevation_img, rotr90(foto_img), Vec2d(mini, maxi))
return Tyler.ElevationData(elevation_img, foto_img, Vec2d(mini, maxi))
end
9 changes: 5 additions & 4 deletions src/tile-plotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,12 @@ function create_tileplot!(config::PlotConfig, axis::AbstractAxis, data::Elevatio
# not so elegant with empty array, we may want to make this a bit nicer going forward
color = isempty(data.color) ? (;) : (color=data.color,)
mini, maxi = extrema(bounds)
uv_transform = isempty(data.color) ? Makie.automatic : Mat{2,3,Float32}(0, 1, 1, 0, 0, 0)
p = Makie.surface!(
axis.scene,
(mini[1], maxi[1]), (mini[2], maxi[2]), data.elevation;
color...,
uv_transform = uv_transform,
shading=Makie.NoShading,
inspectable=false,
colorrange=data.elevation_range,
Expand Down Expand Up @@ -230,7 +232,8 @@ function create_tileplot!(config::PlotConfig, axis::AbstractAxis, data::ImageDat
mini, maxi = extrema(bounds)
plot = Makie.image!(
axis.scene,
(mini[1], maxi[1]), (mini[2], maxi[2]), rotr90(data);
(mini[1], maxi[1]), (mini[2], maxi[2]), data;
uv_transform=Mat{2,3,Float32}(0, 1, 1, 0, 0, 0),
inspectable=false,
config.attributes...
)
Expand All @@ -241,11 +244,10 @@ function update_tile_plot!(plot::Makie.Image, ::PlotConfig, axis::AbstractAxis,
mini, maxi = extrema(bounds)
plot[1] = (mini[1], maxi[1])
plot[2] = (mini[2], maxi[2])
plot[3] = rotr90(data)
plot[3] = data
return
end


############################
#### PointCloudData Data plotting
####
Expand Down Expand Up @@ -317,7 +319,6 @@ function update_tile_plot!(plot::Makie.MeshScatter, ::MeshScatterPlotconfig, ::A
end



############################
#### Debug tile plotting (image only for now)
####
Expand Down

0 comments on commit ffc0d48

Please sign in to comment.