Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add read poly #278

Merged
merged 2 commits into from
Mar 9, 2023
Merged

Add read poly #278

merged 2 commits into from
Mar 9, 2023

Conversation

agila5
Copy link
Contributor

@agila5 agila5 commented Mar 8, 2023

Showcase the example:

library(osmextract)
#> Data (c) OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright.
#> Check the package website, https://docs.ropensci.org/osmextract/, for more details.
toy_poly <- c(
  "test_poly",
  "first_area",
  "0 0",
  "0 1",
  "1 1",
  "1 0",
  "0 0",
  "END",
  "END"
)
(out <- read_poly(toy_poly))
#> Geometry set for 1 feature 
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
#> Geodetic CRS:  WGS 84
#> MULTIPOLYGON (((0 0, 0 1, 1 1, 1 0, 0 0)))
plot(out)

italy_poly <- "https://download.geofabrik.de/europe/italy.poly"
plot(read_poly(italy_poly))

Created on 2023-03-08 with reprex v2.0.2

@agila5 agila5 requested a review from Robinlovelace March 8, 2023 16:09
@agila5 agila5 linked an issue Mar 8, 2023 that may be closed by this pull request
@Robinlovelace
Copy link
Member

Great work Andrea, clearly works, and useful for sure!

@agila5 agila5 merged commit f77ff8b into master Mar 9, 2023
@agila5 agila5 deleted the add-read-poly branch March 9, 2023 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add function to read .poly files
2 participants