Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
robbibt committed Aug 29, 2023
1 parent a3a3ce5 commit 5fd222b
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,25 +160,29 @@ import geopandas as gpd
ymax, xmin = -33.65, 115.28
ymin, xmax = -33.66, 115.30
# Set up WFS requests for annual coastlines & rates of change statistics
deacl_coastlines_wfs = f'https://geoserver.dea.ga.gov.au/geoserver/wfs?' \
# Set up WFS requests for annual shorelines & rates of change points
deacl_annualshorelines_wfs = f'https://geoserver.dea.ga.gov.au/geoserver/wfs?' \
f'service=WFS&version=1.1.0&request=GetFeature' \
f'&typeName=dea:coastlines&maxFeatures=1000' \
f'&typeName=dea:shorelines_annual&maxFeatures=1000' \
f'&bbox={ymin},{xmin},{ymax},{xmax},' \
f'urn:ogc:def:crs:EPSG:4326'
deacl_statistics_wfs = f'https://geoserver.dea.ga.gov.au/geoserver/wfs?' \
deacl_ratesofchange_wfs = f'https://geoserver.dea.ga.gov.au/geoserver/wfs?' \
f'service=WFS&version=1.1.0&request=GetFeature' \
f'&typeName=dea:coastlines_statistics&maxFeatures=1000' \
f'&typeName=dea:rates_of_change&maxFeatures=1000' \
f'&bbox={ymin},{xmin},{ymax},{xmax},' \
f'urn:ogc:def:crs:EPSG:4326'
# Load DEA Coastlines data from WFS using geopandas
deacl_coastlines_gdf = gpd.read_file(deacl_coastlines_wfs)
deacl_statistics_gdf = gpd.read_file(deacl_statistics_wfs)
deacl_annualshorelines_gdf = gpd.read_file(deacl_annualshorelines_wfs)
deacl_ratesofchange_gdf = gpd.read_file(deacl_ratesofchange_wfs)
# Ensure CRSs are set correctly
deacl_coastlines_gdf.crs = 'EPSG:3577'
deacl_statistics_gdf.crs = 'EPSG:3577'
deacl_annualshorelines_gdf.crs = 'EPSG:3577'
deacl_ratesofchange_gdf.crs = 'EPSG:3577'
# Optional: Keep only rates of change points with "good" certainty
# (i.e. no poor quality flags)
deacl_ratesofchange_gdf = deacl_ratesofchange_gdf.query("certainty == 'good'")
```

### Loading DEA Coastlines data from the Web Feature Service (WFS) using R
Expand All @@ -195,18 +199,18 @@ xmax = 115.30
ymin = -33.66
ymax = -33.65
# Read in DEA Coastlines annual coastline data, using `glue` to insert our bounding
# box into the string, and `sf` to load the spatial data from the Web Feature
# Service and set the Coordinate Reference System to Australian Albers (EPSG:3577)
deacl_coastlines = "https://geoserver.dea.ga.gov.au/geoserver/wfs?service=WFS&version=1.1.0&request=GetFeature&typeName=dea:coastlines&maxFeatures=1000&bbox={ymin},{xmin},{ymax},{xmax},urn:ogc:def:crs:EPSG:4326" %>%
# Read in DEA Coastlines annual shoreline data, using `glue` to insert our bounding
# box into the string, and `sf` to load the spatial data from the Web Feature Service
# and set the Coordinate Reference System to Australian Albers (EPSG:3577)
deacl_annualshorelines = "https://geoserver.dea.ga.gov.au/geoserver/wfs?service=WFS&version=1.1.0&request=GetFeature&typeName=dea:shorelines_annual&maxFeatures=1000&bbox={ymin},{xmin},{ymax},{xmax},urn:ogc:def:crs:EPSG:4326" %>%
glue::glue() %>%
sf::read_sf() %>%
sf::read_sf() %>%
sf::st_set_crs(3577)
# Read in DEA Coastlines rates of change statistics data
deacl_statistics = "https://geoserver.dea.ga.gov.au/geoserver/wfs?service=WFS&version=1.1.0&request=GetFeature&typeName=dea:coastlines_statistics&maxFeatures=1000&bbox={ymin},{xmin},{ymax},{xmax},urn:ogc:def:crs:EPSG:4326" %>%
# Read in DEA Coastlines rates of change points
deacl_ratesofchange = "https://geoserver.dea.ga.gov.au/geoserver/wfs?service=WFS&version=1.1.0&request=GetFeature&typeName=dea:rates_of_change&maxFeatures=1000&bbox={ymin},{xmin},{ymax},{xmax},urn:ogc:def:crs:EPSG:4326" %>%
glue::glue() %>%
sf::read_sf() %>%
sf::read_sf() %>%
sf::st_set_crs(3577)
```

Expand Down

0 comments on commit 5fd222b

Please sign in to comment.