Giter Club home page Giter Club logo

r_package_qgis's Introduction

qgis

Lifecycle: experimental

qgis is automatically generated package which originates from qgisprocess and aims to provide calls and simple documentation for each QGIS functions available in core and the most important algorithm providers (GRASS GIS and Saga). The algorithms are automatically extracted from fresh install of latest QGIS version on Ubuntu with packages for GRASS and SAGA installed.

The package is highly experimental and things are quite likely to change a lot in the future. The definition of individual functions can change if it changes in the QGIS.

Installation

You can install the released version of qgis from GitHub with:

# install.package("remotes")
remotes::install_github("JanCaha/r_package_qgis")

The information about local installation are in a vignette vignette("local_instalation").

Functions names

The names of the functions follow general pattern of algorithm-provider_algorithm-id with only the native QGIS algorithms using qgis algorithm provider instead of native.

The available providers are: 3d, gdal, grass7, native, qgis, saga. The overall number of available algorithms is 988.

Example

The package is not meant to be load directly as this would significant number of functions (<900). Instead the functions should be called as:

qgis::qgis_buffer()

This allows you to show the help page for the function (at least in RStudio using the key shortcut F1).

Example in the wild

This example uses qgisprocess pipe ability to directly load output to R.

library(sf)
#> Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1

fname <- system.file("shape/nc.shp", package="sf")
nc <- st_read(fname)
#> Reading layer `nc' from data source 
#>   `/home/runner/work/_temp/Library/sf/shape/nc.shp' using driver `ESRI Shapefile'
#> Simple feature collection with 100 features and 14 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax: 36.58965
#> Geodetic CRS:  NAD27

buffered <- qgis::qgis_buffer(INPUT = nc, 
                              DISTANCE = 0.5, 
                              END_CAP_STYLE = "Flat") %>% 
  st_as_sf()
#> Argument `SEGMENTS` is unspecified (using QGIS default value).
#> Using `JOIN_STYLE = "Round"`
#> Argument `MITER_LIMIT` is unspecified (using QGIS default value).
#> Argument `DISSOLVE` is unspecified (using QGIS default value).
#> Using `OUTPUT = qgis_tmp_vector()`
#> Running qgis_process run 'native:buffer' \
#>   '--INPUT=/tmp/RtmpnbqyTr/file9914730f9017/file99143ded597.gpkg' \
#>   '--DISTANCE=0.5' '--END_CAP_STYLE=1' '--JOIN_STYLE=0' \
#>   '--OUTPUT=/tmp/RtmpnbqyTr/file9914730f9017/file99141dc980f3.gpkg'
#> QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-runner'
#> 
#> ----------------
#> Inputs
#> ----------------
#> 
#> DISTANCE:    0.5
#> END_CAP_STYLE:   1
#> INPUT:   /tmp/RtmpnbqyTr/file9914730f9017/file99143ded597.gpkg
#> JOIN_STYLE:  0
#> OUTPUT:  /tmp/RtmpnbqyTr/file9914730f9017/file99141dc980f3.gpkg
#> 
#> 
#> 0...10...20...30...40...50...60...70...80...90...
#> ----------------
#> Results
#> ----------------
#> 
#> OUTPUT:  /tmp/RtmpnbqyTr/file9914730f9017/file99141dc980f3.gpkg

plot(buffered)
#> Warning: plotting the first 9 out of 14 attributes; use max.plot = 14 to plot
#> all

r_package_qgis's People

Contributors

jancaha avatar github-actions[bot] avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.