Skip to main content

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

  1. Visit Taginfo. 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

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

llama_index_readers_maps-0.2.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

llama_index_readers_maps-0.2.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_readers_maps-0.2.0.tar.gz.

File metadata

  • Download URL: llama_index_readers_maps-0.2.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0

File hashes

Hashes for llama_index_readers_maps-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cbf0169311c498435f64fa9b4d11b14350b2bea2c34ece3252916703ee75a22f
MD5 a6632f7598a687213438cf2b1b95c941
BLAKE2b-256 dbc8c871be7c3c38151e53cc1fe5413924d4737615baf5536f531394dc0f7b03

See more details on using hashes here.

File details

Details for the file llama_index_readers_maps-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_maps-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7f9110ac463d82af66878fdea45b67d6ea8801eb12c69bad0947c6fee15d07c
MD5 99e37b047ee3ec16e40f0cf8729112a9
BLAKE2b-256 0e8a6f5cfac13f7aa33832b8d56eb7b28a17dae462065bd2b726c3fe321a53ee

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page