MyNixOS website logo
Description

Parse Messy Geographic Coordinates.

Parse messy geographic coordinates from various character formats to decimal degree numeric values. Parse coordinates into their parts (degree, minutes, seconds); calculate hemisphere from coordinates; pull out individually degrees, minutes, or seconds; add and subtract degrees, minutes, and seconds. C++ code herein originally inspired from code written by Jeffrey D. Bogan, but then completely re-written.

parzer

Project Status: Active – The project has reached a stable, usablestate and is being activelydeveloped. cranchecks R-CMD-check codecov.io rstudio mirrordownloads cranversion

parzer parses messy geographic coordinates

Docs: https://docs.ropensci.org/parzer/

You may get data from a published study or a colleague, and the coordinates may be in some messy character format that you’d like to clean up to have all decimal degree numeric data.

parzer API:

  • parse_hemisphere
  • parse_lat
  • parse_llstr
  • parse_lon
  • parse_lon_lat
  • parse_parts_lat
  • parse_parts_lon
  • pz_d
  • pz_degree
  • pz_m
  • pz_minute
  • pz_s
  • pz_second

Usage

For example, parse latitude and longitude from messy character vectors.

parse_lat(c("45N54.2356", "-45.98739874", "40.123°"))
#> [1]  45.90393 -45.98740  40.12300
parse_lon(c("45W54.2356", "-45.98739874", "40.123°"))
#> [1] -45.90393 -45.98740  40.12300

See more in the Introduction to the parzer package vignette.

Installation

Stable version

install.packages("parzer")

Development version

remotes::install_github("ropensci/parzer")
library("parzer")

Similar art

  • sp::char2dms: is most similar to parzer::parse_lat and parzer::parse_lon. However, with sp::char2dms you have to specify the termination character for each of degree, minutes and seconds. parzer does this for the user.
  • biogeo::dms2dd: very unlike functions in this package. You must pass separate degrees, minutes, seconds and direction to dms2dd. No exact analog is found in parzer, whose main focus is parsing messy geographic coordinates in strings to a more machine readable version

Meta

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for parzer in R doing citation(package = 'parzer')
  • Please note that this package is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

ropensci_footer

Metadata

Version

0.4.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows