Code Monkey home page Code Monkey logo

maptrack3d's Introduction

maptrack3d

Function to plot GPS lon/lat tracks on a 3-dimensional map generated from SRTM elevations and water/city/road shapefiles available for the US using TIGER data accessed via the tigris package, and from Statistics Canada.

Unzip SRTM .bil files in a map data directory, read and join the raster objects, and save in a large .grd file. Also processes US TIGER spatial data on urban areas, roads, and water. The data can be saved in R's native raster .grd format for future use, and can be used directly from disk rather than being read into memory. These files are very compressible, and I recommend storing them on a disk where the OS handles that. Data access is unlikely to be the performance bottleneck - the rgeos functions called in this code can be very slow.

Speaking of slow, you probably won't be happy using a network drive for storing the raster files.

The functions here can plot a 3d surface and paths on it. The left mouse button rotates the surface, the right button pans, and the wheel zooms. Optinally, the function saves an html file with the plot embedded. The saved plot lacks right mouse-button panning control. Files saved at a resolution of 2800 (this is a factor used to calculate an aggregation factor for the spatial data) are able to be loaded into Firefox but not Edge or Chrome on my 32G windows machine at this moment, this will likely change with browser releases.

This script is not as graceful as I would like near the 180E/180W meridian. Fortunately, pretty much nobody lives there. If you live in the Aleutians, Fiji, Siberia or Chatham Island, I'm sorry for the inconvenience.....

Shuttle Radar Tomography Mission data containing terrestrial surface elevation data is available in several combinations of resolution and void-fill post-processing. You can create an account and bulk download the files at https://earthexplorer.usgs.gov/ There are R packages which will retrieve SRTM tiles, but the data has been around for a while, and keeping a local copy seems more sensible.

There is also a script to thin and format road/city/water shapefiles from Statistics Canada data.

Better instructions to come soon.

maptrack3d's People

Contributors

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