llama-index-readers-maps


Namellama-index-readers-maps JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
Summaryllama-index readers maps integration
upload_time2024-08-22 06:33:20
maintainercarrotpy
docs_urlNone
authorYour Name
requires_python<4.0,>=3.8.1
licenseMIT
keywords geo maps open maps open street maps overpass api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # **_Osmmap Loader_**

```bash
pip install llama-index-readers-maps
```

The Osmmap Loader will fetch map data from the [Overpass](https://wiki.openstreetmap.org/wiki/Main_Page) api for a certain place or area. Version **Overpass API 0.7.60** is used by this loader.

The api will provide you with all the **nodes, relations, and ways** for the particular region when you request data for a region or location.

## **Functions of the loader**

- To start, it first filters out those nodes that are already tagged, leaving just those nodes that are within 2 kilometres of the target location. The following keys are removed during filtering:["nodes," "geometry," "members"] from each node. The response we received is based on the tags and values we provided, so be sure to do that. The actions are covered below.

## **Steps to find the suitable tag and values**

1. Visit [Taginfo](taginfo.openstreetmap.org/tags). In essence, this website has all conceivable tags and values.
2. Perform a search for the feature you're looking for, for instance, "hospital" will return three results: "hospital" as an amenity, "hospital" as a structure, and "hospital" as a healthcare facility.
3. We may infer from the outcome that tag=amenity and value=hospital.
4. Leave the values parameter to their default value if you do not need to filter.

## **Usage**

The use case is here.

Let's meet **Jayasree**, who is extracting map features from her neighbourhood using the OSM map loader.
She requires all the nodes, routes, and relations within a five-kilometer radius of her locale (Guduvanchery).

- She must use the following arguments in order to accomplish the aforementioned. Localarea = "Guduvanchery" (the location she wants to seek), local_area_buffer = 5000 (5 km).

### And the code snippet looks like

```python
from llama_index.readers.maps import OpenMap

loader = MapReader()
documents = loader.load_data(
    localarea="Guduvanchery",
    search_tag="",
    tag_only=True,
    local_area_buffer=5000,
    tag_values=[""],
)
```

### Now she wants only the list hospitals around the location

- so she search for hospital tag in the [Taginfo](https://taginfo.openstreetmap.org/tags) and she got

```python
from llama_index.readers.maps import OpenMap

loader = MapReader()
documents = loader.load_data(
    localarea="Guduvanchery",
    search_tag="amenity",
    tag_only=True,
    local_area_buffer=5000,
    tag_values=["hospital", "clinic"],
)
```

This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llama-index-readers-maps",
    "maintainer": "carrotpy",
    "docs_url": null,
    "requires_python": "<4.0,>=3.8.1",
    "maintainer_email": null,
    "keywords": "geo, maps, open maps, open street maps, overpass api",
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/db/c8/c871be7c3c38151e53cc1fe5413924d4737615baf5536f531394dc0f7b03/llama_index_readers_maps-0.2.0.tar.gz",
    "platform": null,
    "description": "# **_Osmmap Loader_**\n\n```bash\npip install llama-index-readers-maps\n```\n\nThe Osmmap Loader will fetch map data from the [Overpass](https://wiki.openstreetmap.org/wiki/Main_Page) api for a certain place or area. Version **Overpass API 0.7.60** is used by this loader.\n\nThe api will provide you with all the **nodes, relations, and ways** for the particular region when you request data for a region or location.\n\n## **Functions of the loader**\n\n- To start, it first filters out those nodes that are already tagged, leaving just those nodes that are within 2 kilometres of the target location. The following keys are removed during filtering:[\"nodes,\" \"geometry,\" \"members\"] from each node. The response we received is based on the tags and values we provided, so be sure to do that. The actions are covered below.\n\n## **Steps to find the suitable tag and values**\n\n1. Visit [Taginfo](taginfo.openstreetmap.org/tags). In essence, this website has all conceivable tags and values.\n2. Perform a search for the feature you're looking for, for instance, \"hospital\" will return three results: \"hospital\" as an amenity, \"hospital\" as a structure, and \"hospital\" as a healthcare facility.\n3. We may infer from the outcome that tag=amenity and value=hospital.\n4. Leave the values parameter to their default value if you do not need to filter.\n\n## **Usage**\n\nThe use case is here.\n\nLet's meet **Jayasree**, who is extracting map features from her neighbourhood using the OSM map loader.\nShe requires all the nodes, routes, and relations within a five-kilometer radius of her locale (Guduvanchery).\n\n- She must use the following arguments in order to accomplish the aforementioned. Localarea = \"Guduvanchery\" (the location she wants to seek), local_area_buffer = 5000 (5 km).\n\n### And the code snippet looks like\n\n```python\nfrom llama_index.readers.maps import OpenMap\n\nloader = MapReader()\ndocuments = loader.load_data(\n    localarea=\"Guduvanchery\",\n    search_tag=\"\",\n    tag_only=True,\n    local_area_buffer=5000,\n    tag_values=[\"\"],\n)\n```\n\n### Now she wants only the list hospitals around the location\n\n- so she search for hospital tag in the [Taginfo](https://taginfo.openstreetmap.org/tags) and she got\n\n```python\nfrom llama_index.readers.maps import OpenMap\n\nloader = MapReader()\ndocuments = loader.load_data(\n    localarea=\"Guduvanchery\",\n    search_tag=\"amenity\",\n    tag_only=True,\n    local_area_buffer=5000,\n    tag_values=[\"hospital\", \"clinic\"],\n)\n```\n\nThis loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index readers maps integration",
    "version": "0.2.0",
    "project_urls": null,
    "split_keywords": [
        "geo",
        " maps",
        " open maps",
        " open street maps",
        " overpass api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0e8a6f5cfac13f7aa33832b8d56eb7b28a17dae462065bd2b726c3fe321a53ee",
                "md5": "99e37b047ee3ec16e40f0cf8729112a9",
                "sha256": "d7f9110ac463d82af66878fdea45b67d6ea8801eb12c69bad0947c6fee15d07c"
            },
            "downloads": -1,
            "filename": "llama_index_readers_maps-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "99e37b047ee3ec16e40f0cf8729112a9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8.1",
            "size": 4307,
            "upload_time": "2024-08-22T06:33:19",
            "upload_time_iso_8601": "2024-08-22T06:33:19.275257Z",
            "url": "https://files.pythonhosted.org/packages/0e/8a/6f5cfac13f7aa33832b8d56eb7b28a17dae462065bd2b726c3fe321a53ee/llama_index_readers_maps-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dbc8c871be7c3c38151e53cc1fe5413924d4737615baf5536f531394dc0f7b03",
                "md5": "a6632f7598a687213438cf2b1b95c941",
                "sha256": "cbf0169311c498435f64fa9b4d11b14350b2bea2c34ece3252916703ee75a22f"
            },
            "downloads": -1,
            "filename": "llama_index_readers_maps-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a6632f7598a687213438cf2b1b95c941",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8.1",
            "size": 4105,
            "upload_time": "2024-08-22T06:33:20",
            "upload_time_iso_8601": "2024-08-22T06:33:20.448922Z",
            "url": "https://files.pythonhosted.org/packages/db/c8/c871be7c3c38151e53cc1fe5413924d4737615baf5536f531394dc0f7b03/llama_index_readers_maps-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-22 06:33:20",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-readers-maps"
}
        
Elapsed time: 0.30472s