llama-index readers maps integration
Project description
Osmmap Loader
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 import download_loader
MapReader = download_loader("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 import download_loader
MapReader = download_loader("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 and/or subsequently used as a Tool in a LangChain Agent. See here for examples.
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
Hashes for llama_index_readers_maps-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21ec032f11b63e60b39b6c922e2432da9aad33bb7631f43e85ee654a070db1dd |
|
MD5 | 8fd0607f19bc47c87d83458cf3ef7c31 |
|
BLAKE2b-256 | 29c50adaedffaf4e6cf1bd46a78ca118f6ca76dd3d625d772e02028f29c22e56 |
Hashes for llama_index_readers_maps-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bdfe30a16e1373cf8624a00ad6a4406a28204f2eb82e815386a9fe11ac796db |
|
MD5 | df8acd81c623ea03545773aede11e216 |
|
BLAKE2b-256 | 2f55aad1142c2c466686c97c13ececc7d5213c2210f0b096ae8564641f3e2992 |