as.integer(st_intersects()): Errors if any point matches more than one polygon.
It is used in extract_ae_zone, extract_aagis_regions, extract_area and extract_daas_soil_order.
It is replaced by .first_hit()..create_sf(), sf branch:
!st_is(...)) fails for any {sf} object with more than one point.all(st_intersects(sparse = FALSE)) rejects valid points whenever the AEZ has more than one polygon.sf, because the sf path checked it against the AEZ polygons while the list path used a bounding box.
Both now use the bounding box.locations = NULL / lonlat = NULL: Every extract_*() passes these NULL defaults, which overrode the real defaults, so data.frame input failed.
.df_to_list() now falls back to 1 and 2:3..validate_lonlat(): Unnamed vectors and NA coordinates slipped through or gave cryptic errors.
Duplicate location names are also rejected now, since they corrupt merges downstream.aez.gpkg was read from disk on every call.
It is now cached for the session.extract_area: inherits(spatial, "spatVector") never matched, because the class is SpatVector.
It also had no validation of area.extract_daas_soil_order: SOIL != "Nodata" \| SOIL != "Lake" is always TRUE, so nothing was filtered.
It is now !SOIL %in% c(...).extract_aagis_regions:
extract_smips:
smips_totalbucket_mm, so a runoff request came back mislabelled.extract_data_drill: gsub(".X", "", location) is an unescaped regex that also corrupts names containing an uppercase X after any character (for example MAXWELL becomes MWELL).
The code that needed the cleanup is gone.extract_patched_point: Mangled location names with spaces or hyphens (as.data.frame() converts Perth CBD to Perth.CBD).
end_date was documented as defaulting to today but had no default.@returns for patched point was wrong.extract_asc.R had a bare # that splits the roxygen block and drops the title and description.extract_ae_zone and extract_smips and extract_topsoil_thickness from working properlyextract_area() (and presumably other fns) failed due to differing crs specifications.
The crs of the spatial object is now transformed to match the crs of the xy object before the spatial intersection is performed.Removes digits preceding the soil class from TERN ASC.
Supersedes extract_daas_soil_order() with extract_asc() for extracting Australian Soil Classification data from TERN.
The ASC data set is more accurate.
The DAAS may be deprecated in future releases.
Improved documentation, removing redundant information.
extract_power() as I wish for this package to support only Australian data sources, NASA is not Australian.NA value.extract_asc() to extract Australian Soil Classification data from TERN.xy is now included in all functions' documentation, not just extract_ae_zone().extract_patched_point() more elegantly.Better README install instructions.
Depends on R >= 4.1.0 due to using native pipe.
Forked from {extractOz}.
Use xy rather than x as the principal function argument providing the locations of interest.
Accept data.frame objects directly as xy rather than forcing the use of df_to_list().
Remove df_to_list() as an exported function, internal use only now that autodetects if xy is a data.frame that needs conversion to a list object.
Add extract_smips().
Add extract_aagis_regions().
Add extract_topsoil_thickness().
Greatly enhanced the checks of user-input longitude and latitude values.
If some values are invalid, the function will now continue with the valid values and issue a warning with the invalid values and the location that they are in.
Where x and y are reversed, {fifo} attempts to correct the order of the coordinates and issues a warning that this was done and proceeds with the operation.