wkt2geojson: Convert WKT to GeoJSON-like objects.

Description Usage Arguments Details References See Also Examples

View source: R/wkt2geojson.R

Description

Convert WKT to GeoJSON-like objects.

Usage

1
wkt2geojson(str, fmt = 16, feature = TRUE, numeric = TRUE, simplify = FALSE)

Arguments

str

A GeoJSON-like object representing a Point, LineString, Polygon, MultiPolygon, etc.

fmt

Format string which indicates the number of digits to display after the decimal point when formatting coordinates. Max: 20

feature

(logical) Make a feature geojson object. Default: TRUE

numeric

(logical) Give back values as numeric. Default: TRUE

simplify

(logical) Attempt to simplify from a multi- geometry type to a single type. Applies to multi features only. Default: FALSE

Details

Should be robust against a variety of typing errors, including extra spaces between coordinates, no space between WKT type and coordinates. However, some things won't pass, including lowercase WKT types, no spaces between coordinates.

WKT with a 3rd value and when Z is found will be left as is and assumed to be a altitude or similar value. WKT with a 3rd value and when M is found will be discarded as the GeoJSON spec says to do so. WKT with a 4th value as (presumably as a measurement) will also be discarded.

References

https://tools.ietf.org/html/rfc7946

See Also

geojson2wkt()

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
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# point
str <- "POINT (-116.4000000000000057 45.2000000000000028)"
wkt2geojson(str)
wkt2geojson(str, feature=FALSE)
wkt2geojson(str, numeric=FALSE)
wkt2geojson("POINT (-116 45)")
wkt2geojson("POINT (-116 45 0)")
## 3D
wkt2geojson("POINT Z(100 3 35)")
wkt2geojson("POINT M(100 3 35)") # dropped if M
## 4D
wkt2geojson("POINT ZM(100 3 35 1.5)") # Z retained

# multipoint
str <- 'MULTIPOINT ((100.000 3.101), (101.000 2.100), (3.140 2.180))'
wkt2geojson(str, fmt = 2)
wkt2geojson(str, fmt = 2, feature=FALSE)
wkt2geojson(str, numeric=FALSE)
wkt2geojson("MULTIPOINT ((100 3), (101 2), (3 2))")
wkt2geojson("MULTIPOINT ((100 3 0), (101 2 0), (3 2 0))")
wkt2geojson("MULTIPOINT ((100 3 0 1), (101 2 0 1), (3 2 0 1))") 
## 3D
wkt2geojson("MULTIPOINT Z((100 3 35), (101 2 45), (3 2 89))")
wkt2geojson("MULTIPOINT M((100 3 1.3), (101 2 1.4), (3 2 1.9))")
## 4D
wkt2geojson("MULTIPOINT ZM((100 3 35 0), (101 2 45 0), (3 2 89 0))")

## simplify
wkt2geojson("MULTIPOINT ((100 3))", simplify = FALSE)
wkt2geojson("MULTIPOINT ((100 3))", simplify = TRUE)


# polygon
str <- "POLYGON ((100 0.1, 101.1 0.3, 101 0.5, 100 0.1),
   (103.2 0.2, 104.8 0.2, 100.8 0.8, 103.2 0.2))"
wkt2geojson(str)
wkt2geojson(str, feature=FALSE)
wkt2geojson(str, numeric=FALSE)
## 3D
str <- "POLYGON Z((100 0.1 3, 101.1 0.3 1, 101 0.5 5, 100 0.1 8),
   (103.2 0.2 3, 104.8 0.2 4, 100.8 0.8 5, 103.2 0.2 9))"
wkt2geojson(str)
## 4D
str <- "POLYGON ZM((100 0.1 3 0, 101.1 0.3 1 0, 101 0.5 5 0, 100 0.1 8 0),
   (103.2 0.2 3 0, 104.8 0.2 4 0, 100.8 0.8 5 0, 103.2 0.2 9 0))"
wkt2geojson(str)


# multipolygon
str <- "MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)),
 ((20 35, 45 20, 30 5, 10 10, 10 30, 20 35), (30 20, 20 25, 20 15, 30 20)))"
wkt2geojson(str)
wkt2geojson(str, feature=FALSE)
wkt2geojson(str, numeric=FALSE)
## 3D
str <- "MULTIPOLYGON Z(((40 40 1, 20 45 3, 45 30 10, 40 40 0)),
 ((20 35 5, 45 20 67, 30 5 890, 10 10 2, 10 30 0, 20 35 4), 
 (30 20 4, 20 25 54, 20 15 56, 30 20 89)))"
wkt2geojson(str)
## 4D
str <- "MULTIPOLYGON ZM(((40 40 1 0, 20 45 3 4, 45 30 10 45, 40 40 0 1)),
 ((20 35 5 8, 45 20 67 9, 30 5 890 89, 10 10 2 234, 10 30 0 5, 20 35 4 1), 
 (30 20 4 0, 20 25 54 5, 20 15 56 55, 30 20 89 78)))"
wkt2geojson(str)

# simplify multipolygon to polygon if possible
str <- "MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)))"
wkt2geojson(str, simplify = FALSE)
wkt2geojson(str, simplify = TRUE)


# linestring
str <- "LINESTRING (100.000 0.000, 101.000 1.000)"
wkt2geojson(str)
wkt2geojson(str, feature = FALSE)
wkt2geojson("LINESTRING (0 -1, -2 -3, -4 5)")
wkt2geojson("LINESTRING (0 1 2, 4 5 6)")
wkt2geojson(str, numeric = FALSE)
## 3D
wkt2geojson("LINESTRING Z(100.000 0.000 3, 101.000 1.000 5)")
wkt2geojson("LINESTRING M(100.000 0.000 10, 101.000 1.000 67)")
## 4D
wkt2geojson("LINESTRING ZM(100 0 1 4, 101 1 5 78)")


# multilinestring
str <- "MULTILINESTRING ((30 1, 40 30, 50 20)(10 0, 20 1))"
wkt2geojson(str)
wkt2geojson(str, numeric=FALSE)

str <- "MULTILINESTRING (
   (-105.0 39.5, -105.0 39.5, -105.0 39.5, -105.0 39.5,
     -105.0 39.5, -105.0 39.5),
   (-105.0 39.5, -105.0 39.5, -105.0 39.5),
   (-105.0 39.5, -105.0 39.5, -105.0 39.5, -105.0 39.5, -105.0 39.5),
   (-105.0 39.5, -105.0 39.5, -105.0 39.5, -105.0 39.5))"
wkt2geojson(str)
wkt2geojson(str, numeric=FALSE)

## 3D
str <- "MULTILINESTRING Z((30 1 0, 40 30 0, 50 20 0)(10 0 1, 20 1 1))"
wkt2geojson(str)
str <- "MULTILINESTRING M((30 1 0, 40 30 0, 50 20 0)(10 0 1, 20 1 1))"
wkt2geojson(str)
## 4D
str <- "MULTILINESTRING ZM((30 1 0 5, 40 30 0 7, 50 20 0 1)(10 0 1 1, 20 1 1 1))"
wkt2geojson(str)

# simplify multilinestring to linestring if possible
str <- "MULTILINESTRING ((30 1, 40 30, 50 20))"
wkt2geojson(str, simplify = FALSE)
wkt2geojson(str, simplify = TRUE)


# Geometrycollection
str <- "GEOMETRYCOLLECTION (
 POINT Z(0 1 4),
 LINESTRING (-100 0, -101 -1),
 POLYGON ((100.001 0.001, 101.1235 0.0010, 101.001 1.001, 100.001 0.001),
           (100.201 0.201, 100.801 0.201, 100.801 0.801, 100.201 0.201)),
 MULTIPOINT ((100.000 3.101), (101.0 2.1), (3.14 2.18)),
 MULTILINESTRING ((0 -1, -2 -3, -4 -5),
       (1.66 -31.50, 10.0 3.0, 10.9 1.1, 0.0 4.4)),
 MULTIPOLYGON (((100.001 0.001, 101.001 0.001, 101.001 1.001, 100.001 0.001),
               (100.201 0.201, 100.801 0.201, 100.801 0.801, 100.201 0.201)),
                 ((1 2 3, 5 6 7, 9 10 11, 1 2 3))))"
wkt2geojson(str)
wkt2geojson(str, numeric=FALSE)

# case doesn't matter
str <- "point (-116.4000000000000057 45.2000000000000028)"
wkt2geojson(str)

Example output

Attaching package: 'wellknown'

The following object is masked from 'package:graphics':

    polygon

$type
[1] "Feature"

$geometry
$geometry$type
[1] "Point"

$geometry$coordinates
[1] -116.4   45.2


attr(,"class")
[1] "geojson"
$type
[1] "Point"

$coordinates
[1] -116.4   45.2

attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "Point"

$geometry$coordinates
[1] "-116.4000000000000057" "45.2000000000000028"  


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "Point"

$geometry$coordinates
[1] -116   45


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "Point"

$geometry$coordinates
[1] -116   45    0


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "Point"

$geometry$coordinates
[1] 100   3  35


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "Point"

$geometry$coordinates
[1] 100   3


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "Point"

$geometry$coordinates
[1] 100   3  35


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiPoint"

$geometry$coordinates
       [,1]  [,2]
[1,] 100.00 3.101
[2,] 101.00 2.100
[3,]   3.14 2.180


attr(,"class")
[1] "geojson"
$type
[1] "MultiPoint"

$coordinates
       [,1]  [,2]
[1,] 100.00 3.101
[2,] 101.00 2.100
[3,]   3.14 2.180

attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiPoint"

$geometry$coordinates
     [,1]                   [,2]                
[1,] "100.0000000000000000" "3.1010000000000000"
[2,] "101.0000000000000000" "2.1000000000000001"
[3,] "3.1400000000000001"   "2.1800000000000002"


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiPoint"

$geometry$coordinates
     [,1] [,2]
[1,]  100    3
[2,]  101    2
[3,]    3    2


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiPoint"

$geometry$coordinates
     [,1] [,2] [,3]
[1,]  100    3    0
[2,]  101    2    0
[3,]    3    2    0


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiPoint"

$geometry$coordinates
     [,1] [,2] [,3] [,4]
[1,]  100    3    0    1
[2,]  101    2    0    1
[3,]    3    2    0    1


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiPoint"

$geometry$coordinates
     [,1] [,2] [,3]
[1,]  100    3   35
[2,]  101    2   45
[3,]    3    2   89


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiPoint"

$geometry$coordinates
     [,1] [,2]
[1,]  100    3
[2,]  101    2
[3,]    3    2


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiPoint"

$geometry$coordinates
     [,1] [,2] [,3]
[1,]  100    3   35
[2,]  101    2   45
[3,]    3    2   89


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiPoint"

$geometry$coordinates
     [,1] [,2]
[1,]  100    3


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "Point"

$geometry$coordinates
[1] 100   3


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "Polygon"

$geometry$coordinates
$geometry$coordinates[[1]]
      [,1] [,2]
[1,] 100.0  0.1
[2,] 101.1  0.3
[3,] 101.0  0.5
[4,] 100.0  0.1

$geometry$coordinates[[2]]
      [,1] [,2]
[1,] 103.2  0.2
[2,] 104.8  0.2
[3,] 100.8  0.8
[4,] 103.2  0.2



attr(,"class")
[1] "geojson"
$type
[1] "Polygon"

$coordinates
$coordinates[[1]]
      [,1] [,2]
[1,] 100.0  0.1
[2,] 101.1  0.3
[3,] 101.0  0.5
[4,] 100.0  0.1

$coordinates[[2]]
      [,1] [,2]
[1,] 103.2  0.2
[2,] 104.8  0.2
[3,] 100.8  0.8
[4,] 103.2  0.2


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "Polygon"

$geometry$coordinates
$geometry$coordinates[[1]]
     [,1]                   [,2]                
[1,] "100.0000000000000000" "0.1000000000000000"
[2,] "101.0999999999999943" "0.3000000000000000"
[3,] "101.0000000000000000" "0.5000000000000000"
[4,] "100.0000000000000000" "0.1000000000000000"

$geometry$coordinates[[2]]
     [,1]                   [,2]                
[1,] "103.2000000000000028" "0.2000000000000000"
[2,] "104.7999999999999972" "0.2000000000000000"
[3,] "100.7999999999999972" "0.8000000000000000"
[4,] "103.2000000000000028" "0.2000000000000000"



attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "Polygon"

$geometry$coordinates
$geometry$coordinates[[1]]
      [,1] [,2] [,3]
[1,] 100.0  0.1    3
[2,] 101.1  0.3    1
[3,] 101.0  0.5    5
[4,] 100.0  0.1    8

$geometry$coordinates[[2]]
      [,1] [,2] [,3]
[1,] 103.2  0.2    3
[2,] 104.8  0.2    4
[3,] 100.8  0.8    5
[4,] 103.2  0.2    9



attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "Polygon"

$geometry$coordinates
$geometry$coordinates[[1]]
      [,1] [,2] [,3]
[1,] 100.0  0.1    3
[2,] 101.1  0.3    1
[3,] 101.0  0.5    5
[4,] 100.0  0.1    8

$geometry$coordinates[[2]]
      [,1] [,2] [,3]
[1,] 103.2  0.2    3
[2,] 104.8  0.2    4
[3,] 100.8  0.8    5
[4,] 103.2  0.2    9



attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiPolygon"

$geometry$coordinates
$geometry$coordinates[[1]]
$geometry$coordinates[[1]][[1]]
     [,1] [,2]
[1,]   40   40
[2,]   20   45
[3,]   45   30
[4,]   40   40


$geometry$coordinates[[2]]
$geometry$coordinates[[2]][[1]]
     [,1] [,2]
[1,]   20   35
[2,]   45   20
[3,]   30    5
[4,]   10   10
[5,]   10   30
[6,]   20   35

$geometry$coordinates[[2]][[2]]
     [,1] [,2]
[1,]   30   20
[2,]   20   25
[3,]   20   15
[4,]   30   20




attr(,"class")
[1] "geojson"
$type
[1] "MultiPolygon"

$coordinates
$coordinates[[1]]
$coordinates[[1]][[1]]
     [,1] [,2]
[1,]   40   40
[2,]   20   45
[3,]   45   30
[4,]   40   40


$coordinates[[2]]
$coordinates[[2]][[1]]
     [,1] [,2]
[1,]   20   35
[2,]   45   20
[3,]   30    5
[4,]   10   10
[5,]   10   30
[6,]   20   35

$coordinates[[2]][[2]]
     [,1] [,2]
[1,]   30   20
[2,]   20   25
[3,]   20   15
[4,]   30   20



attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiPolygon"

$geometry$coordinates
$geometry$coordinates[[1]]
$geometry$coordinates[[1]][[1]]
     [,1]                  [,2]                 
[1,] "40.0000000000000000" "40.0000000000000000"
[2,] "20.0000000000000000" "45.0000000000000000"
[3,] "45.0000000000000000" "30.0000000000000000"
[4,] "40.0000000000000000" "40.0000000000000000"


$geometry$coordinates[[2]]
$geometry$coordinates[[2]][[1]]
     [,1]                  [,2]                 
[1,] "20.0000000000000000" "35.0000000000000000"
[2,] "45.0000000000000000" "20.0000000000000000"
[3,] "30.0000000000000000" "5.0000000000000000" 
[4,] "10.0000000000000000" "10.0000000000000000"
[5,] "10.0000000000000000" "30.0000000000000000"
[6,] "20.0000000000000000" "35.0000000000000000"

$geometry$coordinates[[2]][[2]]
     [,1]                  [,2]                 
[1,] "30.0000000000000000" "20.0000000000000000"
[2,] "20.0000000000000000" "25.0000000000000000"
[3,] "20.0000000000000000" "15.0000000000000000"
[4,] "30.0000000000000000" "20.0000000000000000"




attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiPolygon"

$geometry$coordinates
$geometry$coordinates[[1]]
$geometry$coordinates[[1]][[1]]
     [,1] [,2] [,3]
[1,]   40   40    1
[2,]   20   45    3
[3,]   45   30   10
[4,]   40   40    0


$geometry$coordinates[[2]]
$geometry$coordinates[[2]][[1]]
     [,1] [,2] [,3]
[1,]   20   35    5
[2,]   45   20   67
[3,]   30    5  890
[4,]   10   10    2
[5,]   10   30    0
[6,]   20   35    4

$geometry$coordinates[[2]][[2]]
     [,1] [,2] [,3]
[1,]   30   20    4
[2,]   20   25   54
[3,]   20   15   56
[4,]   30   20   89




attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiPolygon"

$geometry$coordinates
$geometry$coordinates[[1]]
$geometry$coordinates[[1]][[1]]
     [,1] [,2] [,3]
[1,]   40   40    1
[2,]   20   45    3
[3,]   45   30   10
[4,]   40   40    0


$geometry$coordinates[[2]]
$geometry$coordinates[[2]][[1]]
     [,1] [,2] [,3]
[1,]   20   35    5
[2,]   45   20   67
[3,]   30    5  890
[4,]   10   10    2
[5,]   10   30    0
[6,]   20   35    4

$geometry$coordinates[[2]][[2]]
     [,1] [,2] [,3]
[1,]   30   20    4
[2,]   20   25   54
[3,]   20   15   56
[4,]   30   20   89




attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiPolygon"

$geometry$coordinates
$geometry$coordinates[[1]]
$geometry$coordinates[[1]][[1]]
     [,1] [,2]
[1,]   40   40
[2,]   20   45
[3,]   45   30
[4,]   40   40




attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "Polygon"

$geometry$coordinates
$geometry$coordinates[[1]]
     [,1] [,2]
[1,]   40   40
[2,]   20   45
[3,]   45   30
[4,]   40   40



attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "LineString"

$geometry$coordinates
     [,1] [,2]
[1,]  100    0
[2,]  101    1


attr(,"class")
[1] "geojson"
$type
[1] "LineString"

$coordinates
     [,1] [,2]
[1,]  100    0
[2,]  101    1

attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "LineString"

$geometry$coordinates
     [,1] [,2]
[1,]    0   -1
[2,]   -2   -3
[3,]   -4    5


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "LineString"

$geometry$coordinates
     [,1] [,2] [,3]
[1,]    0    1    2
[2,]    4    5    6


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "LineString"

$geometry$coordinates
     [,1]                   [,2]                
[1,] "100.0000000000000000" "0.0000000000000000"
[2,] "101.0000000000000000" "1.0000000000000000"


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "LineString"

$geometry$coordinates
     [,1] [,2] [,3]
[1,]  100    0    3
[2,]  101    1    5


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "LineString"

$geometry$coordinates
     [,1] [,2]
[1,]  100    0
[2,]  101    1


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "LineString"

$geometry$coordinates
     [,1] [,2] [,3]
[1,]  100    0    1
[2,]  101    1    5


attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiLineString"

$geometry$coordinates
$geometry$coordinates[[1]]
     [,1] [,2]
[1,]   30    1
[2,]   40   30
[3,]   50   20

$geometry$coordinates[[2]]
     [,1] [,2]
[1,]   10    0
[2,]   20    1



attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiLineString"

$geometry$coordinates
$geometry$coordinates[[1]]
     [,1]                  [,2]                 
[1,] "30.0000000000000000" "1.0000000000000000" 
[2,] "40.0000000000000000" "30.0000000000000000"
[3,] "50.0000000000000000" "20.0000000000000000"

$geometry$coordinates[[2]]
     [,1]                  [,2]                
[1,] "10.0000000000000000" "0.0000000000000000"
[2,] "20.0000000000000000" "1.0000000000000000"



attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiLineString"

$geometry$coordinates
$geometry$coordinates[[1]]
     [,1] [,2]
[1,] -105 39.5
[2,] -105 39.5
[3,] -105 39.5
[4,] -105 39.5
[5,] -105 39.5
[6,] -105 39.5

$geometry$coordinates[[2]]
     [,1] [,2]
[1,] -105 39.5
[2,] -105 39.5
[3,] -105 39.5

$geometry$coordinates[[3]]
     [,1] [,2]
[1,] -105 39.5
[2,] -105 39.5
[3,] -105 39.5
[4,] -105 39.5
[5,] -105 39.5

$geometry$coordinates[[4]]
     [,1] [,2]
[1,] -105 39.5
[2,] -105 39.5
[3,] -105 39.5
[4,] -105 39.5



attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiLineString"

$geometry$coordinates
$geometry$coordinates[[1]]
     [,1]                    [,2]                 
[1,] "-105.0000000000000000" "39.5000000000000000"
[2,] "-105.0000000000000000" "39.5000000000000000"
[3,] "-105.0000000000000000" "39.5000000000000000"
[4,] "-105.0000000000000000" "39.5000000000000000"
[5,] "-105.0000000000000000" "39.5000000000000000"
[6,] "-105.0000000000000000" "39.5000000000000000"

$geometry$coordinates[[2]]
     [,1]                    [,2]                 
[1,] "-105.0000000000000000" "39.5000000000000000"
[2,] "-105.0000000000000000" "39.5000000000000000"
[3,] "-105.0000000000000000" "39.5000000000000000"

$geometry$coordinates[[3]]
     [,1]                    [,2]                 
[1,] "-105.0000000000000000" "39.5000000000000000"
[2,] "-105.0000000000000000" "39.5000000000000000"
[3,] "-105.0000000000000000" "39.5000000000000000"
[4,] "-105.0000000000000000" "39.5000000000000000"
[5,] "-105.0000000000000000" "39.5000000000000000"

$geometry$coordinates[[4]]
     [,1]                    [,2]                 
[1,] "-105.0000000000000000" "39.5000000000000000"
[2,] "-105.0000000000000000" "39.5000000000000000"
[3,] "-105.0000000000000000" "39.5000000000000000"
[4,] "-105.0000000000000000" "39.5000000000000000"



attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiLineString"

$geometry$coordinates
$geometry$coordinates[[1]]
     [,1] [,2] [,3]
[1,]   30    1    0
[2,]   40   30    0
[3,]   50   20    0

$geometry$coordinates[[2]]
     [,1] [,2] [,3]
[1,]   10    0    1
[2,]   20    1    1



attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiLineString"

$geometry$coordinates
$geometry$coordinates[[1]]
     [,1] [,2]
[1,]   30    1
[2,]   40   30
[3,]   50   20

$geometry$coordinates[[2]]
     [,1] [,2]
[1,]   10    0
[2,]   20    1



attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiLineString"

$geometry$coordinates
$geometry$coordinates[[1]]
     [,1] [,2] [,3]
[1,]   30    1    0
[2,]   40   30    0
[3,]   50   20    0

$geometry$coordinates[[2]]
     [,1] [,2] [,3]
[1,]   10    0    1
[2,]   20    1    1



attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "MultiLineString"

$geometry$coordinates
$geometry$coordinates[[1]]
     [,1] [,2]
[1,]   30    1
[2,]   40   30
[3,]   50   20



attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "LineString"

$geometry$coordinates
     [,1] [,2]
[1,]   30    1
[2,]   40   30
[3,]   50   20


attr(,"class")
[1] "geojson"
$type
[1] "GeometryCollection"

$geometries
$geometries[[1]]
$geometries[[1]]$type
[1] "Feature"

$geometries[[1]]$geometry
$geometries[[1]]$geometry$type
[1] "Point"

$geometries[[1]]$geometry$coordinates
[1] 0 1 4



$geometries[[2]]
$geometries[[2]]$type
[1] "Feature"

$geometries[[2]]$geometry
$geometries[[2]]$geometry$type
[1] "LineString"

$geometries[[2]]$geometry$coordinates
     [,1] [,2]
[1,] -100    0
[2,] -101   -1



$geometries[[3]]
$geometries[[3]]$type
[1] "Feature"

$geometries[[3]]$geometry
$geometries[[3]]$geometry$type
[1] "Polygon"

$geometries[[3]]$geometry$coordinates
$geometries[[3]]$geometry$coordinates[[1]]
         [,1]  [,2]
[1,] 100.0010 0.001
[2,] 101.1235 0.001
[3,] 101.0010 1.001
[4,] 100.0010 0.001

$geometries[[3]]$geometry$coordinates[[2]]
        [,1]  [,2]
[1,] 100.201 0.201
[2,] 100.801 0.201
[3,] 100.801 0.801
[4,] 100.201 0.201




$geometries[[4]]
$geometries[[4]]$type
[1] "Feature"

$geometries[[4]]$geometry
$geometries[[4]]$geometry$type
[1] "MultiPoint"

$geometries[[4]]$geometry$coordinates
       [,1]  [,2]
[1,] 100.00 3.101
[2,] 101.00 2.100
[3,]   3.14 2.180



$geometries[[5]]
$geometries[[5]]$type
[1] "Feature"

$geometries[[5]]$geometry
$geometries[[5]]$geometry$type
[1] "MultiLineString"

$geometries[[5]]$geometry$coordinates
$geometries[[5]]$geometry$coordinates[[1]]
     [,1] [,2]
[1,]    0   -1
[2,]   -2   -3
[3,]   -4   -5

$geometries[[5]]$geometry$coordinates[[2]]
      [,1]  [,2]
[1,]  1.66 -31.5
[2,] 10.00   3.0
[3,] 10.90   1.1
[4,]  0.00   4.4




$geometries[[6]]
$geometries[[6]]$type
[1] "Feature"

$geometries[[6]]$geometry
$geometries[[6]]$geometry$type
[1] "MultiPolygon"

$geometries[[6]]$geometry$coordinates
$geometries[[6]]$geometry$coordinates[[1]]
$geometries[[6]]$geometry$coordinates[[1]][[1]]
        [,1]  [,2]
[1,] 100.001 0.001
[2,] 101.001 0.001
[3,] 101.001 1.001
[4,] 100.001 0.001

$geometries[[6]]$geometry$coordinates[[1]][[2]]
        [,1]  [,2]
[1,] 100.201 0.201
[2,] 100.801 0.201
[3,] 100.801 0.801
[4,] 100.201 0.201


$geometries[[6]]$geometry$coordinates[[2]]
$geometries[[6]]$geometry$coordinates[[2]][[1]]
     [,1] [,2] [,3]
[1,]    1    2    3
[2,]    5    6    7
[3,]    9   10   11
[4,]    1    2    3






attr(,"class")
[1] "geojson"
$type
[1] "GeometryCollection"

$geometries
$geometries[[1]]
$geometries[[1]]$type
[1] "Feature"

$geometries[[1]]$geometry
$geometries[[1]]$geometry$type
[1] "Point"

$geometries[[1]]$geometry$coordinates
[1] "0.0000000000000000" "1.0000000000000000" "4.0000000000000000"



$geometries[[2]]
$geometries[[2]]$type
[1] "Feature"

$geometries[[2]]$geometry
$geometries[[2]]$geometry$type
[1] "LineString"

$geometries[[2]]$geometry$coordinates
     [,1]                    [,2]                 
[1,] "-100.0000000000000000" "0.0000000000000000" 
[2,] "-101.0000000000000000" "-1.0000000000000000"



$geometries[[3]]
$geometries[[3]]$type
[1] "Feature"

$geometries[[3]]$geometry
$geometries[[3]]$geometry$type
[1] "Polygon"

$geometries[[3]]$geometry$coordinates
$geometries[[3]]$geometry$coordinates[[1]]
     [,1]                   [,2]                
[1,] "100.0010000000000048" "0.0010000000000000"
[2,] "101.1235000000000070" "0.0010000000000000"
[3,] "101.0010000000000048" "1.0009999999999999"
[4,] "100.0010000000000048" "0.0010000000000000"

$geometries[[3]]$geometry$coordinates[[2]]
     [,1]                   [,2]                
[1,] "100.2009999999999934" "0.2010000000000000"
[2,] "100.8010000000000019" "0.2010000000000000"
[3,] "100.8010000000000019" "0.8010000000000000"
[4,] "100.2009999999999934" "0.2010000000000000"




$geometries[[4]]
$geometries[[4]]$type
[1] "Feature"

$geometries[[4]]$geometry
$geometries[[4]]$geometry$type
[1] "MultiPoint"

$geometries[[4]]$geometry$coordinates
     [,1]                   [,2]                
[1,] "100.0000000000000000" "3.1010000000000000"
[2,] "101.0000000000000000" "2.1000000000000001"
[3,] "3.1400000000000001"   "2.1800000000000002"



$geometries[[5]]
$geometries[[5]]$type
[1] "Feature"

$geometries[[5]]$geometry
$geometries[[5]]$geometry$type
[1] "MultiLineString"

$geometries[[5]]$geometry$coordinates
$geometries[[5]]$geometry$coordinates[[1]]
     [,1]                  [,2]                 
[1,] "0.0000000000000000"  "-1.0000000000000000"
[2,] "-2.0000000000000000" "-3.0000000000000000"
[3,] "-4.0000000000000000" "-5.0000000000000000"

$geometries[[5]]$geometry$coordinates[[2]]
     [,1]                  [,2]                  
[1,] "1.6599999999999999"  "-31.5000000000000000"
[2,] "10.0000000000000000" "3.0000000000000000"  
[3,] "10.9000000000000004" "1.1000000000000001"  
[4,] "0.0000000000000000"  "4.4000000000000004"  




$geometries[[6]]
$geometries[[6]]$type
[1] "Feature"

$geometries[[6]]$geometry
$geometries[[6]]$geometry$type
[1] "MultiPolygon"

$geometries[[6]]$geometry$coordinates
$geometries[[6]]$geometry$coordinates[[1]]
$geometries[[6]]$geometry$coordinates[[1]][[1]]
     [,1]                   [,2]                
[1,] "100.0010000000000048" "0.0010000000000000"
[2,] "101.0010000000000048" "0.0010000000000000"
[3,] "101.0010000000000048" "1.0009999999999999"
[4,] "100.0010000000000048" "0.0010000000000000"

$geometries[[6]]$geometry$coordinates[[1]][[2]]
     [,1]                   [,2]                
[1,] "100.2009999999999934" "0.2010000000000000"
[2,] "100.8010000000000019" "0.2010000000000000"
[3,] "100.8010000000000019" "0.8010000000000000"
[4,] "100.2009999999999934" "0.2010000000000000"


$geometries[[6]]$geometry$coordinates[[2]]
$geometries[[6]]$geometry$coordinates[[2]][[1]]
     [,1]                 [,2]                  [,3]                 
[1,] "1.0000000000000000" "2.0000000000000000"  "3.0000000000000000" 
[2,] "5.0000000000000000" "6.0000000000000000"  "7.0000000000000000" 
[3,] "9.0000000000000000" "10.0000000000000000" "11.0000000000000000"
[4,] "1.0000000000000000" "2.0000000000000000"  "3.0000000000000000" 






attr(,"class")
[1] "geojson"
$type
[1] "Feature"

$geometry
$geometry$type
[1] "Point"

$geometry$coordinates
[1] -116.4   45.2


attr(,"class")
[1] "geojson"

wellknown documentation built on May 26, 2021, 1:06 a.m.