Release Changelog prior to v1.0.0
Note
This page details the development history prior to the first official open-source release of RiskScape, v1.0.0. This may be of interest for people who have used older evaluation versions of RiskScape for their modelling.
v1.0.0
Built 4 February 2022
Breaking
The
--homeoption will no longer be supported. Instead, the auto-import feature on projects replaces the home directory functionality. The--homeoption, although now hidden on the CLI, can still be used in the interim to customize where your RiskScapesettings.inifile is located, although this functionality will likely be replaced in a future release. (GL-663)RiskScape will no longer report whether errors are present in your project, unless you use the
--show-project-errorsCLI option. (GL-663)Pipelines can no longer be specified as
[pipeline ID]sections in theproject.inifile. Instead pipelines should be added as a model usingframework = pipeline. This change will only impact advanced users who used pipelines directly. As part of this change, the followingriskscape pipelinecommands have been removed:riskscape pipeline run, replaced byriskscape model runriskscape pipeline list, replaced byriskscape model listriskscape pipeline verify, replaced byriskscape model verifyriskscape pipeline graph, replaced byriskscape model run MODEL_ID --graph
Pipelines can be converted to pipeline models easily by changing
[pipeline ID] pipeline|location = ...
to
[model ID] framework = pipeline pipeline|location = ...
The legacy wizard model has been removed. It is no longer possible to run the legacy survey or to run wizard models that had been saved from it, i.e. wizard models created prior to RiskScape v0.11.0. If users have any saved legacy wizard models they should run through the wizard to re-create them. (GL558)
You can no longer define RiskScape types using a separate Jython script, i.e.
types.py. This was a very old feature and any users still using it should migrate to defining types in theirproject.inifile instead. Defining the Jython function’sRETURN_TYPEandARGUMENT_TYPESin the Python.pyfile, alongside the function, is still supported. However, going forward we recommend following the examples here and defining the functionargument-typesandreturn-typein theproject.inifile instead.The following commands have been renamed (GL-534).
riskscape bookmark format listis nowriskscape format listriskscape bookmark format optionsis nowriskscape format inforiskscape pipeline step parametersis nowriskscape pipeline step info(GL-690)
Plugins are no longer loaded from the
pluginssub-directory within the RiskScape home directory. Plugins should now be loaded via thesettings.inifile in the home directory instead. Refer to Settings plugins for more details on how to configure this. If there are plugins found in the home directory then a warning will now be output. (GL681)The
--stats-outCLI option has been removed. This option is unnecessary now, as metrics are always displayed to the CLI and always saved to file after the pipeline completes.The directory bookmark format has been removed. This bookmark format is no longer used. (GL689)
Enhancements
A new warning is now displayed when no
--projectfile is set, and there is noproject.inifile present in the current working directory (GL655).Add pagination to RiskScape
listandinfocommands. This lets you page through large amounts of data similar to using themorecommand (GL430)CPython functions now accept the
anythingargument type. (GL600)When a model or pipeline is run, some performance metrics for the pipeline are now saved in the output directory as a
stats.txtfile. (GL411)The
riskscape bookmark infocommand now always examines the data that the bookmark contains, by default. Previously, this would only happen when the--measureoption (now removed) was used. Use the--briefCLI option to skip examining the bookmark data. For example, if the bookmark contains a lot of data, then the command could take a while to run. (GL609)Projects now support an auto-import feature, which loads any INI files in the same directory or below. This replaces the RiskScape home directory functionality, which has been removed. Auto-import is enabled by adding
auto-import = trueto theproject.inifile (GL663).Plugins may now be added to RiskScape via the
settings.inifile. (GL681)New tutorials have been added to RiskScape’s documentation for building and running models, as well as for creating RiskScape projects. (GL-650)
Fixes
Cycles in pipelines are now reported with a descriptive error message instead of causing RiskScape to exit unexpectedly (GL615)
Fixed issue on Windows where RiskScape would not run if it was installed in a directory containing spaces, e.g.
C:\Program Files\RiskScape. Note that the Windows shortcut script instructions have also been updated to handle spaces in the installation directory path. (GL644)Fixed a bug where segmenting lat/long geometry could fail. The failures were caused by the geometry becoming invalid during a reprojection. (GL640)
Fixed a bug where RiskScape would appear to hang if the project contained an HTTP bookmark and the target server was not responding. (GL667)
v0.11.0
Built 10 December 2021
Breaking
Some pipeline steps have been removed (or hidden) from RiskScape (GL526). These steps have been superseded by improvements to the RiskScape expression language that allow the same functionality with simpler, more general purpose, constructs.
The removed steps are:
aggregate- replaced by the simpler and more expressivegroupstepfunction- can be done more simply with aselectstepsample- can be done more simply with aselectstep and using one of RiskScape’s sampling functionsjoinloop- no longer used and can be replaced with ajoinandgroupflipaxis- not used and deprecated in favour of correct use of CRS
The
unnestpipeline step now expects theto-unnestparameter to be an expression. This used to be a list of strings. To convert existing pipelines simply remove the quotes from around theto-unnestlists. E.g.unnest(to-unnest: ['foo', 'bar'])->unnest(to-unnest: [foo, bar])(GL526)The
sortpipeline step has changed how thesort-byparameter is specified (GL526). This used to be a list of strings like:sort(sort-by: ['foo desc', 'bar asc'])Now the
sort-byparameter is an expression containing the attributes to sort by. The sort direction is set in a new parameterdirectionwhich is a list containing the sort direction for each attribute. E.gsort(sort-by: [foo, bar], direction: ['desc', 'asc'])Some wizard model parameters have been renamed to reflect the latest model workflow terminology (GL622). This means that any wizard models built and saved using RiskScape v0.10.0 will no longer run successfully. Note that pipeline models saved on v0.10.0 will continue to work - these models would have been saved by RiskScape in a
models_pipeline_<your-model-name>.inifile.
Enhancements
The wizard now shows a menu at the completion of the model survey instead of running the model. (GL551)
When the wizard is given a vector-based hazard (e.g from a shapefile), it now lets you pick a selected attribute from the hazard layer to use as the hazard intensity measure. This lets you use both vector and raster hazards with the same consequence function. It also lets you aggregate the hazard intensity measure from the vector layer (i.e. take the max value) when matching all geometry intersections between the hazard-layer and your elements-at-risk. (GL546)
RiskScape has upgraded the core spatial libraries that are used. Of particular note is JTS. The updated version of JTS contains features that RiskScape can now utilize to fix invalid geometries. The GeoTools library has also been upgraded to v26.0. (GL500)
User-defined functions, such as your risk functions, can now be implemented using CPython, instead of the default Jython implementation. If you have used Python previously, you will find importing modules is simpler using CPython, and it lets you use a wider range of Python packages (e.g.
numpy,scipy, etc…). See thehow-toguides for help on setting up RiskScape’s CPython integration. (#328)Geometry validation modes
ERRORandWARNwill now try to fix any invalid geometries. TheERRORorWARNaction will only occur if the geometry is unable to be fixed automatically.The default mode for geometry validation is now
ERROR. (GL500)Geometry predicate functions such as
intersectswill now produce an error if the input geometries do not have the same coordinate reference system. (GL588)RiskScape will now use a datum aware transform when reprojecting geometry, or warn that reprojections do not account for datum shifts. (GL589)
If no other project or home directory options are set, then RiskScape will default to using a
project.inifile from the current working directory. (GL586)crs-longitude-firstnow defaults to true on shapefile bookmarks. This is to match the shapefile format which specifies an X/Y (longitude/latitude) axis order. (GL604)There is now simple support to use pixel-based raster formats as exposure layers - you can now use an ASCII raster or GeoTIFF as input for a pipeline, or, as your exposure layer in the wizard (GL#593).
RiskScape can now run on Java 17, the latest Java version with long term support. Users are encouraged to upgrade to Java 17 soon, a future (as yet unplanned) release of RiskScape will require Java 17. (GL592)
Fixes
When writing to shapefiles RiskScape will reproject geometries to an X-Y axis order if they are not already. The shapefile format requires geometries to be in the X-Y order. But many coordinate reference systems are have a Y-X axis order (e.g EPSG:2193 New Zealand Transverse Mercator 2000).
This issue mostly affects data from CSV data sources. Until now it has been worked around by using bookmarks with
crs-longitude-firstwith creates the data with a X-Y axis order. (GL556)to_coveragewill now return the same coverage each time it is called if the input arguments are constant. There was a bug which caused a new coverage to be created on every call which caused some models to run a lot slower. (GL581)Fixed a bug where a bad function call expression would trigger an unexpected error when inside a struct declaration, e.g.
{square_root('nine')}(GL575)Cutting geometries could fail when the projection file is missing datum shift parameters. This would affect input data that is:
lat/long or long/lat
not using the WGS84 datum
datum shift parameters (
TOWGS84) not in the*.prjfile RiskScape has now updated how the reprojection required for cutting are done. (GL537)
Fixed issues with the terminal where:
on Windows the status updates could overwrite other output, such as the pipeline DSL in the wizard
aborting a model run could leave the bottom part of the terminal unusable (where the status updates were)
aborting a model run on Windows could output junk characters (GL565)
Fixed some bugs when using WFS data sources:
geometry from WFS sources could not be reprojected (GL597)
setting
crs-nameon WFS bookmarks would cause errors (GL598/GL599)
Fixed a bug where cutting geometries could fail if the geometry contained longitudes over 180 degrees. This would affect geometries from the Chatham Islands in
EPSG:4167(NZGD2000). (GL595)Setting
crs-namewith shapefile now correctly assumes longitude first (GL604)Fixed a bug where sampling a GeoTIFF could return not a number (NaN) when the GeoTIFF is using NaN as the no data value. In this case
<nothing>should be returned. (GL596)
0.10.0
Built 30 September 2021
Breaking
The
riskscape model runcommand has been revamped. The major difference you will notice is with the-ooption. The-ooption is now optional rather than required, and is short for--outputdirectory (whereas previously is was short for--outfilefilename). The command will now always write to file by default, and default to shapefile when geometry is present in your results. To change the output file format to something else, like CSV, please use the-for--formatCLI option. (GL401)If you have already been using the
riskscape beta modelcommand on previous releases, then you can now runriskscape modeland should not notice any difference.You can still run saved models that are based off the
tableordefaulttemplates. However, thedefaultandtabletemplate models themselves will no longer appear inriskscape model list. You will only be able to run the models that appear inriskscape model list.The
riskscape model infocommand has been removed. Useriskscape model framework template infoinstead.The
non-pointmodel template has been removed. The wizard should now be used for this type of modelling.The
riskscape model batchcommand has changed. (GL306)The
PARAMETERSkeyword is no longer supported for Jython functions. Instead, you can now use model pipeline parameters. Refer to Function parameters for an example of how to use these parameters with your function. (GL451)RiskScape no longer reads Z or M coordinate values from shapefiles. RiskScape never made use of these extra coordinate dimensions so this change is unlikely to be noticed by users. The reason for this change is that the extra coordinate dimensions could trigger other problems, most likely after a segmenting operation. (GL484)
When a struct declaration uses the
*select-all or ‘splat’ operator, it now allows struct members to be replaced, e.g.input(value: {name: 'bob', height: 1.74}) -> select({*, height: round(height * 1000)})replaces theheightattribute. This makes it easy to replace parts of a struct that came from the input without having to resort to a cumbersome function likemerge_struct. Note that it is still illegal syntax to redeclare a struct member explicitly, e.g.{loss: 12, loss: 13}Cutting geometries using the
segmentfunction (like the wizard geoprocessing options can do) now always aligns the grid to the bottom left corner of the feature’s bounding box. Previously it would align either to the centroid or 1/2 a grid distance off the centroid, depending on which produced a smaller grid envelope. This can result in slightly different modelling results for non-point models.The
asset_at_risk_ratiofunction has been removed. This function was used to get ratio of an asset’s exposed size. This can be done with the following expressionmeasure(exposed_geom) / measure(geom)(GL401)The built-in
geocodefunction has been renamed tois_exposed. Theis_exposedfunction now may also be called with a thirdresourceargument. Theis_exposedfunction will now be displayed inriskscape function listby default, and can be selected when building models in the wizard. Because theexposureandhazardvalues passed to theis_exposedfunction can be any type, it makes it a versatile placeholder when building a basic model. (GL531)The
--forceor-foption on the pipelinerunandevalcommands have been changed to--replaceor-r. This change now makes the CLI options consistent with themodel runcommand. Note that the-foption is now used for--format. (GL533)The NetCDF bookmark resolver has been changed to produce a relation. Previously it would return a coverage, but it was not possible to access all the data from a multi-dimensional NetCDR dataset.
The resolver can be used to access the data from one or more user defined layers from the NetCDF file. Note that the NetCDF bookmark is part of the optional NetCDF plugin, and so it is only available if you install the plugin. (GL524)
Enhancements
The
riskscape wizardcommand has changed considerably. The wizard now contains support for multiple hazards. Several different hazard-layers can now be combined and sampled in a single operation. The geoprocessing features can now be applied to any layer in your model, not just the exposure-layer. Models created and saved using the wizard on previous releases will continue to work. The old wizard interface is still available by using theriskscape wizard --legacycommand. (GL523)The wizard supports undo to go back a question via the
<ctrl>-cmenu. This makes it easy to go back and change your responses if you make a mistake or try something out, without having to start the wizard process from the start. (GL535)The wizard now makes it easier to customize the results output files produced by your model. You can now interactively pick which attributes to include in the results file, and build aggregation and sort expression easily using the wizard. (GL471)
When writing your own pipelines, RiskScape will now assign default names to all pipeline steps. Previously, RiskScape would only assign a default name to the first pipeline step of a given type. Now you only need to specify a name if you want to reference a step elsewhere in the pipeline. (GL440)
The
mapfunction now accepts non-list arguments. Instead of giving an error, the function will apply the given lambda expression to the argument that wasn’t the list. This has been done to make expressions more reusable and succinct when something may or may not end up being a list, depending on prior steps.A general purpose HDF5 bookmark resolver has been added. This resolver allows users to turn an HDF5 dataset into a relation. Bookmark options exist to configure which dataset (within the HDF5 file) is to be used and which attributes of that dataset should be included. Note that the HDF5 bookmark support is part of the optional HDF5 plugin, and so it is only available if you install the plugin. (GL439)
A
segment_by_gridfunction has been added. This new function is similar to the existingsegmentfunction except that:it lets you align the grid to a specific
to-aligninputit cuts line geometries using a grid (whereas
segmentcuts them to length)
The
to-aligninput may be either a point or a coverage (e.g. a hazard raster file you want to sample). This function now lets you segment your exposure-layer geometry consistently using a common grid. (GL478)A
reprojectfunction has been added. This function reprojects geometries to the desired Coordinate Reference System (CRS). The desired CRS can be either text (‘EPSG:4326’) or another geometry that is in the desired CRS. (GL497)A new
validate-geometryoption has been added to the project INI file and also to relation bookmarks (GL283). This can be set towarnorfailwhen invalid geometry is detected by RiskScape. Invalid geometry can sometimes occur when non-point geometry is modified, such as during reprojection or cutting. Sometimes invalid geometry may simply be present in your input data file. Note that this setting has a slight performance hit and so is off by default. Invalid geometry may result in aTopologyExceptionwhen thevalidate-geometryoption is disabled.In the future the
validate-geometrysetting will be extended to include the option of automatically fixing the invalid geometry, if possible. This enhancement is pending a new JTS library release, which will contain new features to support fixing invalid geometry. (GL283)The
skip-invalidbookmark setting is now enabled by default. If any invalid tuples (i.e. rows or records of input data) are encountered then a warning will be output but the model pipeline will continue running.skip-invalidcan still be disabled for any given bookmark, i.e. to stop running the model pipeline immediately as soon as an invalid tuple is encountered. (GL510)Any
-pparameters that are given toriskscape model runcommand that start with./will now be expanded with the full path of your current directory. Previously it would try to resolve relative file-paths and URIs relative to the project’s URI, which could be confusing when the project file was not in the current directory. See (GL511) for more details.The details of a Python function can now be defined in your
project.inifile. (GL447) This can make it simpler to define the argument-types. For example:[function foo] location = example.py argument-types = [floating, integer] return-type = floating
A new
combine_coveragesfunction has been added for multi-hazard pipeline support. This lets you combine multiple coverages into one and sample multiple hazard or resource-layers with a single operation. (GL472)RiskScape now supports GeoJSON (GL218) and KML (Keyhole Markup Language - GL203) for both input and output files.
The
to_coveragefunction has been enhanced to create a coverage from a bookmark relation directly. Previously it could only be used as an aggregation function. Therelation_to_coveragefunction has been deprecated asto_coverageis now equivalent. (GL490)Additional options have been added to the
to_coveragefunction that now let you turn vector data containing point geometries into a nearest neighbour coverage. This allows for better spatial matching when using a point-based hazard layer (e.g. a site mesh), which is typically used in HDF5 and NetCDF datasets. (GL485)
Fixes
The wizard would throw an unexpected exception if an analysis function was chosen with an ID that required quoting in the pipeline DSL. Quoting will be required when the function ID contains characters that are used as part of the RiskScape expression language, in this case
-would be the most likely. The wizard now quotes function IDs when this is required. (GL419)Shapefiles that contain special characters (such as macrons) would not be read correctly. This would result in unusual characters in the output where the special characters should have been. RiskScape now uses the
<shapefile>.cpgfile to select the character encoding to use which should fix this issue. RiskScape will now also create a<shapefile>.cpgfile when writing shapefiles. This fix uses new a new GeoTools feature that was part of the 25.2 release. (GL481)Relative paths have been resolved incorrectly in
model.iniandpipeline.inifiles that are in a different directory to the project file. Alocation = path-to-fileshould be resolved relative to the file containing it. Butmodel.iniandpipeline.inifiles were resolving these relative to the project file location. This has now been fixed. (GL512)Warnings from pipeline step realization were been treated as errors and preventing the pipeline from running. This has been corrected now and any warnings are logged but the pipeline will run as expected. (GL486)
Struct and list expressions have been treating the comma separating elements as optional. That is
[1 2]would be treated as[1, 2]for lists, and{foo: 1 bar: 2}would be treated as{foo: 1, bar: 2}for structs. This behaviour could be unexpected or confusing for users. Now RiskScape requires the comma separator in these cases. (GL514)
0.9.0
Built 8 June 2021
Breaking
Previously, the percentile(s) aggregation functions were using the nearest-rank inclusive method when used for list aggregation or
grouppipeline steps, and nearest-rank exclusive when used with theaggregatepipeline step. This has changed so that now nearest rank exclusive is used consistently for all percentile aggregation. (GL394)The new
countaggregation function (used by thegrouppipeline step, and for aggregating lists) has been changed so that when aggregating boolean values, only those that are true get counted. This is now consistent with the oldercountfunction (used by theaggregatepipeline step). (GL397)The
seismicplugin has now been removed. This has been replaced by thehdf5,openquake, andusgsplugins, as well as by general-purpose new ‘core’ pipeline features. (GL416)
Enhancements
The sort step may now be used to calculate a delta between the sorted items. This could be used to sort items based on value and to calculate the value difference between items. (GL398)
Expressions now have some support for binary operations on structs, e.g.
{a: 10, b: 20} + {a: 3, b: 12}works by applying the operation to all matching members. It will not apply if the left hand side of the operation has extra members or if any of the pairs do not have a compatible operator. Support is also present for applying an operation on a struct and a scalar value, e.g.2 * {a: 3, b: 4}results in{a: 6, b: 8}.RiskScape has upgraded the core spatial libraries that are used. Of particular note is JTS. The updated version of JTS contains features that RiskScape can now utilize to reduce (or hopefully eliminate) the occurrence of Topology Exceptions. The GeoTools library has also been upgraded to v25.0. (GL340)
The
bufferfunction now has options that may be used to control how geometries are enlarged. By default buffer will round off external corners. If this is not desired, then the new options can be used tomitreorbevelcorners. Lines can also havesquareorflatends. Flat ends do not cause the line to increase in length. (GL391)The wizard now allows the exposure-layer geometries to be enlarged in the geoprocessing phase. The primary use for this is to convert road centre lines into road polygons. When enlarging there are further options to control how geometries are enlarged, including whether any resulting overlaps should be removed. (GL383)
Multi-threaded execution is now enabled by default. The
--pipeline-threadsoption is now set by default to the number of processors (or CPU cores) that are available. This should provide the optimal performance. (GL405)Models that use the pipeline framework now support custom parameter replacement. For example,
$can now be used in the pipeline definition to declare a named parameter that can be overridden or replaced when the model pipeline is run. For example, if you declare a$fooparameter, then it can be overridden by--parameter foo='bar'on the command line. Note that any such parameters also need to be defined in theproject.inifile usingparam.name = default-value. (GL-414)When a pipeline framework model is run, a copy of the pipeline definition is now saved in the output directory. This means you can always see the exact pipeline code that was used to produce a given result. This is particularly helpful now that custom
$parameters are supported in the pipeline definition, as it records the actual replacement value that was used. (GL-404)Parameters can now be passed to the
beta model runcommand in an INI-format file. When changing many different parameters in the model, this makes it more convenient to save them in a file and reuse that, rather than typing them all out on the command line each time. (GL409)The default
output-base-locationmay now be specified in theproject.inifile. Theoutput-base-locationis the base directory that output is written to by thepipelineandbeta modelcommands. If not specified then ‘output’ is the default. (GL406)New aggregation functions
bucketandbucket_rangehave been added that allow for very flexible customization of the aggregated results. These are conceptually similar toSUMIFspreadsheet operations, in that they can aggregate based on a given condition, such as whether the underlying data falls into a certain category.bucket_rangeis useful for aggregating against predefined bands, for example, counting individual losses that fall within a specific dollar value range. (GL-377)The underlying execution of pipelines and models has been changed to use a more task-centric, scheduler-based approach. This new approach means that model execution can be better tailored to efficiently process individual RiskScape pipeline steps, such as better parallelization of aggregation steps. (GL-266, GL-334, GL-407)
Interpolation is now supported with loss-modelling functions, using the new
create_continuousandapply_continuousbuilt-in RiskScape functions. This allows efficient execution of a pipeline when the loss function is computationally expensive, or when there is a very large number of data-points. In addition, when a value is common across multiple data-points, such as multiple elements-at-risk that map to the same hazard value, thestack_continuousfunction can also be used for further efficiencies. (GL-412)Real-time progress diagnostics have been added when running a model. This now clearly shows the number of rows (i.e. exposure/hazard data-points) that are processed by each step of the underlying pipeline. (GL-399)
RiskScape pipelines now support dynamically changing the details of a bookmark on the fly, including the bookmarked file location. This can be useful for combining many different data sources, such as for probabilistic modelling. For example, a bookmarked data source can now contain a list of other input files that RiskScape should use. (GL-417)
Fixes
Previously RiskScape could throw Topology Exceptions when some geometry operations such as intersection or difference were applied. These exceptions where caused by long standing issues related to rounding, in the underlying JTS library that RiskScape uses for geometry operations. The JTS library has been updated and has added new functionality for dealing with these operations that should eliminate these Topology Exceptions. Now RiskScape has been updated to use these new features of the JTS library. (GL369)
Previously RiskScape would let you save a partially complete model when you were halfway through the wizard, but would then refuse to run the saved model. This has now been fixed. For example, this allows you to save only the geoprocessing actions as a model, and then re-run the ‘model’ on different input data files. (GL323)
On some Windows systems, RiskScape v0.8.0 could log the following message when saving a shapefile:
Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. This message was harmless and can be ignored. It now no longer gets displayed. (GL373)Previously, if you had a multi-geometry exposure-layer and you used the wizard
cut-by-layeroption to cut it against a layer in a different CRS, it could result in an error message likeCould not find a suitable transverse mercator based projection.... This issue has now been resolved (GL370)When the wizard was used to save either geoprocessing or analysis raw results an exception would be caused later on if a report filter option was used. This has been fixed (GL372)
When the wizard
cut-by-layeroption was used against a layer in a different CRS, in combination with buffering when sampling (i.e. thehazard-bufferoption), then RiskScape would fail to match anything against the buffered geometry. This issue has now been resolved (GL375)The
shapefile_geotoolswriter would fail when writing a relation that only contained geometries that were created by thecreatePointfunction and did not have acrs-nameset as part of a bookmark. Now the shapefile will be created as expected, but the projection file will be empty as that is unknown. (GL314)When the wizard
cut-by-layeroption was used against a layer in a different CRS, andALL_PARTSwas used, then the difference could appear to duplicate the exposure. This was due to reprojection introducing small changes to the geometry that were large enough to produce a difference. Now in this case thecut-by-layeris reprojected up front to prevent this issue. But this is only possible if the features incut-by-layerare known to fit inside the projection bounds of the exposure-layer. (GL376)When the wizard
cut-by-layeroption was used any multi-geometries that were found would be added to the result list individually. IfALL_PARTSwas used then this would also be done for the difference if that was a multi-geometry. This would be done whether the input geometry was itself a multi-geometry or not. This could cause the exposures modelled to be far larger than expected if they were multi-geometries.Now any resulting multi-geometries are only added to the resulting list by their parts if the input geometry was not a multi-geometry. So for a line exposure, if multi-line intersections were found, then each part would be added to the list separately. But if the input was a multi-line then the multi-line intersection would be added to the list. This applies to both intersections and differences. (GL382)
The
to_coveragefunction used in the geoprocessing filter by layer/attribute step could trigger unexpected exceptions. This would be more likely to occur if the filter by layer contains a larger number of features. Processing has been amended to no longer trigger this exception. (GL390)RiskScape could produce CSV (comma separated values) files that could not be opened by Microsoft Excel. The reason for this was that the file contained columns with more than 32,767 characters which is an Excel limitation. Now RiskScape will truncate columns that would otherwise exceed this limit. (GL384)
0.8.0
Built 3 March 2021
Known Issues
Wizard
ctrl-csupport has been disabled in Windows while we fix (GL371)Using the new shapefile format on windows can produce a harmless but annoying log message
Breaking
measure,measure_lengthandmeasure_areafunctions have been enhanced to measure in metres. Previously these functions returned a measurement that was in the units of the geometry’s CRS (Coordinate reference system) which in the case of lat/long CRSs would be degrees. (GL26)rasterize-grid-sizeis now specified in metres. Bookmarks allow a relation to be rasterized in which caserasterize-grid-sizeis used to specify how big each raster cell should be. Previouslyrasterize-grid-sizewas specified in the unit of the relation’s CRS (Coordinate reference system) which in the case of lat/long CRSs would be degrees. (GL325)beyond,bufferanddwithingeometry function now have the distance argument in metres. Previously these functions required the distance argument to be in the units of the geometry’s CRS (Coordinate reference system) which in the case of lat/long CRSs would be degrees. (GL115)Aggregation functions
p75,p90,p95andp99have been removed. These functions were aliases topercentile(value, percentile: xx)and were created to allow these percentiles to be used from the wizard. These functions are not required now as the wizard will ask for the percentile should that aggregation be selected. (GL335)The
--forceoption for theriskscape beta model runcommand has been renamed to--replace. (GL343)The
capturepipeline step has been removed. Thesavepipeline step can be used in its place. (GL321)How shapefiles get written for the
pipeline runandmodel runcommands has now changed slightly (GL310). This may now save the shapefile attributes with slightly different names compared to the previous RiskScape version. Instead ofasset.name,agg.name, etc attributes will now be saved asname,name1, etc. To restore the old behaviour, you can use--format=shapefile_geotoolson the CLI.
Enhancements
Performance has been significantly improved when writing large shapefiles. Note that the attribute column-naming behaviour has changed slightly as a result. You will benefit from the improved performance whenever you use
--format=shapefilewith theriskscape model runcommand. Note that by default, the old (slower) shapefile writing behaviour will still be used when--formatis omitted, e.g. if you useriskscape model run --outfile=output.shp. (GL310)Wizard now has a geoprocessing phase for processing the exposure layer. Available options are:
filter, to include only desired exposure features
cut-distance, to segment exposure features that are larger than desired size
adjust-attributes, to scale attributes by the ratio of cut/original feature (GL313)
wizardresults now include anexposed_ratioattribute whenall_intersectionshazard sampling is used. Theexposed_ratiomay be used to scale losses to the part of the exposure that is actually exposed. (GL311)Wizard now has option to save raw results when
all_intersectionshazard sampling is used. The raw results include:hazard intersections
consequence (when aggregating consequences)
exposure The raw results may be useful to show the workings of RiskScape which may be required for auditing purposes. (GL119)
Wizard now offers to recalculate the exposure layer’s attributes after cutting (GL337). This lets a user decide what to do to each attribute on a case by case basis.
Additional geometry types have been added for
line,multiline,point,multipoint,polygonandmultipolygon. These specific geometry types can be used instead ofgeometryif only that geometry type should be used. Care must be taken when dealing with shapefiles as they read all geometries as a multi version (due to the shapefile data format). (GL285)A
cut-by-layeroption has been added to the wizard’s geoprocessing functionality. This lets you cut the lines/polygons in the exposure-layer by another vector layer (e.g. regional boundaries) before running the model. (GL99)When RiskScape detects a duplicate item (type, function, bookmark, model etc) with the same ID as an existing item, then the error now includes the location of both items. This will make if much easier to find and remove the duplicate item. (GL305)
The wizard now lets you specify the file format that the model results should be saved in (i.e. CSV or shapefile). (GL321)
A host of new sampling questions that allow the modeller to specify a proximity when sampling from the hazard and area layer, as well as buffering non-point exposure geometry. These allow a margin of error when exposures might not lie exactly over your other layers, such as ports on district boundaries, or flood maps that have been produced using the exposure layer. (GL362, GL361 and GL348)
The interactive wizard now supports being interrupted with
ctrl-c, which brings up a context menu of wizard actions. Currently disabled on Windows due to GL#371.Similar to GL119, the results of the geoprocessing phase can optionally be saved to get a view of the modified exposure layer before other processing phases are applied (GL365)
Fixes
Wizard support for area and resource layers has now been improved. The wizard now supports these layers as either vector or raster input data. Previously, the area-layer had to be in the same CRS as the exposure-layer, but now these layers can be in any CRS. (GL309)
Previously an unexpected exception could occur when running RiskScape over shapefile input data. There were two possible causes, both of which have now been fixed:
The shapefile contained null geometry (GL317). Any records in the shapefile with null geometry are now treated as invalid tuples, and can be skipped over by specifying
skip-invalid = truein the bookmark.The shapefile contained Z-values, but no corresponding M-values (GL265). These shapefiles are now successfully read, as the M-value is optional.
When RiskScape read integer values from a shapefile they where not being converted to the correct RiskScape INTEGER type. This caused problems when running expressions that used these attributes. Now RiskScape is converting these attribute values to the correct RiskScape type. (GL319)
RiskScape can now read CSV files created by Excel. Previously reading these files would mislabel the first column because Excel start the file with an invisible byte order mark. Now RiskScape tolerates the inclusion of these characters and does not include it when assigning the name to first column. (GL230)
Wizard now asks additional questions when aggregations are chosen that require extra configuration (such as percentile aggregation). Previously using
percentileaggregation would result in an invalid model as the extra configuration was not collected. (GL335)RiskScape was silently ignoring lines in a INI file type definition that contained typos. For example, if you had
typ.nameinstead oftype.name. You will now see ‘spurious attribute’ warnings in theriskscape type listoutput. (GL322)If a bookmark specified
crs-namebut did not contain a geometry member then an unexpected error would occur. Now should this occur an error is output saying that a geometry member is required. (GL352)
0.7.4
Built 4 November 2020.
Enhancements
More functionality has been added to the interactive wizard (GL290), although it’s still a beta feature. This includes support for:
saving the wizard model to INI file.
better handling of struct-based (i.e. composite value) hazards or consequences, by aggregating where necessary.
renaming columns in the output file.
Note that the area-layer support will be improved in the next release (currently one limitation is that the area-layer needs to be in the same CRS as the exposure-layer).
A new set of
riskscape beta modelcommands have been added. These commands support running new models that were saved in the wizard. Anyone with existing (template) models can continue using the sameriskscape modelcommands they currently do and should not notice any difference. Eventually theriskscape modelcommands will be replaced by the new beta commands. Note that anyone who wants to try using the new beta commands with a template model, will first need to manually addframework = templatedto their model’s INI definition.A new
set-attributeparameter has been added to bookmarks. This is an alternative to the existingmap-attributeparameter. The difference isset-attributecan be used without specifying a type for the bookmark, whereasmap-attributealways requires a type. The idea is that you can useset-attributeto manipulate the input data, such as renaming an attribute in a shapefile, without being forced to define unnecessary types in RiskScape. (GL288)More aggregation functions now support lists as arguments. These include:
median,mode,stddev, andpercentile(includingp99,p95,p90, andp75). (GL264)A new beta pipeline
groupstep (GL264) has been added that allows grouping and aggregating in more consistent, flexible and powerful ways, by making use of aggregate expressions. While this feature is working, it is currently missing a few important aggregate functions (compared to the old style functions) and will not scale as well with large datasets like the existing implementation can (likely leading to out of memory errors).The glossary has been updated with new proposed terminology to use with RiskScape going forward.
0.7.3
Built 30 September 2020.
Breaking
The select pipeline step now accepts just a single expression parameter. In practice, most users will not notice a difference, but some pipeline expressions may need to be amended to produce identical results as before the change. (Part of GL213)
Enhancements
A beta version of an interactive wizard for building model pipelines has been added. To run the wizard, point RiskScape at your home directory or project file containing your bookmarks and types, and enter the
riskscape wizardcommand. (GL274)A new API for aggregation functions that can also work as normal functions (GL#137). These will eventually be used in a new type of expression, an aggregation expression.
A new framework has been added for constructing aggregation functions from expressions using a classic map/reduce style, along with several implementations that make use of it (
mean,max,count,sum,to_list).A few new language functions for dealing with lists (
append,concat) and nulls (if_nullandnull_of) have been added.Expressions now allow use of the select-all
*operator (also known as ‘splat’) (GL200). This is helpful for various scenarios where input is copied from one pipeline step to another, or for manipulating structs within an expression. For example,select({*, hello: 'world'})will append hello world to whatever was emitted from the previous pipeline step.Expressions now support lambdas (GL37). Two new functions have been added,
mapandcall, that use lambdas For example, a list of integers can be turned in to a list of strings with the following expression:map([1, 2, 3], el -> str(el)).More complicated log configurations can now be set from the command line to target specific loggers, e.g.
--log-level info,.engine.i18n=error,.engine.rl=debugwould set default logging to info level, i18n to error level and RiskScape expression language code to log at debug level.
Fixes
When the
riskscape type-registry listcommand was run, RiskScape would exit with an exception. This problem only affected RiskScape v0.7.2 and has now been fixed. Additional unit tests and integration tests have now been added to avoid this type of problem occurring again. (GL276)RiskScape error messages have now been improved when running a model or pipeline that uses vector data (i.e. shapefiles) that contains:
Shapes with invalid geometry. Or
Shapes with geometry that, when reprojected between two different CRS, becomes invalid.
Previously, RiskScape would just exit with an
EvalException, resulting from aTopologyException. Now RiskScape will provide more details on how to resolve this problem. (GL279, GL281)When running a non-point-asset model with vector data, or using the
relation_to_coveragefunction directly, you would see a message like: WARNING There is code leaving shapefile readers open, this might result in file system locks not being cleared. Depending on the size of the input data, this may have resulted in an exception with the message:Error: Maximum lock count exceeded. This issue has now been resolved. (GL279)When using a non-point-asset model or pipeline with vector data, and the
crs-namebookmark parameter is used, it was possible that RiskScape could exit with anUnknownSRIDExceptionwhen manipulating the geometry. This issue has now been resolved. (GL281)
0.7.2
Built 13 August 2020.
Enhancements
Improve performance for the seismic plugin’s
riskscape seismic convert-relationcommand. Converting a large HDF5 file to OQRS format should now run approximately five to ten times faster. As part of these changes, two parameters have been renamed slightly:--cursor-sizehas been renamed to--cursor-size-mbto make it clear what unit is expected.--quiethas been replaced by--verbose. Quiet is now the default, but you can use--verboseto restore the old behaviour.
To help ensure your CRS settings for bookmarks are correct, the geographic bounds used by your model are now displayed whenever a model is run. You can also see more details about a bookmark’s CRS, axis-order, and bounding envelope by using the
riskscape bookmark info <name> --measurecommand. Refer to Axis/Ordinate Order for more details. (GL252)RiskScape expressions now allow hyphens in keywords without needing escaping. This fixes GL232 by avoiding having to change any function or pipeline parameters to avoid or workaround hyphens in their names. For example,
join(intersects(foo, bar), join-type: 'INNER')would have previously required quotes aroundjoin-type.
Breaking
The bookmark
crs-force-xyoption has been renamed tocrs-longitude-firstto better reflect what it does. Currently the oldcrs-force-xyoption will continue to be accepted, but may be removed in future. (GL252)
Changes to error reporting
Failed functions, bookmarks etc are no longer ‘removed’ from your project on start up. Instead, when they are referenced, e.g trying to use a function in your model, the failure is linked to the parameter or thing that tried to use it to show the user a detailed and traceable error message to help them identify and fix the problem.
CLI list commands now show failed things in their listings, along with a description of the failure message.
Errors building your project are now hidden unless you run RiskScape with
--show-project-errors. Instead, the number of errors is shown with instructions on how to see more details on these errors.Reusing IDs for functions, bookmarks, etc will now cause RiskScape to not run until the collision has been removed. Previously RiskScape would somewhat inconsistently replace or ignore duplicates.
Fixes
The
--stats-outoption was not recording any metrics when a model was run. When a pipeline was run, it did not reliably record metrics for the last second of execution. This has now been fixed. (GL252)
v0.7.1
Built 3 June 2020.
Enhancements
New built-in RiskScape functions have been added to support randomness. (GL244) These include:
random_choice()for randomly selecting an item from a list. Optionally, a weighting can be specified for each list item.random_uniform()for randomly selecting a floating-point number within a given range.random_norm()for randomly selecting a number from a given normal distribution.
A new
exp()built-in RiskScape function has been added. For example, to get the constant e, you can now useexp(1). (GL247)The
riskscape function info <id>command will now display more detailed help for some built-in RiskScape functions, e.g.polynomialorlognorm_cdf.The non-point model now supports a vector-based hazard layer. A new
hazard-expressionparameter has been added to the model for accessing or modifying the hazard value. (GL98)
Fixes
Some converted OpenQuake datasets (OQRS) files were failing to be read because of a buffer underflow bug in the OQRS parsing code. This has now been fixed (GL253)
In previous releases, the
norm_pdf()andlognorm_pdf()functions were available for use in RiskScape expressions, however these functions were not fully implemented (and so they always returned zero). These functions now correctly return the Probability Density Function result. (GL242)Improve the error message that gets displayed when trying to use a GeoTIFF file that is in an ESRI proprietary format. (GL248)
A more informative error message is now displayed when referencing a bookmark that does not exist, e.g. if the bookmark name contained a typo. (GL208)
Some minor improvements to type variance for function parameters have been made. For example, previously a function with a parameter type
anythingwould incorrectly acceptnothingornull. (GL244)
v0.7.0
Built 5 May 2020.
Enhancements
Some improvements have been made to RiskScape’s error reporting, in particular when parsing files and expressions. More error messages now support internationalization (i.e. are capable of translation).
Advanced users can now define their own custom Pipelines using a new purpose-built text file format. For an example of building your own pipeline from scratch, see How to write basic pipelines. Note that pipelines are a beta feature that are still evolving.
Breaking changes
RiskScape output on Windows now defaults to UTF-8 encoding. If your terminal is not setup to handle UTF-8 characters, RiskScape will now automatically change your terminal encoding (called the code page) the first time RiskScape runs. When RiskScape does this, a warning will be displayed to let you know this is happening, e.g.
Changed console to use UTF-8 encoding (was chcp 850). You don’t have to worry about this message, and shouldn’t notice any difference to your terminal. In previous releases, without the UTF-8 encoding, some characters (e.g. ellipsis) were rendered strangely in the RiskScape output. If, for some reason, you need RiskScape output encoded in a different code page, then in your terminal runset RISKSCAPE_OPTS=-Dfile.encoding=cp1252before running RiskScape to restore the old behaviour. You can also usechcp 850to set the terminal encoding back to the default. (GL190)The language that pipelines are defined in has now changed. Most users would not have needed to use pipelines directly, so should not be affected. However, if you did have a pipeline defined in your project file previously, then this will need to be rewritten. Many pipeline steps have been renamed. Pipelines that contain steps with old names will no longer work. Refer to
riskscape pipeline step listfor available pipeline steps. (GL123)If the hazard argument-type for a model’s function is not defined as
nullable, then the function will no longer be called for null hazards (i.e. where no hazard overlaps with a given asset). This means you may notice a slight change in the model’s results for exposure functions that produce output information even when the hazard is null. To define a nullable hazard argument-type for a Python function use:ARGUMENT_TYPES = ['my_asset_type', Nullable.of(typeset.getLinkedType('my_hazard_type'))]
Note that for simple coverage-based hazards, you can alternatively define your hazard type itself as nullable. For example:
[type flood_hazard] type = nullable(struct(depth: floating))
The default column heading produced by group-by expressions has changed slightly. Group-by expressions will infer an output name if one was not provided. For nested tuple accesses like
asset.constructionthe inferred name was the same as the expression, leading to confusion as the output property name looked like a nested property access. Now any dots.in the inferred name are changed to an underscore_. E.g.riskscape model run --group-by=asset.constructionnow produces a field calledasset_constructioninstead ofasset.construction. (GL50)
Fixes
Shapefile output produced by RiskScape could contain null values which is not supported by ESRI software. Now RiskScape will map null values to other constant non-null values to ensure shapefiles can be used in ESRI. The mapped values are:
integer/floating/decimal: -9999
text: “” (an empty string)
geometry: empty point geometry
boolean: false
date: 1st January 1970 (GL170)
Expression parsing would fail with an unexpected error with a misleading message when characters not allowed by the parser were encountered. This now returns a meaningful error message. (GL177)
The default model would fail if null hazards were passed to a function that does not accept nullable hazard values. Now the function call is skipped if unexpected null values are encountered. Instead a null result is produced. (GL197)
When a
riskscape model batchcommand hit certain error conditions (such as no geometry in input dataset) the output error was not very useful. Thebatchcommand now outputs the same useful errors asriskscape model runwould. (GL209)Previously the
riskscape model infocommand would not display any help information for template models. E.g.riskscape model info defaultwould display help, butriskscape model info kaiju_stompwould not. This is now fixed. (GL128).On Windows, RiskScape output will now adjust to match the width of the terminal, instead of always being 80 characters wide. (GL195)
RiskScape now displays a more helpful error message when a
.ascfile has a corresponding.prjfile in an unsupported format. (GL236)
v0.6.0
Built 25 March 2020.
Note that in this release, major refactors have been made to the following:
RiskScape expressions.
Model execution.
Enhancements
RiskScape now runs pipelines with the scheduler based executor which has improved performance. (GL266)
How error messages are handled and displayed has been refactored to better support internationalization of error messages in future. The wording of some error messages may have changed slightly as a result of this (GL32).
Pipeline steps now use RiskScape expressions instead of GeoTools expressions/filters. This allows users full access to RiskScape functions from the expression language. (GL68)
Bookmarks now use RiskScape expressions instead of GeoTools expressions/filters. This applies to
filter,map-attributesandrasterize-expression. (GL72)RiskScape expressions now apply standard maths operator precedence (BEDMAS). (GL64)
Models are now run using an underlying pipeline. This allows models and pipelines to share improvements made to performance and other features. (GL23)
Query and related code has been removed as it is no longer used by models. (GL53)
Various improvements have been made to the RiskScape documentation. (GL74)
Internationalization support has been further improved. This includes a new
riskscape i18ncommand to generate the i18n resource bundles. Documented instructions on how to add RiskScape translations have been added. (GL79)New functionality has been added to improve pipeline execution performance. However, this new functionality is still experimental and is disabled by default. (GL53)
New built-in functions for sampling -
sampleandsample_at_centroidfor sampling non-point and point geometries (GL97).New model
non-point-assetfor modelling assets represented with polygon or line geometries (GL25).New built-in function,
bookmark, for inserting data from your project’s bookmarks in to a RiskScape expression. This is required for most uses of thesamplefunctions. (GL97)Geometry measuring functions:
measure,measure_areaandmeasure_length. (Start of GL26)You can now apply particular common percentile aggregate functions with the shortcut functions
p99,p95,p90andp50.New command
pipeline evalfor testing out the new Domain Specific Language for constructing pipelines. (GL122)Many built-in RiskScape functions have been renamed so that naming style is consistent. As part of this function resolution will attempt to convert old style names to the new format so that users do not have to immediately change how they call these functions. Users are encouraged to use the new function names, e.g.
create_point,geom_from_wkt,is_nullandis_not_null. (GL186)
Breaking changes
--pipeline-threadsoption moved to immediately after theriskscapecommand, e.g.riskscape --pipeline-threads. Older commands, likeriskscape pipeline run --pipeline-threadswill no longer be accepted.The unused stochastic model has been removed. (GL54)
The
riskscape pluginscommand has been removed. This information is now available using the new CLI optionriskscape --version. The output now includes the core RiskScape engine version and build date, as well as basic Java/OS information (for support purposes). (GL143)The keyword arguments for the
lognorm_cdf()andlognorm_pdf()functions have been renamed frommeanandstddevtoscaleandshape. This was to try to avoid confusion over whether these values were the mean/standard-deviation of the log or raw values. For more details aboutscaleandshape, refer to the underlying Java implementation here. This change means that if you used keyword arguments with thelognorm_cdf()orlognorm_pdf()functions, you will need to update your code. For example:lognorm_cdf(x: 1.0, mean: 0.0, stddev: 0.25)
would need to change to:
lognorm_cdf(x: 1.0, scale: 0.0, shape: 0.25)
Note that if keyword arguments are not used, then no change is needed, i.e. the following is still accepted without problem:
lognorm_cdf(1.0, 0.0, 0.25)
Fixes
Writing output to a shapefile would fail if null hazards (or resources) were included (GL152).
Model batch command was not picking up the correct output file format, from the
--outfileargument. Instead it was writing output in JSON format even though the files been written to had some other formats extension (e.gcsv,shp). (GL153)Model batch command would fail on Windows if vary-input contains ‘*’ (GL156)
Exceptions from bad Python functions would cause unexpected errors when run from models. This has been changed to report an error message with problem source (GL154).
Windows file paths are now accepted in the Projects file, as well as by the
--projectCLI option. (GL175)
v0.5.5
Built 26 November 2019.
Enhancements
How error messages are handled and displayed has been refactored to better support internationalization of error messages in future. However, there should be no noticeable difference to functionality (GL32).
Fixes
A
map-member-nameparameter has been added to thecore:apply-functionpipeline step, which executes a function against each member of a list. This means theapply-functionstep can be used for the Minerva vulnerability function modelling without using interpolation (RM641).The
seismic:apply-function-preset-hazardpipeline step can now support ‘unpacking’ a single value from a tuple before passing it to the function. This is only done if that function’s last argument is not a struct type (RM641).
v0.5.4
Built 14 November 2019.
Enhancements
Internationalization support has been added allow translations of command line help output
Bucketing_by aggregation added to allow values to be aggregated to to a bucket that is selected by some independent value (RM642)
Fixes
Changes around indexing on joins to improve performance (RM646).