pcomp1 <- create_component("MULTIPOINT(1 2, 3 2)", 0.4)
pcomp2 <- create_component("POINT(2 1)", 0.3)
ppoint <- create_pgeometry(list(pcomp1, pcomp2), "PLATEAUPOINT")
# using spa_pwkt()
spa_pwkt(ppoint)
# using show() to display the content of ppoint
ppoint
# using format with width = 30 (default value)
format(ppoint)
lcomp1 <- create_component("LINESTRING(1 2, 3 3, 3 4)", 1)
lcomp2 <- create_component("LINESTRING(0 0, 5 5)", 0.5)
pline <- create_pgeometry(list(lcomp1, lcomp2), "PLATEAULINE")
spa_pwkt(pline)
rcomp1 <- create_component("POLYGON((40 40, 20 48, 48 35, 40 40))", 0.8)
rcomp2 <- create_component("POLYGON((10 0, 40 18, 10 20, 5 18, 10 0))", 0.2)
pregion <- create_pgeometry(list(rcomp1, rcomp2), "PLATEAUREGION")
spa_pwkt(pregion)
pcomposition <- create_pgeometry(list(ppoint, pline, pregion), "PLATEAUCOMPOSITION")
spa_pwkt(pcomposition)
pcomp3 <- create_component("POINT(10 15)", 0.3)
ppoint2 <- create_pgeometry(list(pcomp3), "PLATEAUPOINT")
pcollection <- create_pgeometry(list(pcomposition, ppoint2), "PLATEAUCOLLECTION")
spa_pwkt(pcollection)
Run the code above in your browser using DataLab