CSC/ECE 517 Spring 2015/oss S1504 AAC

From Expertiza_Wiki
Jump to navigation Jump to search

About Sahana

Sahana Eden is an Open Source Humanitarian Platform which can be used to provide solutions for Disaster Management, Development, and Environmental Management sectors. Being open source, it is easily customisable, extensible and free. It is supported by the Sahana Software Foundation. Sahana Eden was first developed in Sri Lanka as a response to the Indian Ocean Tsunami in 2005. The code for the Sahana Eden project is hosted at Github and it is published under the MIT License. The demo version of Sahana Eden can be found here.

Eden is a flexible humanitarian platform with a rich feature set which can be rapidly customized to adapt to existing processes and integrate with existing systems to provide effective solutions for critical humanitarian needs management either prior to or during a crisis. Sahana Eden contains a number of different modules like 'Organization Registry', 'Project Tracking', 'Human Resources', 'Inventory', 'Assets', 'Assessments', 'Scenarios & Events', 'Mapping', 'Messaging' which can be configured to provide a wide range of functionality. We are contributing to Sahana Eden as a part of our Object-Oriented Design and Development's Open-Source Software (OSS) Project. In this Wiki Page, we would be explaining the goals of our project and how we implemented them.

Goals of the project

Implementation

Searching Internal database

    #Get vars from url
    user_str = get_vars["name_startsWith"]
    callback_func = request.vars["callback"]
    atable = db.gis_location
    query = atable.name.lower().like(user_str + '%')
    rows = db(query).select(atable.id,
                            atable.level,
                            atable.name,
                            atable.lat,
                           atable.lon
                            )
    results = []
    count = 0
    for row in rows:
        count += 1
        result = {}
         
        #Convert the level colum into the ADM codes geonames returns
        #fcode = row["gis_location.level"]
        level = row["gis_location.level"]
        if level=="L0": #Country
            fcode = "PCL" #Zoom 5
        elif level=="L1": #State/Province
            fcode = "ADM1"
        elif level=="L2": #County/District
            fcode = "ADM2"
        elif level=="L3": #Village/Suburb
            fcode = "ADM3"
        else: #City/Town/Village
            fcode = "ADM4"
             
        result = {"id" : row["gis_location.id"],
                  "fcode" : fcode,
                  "name" : row["gis_location.name"],
                  "lat" : row["gis_location.lat"],
                  "lng" : row["gis_location.lon"]}
        results.append(result)

Searching geonames