#! /usr/local/bin/python3

presentations = {
    "community_presentations": [
        {
            "name": "Damien Hassan",
            "organisation": "State Records Office of Western Australia",
            "presentation_title": "RetroMaps: Adventures in Time and Space",
            "abstract": "A case study in using historic survey plans for Perth in a modern mapping interface: what we learnt, public reaction and where to from here."
        },
        {
            "name": "Norm Santich",
            "organisation": "Landgate",
            "presentation_title": "Using open source solutions to deliver spatial applications for government",
            "abstract": "Overview of web-mapping applications developed by Landgate's Location intelligence. These include the Western Power Network Bushfire Risk project, the Aurora fire spread simulation system, the fire behaviour calculator, grassland curing and automatic mapping of fire scars from Sentinel-2 imagery."
        },
        {
            "name": "Dan Dixon",
            "organisation": "University of Western Australia",
            "presentation_title": "Using Satellite and Drone Remote Sensing to monitor Eucalypt Flowering Events",
            "abstract": "Knowledge of flowering events is key for various applications including ecology and beekeeping. This research presents a method that combines drone and satellite images to produce landscape-scale maps of flowering dynamics. The tradeoffs of open source GIS and remote sensing tools are discussed in this context."
        },
        {
            "name": "Jenny Smith",
            "organisation": "Landgate",
            "presentation_title": "A non-technical tale of Data WA open source discovery",
            "abstract": "Data WA manager’s account on discovering the meaning of free and open source software after attending a FOSS4G SotM conference."
        },
        {
            "name": "James Spath",
            "organisation": "City of Swan",
            "presentation_title": "All Take, No Give (LGAs  - Open Data and FOSS4G)",
            "abstract": "Open Data use in LGAs, quick overview of the disparity in staffing and capability amongst LGAs. Percentage of councils using Open Data, what they do with it and percentage who supply Open Data. Success stories and barriers to supply. Uptake of FOSS4G vs Esri Trend in WA."
        },
        {
            "name": "Piers Higgs",
            "organisation": "Gaia Resources",
            "presentation_title": "How Open Source Created a Company",
            "abstract": "Gaia Resources has grown from a small Perth company to an Australia-wide company - all thanks to open source software and open data. In this talk, the founder, Piers, will explain how the “open” philosophy has enabled the company to deliver its mission to make the world a better place."
        },
        {
            "name": "Ross Gillis",
            "organisation": "Hydrobiology",
            "presentation_title": "Open source remote sensing and dashboarding – surface water monitoring at your fingertips",
            "abstract": "Monitoring seasonal variation in Western Australia’s surface water (e.g. lakes, ponds, dams etc) is essential for water management, aquatic ecology and biodiversity, regulatory compliance, public amenity, and water resourcing for bush fire-fighting. Hydrobiology have developed a workflow to extract, wrangle, process, analyse and interpret patterns in surface water as it grows and shrinks seasonally.<br /><br />Our process utilizes freely available satellite imagery (Sentinel-2), geospatial analysis in R and dashboarding in RShiny to create a simple end product for clients to understand, interact and ultimately make decisions towards better water management."
        },
        {
            "name": "Nimalika Fernando",
            "organisation": "Curtin University",
            "presentation_title": "Let's map indoors: starting indoor mapping with OSM ",
            "abstract": "Indoor maps of public spaces are still not commonly available as open data.  Indoor data in OSM is growing but still at infancy compared to the outdoor maps. This presentation will discuss how to get started with indoor mapping with OSM."
        },
        {
            "name": "Edward Keys",
            "organisation": "Prodigy Gold",
            "presentation_title": "QField: Exploration Geology's new 'must-have' tool",
            "abstract": "QField is now able to drastically improve the way the mining industry collects and manages spatial information. From keeping track of complicated drilling programs, organizing rehabilitation to geological mapping, QField is the newest indispensable tool for exploration."
        },
        {
            "name": "Gabriel Diosan",
            "organisation": "City of Canning",
            "presentation_title": "A Local Government Journey with QGIS",
            "abstract": "This presentation will examine the use of QGIS at the City of Canning from the early days to present. The presentation will detail the use of QGIS in the organisation with a focus of strategic planning and also look at how the City of Canning has become a contributor to the QGIS project."
        },
        {
            "name": "John Duncan",
            "organisation": "University of Western Australia",
            "presentation_title": "Mapping Tongan farms with QField",
            "abstract": "With the Ministry of Agriculture in Tonga, a workflow to map farms was developed. In the field, QField mobile GIS is used to map farms. Server-side, an Express app processes data submitted from mobile devices. Finally, a Shiny dashboard is used for syncing, querying, and visualising data."
        },
        {
            "name": "Ivana Ivánová",
            "organisation": "Curtin University",
            "presentation_title": "UN peacebuilding & peacekeeping is going….OPEN!",
            "abstract": "In this presentation, we introduce the UN OpenGIS Initiative and its Open GIS Bundle for geo-data collection, analysis and dissemination compliant with requirements of peace-building and peacekeeping UN operations, and our experience with improving UN GIS officers’ FOSS4G and Open Data skills."
        },
    ],
    "lightning_talks": [
        {
            "name": "Petra Helmholz",
            "organisation": "Curtin University",
            "presentation_title": "From Applied Cartography students to the QGIS developers with love",
            "abstract": "Teaching Applied Cartography with QGIS is great, but our wish list of additional features indicates that it could be even better! In this presentation, we will briefly explain what we do with QGIS and present the functionality we’d like to ask the developer community to add to the tool."
        },
        {
            "name": "Jianhong Cecilia Xia",
            "organisation": "Curtin University",
            "presentation_title": "Time Series Forecasting Of COVID-19 in Australia",
            "abstract": "With this research, dynamic regression models using R and Python were validated with variable factors to explore any relationships and trends that are likely to cause widespread in Australia."
        },
        {
            "name": "Alex Chapman",
            "organisation": "Gaia Resources",
            "presentation_title": "Open and Dynamic Field Guides",
            "abstract": "Using open source software and open data, the team at Gaia Resources were able to develop a system that can generate a dynamic field guide for anywhere in Australia, across various different groupings of plants, animals and fungi. More at https://tinyurl.com/y5ulrelz."
        },
        {
            "name": "James Keating",
            "organisation": "Hydrobiology",
            "presentation_title": "Into the deep – Hydrographic surveying using open source applications",
            "abstract": "Aquatic ecological investigations require a strong understanding of the entire water body, from top to bottom. Typical examples include habitat classification of the seabed, old infrastructure abandoned at the bottom of a flooded mine pit, or the morphology of a river. < br / > < br / >Commercially available hydrographic instruments and software are often cost prohibitive in conducting such surveys. We present a concept for a hydrographic workflow that incorporates affordable off - the - shelf side scan sonar, low cost DIY tow - fish(think mini - torpedo) and Python based image analysis in a QGIS plugin to automate the processing of sonar imagery into a cohesive story. We take a case study from a project we conducted in South America to identify abandoned mining infrastructure in a flooded mine pit."
        },
        {
            "name": "Katherine Allan",
            "organisation": "Landgate",
            "presentation_title": "Discovering WA Government Data",
            "abstract": "Introduction to Data WA (data.wa.gov.au), including tips for finding and accessing spatial data."
        },
        {
            "name": "Sanath Jayamanna & Nicholas Shannon",
            "organisation": "Main Roads",
            "presentation_title": "Main Roads Open Data, Maps and Apps Portal",
            "abstract": "Main Roads Open Data journey and the development of its Open Data Portal, its governance and operation and a demonstration of the opportunities it offers to  data users to explore and develop transport related products and services for the broader Western Australian community."
        },
        {
            "name": "Joseph Harris",
            "organisation": "Telethon Kids Institute",
            "presentation_title": "Using open geospatial data and technology to support malaria risk modelling",
            "abstract": "In this presentation we will describe how we use open geospatial data and technology at the Malaria Atlas Project (https://malariaatlas.org/) to support the generation of highly detailed maps of malaria risk at global scale."
        },
        {
            "name": "John Bryant",
            "organisation": "Mammoth Geospatial",
            "presentation_title": "OpenStreetMap Data Pacific",
            "abstract": "OpenStreetMap Data Pacific is a new resource, bundling OSM data into user - friendly QGIS projects for 21 Pacific Island countries. < br / > < br / >We're aiming to help Pacific GIS users become more familiar with OpenStreetMap data, and perhaps become interested in participating in the OSM project."
        },
        {
            "name": "Bryan Boruff",
            "organisation": "The University of Western Australia",
            "presentation_title": "The future impact of R-code changes on tree canopy cover: a Nedlands story",
            "abstract": "Using high resolution remotely sensed imagery, built environment data and open source tools, the impact of changes to the Nedlands, WA Planning Scheme on tree canopy cover were modeled to the year 2050. Results show a loss of up to 18% in areas zoned for higher density."
        },
        {
            "name": "Rocio Peyronnet",
            "organisation": "The University of Western Australia",
            "presentation_title": "A multi-sensor machine learning method to map flooding after cyclone events",
            "abstract": "Monitoring floods is essential for disaster response. This project used Sentinel-1 and -2 remote sensing data, with ancillary datasets, in a machine learning framework to model flooding in Fiji’s tropical cyclone season. This model provides an accurate, semi-automated tool for local flood mapping."
        },
        {
            "name": "Khan Mohammed Sazzadur Rahman",
            "organisation": "The University of Western Australia",
            "presentation_title": "Assessing the cooling effect of urban vegetation in Perth",
            "abstract": "The risk of outdoor thermal stress in urban areas is increasing. This study modelled the effect of re-vegetation on residential area’s temperature in Perth using a combination of open data (Landsat) and open source geospatial software (QGIS, UMEP-SOLWEIG)."
        },
        {
            "name": "Merindah Bairnsfather-Scott",
            "organisation": "Winyama",
            "presentation_title": "IMW Australia - On Demand",
            "abstract": "The Indigenous Mapping Workshop Australia is now delivered a little differently. The IMW Australia - On Demand has been purpose built for our participants to access culturally appropriate training from across country and community while we have found ourselves unable to travel during this time."
        },
        {
            "name": "Sam Wilson",
            "organisation": "",
            "presentation_title": "Contributing to OpenStreetMap",
            "abstract": "How to get started with adding data to OpenStreetMap. To be followed on Saturday by a ground-truthing excursion in Perth and hands-on map editing."
        }
    ]
}


template = """
<div class="speaker_bio">
    <h4 id="#name-speaker-id#">#name# - #organisation#</h4>

    <p><b>Title:</b> #presentation_title#</p>

    <p><b>Abstract:</b> #abstract#</p>
</div>
"""

replacements = ["name", "organisation", "presentation_title", "abstract", "biography"]

# community_presentations or lightning_talks
talk_type = "lightning_talks"

for speaker in presentations[talk_type]:
    talk = template
    for replacement in replacements:
        if replacement in speaker:
            if replacement == "name":
                talk = talk.replace(f"#{replacement}#", speaker[replacement])
                talk = talk.replace("#name-speaker-id#", speaker[replacement].lower().replace(" ", "-") + "-" + talk_type.replace("_", "-")[:-1])
            elif replacement == "organisation":
                if speaker[replacement] == "":
                    talk = talk.replace(" - #organisation#", "")
                else:
                    talk = talk.replace(f"#{replacement}#", speaker[replacement])
            else:
                talk = talk.replace(f"#{replacement}#", speaker[replacement])
        else:

            talk = talk.replace(f"#{replacement}#", "TBA")

    print(talk)
