File: test-plot.R

package info (click to toggle)
r-cran-wkutils 0.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 816 kB
  • sloc: cpp: 3,625; sh: 12; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 1,119 bytes parent folder | download | duplicates (2)
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

test_that("wk*_plot works", {
  example_wkt <- c(
    NA,
    "POINT (30 10)",
    "POINT EMPTY",
    "POINT Z (1 1 5)",
    "MULTIPOINT (10 40, 40 30, 20 20, 30 10)",
    "MULTIPOINT EMPTY",
    "POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))",
    "POLYGON ((35 10, 45 45, 15 40, 10 20, 35 10), (20 30, 35 35, 30 20, 20 30))",
    "POLYGON EMPTY",
    "MULTIPOINT ((10 40), (40 30), (20 20), (30 10))",
    "MULTILINESTRING ((10 10, 20 20, 10 40), (40 40, 30 30, 40 20, 30 10))",
    "MULTILINESTRING EMPTY",
    "MULTIPOLYGON (((30 20, 45 40, 10 40, 30 20)), ((15 5, 40 10, 10 20, 5 10, 15 5)))",
    "MULTIPOLYGON (
      ((40 40, 20 45, 45 30, 40 40)), ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35),
      (30 20, 20 15, 20 25, 30 20))
    )",
    "MULTIPOLYGON EMPTY",
    "GEOMETRYCOLLECTION (
      POINT (40 10),
      LINESTRING (10 10, 20 20, 10 40),
      POLYGON ((40 40, 20 45, 45 30, 40 40))
    )",
    "GEOMETRYCOLLECTION EMPTY"
  )

  wkt_plot(as_wkt(example_wkt))
  wkb_plot(as_wkb(example_wkt))

  wkt_plot(unclass(as_wkt(example_wkt)))
  wkb_plot(unclass(as_wkb(example_wkt)))

  expect_true(TRUE)
})