dev_func/test_script.R

# test pkg

# http://tinyheero.github.io/jekyll/update/2015/07/26/making-your-first-R-package.html

# Check if %eq%, %leq%, etc... documentation is up to date.
# Check if osh_filter documentation is up to date.
# Continue checking packages.
# In osh_filter: # add option for filter of tags / attrs to get all parent nodes !!
# rethink checkExprs as a method?!
# Split file
# Document

devtools::check()

# method to get length of oshex. to get metasummary. to get tag summary
devtools::load_all()

library(sp)
library(raster)
library(magrittr)

fname <- "../WB_history_test.osm"
xml <- XML::xmlParse(fname, encoding = "utf-8")

osh <- as_oshex(osm = xml, parse.tags = FALSE)

tst <- osh_filter(osh, conditions = tag(highway %eq% "."))

cond <- tag(building %eq% ".", addr:housenumber %meq% 30)
tst <- osh_filter(osh, cond)


bldgs <- osh_filter(osh, conditions = list(tag(building %eq% yes,
                                          roof:shape %eq% hipped),
                                          temp(from = "1-10-2017", format = "%d-%m-%Y")))#



c("JumpStart International", "Esperanza36", "talkat")
  usr <- osh_filter(osh, conditions = attrs(user %inc% "talkat"))

  coords <- lapply(usr@node@attrs, function(x) {x[c("lon", "lat")]}) %>% do.call("rbind", .)
  coords %<>% apply(2, as.numeric)

  shpBMM <- SpatialPoints(coords = coords, proj4string = CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"))
  r <- raster(xmn = shpBMM@bbox[1, 1],
              xmx = shpBMM@bbox[1, 2],
              ymn = shpBMM@bbox[2, 1],
              ymx = shpBMM@bbox[2, 2])
  nc2 <- rasterize(shpBMM, r, fun = 'count', background = 0)
dof1985/OSHEX documentation built on May 28, 2019, 3:36 p.m.