Skip to content

Commit

Permalink
dynamic CRS for xy requests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejohnson51 committed Feb 20, 2025
1 parent 86887f3 commit 66a9250
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions R/find_origin.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,15 @@ find_origin_query.xy <- function(xy, network, src) {
src = src
}

bb <- sf::st_point(xy) |>
crs <- as_ogr(src, "divides") |>
head(1) |>
sf::st_as_sf() |>
st_crs()

bb <- sf::st_point(unclass(xy)) |>
sf::st_sfc(crs = 4326) |>
sf::st_as_sf() |>
sf::st_transform(5070) |>
sf::st_transform(crs$wkt) |>
sf::st_geometry() |>
sf::st_as_text()

Expand Down
2 changes: 1 addition & 1 deletion R/query_subset.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ query_subset <- function(query) {

origin <- find_origin(
network = query_source_layer(query$source, "network"),
src = query$source,
src = query$source[1],
id = identifier,
type = class(identifier)
)
Expand Down

0 comments on commit 66a9250

Please sign in to comment.