geojson2wkt: Convert GeoJSON-like objects to WKT

Description Usage Arguments Inputs Each point Coordinates data formats References See Also Examples

View source: R/geojson2wkt.R

Description

Convert GeoJSON-like objects to WKT

Usage

1
geojson2wkt(obj, fmt = 16, third = "z", ...)

Arguments

obj

(list/json/character) A GeoJSON-like object representing a Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, or GeometryCollection

fmt

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

third

(character) Only applicable when there are three dimensions. If m, assign a M value for a measurement, and if z assign a Z value for three-dimenionsal system. Case is ignored. An M value represents a measurement, while a Z value usually represents altitude (but can be something like depth in a water based location).

...

Further args passed on to jsonlite::fromJSON() only in the event of json passed as a character string (can also be json of class json as returned from jsonlite::toJSON() or simply coerced to json by adding the class manually)

Inputs

Input to obj parameter can take two forms:

Each point

For any one point, 2 to 4 values can be used:

The 3rd value is typically altitude though can be depth in an aquatic context.

The 4th value is a measurement of some kind.

The GeoJSON spec https://tools.ietf.org/html/rfc7946 actually doesn't allow a 4th value for a point, but we allow it here since we're converting to WKT which does allow a 4th value for a point.

Coordinates data formats

Coordinates data should follow the following formats:

Matrices by definition can not have unequal lengths in their columns, so we don't have to check for that user error.

Each matrix can have any number of rows, and from 2 to 4 columns. If > 5 columns we stop with an error message.

References

https://tools.ietf.org/html/rfc7946, https://en.wikipedia.org/wiki/Well-known_text

See Also

wkt2geojson()

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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# point
## new format
point <- list(Point = c(116.4, 45.2))
geojson2wkt(point)
## old format, warns
point <- list(type = 'Point', coordinates = c(116.4, 45.2))
geojson2wkt(point)

# multipoint
## new format
mp <- list(MultiPoint = matrix(c(100, 101, 3.14, 3.101, 2.1, 2.18),
   ncol = 2))
geojson2wkt(mp)
## 3D
mp <- list(MultiPoint = matrix(c(100, 101, 3, 3, 2, 2, 4, 5, 6),
   ncol = 3))
geojson2wkt(mp)
## old format, warns
mp <- list(
  type = 'MultiPoint',
  coordinates = matrix(c(100, 101, 3.14, 3.101, 2.1, 2.18), ncol = 2)
)
geojson2wkt(mp)

# linestring
## new format
st <- list(LineString = matrix(c(0.0, 2.0, 4.0, 5.0,
                               0.0, 1.0, 2.0, 4.0),
                               ncol = 2))
geojson2wkt(st)
## 3D
st <- list(LineString = matrix(
  c(0.0, 0, 0, 
   2, 1, 5,
   100, 300, 800), nrow = 3))
geojson2wkt(st, fmt = 2)
geojson2wkt(st, fmt = 2, third = "m")
## old format, warns
st <- list(
  type = 'LineString',
  coordinates = matrix(c(0.0, 2.0, 4.0, 5.0,
                         0.0, 1.0, 2.0, 4.0), ncol = 2)
)
geojson2wkt(st)
## 3D
st <- list(LineString = matrix(c(0.0, 2.0, 4.0, 5.0,
                               0.0, 1.0, 2.0, 4.0,
                               10, 20, 30, 40),
                               ncol = 3))
geojson2wkt(st, fmt = 2)

## 4D
st <- list(LineString = matrix(c(0.0, 2.0, 4.0, 5.0,
                               0.0, 1.0, 2.0, 4.0,
                               10, 20, 30, 40,
                               1, 2, 3, 4),
                               ncol = 4))
geojson2wkt(st, fmt = 2)


# multilinestring
## new format
multist <- list(MultiLineString = list(
   matrix(c(0, -2, -4, -1, -3, -5), ncol = 2),
   matrix(c(1.66, 10.9999, 10.9, 0, -31.5, 3.0, 1.1, 0), ncol = 2)
 )
)
geojson2wkt(multist)
## 3D
multist <- list(MultiLineString = list(
   matrix(c(0, -2, -4, -1, -3, -5, 100, 200, 300), ncol = 3),
   matrix(c(1, 10, 10.9, 0, -31.5, 3.0, 1.1, 0, 3, 3, 3, 3), ncol = 3)
 )
)
geojson2wkt(multist, fmt = 2)
geojson2wkt(multist, fmt = 2, third = "m")
## old format, warns
multist <- list(
  type = 'MultiLineString',
  coordinates = list(
   matrix(c(0, -2, -4, -1, -3, -5), ncol = 2),
   matrix(c(1.66, 10.9999, 10.9, 0, -31.5, 3.0, 1.1, 0), ncol = 2)
 )
)
geojson2wkt(multist)

## points within MultiLineString that differ 
## -> use length of longest 
## -> fill with zeros
# 3D and 2D
multist <- list(MultiLineString = list(
    matrix(1:6, ncol = 3), matrix(1:8, ncol = 2)))
geojson2wkt(multist, fmt = 0)
# 4D and 2D
multist <- list(MultiLineString = list(
    matrix(1:8, ncol = 4), matrix(1:8, ncol = 2)))
geojson2wkt(multist, fmt = 0)
# 2D and 2D
multist <- list(MultiLineString = list(
    matrix(1:4, ncol = 2), matrix(1:8, ncol = 2)))
geojson2wkt(multist, fmt = 0)
# 5D and 2D - FAILS
# multist <- list(MultiLineString = list(
#    matrix(1:10, ncol = 5), matrix(1:8, ncol = 2)))
# geojson2wkt(multist, fmt = 0)


# polygon
## new format
poly <- list(Polygon = list(
   matrix(c(100.001, 101.1, 101.001, 100.001, 0.001, 0.001, 1.001, 0.001), ncol = 2),
   matrix(c(100.201, 100.801, 100.801, 100.201, 0.201, 0.201, 0.801, 0.201), ncol = 2)
))
geojson2wkt(poly)
geojson2wkt(poly, fmt=6)
## 3D
poly <- list(Polygon = list(
   matrix(c(100.1, 101.1, 101.1, 100.1, 0.1, 0.1, 1.1, 0.1, 1, 1, 1, 1), ncol = 3),
   matrix(c(100.2, 100.8, 100.8, 100.2, 0.2, 0.2, 0.80, 0.2, 3, 3, 3, 3), ncol = 3)
))
geojson2wkt(poly, fmt = 2)
geojson2wkt(poly, fmt = 2, third = "m")
## old format, warns
poly <- list(
  type = 'Polygon',
  coordinates = list(
    matrix(c(100.001, 101.1, 101.001, 100.001, 0.001, 0.001, 1.001, 0.001),
      ncol = 2),
    matrix(c(100.201, 100.801, 100.801, 100.201, 0.201, 0.201, 0.801, 0.201),
      ncol = 2)
  )
)
geojson2wkt(poly)
geojson2wkt(poly, fmt=6)

## points within Polygon that differ 
## -> use length of longest 
## -> fill with zeros
# 3D and 2D
poly <- list(Polygon = list(
   matrix(c(100, 101, 101, 100, 0.1, 0.2, 0.3, 0.1, 5, 6, 7, 8), ncol = 3),
   matrix(c(40, 41, 61, 40, 0.1, 0.2, 0.3, 0.1), ncol = 2)
))
geojson2wkt(poly, fmt = 0)
# 4D and 2D
poly <- list(Polygon = list(
   matrix(c(100, 101, 101, 100, 0.1, 0.2, 0.3, 0.1, 5, 6, 7, 8, 1, 1, 1, 1), 
     ncol = 4),
   matrix(c(40, 41, 61, 40, 0.1, 0.2, 0.3, 0.1), ncol = 2)
))
geojson2wkt(poly, fmt = 0)
# 5D and 2D - FAILS
# multist <- list(Polygon = list(
#    matrix(1:10, ncol = 5), matrix(1:8, ncol = 2)))
# geojson2wkt(poly, fmt = 0)



# multipolygon
## new format
mpoly <- list(MultiPolygon = list(
  list(
    matrix(c(100, 101, 101, 100, 0.001, 0.001, 1.001, 0.001), ncol = 2),
    matrix(c(100.2, 100.8, 100.8, 100.2, 0.2, 0.2, 0.8, 0.2), ncol = 2)
  ),
  list(
    matrix(c(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0), ncol = 2),
    matrix(c(9.0, 10.0, 11.0, 12.0, 1.0, 2.0, 3.0, 4.0), ncol = 2)
  )
))
geojson2wkt(mpoly, fmt=2)
## 3D
mpoly <- list(MultiPolygon = list(
  list(
    matrix(c(100, 101, 101, 100, 0.001, 0.001, 1.001, 0.001, 1, 1, 1, 1), 
      ncol = 3),
    matrix(c(100.2, 100.8, 100.8, 100.2, 0.2, 0.2, 0.8, 0.2, 3, 4, 5, 6), 
      ncol = 3)
  ),
  list(
    matrix(c(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 1, 1, 1, 1),
      ncol = 3),
    matrix(c(9.0, 10.0, 11.0, 12.0, 1.0, 2.0, 3.0, 4.0, 9, 9, 9, 9),
      ncol = 3)
  )
))
geojson2wkt(mpoly, fmt=2)
geojson2wkt(mpoly, fmt=2, third = "m")
## old format, warns
mpoly <- list(
  type = 'MultiPolygon',
  coordinates = list(
    list(
      matrix(c(100, 101, 101, 100, 0.001, 0.001, 1.001, 0.001), ncol = 2),
      matrix(c(100.2, 100.8, 100.8, 100.2, 0.2, 0.2, 0.8, 0.2), ncol = 2)
    ),
    list(
      matrix(c(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 1.0), ncol = 3),
      matrix(c(9.0, 10.0, 11.0, 12.0, 1.0, 2.0, 3.0, 4.0, 9.0), ncol = 3)
    )
  )
)
geojson2wkt(mpoly, fmt=2)

mpoly2 <- list(
  type = "MultiPolygon",
  coordinates = list(
    list(list(c(30, 20), c(45, 40), c(10, 40), c(30, 20))),
    list(list(c(15, 5), c(40, 10), c(10, 20), c(5 ,10), c(15, 5)))
  )
)

mpoly2 <- list(
  type = "MultiPolygon",
  coordinates = list(
    list(
      matrix(c(30, 45, 10, 30, 20, 40, 40, 20), ncol = 2)
    ),
    list(
      matrix(c(15, 40, 10, 5, 15, 5, 10, 20, 10, 5), ncol = 2)
    )
  )
)
geojson2wkt(mpoly2, fmt=1)

## points within MultiPolygon that differ 
## -> use length of longest 
## -> fill with zeros
# 3D and 2D
mpoly <- list(MultiPolygon = list(
  list(
    matrix(c(40, 130, 155, 40, 20, 34, 34, 20), ncol = 2),
    matrix(c(30, 40, 54, 30, 0.1, 42, 62, 0.1, 1, 1, 1, 1), ncol = 3)
  ),
  list(
    matrix(c(9, 49, 79, 9, 11, 35, 15, 11), ncol = 2),
    matrix(c(1, 33, 59, 1, 5, 16, 36, 5), ncol = 2)
  )
))
geojson2wkt(mpoly, fmt = 0)
# 4D and 2D
mpoly <- list(MultiPolygon = list(
  list(
    matrix(c(40, 130, 155, 40, 20, 34, 34, 20), ncol = 2),
    matrix(c(30, 40, 54, 30, 0.1, 42, 62, 0.1, 1, 1, 1, 1, 0, 0, 0, 0), ncol = 4)
  ),
  list(
    matrix(c(9, 49, 79, 9, 11, 35, 15, 11), ncol = 2),
    matrix(c(1, 33, 59, 1, 5, 16, 36, 5), ncol = 2)
  )
))
geojson2wkt(mpoly, fmt = 0)
# 5D and 2D - FAILS
mpoly <- list(MultiPolygon = list(
  list(
    matrix(c(40, 130, 155, 40, 20, 34, 34, 20), ncol = 2),
    matrix(c(30, 40, 54, 30, 
             0.1, 42, 62, 0.1, 
             1, 1, 1, 1, 
             0, 0, 0, 0,
             0, 0, 0, 0), ncol = 5)
  ),
  list(
    matrix(c(9, 49, 79, 9, 11, 35, 15, 11), ncol = 2),
    matrix(c(1, 33, 59, 1, 5, 16, 36, 5), ncol = 2)
  )
))
# geojson2wkt(mpoly, fmt = 0)



# geometrycollection
## new format
gmcoll <- list(GeometryCollection = list(
 list(Point = c(0.0, 1.0)),
 list(LineString = matrix(c(0.0, 2.0, 4.0, 5.0,
                           0.0, 1.0, 2.0, 4.0),
                           ncol = 2)),
 list(Polygon = list(
   matrix(c(100.001, 101.1, 101.001, 100.001, 0.001, 0.001, 1.001, 0.001),
     ncol = 2),
   matrix(c(100.201, 100.801, 100.801, 100.201, 0.201, 0.201, 0.801, 0.201),
     ncol = 2)
  ))
))
geojson2wkt(gmcoll, fmt=0)
## old format, warns
gmcoll <- list(
 type = 'GeometryCollection',
 geometries = list(
   list(type = 'Point', coordinates = c(0.0, 1.0)),
   list(type = 'LineString', coordinates = matrix(c(0.0, 2.0, 4.0, 5.0,
                           0.0, 1.0, 2.0, 4.0),
                           ncol = 2)),
   list(type = 'Polygon', coordinates = list(
     matrix(c(100.001, 101.1, 101.001, 100.001, 0.001, 0.001, 1.001, 0.001),
       ncol = 2),
     matrix(c(100.201, 100.801, 100.801, 100.201, 0.201, 0.201, 0.801, 0.201),
       ncol = 2)
  ))
 )
)
geojson2wkt(gmcoll, fmt=0)

# Convert geojson as character string to WKT
# new format
str <- '{
   "Point": [
       -105.01621,
       39.57422
   ]
}'
geojson2wkt(str)

## old format, warns
str <- '{
   "type": "Point",
   "coordinates": [
       -105.01621,
       39.57422
   ]
}'
geojson2wkt(str)

## new format
str <- '{"LineString":[[0,0,10],[2,1,20],[4,2,30],[5,4,40]]}'
geojson2wkt(str)
## old format, warns
str <-
'{"type":"LineString","coordinates":[[0,0,10],[2,1,20],[4,2,30],[5,4,40]]}'
geojson2wkt(str)

# From a jsonlite json object
library("jsonlite")
json <- toJSON(list(Point=c(-105,39)), auto_unbox=TRUE)
geojson2wkt(json)
## old format, warns
json <- toJSON(list(type="Point", coordinates=c(-105,39)), auto_unbox=TRUE)
geojson2wkt(json)

Example output

Attaching package:wellknownThe following object is masked frompackage:graphics:

    polygon

[1] "POINT (116.4000000000000057  45.2000000000000028)"
[1] "POINT (116.4000000000000057  45.2000000000000028)"
[1] "MULTIPOINT ((100.0000000000000000 3.1010000000000000), (101.0000000000000000 2.1000000000000001), (3.1400000000000001 2.1800000000000002))"
[1] "MULTIPOINT Z((100.0000000000000000 3.0000000000000000 4.0000000000000000), (101.0000000000000000 2.0000000000000000 5.0000000000000000), (3.0000000000000000 2.0000000000000000 6.0000000000000000))"
[1] "MULTIPOINT ((100.0000000000000000 3.1010000000000000), (101.0000000000000000 2.1000000000000001), (3.1400000000000001 2.1800000000000002))"
[1] "LINESTRING (0.0000000000000000 0.0000000000000000, 2.0000000000000000 1.0000000000000000, 4.0000000000000000 2.0000000000000000, 5.0000000000000000 4.0000000000000000)"
[1] "LINESTRING Z(0.00 2.00 100.00, 0.00 1.00 300.00, 0.00 5.00 800.00)"
[1] "LINESTRING M(0.00 2.00 100.00, 0.00 1.00 300.00, 0.00 5.00 800.00)"
[1] "LINESTRING (0.0000000000000000 0.0000000000000000, 2.0000000000000000 1.0000000000000000, 4.0000000000000000 2.0000000000000000, 5.0000000000000000 4.0000000000000000)"
[1] "LINESTRING Z(0.00 0.00 10.00, 2.00 1.00 20.00, 4.00 2.00 30.00, 5.00 4.00 40.00)"
[1] "LINESTRING ZM(0.00 0.00 10.00 1.00, 2.00 1.00 20.00 2.00, 4.00 2.00 30.00 3.00, 5.00 4.00 40.00 4.00)"
[1] "MULTILINESTRING ((0.0000000000000000 -1.0000000000000000, -2.0000000000000000 -3.0000000000000000, -4.0000000000000000 -5.0000000000000000), (1.6599999999999999 -31.5000000000000000, 10.9999000000000002 3.0000000000000000, 10.9000000000000004 1.1000000000000001, 0.0000000000000000 0.0000000000000000))"
[1] "MULTILINESTRING Z((0.00 -1.00 100.00, -2.00 -3.00 200.00, -4.00 -5.00 300.00), (1.00 -31.50 3.00, 10.00 3.00 3.00, 10.90 1.10 3.00, 0.00 0.00 3.00))"
[1] "MULTILINESTRING M((0.00 -1.00 100.00, -2.00 -3.00 200.00, -4.00 -5.00 300.00), (1.00 -31.50 3.00, 10.00 3.00 3.00, 10.90 1.10 3.00, 0.00 0.00 3.00))"
[1] "MULTILINESTRING ((0.0000000000000000 -1.0000000000000000, -2.0000000000000000 -3.0000000000000000, -4.0000000000000000 -5.0000000000000000), (1.6599999999999999 -31.5000000000000000, 10.9999000000000002 3.0000000000000000, 10.9000000000000004 1.1000000000000001, 0.0000000000000000 0.0000000000000000))"
[1] "MULTILINESTRING Z((1 3 5, 2 4 6), (1 5 0, 2 6 0, 3 7 0, 4 8 0))"
[1] "MULTILINESTRING ZM((1 3 5 7, 2 4 6 8), (1 5 0 0, 2 6 0 0, 3 7 0 0, 4 8 0 0))"
[1] "MULTILINESTRING ((1 3, 2 4), (1 5, 2 6, 3 7, 4 8))"
[1] "POLYGON ((100.0010000000000048 0.0010000000000000, 101.0999999999999943 0.0010000000000000, 101.0010000000000048 1.0009999999999999, 100.0010000000000048 0.0010000000000000), (100.2009999999999934 0.2010000000000000, 100.8010000000000019 0.2010000000000000, 100.8010000000000019 0.8010000000000000, 100.2009999999999934 0.2010000000000000))"
[1] "POLYGON ((100.001000 0.001000, 101.100000 0.001000, 101.001000 1.001000, 100.001000 0.001000), (100.201000 0.201000, 100.801000 0.201000, 100.801000 0.801000, 100.201000 0.201000))"
[1] "POLYGON Z((100.10 0.10 1.00, 101.10 0.10 1.00, 101.10 1.10 1.00, 100.10 0.10 1.00), (100.20 0.20 3.00, 100.80 0.20 3.00, 100.80 0.80 3.00, 100.20 0.20 3.00))"
[1] "POLYGON M((100.10 0.10 1.00, 101.10 0.10 1.00, 101.10 1.10 1.00, 100.10 0.10 1.00), (100.20 0.20 3.00, 100.80 0.20 3.00, 100.80 0.80 3.00, 100.20 0.20 3.00))"
[1] "POLYGON ((100.0010000000000048 0.0010000000000000, 101.0999999999999943 0.0010000000000000, 101.0010000000000048 1.0009999999999999, 100.0010000000000048 0.0010000000000000), (100.2009999999999934 0.2010000000000000, 100.8010000000000019 0.2010000000000000, 100.8010000000000019 0.8010000000000000, 100.2009999999999934 0.2010000000000000))"
[1] "POLYGON ((100.001000 0.001000, 101.100000 0.001000, 101.001000 1.001000, 100.001000 0.001000), (100.201000 0.201000, 100.801000 0.201000, 100.801000 0.801000, 100.201000 0.201000))"
[1] "POLYGON Z((100.0 0.1 5.0, 101.0 0.2 6.0, 101.0 0.3 7.0, 100.0 0.1 8.0), (40.0 0.1 0.0, 41.0 0.2 0.0, 61.0 0.3 0.0, 40.0 0.1 0.0))"
[1] "POLYGON ZM((100.0 0.1 5.0 1.0, 101.0 0.2 6.0 1.0, 101.0 0.3 7.0 1.0, 100.0 0.1 8.0 1.0), (40.0 0.1 0.0 0.0, 41.0 0.2 0.0 0.0, 61.0 0.3 0.0 0.0, 40.0 0.1 0.0 0.0))"
[1] "MULTIPOLYGON (((100.000 0.001, 101.000 0.001, 101.000 1.001, 100.000 0.001), (100.20 0.20, 100.80 0.20, 100.80 0.80, 100.20 0.20)), ((1.00 5.00, 2.00 6.00, 3.00 7.00, 4.00 8.00), (9.00 1.00, 10.00 2.00, 11.00 3.00, 12.00 4.00)))"
[1] "MULTIPOLYGON Z(((100.000 0.001 1.000, 101.000 0.001 1.000, 101.000 1.001 1.000, 100.000 0.001 1.000), (100.20 0.20 3.00, 100.80 0.20 4.00, 100.80 0.80 5.00, 100.20 0.20 6.00)), ((1.00 5.00 1.00, 2.00 6.00 1.00, 3.00 7.00 1.00, 4.00 8.00 1.00), (9.00 1.00 9.00, 10.00 2.00 9.00, 11.00 3.00 9.00, 12.00 4.00 9.00)))"
[1] "MULTIPOLYGON M(((100.000 0.001 1.000, 101.000 0.001 1.000, 101.000 1.001 1.000, 100.000 0.001 1.000), (100.20 0.20 3.00, 100.80 0.20 4.00, 100.80 0.80 5.00, 100.20 0.20 6.00)), ((1.00 5.00 1.00, 2.00 6.00 1.00, 3.00 7.00 1.00, 4.00 8.00 1.00), (9.00 1.00 9.00, 10.00 2.00 9.00, 11.00 3.00 9.00, 12.00 4.00 9.00)))"
[1] "MULTIPOLYGON Z(((100.000 0.001 0.000, 101.000 0.001 0.000, 101.000 1.001 0.000, 100.000 0.001 0.000), (100.20 0.20 0.00, 100.80 0.20 0.00, 100.80 0.80 0.00, 100.20 0.20 0.00)), ((1.00 4.00 7.00, 2.00 5.00 8.00, 3.00 6.00 1.00), (9.00 12.00 3.00, 10.00 1.00 4.00, 11.00 2.00 9.00)))"
[1] "MULTIPOLYGON (((30.0 20.0, 45.0 40.0, 10.0 40.0, 30.0 20.0)), ((15.0 5.0, 40.0 10.0, 10.0 20.0, 5.0 10.0, 15.0 5.0)))"
[1] "MULTIPOLYGON Z(((40 20 0, 130 34 0, 155 34 0, 40 20 0), (30.0 0.1 1.0, 40.0 42.0 1.0, 54.0 62.0 1.0, 30.0 0.1 1.0)), ((9 11 0, 49 35 0, 79 15 0, 9 11 0), (1 5 0, 33 16 0, 59 36 0, 1 5 0)))"
[1] "MULTIPOLYGON ZM(((40 20 0 0, 130 34 0 0, 155 34 0 0, 40 20 0 0), (30.0 0.1 1.0 0.0, 40.0 42.0 1.0 0.0, 54.0 62.0 1.0 0.0, 30.0 0.1 1.0 0.0)), ((9 11 0 0, 49 35 0 0, 79 15 0 0, 9 11 0 0), (1 5 0 0, 33 16 0 0, 59 36 0 0, 1 5 0 0)))"
[1] "GEOMETRYCOLLECTION (POINT (0 1), LINESTRING (0 0, 2 1, 4 2, 5 4), POLYGON ((100.001 0.001, 101.100 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] "GEOMETRYCOLLECTION (POINT (0 1), LINESTRING (0 0, 2 1, 4 2, 5 4), POLYGON ((100.001 0.001, 101.100 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] "POINT (-105.0162100000000009   39.5742199999999968)"
[1] "POINT (-105.0162100000000009   39.5742199999999968)"
[1] "LINESTRING Z(0 0 10, 2 1 20, 4 2 30, 5 4 40)"
[1] "LINESTRING Z(0 0 10, 2 1 20, 4 2 30, 5 4 40)"
[1] "POINT (-105   39)"
[1] "POINT (-105   39)"

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