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.5.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_readers_maps-0.5.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llama_index_readers_maps-0.5.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_readers_maps-0.5.0.tar.gz
Algorithm Hash digest
SHA256 88551c418e838bb3ba29f5d622efc9934749335af83655fdee113e802c84bd1a
MD5 60823a46b00062349f8fa5af835fe259
BLAKE2b-256 fac469c1e67b58fe34a8f6e5f59a7590706313969cf6c58178530c67aade93e5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llama_index_readers_maps-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_readers_maps-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9da19355d4b3c81cfb00ace5724814d5ab40ef98aa462f5bc9371f851c6277dd
MD5 56b1f53b786fd04920d5ffd86efff8ea
BLAKE2b-256 0f57832879344ea33ff495ca898df4948be79d18753de0ebe1f36f9f0ee64f53

See more details on using hashes here.

Supported by

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