inst/tinytest/test_region.R

# Test Region
expect_equal(polygonToCells(polygon = list(
    list(
        matrix(
            c(
                37.813318999983238, -122.4089866999972145,
                37.7198061999978478, -122.3544736999993603,
                37.8151571999998453, -122.4798767000009008
            )
            , ncol = 2
            , byrow = TRUE
        ),
        matrix(
            c(
                37.813318999983238, -122.4089866999972145,
                37.7198061999978478, -122.3544736999993603,
                37.8151571999998453, -122.4498767000009008
            )
            , ncol = 2
            , byrow = TRUE
        )
    ),
    list(
        matrix(
            c(
                37.813318999983238, -122.4089866999972145,
                37.7198061999978478, -122.3544736999993603,
                37.8151571999998453, -122.4498767000009008
            )
            , ncol = 2
            , byrow = TRUE
        )
    )
), resolution = c(7L, 6L)), list(c(  "872830870ffffff","872830828ffffff","872830876ffffff"), c("862830827ffffff")))

# expect_equal(cellsToMultiPolygon(cellSet = list(list(c("872830828ffffff", "87283082effffff")), list(c("862830827ffffff"))), 1L)
#              , list(list(list(list(matrix(c(37.78404622259876, -122.42708872508096,
#                                             37.77226734985154, -122.43458610784572,
#                                             37.76173573392154, -122.42576908738396,
#                                             37.76298184766421, -122.40945463242251,
#                                             37.75244647475626, -122.40063951171169,
#                                             37.75368882535418, -122.38432356237523,
#                                             37.76546768434345, -122.37681938644465,
#                                             37.776004200673846, -122.38563455403627,
#                                             37.7747607144902, -122.40195385157608,
#                                             37.78529347359728, -122.41077092287513),
#                               ncol = 2, byrow = TRUE)))), list(list(list(matrix(c(37.69973779105049, -122.35658316980643,
#                                                                                   37.724533591552756, -122.32525327556627,
#                                                                                   37.75740308914818, -122.33536307014123,
#                                                                                   37.76546768434345, -122.37681938644465,
#                                                                                   37.74066613210137, -122.40813889567379,
#                                                                                   37.707805739822945, -122.39801249019256),
#                                                                                            ncol = 2, byrow = TRUE))))))

Try the h3r package in your browser

Any scripts or data that you put into this service are public.

h3r documentation built on April 3, 2025, 10:47 p.m.