starling_sim.basemodel.output.geojson_output

This module contains tools for the generation of a geojson output, used for visualisation purposes, after the simulation run

Module Contents

Classes

GeojsonOutput

Manage the generation of a geojson output, mainly for visualisation purposes.

GeojsonOutput1

Manage the generation of a geojson output, mainly for visualisation purposes.

GeojsonOutput0

Manage the generation of a geojson output, mainly for visualisation purposes.

Functions

new_geojson_output()

Create a new GeojsonOutput instance.

Attributes

ICON_LIST

CURRENT_GEOJSON_VERSION

starling_sim.basemodel.output.geojson_output.ICON_LIST = ['user', 'user-01', 'user-02', 'user-03', 'user-04', 'user-05', 'user-06', 'user-07', 'user-08',...
starling_sim.basemodel.output.geojson_output.CURRENT_GEOJSON_VERSION = 1
class starling_sim.basemodel.output.geojson_output.GeojsonOutput

Bases: abc.ABC

Manage the generation of a geojson output, mainly for visualisation purposes.

VERSION = 'X.X.X'
setup(simulation_model, filename, folder)

Set the values of the simulation model, topologies and outfile

This setup method is called during simulation setup

Parameters:
  • simulation_model

  • filename

  • folder

set_information_factories(information_factories)
add_population_features(population=None)

Build and add features for the given population, with additional information provided by the information factories.

These are added to the features attributes, used to build the final FeatureCollection.

If population is

Parameters:

population – population key, population list or None.

add_element_feature(element)
init_element_feature(element)
add_factories_information()
generate_geojson()

Write the geojson feature collection in a file.

class starling_sim.basemodel.output.geojson_output.GeojsonOutput1

Bases: GeojsonOutput

Manage the generation of a geojson output, mainly for visualisation purposes.

VERSION = '1.0'
init_element_feature(element)

Initialise a geojson feature for the element regarding its class.

The current_feature attribute is set with a geojson feature or None.

Parameters:

element – simulation element

add_factories_information()
class starling_sim.basemodel.output.geojson_output.GeojsonOutput0

Bases: GeojsonOutput

Manage the generation of a geojson output, mainly for visualisation purposes.

VERSION = '0.1'
init_element_feature(element)
starling_sim.basemodel.output.geojson_output.new_geojson_output()

Create a new GeojsonOutput instance.

Use the version provided in the ‘geojson_version’ field of parameters, and the default version if not provided.

Returns:

GeojsonOutput instance