overture2hdx


Nameoverture2hdx JSON
Version 0.0.3 PyPI version JSON
download
home_pageNone
SummaryLib to convert Overture data in GIS formats and upload it to HDX
upload_time2024-11-08 08:11:20
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseGPL-3.0-only
keywords overture humanitarian duckdb hdx
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Overture Map Data 2 HDX

This project is designed to export geographic data from Overture Maps and upload it to the Humanitarian Data Exchange (HDX). The data is processed using DuckDB and can be exported in various formats such as GeoJSON, GPKG, and ESRI Shapefile.

## Features

- Export geographic data from Overture Maps.
- Upload data to HDX.
- Support for multiple output formats.
- Configurable via YAML and environment variables.
- Logging setup using environment variables or parameters.


## Installation

```bash
pip install overture2hdx
```

## Configuration

The application is configured using a YAML file and environment variables.

### YAML Configuration

Example `config.yaml`:
```yaml
iso3: npl
geom: '{"type": "FeatureCollection", "features": [{"type": "Feature", "properties": {}, "geometry": {"coordinates": [[]], "type": "Polygon"}}]}'
key: osgeonepal_pkr
subnational: true
frequency: yearly
categories:
- Roads:
    select:
        - id
        - names.primary as name
        - class as class
        - subclass as subclass
        - UNNEST(JSON_EXTRACT(road_surface, '$[*].value')) as road_surface
        - UNNEST(JSON_EXTRACT(sources, '$[*].dataset')) AS source
    hdx:
        title: Roads of Pokhara
        notes: Overturemaps Export for Pokhara. Data might have errors but has gone through validation checks.
        tags:
        - geodata
        - transportation
        - roads
    theme:
        - transportation
    feature_type:
        - segment
    formats:
        - gpkg
        - shp

```
### Code Overview

`Config`: Class to handle configuration.
`OvertureMapExporter`: Class to handle the export process.
`setup_logging`: Function to set up logging.

Example 
```python
import json

geom = json.dumps(
    {
        "type": "FeatureCollection",
        "features": [
            {
                "type": "Feature",
                "properties": {},
                "geometry": {
                    "coordinates": [
                        [
                            [83.98047393581618, 28.255338988044088],
                            [83.973540694181, 28.230486421513703],
                            [83.91927014759125, 28.214265947308945],
                            [83.97832224013575, 28.195093119231174],
                            [83.96971545741735, 28.158212628626416],
                            [84.00175181531534, 28.19361814379657],
                            [84.03187555483152, 28.168540447741847],
                            [84.01059767533235, 28.208788347541898],
                            [84.0342663278089, 28.255549578267903],
                            [83.99960011963498, 28.228801292171724],
                            [83.98047393581618, 28.255338988044088],
                        ]
                    ],
                    "type": "Polygon",
                },
            }
        ],
    }
)
config_yaml_mini = f"""
    iso3: npl
    geom: {geom}
    key: osgeonepal_pkr
    subnational: true
    frequency: yearly
    categories:
    - Roads:
        select:
            - id
            - names.primary as name
            - class as class
            - subclass as subclass
            - UNNEST(JSON_EXTRACT(road_surface, '$[*].value')) as road_surface
            - UNNEST(JSON_EXTRACT(sources, '$[*].dataset')) AS source
        hdx:
            title: Roads of Pokhara Nepal
            notes:  Overturemaps Export for Pokhara . Data might known to have errors however gone through validation checks to detect map errors, breakage, and vandalism . Sources would be combination of OSM and Other openly available datasets in the region including facebook roads and ESRI community datasets
            tags:
            - geodata
            - transportation
            - roads
        theme:
            - transportation
        feature_type:
            - segment
        formats:
            - gpkg
            - shp

    - Buildings:
        select:
            - id
            - names.primary as name
            - class as class
            - subtype as subtype
            - height as height
            - level as level
            - num_floors as num_floors
            - UNNEST(JSON_EXTRACT(sources, '$[*].dataset')) AS source
        hdx:
            title: Buildings of Pokhara Nepal
            notes:  Overturemaps Export for Nepal . Data might known to have errors however gone through validation checks to detect map errors, breakage, and vandalism . Sources would be combination of OSM and Other openly available datasets in the region including facebook roads and ESRI community datasets
            tags:
            - geodata
        theme:
            - buildings
        feature_type:
            - building
        formats:
            - gpkg
            - shp
    """


from overture2hdx import Config, Exporter

config = Config(config_yaml=config_yaml_mini)
exporter = Exporter(config)
results = exporter.export()
print(results)
```

### Author and License 
Kshitij Raj Sharma , License : GNU GENERAL PUBLIC LICENSE V3


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "overture2hdx",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "overture, humanitarian, duckdb, hdx",
    "author": null,
    "author_email": "Kshitij Raj Sharma <skshitizraj@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/bf/52/634141587363c4a20c8547217eacf2667134abcc8f5e56b7cf149ae282fa/overture2hdx-0.0.3.tar.gz",
    "platform": null,
    "description": "# Overture Map Data 2 HDX\n\nThis project is designed to export geographic data from Overture Maps and upload it to the Humanitarian Data Exchange (HDX). The data is processed using DuckDB and can be exported in various formats such as GeoJSON, GPKG, and ESRI Shapefile.\n\n## Features\n\n- Export geographic data from Overture Maps.\n- Upload data to HDX.\n- Support for multiple output formats.\n- Configurable via YAML and environment variables.\n- Logging setup using environment variables or parameters.\n\n\n## Installation\n\n```bash\npip install overture2hdx\n```\n\n## Configuration\n\nThe application is configured using a YAML file and environment variables.\n\n### YAML Configuration\n\nExample `config.yaml`:\n```yaml\niso3: npl\ngeom: '{\"type\": \"FeatureCollection\", \"features\": [{\"type\": \"Feature\", \"properties\": {}, \"geometry\": {\"coordinates\": [[]], \"type\": \"Polygon\"}}]}'\nkey: osgeonepal_pkr\nsubnational: true\nfrequency: yearly\ncategories:\n- Roads:\n    select:\n        - id\n        - names.primary as name\n        - class as class\n        - subclass as subclass\n        - UNNEST(JSON_EXTRACT(road_surface, '$[*].value')) as road_surface\n        - UNNEST(JSON_EXTRACT(sources, '$[*].dataset')) AS source\n    hdx:\n        title: Roads of Pokhara\n        notes: Overturemaps Export for Pokhara. Data might have errors but has gone through validation checks.\n        tags:\n        - geodata\n        - transportation\n        - roads\n    theme:\n        - transportation\n    feature_type:\n        - segment\n    formats:\n        - gpkg\n        - shp\n\n```\n### Code Overview\n\n`Config`: Class to handle configuration.\n`OvertureMapExporter`: Class to handle the export process.\n`setup_logging`: Function to set up logging.\n\nExample \n```python\nimport json\n\ngeom = json.dumps(\n    {\n        \"type\": \"FeatureCollection\",\n        \"features\": [\n            {\n                \"type\": \"Feature\",\n                \"properties\": {},\n                \"geometry\": {\n                    \"coordinates\": [\n                        [\n                            [83.98047393581618, 28.255338988044088],\n                            [83.973540694181, 28.230486421513703],\n                            [83.91927014759125, 28.214265947308945],\n                            [83.97832224013575, 28.195093119231174],\n                            [83.96971545741735, 28.158212628626416],\n                            [84.00175181531534, 28.19361814379657],\n                            [84.03187555483152, 28.168540447741847],\n                            [84.01059767533235, 28.208788347541898],\n                            [84.0342663278089, 28.255549578267903],\n                            [83.99960011963498, 28.228801292171724],\n                            [83.98047393581618, 28.255338988044088],\n                        ]\n                    ],\n                    \"type\": \"Polygon\",\n                },\n            }\n        ],\n    }\n)\nconfig_yaml_mini = f\"\"\"\n    iso3: npl\n    geom: {geom}\n    key: osgeonepal_pkr\n    subnational: true\n    frequency: yearly\n    categories:\n    - Roads:\n        select:\n            - id\n            - names.primary as name\n            - class as class\n            - subclass as subclass\n            - UNNEST(JSON_EXTRACT(road_surface, '$[*].value')) as road_surface\n            - UNNEST(JSON_EXTRACT(sources, '$[*].dataset')) AS source\n        hdx:\n            title: Roads of Pokhara Nepal\n            notes:  Overturemaps Export for Pokhara . Data might known to have errors however gone through validation checks to detect map errors, breakage, and vandalism . Sources would be combination of OSM and Other openly available datasets in the region including facebook roads and ESRI community datasets\n            tags:\n            - geodata\n            - transportation\n            - roads\n        theme:\n            - transportation\n        feature_type:\n            - segment\n        formats:\n            - gpkg\n            - shp\n\n    - Buildings:\n        select:\n            - id\n            - names.primary as name\n            - class as class\n            - subtype as subtype\n            - height as height\n            - level as level\n            - num_floors as num_floors\n            - UNNEST(JSON_EXTRACT(sources, '$[*].dataset')) AS source\n        hdx:\n            title: Buildings of Pokhara Nepal\n            notes:  Overturemaps Export for Nepal . Data might known to have errors however gone through validation checks to detect map errors, breakage, and vandalism . Sources would be combination of OSM and Other openly available datasets in the region including facebook roads and ESRI community datasets\n            tags:\n            - geodata\n        theme:\n            - buildings\n        feature_type:\n            - building\n        formats:\n            - gpkg\n            - shp\n    \"\"\"\n\n\nfrom overture2hdx import Config, Exporter\n\nconfig = Config(config_yaml=config_yaml_mini)\nexporter = Exporter(config)\nresults = exporter.export()\nprint(results)\n```\n\n### Author and License \nKshitij Raj Sharma , License : GNU GENERAL PUBLIC LICENSE V3\n\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-only",
    "summary": "Lib to convert Overture data in GIS formats and upload it to HDX",
    "version": "0.0.3",
    "project_urls": {
        "documentation": "https://github.com/kshitijrajsharma/overture2hdx",
        "homepage": "https://github.com/kshitijrajsharma/overture2hdx",
        "repository": "https://github.com/kshitijrajsharma/overture2hdx"
    },
    "split_keywords": [
        "overture",
        " humanitarian",
        " duckdb",
        " hdx"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1ecf6961ce520d548bbe4993d805b30aca4f9a18145b0f4aa383da9dce0b9c83",
                "md5": "7a330a98278143cfd46f93961fc9e829",
                "sha256": "90966a3d4a644889cb660c2b42095009273afdba4e706d5f0fc3368c28762b6e"
            },
            "downloads": -1,
            "filename": "overture2hdx-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7a330a98278143cfd46f93961fc9e829",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 19803,
            "upload_time": "2024-11-08T08:11:18",
            "upload_time_iso_8601": "2024-11-08T08:11:18.565343Z",
            "url": "https://files.pythonhosted.org/packages/1e/cf/6961ce520d548bbe4993d805b30aca4f9a18145b0f4aa383da9dce0b9c83/overture2hdx-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bf52634141587363c4a20c8547217eacf2667134abcc8f5e56b7cf149ae282fa",
                "md5": "0ab5939057364bfadf935f8f72c0929a",
                "sha256": "07cee4ecdb1897d4e21fee69870ad057dbafc83241a888250e439ecb2ef1c867"
            },
            "downloads": -1,
            "filename": "overture2hdx-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "0ab5939057364bfadf935f8f72c0929a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 19214,
            "upload_time": "2024-11-08T08:11:20",
            "upload_time_iso_8601": "2024-11-08T08:11:20.308216Z",
            "url": "https://files.pythonhosted.org/packages/bf/52/634141587363c4a20c8547217eacf2667134abcc8f5e56b7cf149ae282fa/overture2hdx-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-08 08:11:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kshitijrajsharma",
    "github_project": "overture2hdx",
    "github_not_found": true,
    "lcname": "overture2hdx"
}
        
Elapsed time: 2.10435s