Articles by Kay Cichini

Make a KML-File from an OpenStreetMap Trail

September 26, 2014 | Kay Cichini

Ever wished to use a trail on OSM on your GPS or smartphone? With this neat little R-Script this can easily be done. You'll just need to search OpenStreetMap for the ID of the trail (way), put this as argument to osmar::get_osm, convert to KML and you're good ... [Read more...]

R GIS: Function to Reverse KML Paths

May 3, 2014 | Kay Cichini

This is a function I wrote up for reversing KML-paths. The paths within a KML can partially matched by their name-tags## name: ReverseKmlPath ## use: Reverser a KML-path by matching its ## arguments: PATH_TO_DOC the path to the KML-file## NAME the value of the name tag, function uses partial matching!## ... [Read more...]

R GIS: Generalizer for KML Paths

May 3, 2014 | Kay Cichini

I'm posting a recent project's spin-off, which is a custom line-generalizer which I used for huge KML-paths. Anyone with a less clumpsy approach?## line generalizing function: takes two vectors of with x/ycoords ## and return ids of x/y elements which distance to its next element## is shorter than the ... [Read more...]

Use GDAL from R Console to Split Raster into Tiles

March 1, 2014 | Kay Cichini

When working with raster datasets I often encounter limitations caused by the large size of the files. I thus wrote up a little R function that invokes gdal_translate which would split the raster into parts.The screenshot to the left shows a raster in QGIS that was split into ... [Read more...]

Get No. of Google Search Hits with R and XML

January 20, 2014 | Kay Cichini

UPDATE: Thanks to Max Ghenis for updating my R-script which I wrote a while back - the below R-script can now be used again for pulling the number of hits from Google-Search.GoogleHits { require(XML) require(RCurl) url input, "\"", sep = "") CAINFO = paste(system.file(package="RCurl"), "/CurlSSL/ca-bundle.crt", sep = "") ... [Read more...]

R GIS: Polygon Intersection with gIntersection{rgeos}

September 16, 2013 | Kay Cichini

A short tutorial on doing intersections in R GIS. gIntersection{rgeos} will pick the polygons of the first submitted polygon contained within the second poylgon - this is done without cutting the polygon's edges which cross the clip source polygon. For the function that I use to download the example ... [Read more...]

Batch Downloading Zipped Shapefiles with R

September 16, 2013 | Kay Cichini

Here's a function I use to download multiple zipped shapefiles from url and load them to the workspace:URLs "http://gis.tirol.gv.at/ogd/umwelt/wasser/wis_tseepeicher_pl.zip")url_shp_to_spdf require(rgdal) wd td setwd(td) temp download.file(URL, temp) unzip(temp) shp lyr ... [Read more...]

R GIS: Terrain Analysis for Polygons as Simple as it Gets!

June 18, 2013 | Kay Cichini

library(rgdal)library(raster)alt gadm gadm_sub plot(alt)plot(gadm_sub, add=T)asp slo __ extract(slo, gadm_sub, fun = mean, na.rm = T, small = T, df = T) ID slope1 1 9.9590532 2 1.0474433 3 7.4561654 4 1.6737865 5 11.946553__ extract(asp, gadm_sub, fun = mean, na.rm = T, small = T, df = T) ID aspect1 1 170.80652 2 184.01303 3 190.71554 4 136.89535 5 205.2115 [Read more...]

Download File from Google Drive/Docs Programmatically with R

April 11, 2013 | Kay Cichini

Following up my lattest posting on how to download files from the cloud with R..dl_from_GoogleD ## Arguments:## output = output file name## key = Google document key## format = output format (pdf, rtf, doc, txt..)## Note: File must be shareable! require(RCurl) bin ssl.verifypeer = FALSE) con writeBin(bin, con) close(... [Read more...]
1 2 3 6

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)