https://github.com/ropensci/parzer
Parse geographic coordinates
https://github.com/ropensci/parzer
geo geospatial parser r r-package rstats
Last synced: 3 months ago
JSON representation
Parse geographic coordinates
- Host: GitHub
- URL: https://github.com/ropensci/parzer
- Owner: ropensci
- License: other
- Created: 2019-02-14T22:36:58.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2025-09-11T19:09:52.000Z (5 months ago)
- Last Synced: 2025-10-22T05:59:21.293Z (3 months ago)
- Topics: geo, geospatial, parser, r, r-package, rstats
- Language: R
- Homepage: https://docs.ropensci.org/parzer
- Size: 341 KB
- Stars: 64
- Watchers: 2
- Forks: 7
- Open Issues: 9
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codemeta: codemeta.json
Awesome Lists containing this project
README
---
title: "parzer"
output: github_document
---
```{r echo=FALSE}
knitr::opts_chunk$set(
comment = "R>",
echo = TRUE,
output = TRUE,
collapse = TRUE,
eval = TRUE,
warning = FALSE
)
```
[](https://www.repostatus.org/#active)
[](https://cran.r-project.org/web/checks/check_results_parzer.html)
[](https://github.com/ropensci/parzer/actions/)
[](https://github.com/r-hub/cranlogs.app)
[](https://cran.r-project.org/package=parzer)
[](https://app.codecov.io/github/ropensci/parzer?branch=main)
[](https://github.com/ropensci/software-review/issues/341)
[](https://doi.org/10.32614/CRAN.package.parzer)
`parzer` parses messy geographic coordinates
Docs: https://docs.ropensci.org/parzer/
You may get data from a published study or a colleague where the coordinates
are in some messy character format that you'd like to clean up to get
all decimal degree numeric data.
## `parzer` usage
For example, parse latitude and longitude from messy character vectors.
```{r echo=FALSE}
library("parzer")
```
```{r}
parse_lat(c("45N54.2356", "-45.98739874", "40.123°"))
```
```{r}
parse_lon(c("45W54.2356", "-45.98739874", "40.123°"))
```
And you can even split and parse strings that contain latitude and longitude
together.
```{r}
parse_llstr(c("4 51'36\"S, 101 34'7\"W",
"40.123°; 45W54.2356"))
```
See more in the [Introduction to the `parzer` package vignette](https://docs.ropensci.org/parzer/articles/parzer.html).
## Installation
### Stable version:
```{r echo = TRUE, eval=FALSE}
install.packages("parzer")
```
### Development version:
```{r echo = TRUE, eval=FALSE}
remotes::install_github("ropensci/parzer")
```
## List of functions:
```{r echo=FALSE, comment=NA, results='asis'}
cat(paste(" -", paste(sprintf("`%s`", sort(getNamespaceExports("parzer"))), collapse = "\n - ")))
```
## 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](https://github.com/ropensci/parzer/issues).
* 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](https://ropensci.org/code-of-conduct/). By contributing to this project, you agree to abide by its terms.
[](https://ropensci.org)