Skip to content

Commit

Permalink
Don't publish, but render.
Browse files Browse the repository at this point in the history
  • Loading branch information
evetion committed Aug 31, 2023
1 parent df98027 commit c4a3578
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ jobs:
# Extra repositories:
extra-repositories: |
https://josiahparry.r-universe.dev
- name: R deps
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
extra-packages: |
any::sf
- name: Render Quarto Project
uses: quarto-dev/quarto-actions/render@v2
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[deps]
GeoDataFrames = "62cb38b5-d8d2-4862-a48e-6a340996859f"
Missings = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
18 changes: 15 additions & 3 deletions blog.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -229,23 +229,28 @@ pol_all
## Julia

```{julia}
df = GeoDataFrames.read("/vsizip/data.zip/data/osm/gis_osm_transport_a_free_1.shp")
df
pol_all = GeoDataFrames.read("/vsizip/data.zip/data/osm/gis_osm_transport_a_free_1.shp")
pol_all
```

:::

<!---
This should also work in Python and Julia no? It's a GDAL feature.
--->
Note: in R, you can read-in the dataset from the URL in a single line of code without first downloading the zip file:
Note: in R and Julia, you can read-in the dataset from the URL in a single line of code without first downloading the zip file:

```{r}
#| eval: false
uz = paste0("/vsizip//vsicurl/", u, "/data/osm/gis_osm_transport_a_free_1.shp")
pol_all = sf::read_sf(uz)
```

```{julia}
zipurl = "/vsizip/vsicurl/" * u * "/data/osm/gis_osm_transport_a_free_1.shp"
pol_all = GeoDataFrames.read(zipurl)
```

## Subsetting by attributes

The following commands select a subset of the data based on attribute values (looking for a specific string in the `name` column).
Expand All @@ -267,6 +272,13 @@ pol = pol_all |>
pol
```

## Julia
```{julia}
using DataFrames
pol = dropmissing(pol_all, :name)
pol = subset!(pol, :name => n -> occursin.(r"Port*.+Poz", n))
```

:::

## Basic plotting
Expand Down

0 comments on commit c4a3578

Please sign in to comment.