Giter Site home page Giter Site logo

mapix's Introduction

mapix

A set of simple bash commands that bring r-spatial tools to the Linux command line. My motivation for writing these were a bunch of geojson files I had to go through, some of them just needed visual inspection, others needed some editing.

Installation

Installing R and r-spatial tools

These scripts assume that R along with the packages sf, mapview, and mapedit are all installed already. To install R, downlaod from your favorite CRAN mirror. Once you have R installed, open an R session, and install sf, mapview, and mapedit by running the following command:

install.packages(c("sf", "mapview", "mapedit"))

Or, to make sure you get the latest features in these libraries, install with devtools:

install.packages("devtools")
devtools::install_github("r-spatial/sf")
devtools::install_github("r-spatial/mapview")
devtools::install_github("r-spatial/mapedit")

Installing mapix

For debian-based systems, download the mapix.deb file and install with apt. Otherwise download the scripts in the src directory and place them in your /usr/local/bin/ directory. Give yourself permission to read and execute the scripts (e.g. sudo chmod 755 /usr/local/bin/Rint etc) and you're all set!

Usage

Rint

Rint is a trick by Jon Gjengset to get R to run a script interactively. Check out his explanation for how it works. I changed it slightly to allow the R script to accept command line arguments. The commands are all executed with Rint.

mapcreate

Usage: mapcreate filename

This will create a new file with the given filename with the drawn features. Make sure it has a valid extension like '.geojson', '.shp', '.kml', etc.

mapupdate

Usage: mapupdate input_filename [output_filename]

This is used to edit an existing file. If you call mapupdate with just one filename, your edits will overwrite the original file with your edits. If you call it with two filenames, the first will be used as the input file, and the second will be the new file where the edits will be written to.

mapview

Usage: mapview filename

If you just want to inspect a file visually, use mapview.

All of the commands should open in the default browser.

mapix's People

Contributors

yeedle avatar

Stargazers

Xiangyun Huang avatar Michael Dorman avatar mark padgham avatar Robin Lovelace 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.