popframe.method.popuation_frame

Classes

PopFrame(*, region)

Class provides methods for network analysis on geographic data

class popframe.method.popuation_frame.PopFrame(*, region: Region)[source]

Bases: BaseMethod

Class provides methods for network analysis on geographic data

_initialize_graph(towns: GeoDataFrame)[source]

Initializes the graph with nodes

_connect_levels(towns: GeoDataFrame, G: Graph, from_level: str, to_levels: List[str])[source]

Connects nodes across specified levels

_euclidean_distance(coord1, coord2)[source]

Calculates Euclidean distance between two coordinates

_connect_same_level(towns: GeoDataFrame, G: Graph, level: str)[source]

Connects nodes within the same level using Kruskal’s algorithm

build_network_frame() Graph[source]
get_color_map(levels)[source]
get_graph_html(G: Graph, filepath: str)[source]

Saves the graph as an HTML file with a map visualization

save_graph_to_geojson(G: Graph, filepath: str | None = None)[source]

Saves the graph as a GeoJSON file or returns it as a GeoDataFrame

create_circle(center, size)[source]
size_from_population(population, level)[source]
convert_points_to_circles(gdf)[source]
generate_map(towns)[source]
build_circle_frame(output_type='html')[source]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.