Lint geojson

Share:

Description

Lint geojson

Usage

1
lint(x, ...)

Arguments

x

Input, a geojson character string or list

...

Further args passed on to helper functions.

Details

This function is Deprecated - and will be removed in the next version of this package. See geojsonio-deprecated for more information

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
## Not run: 
lint('{"type": "FooBar"}')
lint('{ "type": "FeatureCollection" }')
lint('{"type":"Point","geometry":{"type":"Point","coordinates":[-80,40]},"properties":{}}')

# From a list turned into geo_list
mylist <- list(list(latitude=30, longitude=120, marker="red"),
               list(latitude=30, longitude=130, marker="blue"))
x <- geojson_list(mylist)
class(x)
lint(x)

# A file
file <- system.file("examples", "zillow_or.geojson", package = "geojsonio")
lint(as.location(file))

# A URL
url <- "https://raw.githubusercontent.com/glynnbird/usstatesgeojson/master/california.geojson"
lint(as.location(url))

# from json (jsonlite class)
x <- jsonlite::minify('{ "type": "FeatureCollection" }')
class(x)
lint(x)

# From SpatialPoints class
library("sp")
a <- c(1,2,3,4,5)
b <- c(3,2,5,1,4)
(x <- SpatialPoints(cbind(a,b)))
class(x)
lint(x)

# From a data.frame
## need to specify what columns are lat and long with a data.frame
lint(us_cities[1:2,], lat='lat', lon='long')

# From numeric
vec <- c(32.45,-99.74)
lint(vec)

# From a list
mylist <- list(list(latitude=30, longitude=120, marker="red"),
               list(latitude=30, longitude=130, marker="blue"))
lint(mylist)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.