Skip to content

Commit

Permalink
fix logs (#2025)
Browse files Browse the repository at this point in the history
  • Loading branch information
george-silva authored Dec 18, 2024
1 parent b42f3a7 commit 8a45dab
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/planscape/rscripts/forsys.R
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,15 @@ get_restrictions <- function(connection, scenario_id, restrictions) {
rr.geometry && plan_scenario.geometry AND
ST_Intersects(rr.geometry, plan_scenario.geometry)"
restrictions_statement <- glue_sql(statement, scenario_id = scenario_id, restrictions = restrictions, .con = connection)
crs <- st_crs(5070)
restriction_data <- st_read(
dsn = connection,
layer = NULL,
query = restrictions_statement,
geometry_column = "geometry",
crs = st_crs(5070)
crs = crs
)
log_info(paste("restriction data using", st_crs(restriction_data)))
log_info("restriction data using {crs}")
return(restriction_data)
}

Expand All @@ -304,16 +305,16 @@ get_stands <- function(connection, scenario_id, stand_size, restrictions) {
ss.geometry && plan_scenario.geometry AND
ST_Within(ST_Centroid(ss.geometry), plan_scenario.geometry)"
query <- glue_sql(query_text, scenario_id = scenario_id, .con = connection)

crs <- st_crs(5070)
stands <- st_read(
dsn = connection,
layer = NULL,
query = query,
geometry_column = "geometry",
crs = st_crs(5070)
crs = crs
)

log_info(paste("stand data using", st_crs(stands)))
log_info("stand data using {crs}")

if (length(restrictions) > 0) {
log_info("Restrictions found!")
Expand Down

0 comments on commit 8a45dab

Please sign in to comment.