
Exclude points out of their city
f_inContour.Rd
Retire les points en dehors du contour de leur commune
Exclude points out of a border
Examples
sfpoints <- addresses_sample[addresses_sample$code_commune_ref == "29039", ]
sfpoints <- sfpoints %>%
sf::st_as_sf(
coords = c("longitude", "latitude"),
crs = 4326,
na.fail = FALSE
)
sfcontour <- contours_com_sample[contours_com_sample$code_insee == "29039", ]
verbose <- TRUE
mapvotr:::f_inContour(sfpoints, sfcontour, verbose)
#> [1] "Launch f_inContour"
#> Log is not open.
#> [1] "2 points removed"
#> Log is not open.
#> Simple feature collection with 6847 features and 5 fields
#> Geometry type: POINT
#> Dimension: XY
#> Bounding box: xmin: -3.94575 ymin: 47.851 xmax: -3.848959 ymax: 47.94269
#> Geodetic CRS: WGS 84
#> # A tibble: 6,847 × 6
#> id_brut_bv_reu code_commune_ref geo_type geo_score nb_adresses
#> <chr> <chr> <chr> <dbl> <int>
#> 1 29039_1 29039 housenumber 0.96 2
#> 2 29039_1 29039 housenumber 0.96 4
#> 3 29039_1 29039 housenumber 0.96 1
#> 4 29039_1 29039 housenumber 0.96 2
#> 5 29039_1 29039 housenumber 0.97 2
#> 6 29039_1 29039 street 0.96 2
#> 7 29039_1 29039 housenumber 0.96 1
#> 8 29039_1 29039 housenumber 0.56 1
#> 9 29039_1 29039 housenumber 0.96 1
#> 10 29039_1 29039 housenumber 0.97 1
#> # ℹ 6,837 more rows
#> # ℹ 1 more variable: geometry <POINT [°]>