Git Product home page Git Product logo

lagosusgis's People

Contributors

jsta avatar

Stargazers

 avatar

Watchers

 avatar  avatar

lagosusgis's Issues

Add vapour extent argument to query functions

file <- "list_locality_postcode_meander_valley.tab"
mvfile <- system.file(file.path("extdata/tab", file), package="vapour")

## doesn't need names, they aren't used
## order is assumed
e <- c(xmin = 469750, xmax = 500840, 
       ymin = 5381892, ymax = 5393322)

library(vapour)
## no change
length(vapour_read_geometry(mvfile, extent = e))
#> [1] 58

## needs sql to be run as well
g <- vapour_read_geometry(mvfile, extent = e, sql = "SELECT * FROM list_locality_postcode_meander_valley")
length(g)  ## 9, they intersect the bounding box / extent
#> [1] 9


## compare with sf plot
library(sf)
#> Linking to GEOS 3.6.2, GDAL 2.3.2, PROJ 4.9.3
x <- sf::read_sf(mvfile)
plot(x[1], reset = F)
plot(sf::st_cast(sf::st_as_sfc(g)), add = TRUE, lwd =5)
rect(e[1], e[3], e[2], e[4])

Look into whether query_gis with large polygons can be sped up

ll_poly <- LAGOSUSgis::query_gis("LAGOS_US_All_Lakes_1ha", "lagoslakeid", 7922)

Warning message:
In vapour_read_attributes_cpp(dsource = dsource, layer = layer, :
GDAL Message 1: organizePolygons() received a polygon with more than 100 parts. The processing may be really slow. You can skip the processing by setting METHOD=SKIP, or only make it analyze counter-clock wise parts by setting METHOD=ONLY_CCW if you can assume that the outline of holes is counter-clock wise defined

Fix memoised functions onLoad instead of on compile

It is recommended that functions in a package are not memoised at build-time,
but when the package is loaded. The simplest way to do this is within
\code{.onLoad()} with, for example

fun <- function() {
some_expensive_process()

zzz.R
.onLoad <- function(libname, pkgname) {
fun <<- memoise::memoise(fun)
}

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.