-
Notifications
You must be signed in to change notification settings - Fork 0
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 packaged DEM data #51
Merged
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2465f39
fix reprojection of spatial rasters
fnattino 091adcf
add DEM to data
fnattino 51cf242
fix reprojection of spatial rasters
fnattino 793e4d6
add DEM to data
fnattino bfbc4fb
Merge branch '49-add-dem-data-fn' of github.com:CityRiverSpaces/CRiSp…
fnattino 47c2a29
update data
fnattino a58ee34
Merge branch 'main' into 49-add-dem-data-fn
fnattino 37fd841
wrap dem object before serializing it
fnattino 2bfd1fd
update tests and vignettes
fnattino a42c8fc
update naming of dataset
fnattino 7ed8f14
rollback to fix of wkt encoding
fnattino 90e0213
update data description
fnattino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
test_that("Bucharest dataset includes all elements", { | ||
expect_setequal(names(bucharest), | ||
expect_setequal(names(bucharest_osm), | ||
c("bb", "boundary", "river_centerline", "river_surface", | ||
"streets", "railways")) | ||
}) | ||
|
||
test_that("Bounding box has correct type", { | ||
bb <- bucharest$bb | ||
bb <- bucharest_osm$bb | ||
expect_true(inherits(bb, "bbox")) | ||
}) | ||
|
||
test_that("Only the bounding box has a geographic CRS", { | ||
is_longlat <- sapply(bucharest, sf::st_is_longlat) | ||
is_longlat <- sapply(bucharest_osm, sf::st_is_longlat) | ||
expect_true(is_longlat["bb"]) | ||
others <- is_longlat[names(bucharest) != "bb"] | ||
others <- is_longlat[names(bucharest_osm) != "bb"] | ||
expect_true(!any(others)) | ||
}) | ||
|
||
test_that("City boundary has one multipolygon geometry", { | ||
boundary <- bucharest$boundary | ||
boundary <- bucharest_osm$boundary | ||
expect_equal(length(boundary), 1) | ||
expect_true(sf::st_is(boundary, "MULTIPOLYGON")) | ||
}) | ||
|
||
test_that("River center line has one multilinestring geometry", { | ||
river_centerline <- bucharest$river_centerline | ||
river_centerline <- bucharest_osm$river_centerline | ||
expect_equal(length(river_centerline), 1) | ||
expect_true(sf::st_is(river_centerline, "MULTILINESTRING")) | ||
}) | ||
|
||
test_that("River surface has one multipolygon geometry", { | ||
river_surface <- bucharest$river_surface | ||
river_surface <- bucharest_osm$river_surface | ||
expect_equal(length(river_surface), 1) | ||
expect_true(sf::st_is(river_surface, "MULTIPOLYGON")) | ||
}) | ||
|
||
test_that("Streets are all linestrings", { | ||
expect_true(all(sf::st_is(bucharest$streets, "LINESTRING"))) | ||
expect_true(all(sf::st_is(bucharest_osm$streets, "LINESTRING"))) | ||
}) | ||
|
||
test_that("Streets have type column", { | ||
expect_equal(colnames(bucharest$streets), c("type", "geometry")) | ||
expect_equal(colnames(bucharest_osm$streets), c("type", "geometry")) | ||
}) | ||
|
||
test_that("Railways are all linestrings", { | ||
expect_true(all(sf::st_is(bucharest$railways, "LINESTRING"))) | ||
expect_true(all(sf::st_is(bucharest_osm$railways, "LINESTRING"))) | ||
}) | ||
|
||
test_that("Railways have type column", { | ||
expect_equal(colnames(bucharest$railways), c("type", "geometry")) | ||
expect_equal(colnames(bucharest_osm$railways), c("type", "geometry")) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When updating the name of the dataset, I have noticed this function probably had a placeholder for the name of the dataset (
st_write_list
->bucharest
)? Also I made a suggestion to replacewalk
forwalk2
, which seems to simplify quite a bit the overall snippet?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, much better!