-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from MakieOrg/jeremiahpslewis-jpsl/geojson-0.6
Jeremiahpslewis jpsl/geojson 0.6
- Loading branch information
Showing
19 changed files
with
237 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ stuff.jl | |
src/oldsrc | ||
src/experimental | ||
|
||
docs/src/images | ||
test_images/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
using CairoMakie, GeoMakie | ||
using GeoMakie.GeoJSON | ||
using Downloads | ||
using GeometryBasics | ||
using GeoInterface | ||
|
||
# Acquire data | ||
it_states = Downloads.download("https://github.com/openpolis/geojson-italy/raw/master/geojson/limits_IT_provinces.geojson") | ||
geo = GeoJSON.read(read(it_states, String)) | ||
basic = GeoMakie.geo2basic(geo) | ||
|
||
fig = Figure() | ||
ga = GeoAxis(fig[1, 1]; dest = "+proj=ortho +lon_0=12.5 +lat_0=42", lonlims=(12, 13), latlims = (40, 44)) | ||
plot!.(ga, basic; strokecolor = :blue, strokewidth = 1, color = (:blue, 0.5), shading = false); | ||
poly!(ga, geo; strokecolor = :blue, strokewidth = 1, color = (:blue, 0.5), shading = false); | ||
datalims!(ga) | ||
|
||
fig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,38 @@ | ||
# This example was contributed by Martijn Visser (@visr) | ||
using Makie, CairoMakie, GeoMakie | ||
using GeoMakie.GeoJSON | ||
using GeometryBasics | ||
using Downloads | ||
|
||
source = "+proj=longlat +datum=WGS84" | ||
dest = "+proj=natearth2" | ||
|
||
fig = Figure(resolution = (1000,500)) | ||
ga = GeoAxis( | ||
fig[1, 1]; | ||
source = source, | ||
dest = dest, | ||
) | ||
|
||
ga.xticklabelsvisible[] = false | ||
ga.yticklabelsvisible[] = false | ||
|
||
url = "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/" | ||
land = Downloads.download(url * "ne_110m_land.geojson") | ||
land_geo = GeoJSON.read(read(land, String)) | ||
poly!(ga, land_geo, color=:black) | ||
|
||
pop = Downloads.download(url * "ne_10m_populated_places_simple.geojson") | ||
pop_geo = GeoJSON.read(read(pop, String)) | ||
scatter!(ga, GeoMakie.geo2basic(pop_geo), color="lightgrey", markersize=1.2) | ||
|
||
fig | ||
begin | ||
fig = Figure(resolution = (1000,500)) | ||
ga = GeoAxis( | ||
fig[1, 1]; | ||
source = source, | ||
dest = dest | ||
) | ||
|
||
ga.xticklabelsvisible[] = false | ||
ga.yticklabelsvisible[] = false | ||
poly!(ga, land_geo, color=:black) | ||
popisqrt = map(pop_geo) do geo | ||
popi = geo.pop_max | ||
popi > 0 ? sqrt(popi) : 0.0 | ||
end | ||
mini, maxi = extrema(popisqrt) | ||
size = map(popisqrt) do popi | ||
normed = (popi .- mini) ./ (maxi - mini) | ||
return (normed * 20) .+ 1 | ||
end | ||
scatter!(ga, pop_geo, color=popisqrt, markersize=size) | ||
fig | ||
end |
Oops, something went wrong.