llama-index readers maps integration
Project description
Osmmap Loader
pip install llama-index-readers-maps
The Osmmap Loader will fetch map data from the Overpass 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
- Visit Taginfo. In essence, this website has all conceivable tags and values.
- 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.
- We may infer from the outcome that tag=amenity and value=hospital.
- 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
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 and she got
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file llama_index_readers_maps-0.3.0.tar.gz
.
File metadata
- Download URL: llama_index_readers_maps-0.3.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 725d27214a911949e881d47037f89978aaa5f828eaab5f7a1bd290f81c7dcdf5 |
|
MD5 | 4fd70ffd678561cac87835bd44045d1f |
|
BLAKE2b-256 | d070f140c55937a055cfde1f34eb5647f5bdae8fd57af8b9aaaeab1a5cff7154 |
File details
Details for the file llama_index_readers_maps-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_readers_maps-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c03a15c24ba89d712e8f9ea28eaeea518fa869fda41d70e4ea28aaa4aa9c55b2 |
|
MD5 | b3bd07d920998d0c5efd7a9bf1b1a951 |
|
BLAKE2b-256 | 6330a69101c1a234c07c4520cb69a66ac40418f3613aa07dc571906f23928088 |