ZoningTranslationInputs#
- class caf.space.inputs.ZoningTranslationInputs(*, zone_1, zone_2=None, lower_zoning=None, cache_path=PosixPath('I:/Data/Zone Translations/cache'), method=None, sliver_tolerance=0.98, rounding=True, filter_slivers=True, point_handling=False, point_tolerance=1, run_date='30_04_26')[source]#
Bases:
BaseConfigClass for storing and reading input parameters for ZoneTranslation.
- Parameters:
zone_1 (TransZoneSystemInfo) – Zone system 1 information
None (zone_2 |) – Zone system 2 information. Unless performing a centroid calculation , this must be provided.
lower_zoning (LowerZoneSystemInfo) – Information about the lower zone system, used for performing weighted translations. This should be as small a zone system as possible relative to zone_1 and zone_2. For spatially weighted translations this isn’t needed
cache_path (Path) – File path to a cache of existing translations. This defaults to a location on a network drive, and it is best to keep it there, but it’s more important for weighted translations.
method (str, optional) – The name of the method used for weighting (e.g. pop or emp). This can be anything, but must be included as the tool checks if this parameter exists to decide whether to perform a spatial or weighted translation.
sliver_tolerance (float, default 0.98) – This is a float less than 1, and defaults to 0.98. If filter_slivers (explained below) is chosen, tolerance controls how big or small the slithers need to be to be rounded away. For most users this can be kept as is.
rounding (bool, default True) – Select whether or not zone totals will be rounded to 1 after the translation is performed. Recommended to keep as True.
filter_slivers (bool, True) – Select whether very small overlaps between zones will be filtered out. This accounts for zone boundaries not aligning perfectly when they should between shapefiles, and the tolerance for this is controlled by the tolerance parameter. With this parameter set to false translations can be a bit messy.
point_handling (bool, False) – Select whether point zones should be handled specially. If this is set to True a ‘point_tolerance’ parameter must also be provided. By default, this is set to 1 which would only class true points as point zones. This also only works for weighted translations.
point_tolerance (Optional[float]) – The area of zone below which zones will be treated as point zones. Point zones have their geometry adjusted to the lower zone they sit within.
run_date (str, datetime.datetime.now().strftime("%d_%m_%y")) – When the tool is being run. This is always generated automatically and shouldn’t be included in the config yaml file.
zone_2 (TransZoneSystemInfo | None)
Attributes
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Get extra fields set during validation.
Returns the set of fields that have been explicitly set on this model instance.
Methods
write_example_space(out_path)Write out an example config file.
Attributes Documentation
- model_computed_fields = {}#
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_extra#
Get extra fields set during validation.
- Returns:
A dictionary of extra fields, or None if config.extra is not set to “allow”.
- model_fields = {'cache_path': FieldInfo(annotation=Path, required=False, default=PosixPath('I:/Data/Zone Translations/cache')), 'filter_slivers': FieldInfo(annotation=bool, required=False, default=True), 'lower_zoning': FieldInfo(annotation=Union[LowerZoneSystemInfo, NoneType], required=False, default=None), 'method': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'point_handling': FieldInfo(annotation=bool, required=False, default=False), 'point_tolerance': FieldInfo(annotation=float, required=False, default=1), 'rounding': FieldInfo(annotation=bool, required=False, default=True), 'run_date': FieldInfo(annotation=str, required=False, default='30_04_26'), 'sliver_tolerance': FieldInfo(annotation=float, required=False, default=0.98), 'zone_1': FieldInfo(annotation=TransZoneSystemInfo, required=True), 'zone_2': FieldInfo(annotation=Union[TransZoneSystemInfo, NoneType], required=False, default=None)}#
- model_fields_set#
Returns the set of fields that have been explicitly set on this model instance.
- Returns:
- A set of strings representing the fields that have been set,
i.e. that were not filled from defaults.
- zone_1: TransZoneSystemInfo[source]#
- zone_2: TransZoneSystemInfo | None[source]#
- lower_zoning: LowerZoneSystemInfo | None[source]#