I am trying to create a point based on an XY value but I am getting the error that the XY columns are unable to be found. The columns are shown in the error message to be part of the file it is just unable to detect them for some reason.
C:\Users\powellj\>riskscape model run addSSPIds
[WARNING] A Java upgrade is recommended. Your computer is currently using Java version 11.0.19, which will no longer be supported by future versions of RiskScape (RiskScape v1.5.0 onwards). Please upgrade to Java 17 (or higher) to ensure RiskScape will continue to run on your computer.
[WARNING] The 'beta' plugin is enabled. This contains experimental features that may significantly change or be deprecated in future releases.
Failed to validate model for execution
- Failed to validate 'input(bookmark('assets'), name: 'assets')' step for execution
- Parameter 'relation' requires value, but expression 'bookmark('assets')' cannot be realized
- Problems found with 'bookmark' riskscape function
- Problems found with 'assets' bookmark in location file:///C:/Users/powellj/AAL_High_lat_lon.csv
- Could not apply all `set-attribute` parameters
- Problems found with attribute geom
- Problems found with expression 'create_point(exposedBuildings.Y_Coord, exposedBuildings.X_Coord)'
- Could not find 'exposedBuildings.Y_Coord' among [exposedBuildings.fid, exposedBuildings.building_i, exposedBuildings.X_Coord, exposedBuildings.Y_Coord]
- Could not find 'exposedBuildings.X_Coord' among [exposedBuildings.fid, exposedBuildings.building_i, exposedBuildings.X_Coord, exposedBuildings.Y_Coord]
project.ini
[model addSSPIds]
description = Adds ssp IDs to the output of addBuildingLocations
framework = pipeline
location = addSSPIds.txt
[bookmark hazard_points]
description = point based hazard
location = SSPSiteIds.csv
set-attribute.geom = create_point(lat,lon)
crs-name = EPSG:4326
[bookmark assets]
description = point based assets
location = AAL_High_lat_lon.csv
set-attribute.geom = create_point(exposedBuildings.Y_Coord,exposedBuildings.X_Coord)
crs-name = EPSG:2193
addSSPIds.txt
input(bookmark('assets'), name: 'assets')
->
select({
*,
to_coverage(bookmark('hazard_points'), options: {index:'nearest_neighbour', nearest_neighbour_max_distance: 100000}) as hazard_coverage
})
->
select({
*,
sample_centroid(assets.geom, hazard_coverage) as hazard_coverage
})
->
select({
assets,
hazard_coverage
})
->
save('output.csv', format: 'csv')
AAL_High_lat_lon.csv
exposedBuildings.fid,exposedBuildings.building_i,exposedBuildings.X_Coord,exposedBuildings.Y_Coord
1,1,1574914,5184025
SSPSiteIDs.csv
siteId,lat,lon
689,-36.6197,174.6772