Project

General

Profile

Live » History » Version 1

Version 1/12 - Next » - Current version
Philippe May, 06/05/2019 16:37


Live

While the primary intention is use a database for all layers, Gisaf has the capability to display layers directly from GeoPandas GeodataFrames.

In this case, they can also be updated dynamically, adding animation capabilities to the maps.

This can be used for, eg:

  • displaying text (eg. temperatures, well levels)
  • moving elements
  • results of computations and analysis...

Using live directly from a Python script on the Gisaf server

Eg:

#!/usr/bin/env python
from asyncio import run

import geopandas as gpd

from shapely.geometry import Point

from gisaf.live import live_server

async def run(gs):
    gdf = gpd.GeoDataFrame(
        data={
            'geometry': [
                Point(12.01, 79.81)
            ]
        },
        crs='epsg:4326'
    )

    await live_server.publish_gdf('FooLayer', gdf)

async def main():
    await live_server.create_connections()
    await run(gs)

if __name__ == '__main__':
    run(main())

Live_arch.odg (11.3 KB) Philippe May, 06/05/2019 17:17

Live_arch.png View (68 KB) Philippe May, 06/05/2019 17:17