{"id":27889631,"url":"https://github.com/justincally/vicmapr","last_synced_at":"2025-12-30T09:34:38.975Z","repository":{"id":38116187,"uuid":"292424001","full_name":"JustinCally/VicmapR","owner":"JustinCally","description":"An R package to easily utilise Victorian Government spatial datasets","archived":false,"fork":false,"pushed_at":"2024-09-11T01:20:53.000Z","size":6117,"stargazers_count":17,"open_issues_count":5,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-09-11T05:59:11.339Z","etag":null,"topics":["gis","r","spatial-data","wfs","wfs-urls"],"latest_commit_sha":null,"homepage":"https://justincally.github.io/VicmapR","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JustinCally.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-09-03T00:22:13.000Z","updated_at":"2024-09-11T01:17:18.000Z","dependencies_parsed_at":"2023-10-02T00:22:32.632Z","dependency_job_id":null,"html_url":"https://github.com/JustinCally/VicmapR","commit_stats":{"total_commits":205,"total_committers":7,"mean_commits":"29.285714285714285","dds":0.5609756097560976,"last_synced_commit":"505154e830c9eefad7aa02417b196e7c63d02e06"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JustinCally%2FVicmapR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JustinCally%2FVicmapR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JustinCally%2FVicmapR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JustinCally%2FVicmapR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JustinCally","download_url":"https://codeload.github.com/JustinCally/VicmapR/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252479070,"owners_count":21754481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gis","r","spatial-data","wfs","wfs-urls"],"created_at":"2025-05-05T10:25:03.350Z","updated_at":"2025-12-30T09:34:38.968Z","avatar_url":"https://github.com/JustinCally.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# vicspatial \n\n\u003cimg src='man/figures/logo.png' align=\"right\" height=\"100\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![Codecov test coverage](https://codecov.io/gh/JustinCally/vicspatial/branch/master/graph/badge.svg)](https://app.codecov.io/gh/JustinCally/vicspatial?branch=master)\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n\u003c!-- [![R build status](https://github.com/JustinCally/vicspatial/workflows/R-CMD-check/badge.svg)](https://github.com/JustinCally/vicspatial/actions) --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/vicspatial)](https://CRAN.R-project.org/package=vicspatial)\n[![](http://cranlogs.r-pkg.org/badges/grand-total/vicspatial?color=ff69b4)](https://cran.r-project.org/package=vicspatial)\n\u003c!-- [![Devel version](https://img.shields.io/badge/devel%20version-0.1.3-blue.svg)](https://github.com/JustinCally/vicspatial) --\u003e\n\u003c!-- [![Code size](https://img.shields.io/github/languages/code-size/JustinCally/vicspatial.svg)](https://github.com/JustinCally/vicspatial) --\u003e\n[![R-CMD-check](https://github.com/JustinCally/vicspatial/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/JustinCally/vicspatial/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\n**In May 2025 (version 0.3.0) `VicmapR` was renamed to `vicspatial`. Unfortunately this change has been requested by the trademark holders of `VICMAP` (Department of Transport and Planning). While redirections should be in place for GitHub and CRAN websites, please check existing code for explicit mentions of `VicmapR`.**\n\nThe goal of vicspatial is to provide functions to easily access Victorian Government spatial data through their WFS (Web Feature Service). vicspatial leverages code and a lazy querying approach developed by [Teucher et al. (2021)](https://joss.theoj.org/papers/10.21105/joss.02927) for the [{bcdata} R package](https://bcgov.github.io/bcdata/), which allows for a responsive and precise querying process. \n\n## Migration of Victoria's Open Data Geoserver  \n\n**From March 2023 (`vicspatial v0.2.0`) the way `vicspatial` obtains data has changed**\n\nIn March 2023 the data platform used by `vicspatial` will be migrated with the legacy platform discontinued. Changes have been to the `vicspatial` package to allow for the conversion and translation of of code in an effort to ensure legacy code still works. However, the migration may have unseen consequences and users are encouraged to review code. \n\n## Installation  \n\nYou can install the released version from CRAN with:  \n``` r\ninstall.packages(\"vicspatial\")\n```\n\nOr you can install the the development version from [GitHub](https://github.com/) with: \n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"JustinCally/vicspatial\")\n```\n\n### Dependencies  \n\nCurrently, the ability to use accurate geometric filters using `vicspatial` requires GDAL \u003e 3.0. To see how to upgrade your version of GDAL and link it to the `sf` package visit: https://r-spatial.github.io/sf/#installing  \n\n```{r dependencies}\nlibrary(sf)\nsf::sf_extSoftVersion()\n```\n\n\n## Example\n\n### Searching for data\n\n```{r example}\nlibrary(vicspatial)\n\n# Check to see if the geoserver is working. It will error if it is not working  \ncheck_geoserver()\n\nlistLayers(pattern = \"watercourse\", ignore.case = T)\n```\n\n### Reading in data\n\nAs of vicspatial version `0.1.0` data is read in using a lazy evaluation method with the convenience of pipe operators (`%\u003e%`). A lot of the methods and code have already been written for a similar package ([bcdata](https://github.com/bcgov/bcdata)) that downloads data from the British Columbia WFS catalogues. Using a similar approach, vicspatial allows users to construct a WFS query in a step-wise format. In doing so a query is reserved until `collect()` is used on the `vicmap_promise`. The example below shows an extensive example of how the to easily read in spatial data:\n\n```{r query_example}\n# Read in an example shape to restrict our query to using geometric filtering\nmelbourne \u003c- sf::st_read(system.file(\"shapes/melbourne.geojson\", package=\"vicspatial\"), quiet = T)\n\n# Obtain a promise of what data will be returned for a given layer\nvicmap_query(layer = \"open-data-platform:hy_watercourse\")\n\n# Build a more specific query and collect the results\nvicmap_query(layer = \"open-data-platform:hy_watercourse\") %\u003e% # layer to query\n  filter(hierarchy == \"L\" \u0026 feature_type_code == 'watercourse_channel_drain') %\u003e% # simple filter for a column\n  filter(INTERSECTS(melbourne)) %\u003e% # more advanced geometric filter\n  select(hierarchy, pfi) %\u003e% \n  collect()\n```\n\nvicspatial translates numerous geometric filter functions available in the Victorian Government's WFS Geoserver supports numerous [geometric filters](https://docs.geoserver.org/stable/en/user/tutorials/cql/cql_tutorial.html#geometric-filters):  \n\n+ `EQUALS`   \n+ `DISJOINT`   \n+ `INTERSECTS`   \n+ `TOUCHES`   \n+ `CROSSES`   \n+ `WITHIN`   \n+ `CONTAINS` \n+ `OVERLAPS`   \n+ `DWITHIN`   \n+ `BEYOND`  \n+ `BBOX`  \n\nThese filters can be used within the `filter()` function by providing them an object of class `sf/sfc/sfg/bbox` as shown above with the `melbourne` object. \n\n### Using other WFS urls  \n\nUsing `options(vicmap.base_url)` vicspatial can query data from other WFS services; while this remains somewhat untested it is relatively easy to point vicspatial to another WFS url. This option would need to be set every session to override the base vicspatial url. For instance, the BOM WFS can be used as follows:  \n\n```{r, eval=FALSE}\n# set the new base url\noptions(vicmap.base_url = \"http://geofabric.bom.gov.au/simplefeatures/ahgf_shcatch/wfs\")\n\n# collect a data sample\ncatchments \u003c- vicmap_query(\"ahgf_shcatch:AHGFCatchment\") %\u003e% \n  head(10) %\u003e% \n  collect()\n```\n\n*__Note__: Using other Geoserver WFS urls will not necessarily work as expected due to the potential differences in the capabilities of the Geoserver instance*\n\n\n\n\n### License\n\nCopyright 2018 Province of British Columbia  \nModifications Copyright 2020 Justin Cally\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttps://www.apache.org/licenses/LICENSE-2.0.txt\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and limitations under the License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustincally%2Fvicmapr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustincally%2Fvicmapr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustincally%2Fvicmapr/lists"}