Blog Archives

Make a KML-File from an OpenStreetMap Trail

September 26, 2014
By
Make a KML-File from an OpenStreetMap Trail

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 to go! # get OSM datalibrary(osmar)library(maptools)rotewandsteig sp_rotewandsteig # convert to...

Read more »

R GIS: Function to Reverse KML Paths

May 3, 2014
By

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...

Read more »

R GIS: Generalizer for KML Paths

May 3, 2014
By

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 average distance between consecutive vertices## multiplied by 'fac'check_dist ...

Read more »

Download all Documents from Google Drive with R

March 17, 2014
By
Download all Documents from Google Drive with R

. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don't. A commentator on my blog recently asked if it is possible to retrieve all direct links to...

Read more »

Use Case: Make Contour Lines for Google Earth with Spatial R

March 3, 2014
By
Use Case: Make Contour Lines for Google Earth with Spatial R

Here's comes a script I wrote for creating contour lines in KML-format to be used with Google Earth https://github.com/gimoya/theBioBucket-Archives/blob/master/R/r_contours_for_google_earth.RIf you want to check or just use the datasets I created for t...

Read more »

Use GDAL from R Console to Split Raster into Tiles

March 1, 2014
By
Use GDAL from R Console to Split Raster into Tiles

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 four parts with the below script.## get filesnames (assuming the datasets...

Read more »

Use Case: Spatial R & Google Earth for Terrain Analyses

February 5, 2014
By
Use Case: Spatial R & Google Earth for Terrain Analyses

I'd like to share code that uses spatial R and Google Earth for terrain analyses. In this example I took SRTM data at 1" resolution from http://www.viewfinderpanoramas.org/dem3.html#alps read it into R did a little processing and finally wrapped it up ...

Read more »

Get No. of Google Search Hits with R and XML

January 20, 2014
By

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 ...

Read more »

R GIS: Polygon Intersection with gIntersection{rgeos}

September 16, 2013
By
R GIS: Polygon Intersection with gIntersection{rgeos}

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 data, url_shp_to_spdf() please see HERE. library(rgeos)library(dismo)URLs ...

Read more »

Batch Downloading Zipped Shapefiles with R

September 16, 2013
By

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 y names(y)...

Read more »

Search R-bloggers

Sponsors

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)