Skip to main content

Geospatial queries powered by Boost Geom

Project description

Movici Geo Query is a library for creating geospatial indexes (rtrees) and querying those trees. It is targeted and optimized to work together with other Movici libaries. It works natively with numpy arrays, where multi-point geometries (such as linestrings and polygons) are accepted using Movici’s csr format.

Getting Started

import numpy as np
from movici_geo_query import GeoQuery, PointGeometry

points_a = PointGeometry(np.array([[0, 1], [0.5, 1]]))
points_b = PointGeometry(np.array([[0.6, 0.9]]))

gq = GeoQuery(points_a)


result = gq.nearest_to(points_b)

# for each point in point_b, gq.nearest returns the index of the nearest point in points_a. The
# result will have the same length as points_b and contains indexes to the points_a array

print(result.indices) # np.array([1])

Installation

Movici Geo Query binary wheels are currently available for Linux (manylinux) and Windows. There are currently no concrete plans for Mac builds. If you’d like to have macos binaries, please create an issue for it. Installation can be done using pip install movici-geo-query

Building from source

Building from source requires a C compiler that supports C++17, such as Clang>=5. To build movici-geo-query from source you also need a version of Boost.geometry that contains the boost::geometry::index::rtree headers (eg. boost > 1.74.0). These can be installed using your favorite package manager, downloaded from the Boost website, or taken directly from GitHub. When downloading manually, make sure the boost header files can be found by pip by placing them in pythons include directory:

BOOST_VERSION=1.89.0
INCLUDE_DIR=$(python3 -c "import sysconfig as sc; print(sc.get_paths()['include'])")
TMP_DIR=/tmp/boost_geometry
mkdir -p ${TMP_DIR}
git clone --depth 1 --branch boost-${BOOST_VERSION} https://github.com/boostorg/geometry.git ${TMP_DIR}
cp ${TMP_DIR}/include/boost ${INCLUDE_DIR}

Now you can clone, compile and install from source:

git clone https://github.com/nginfra/movici-geo-query.git
pip3 install movici-geo-query/

To specify a compiler, use the CC environment variable:

CC=g++7 pip install movici-geo-query/

Developing Movici Geo Query

Developing Movici Geo Query assumes you’re developing on Linux using a modern C++ compiler that support C++17, such as Clang>=5. We have tests both in C++ and in Python. Supported Python versions are 3.8 and higher. It also requires Boost.geometry (see Building from source)

# install the package in editable mode with dev dependencies
pip install -e ".[dev]"

# run the c test suite
mkdir build
cd build
cmake ..
make -j
./test
cd ..

# run the python test suite
pytest tests/python

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

movici_geo_query-1.5.0.tar.gz (91.1 kB view details)

Uploaded Source

Built Distributions

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

movici_geo_query-1.5.0-cp314-cp314-win_amd64.whl (497.7 kB view details)

Uploaded CPython 3.14Windows x86-64

movici_geo_query-1.5.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (649.1 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

movici_geo_query-1.5.0-cp314-cp314-macosx_11_0_arm64.whl (571.2 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

movici_geo_query-1.5.0-cp313-cp313-win_amd64.whl (482.9 kB view details)

Uploaded CPython 3.13Windows x86-64

movici_geo_query-1.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (648.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

movici_geo_query-1.5.0-cp313-cp313-macosx_11_0_arm64.whl (570.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

movici_geo_query-1.5.0-cp312-cp312-win_amd64.whl (482.9 kB view details)

Uploaded CPython 3.12Windows x86-64

movici_geo_query-1.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (649.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

movici_geo_query-1.5.0-cp312-cp312-macosx_11_0_arm64.whl (570.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

movici_geo_query-1.5.0-cp311-cp311-win_amd64.whl (480.5 kB view details)

Uploaded CPython 3.11Windows x86-64

movici_geo_query-1.5.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (648.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

movici_geo_query-1.5.0-cp311-cp311-macosx_11_0_arm64.whl (569.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

movici_geo_query-1.5.0-cp310-cp310-win_amd64.whl (479.4 kB view details)

Uploaded CPython 3.10Windows x86-64

movici_geo_query-1.5.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (647.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

movici_geo_query-1.5.0-cp310-cp310-macosx_11_0_arm64.whl (568.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file movici_geo_query-1.5.0.tar.gz.

File metadata

  • Download URL: movici_geo_query-1.5.0.tar.gz
  • Upload date:
  • Size: 91.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for movici_geo_query-1.5.0.tar.gz
Algorithm Hash digest
SHA256 803652ad48ce752b4b17553c735dd2a921ca2dbf5341179e5fb978483bd07434
MD5 204d015cb459b9e93d4694466e489b22
BLAKE2b-256 73b7e3198206c46d05b5ee468e253d41bb00e2b0b9636434a2a5c3e15ad60f33

See more details on using hashes here.

File details

Details for the file movici_geo_query-1.5.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for movici_geo_query-1.5.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 3b6577c972ca84234ce3644c5bded4980b1d65f7c091b7c3c09d2ec704e58fb3
MD5 c8f841424305f6e51693c49846aeaf3d
BLAKE2b-256 c78213f28ad1df61b30a2b9b5261910805639f71cfcd8d63cf129f5e8e91976b

See more details on using hashes here.

File details

Details for the file movici_geo_query-1.5.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for movici_geo_query-1.5.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6a9d4e7f0457f2e8b2e129cabfdb42007603ad30c7fd3eefac43a9f27894d4f9
MD5 74f6e1d3b7ac85fa98697bacf5727771
BLAKE2b-256 7c8d2ffc0b043d5da65577dd30925b7644f01d0c1ac13f9e9aba11a37115aa05

See more details on using hashes here.

File details

Details for the file movici_geo_query-1.5.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for movici_geo_query-1.5.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2333ba67710e1d968d16c291eddebe3033e4dc05a053c2b1961b4ff6323f2457
MD5 0bf986d97ca83df8de0e07a748ec46e9
BLAKE2b-256 d4ca9489c6bb10ea80479eaf93b5e39b1087935b7fbedf6c36aeef8ec3979af5

See more details on using hashes here.

File details

Details for the file movici_geo_query-1.5.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for movici_geo_query-1.5.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b43a2424e5dca32fe15ede24c3da0222a8924636f243c98b2077fe5f06497d47
MD5 d6dde86de36a2b0a781934f7b597091e
BLAKE2b-256 bd540a665fb52551f5be5083fec49bc25450f74bb729d2e989a4365353fd8484

See more details on using hashes here.

File details

Details for the file movici_geo_query-1.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for movici_geo_query-1.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e2507de1f9563ad4fc261b326ad794f8cb2bb011bb30264a3af0b40cec2248b0
MD5 f2e491e8d3b8e9570956f0afbae4f286
BLAKE2b-256 b9b0e275be45ac212d6515f050ec6e8b04d22d8cf28f781a52f734c6a6742572

See more details on using hashes here.

File details

Details for the file movici_geo_query-1.5.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for movici_geo_query-1.5.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 910785df28726a981bcd14c209ea3fff6442cddc0146d1186d3fc6809a678d93
MD5 eaae4b54ebaabb6d34bfcb4217b1fc2a
BLAKE2b-256 a61e50109a614d7a91beac9c38b3c3bf0109bc66e347ba2995761a7d86e5ea14

See more details on using hashes here.

File details

Details for the file movici_geo_query-1.5.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for movici_geo_query-1.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1b5085e14c9afd821f8eaef3fc7b26981d338f3298b7a13b1676b22a2acb33ac
MD5 521e75f84f26f56960b16c1686d1a174
BLAKE2b-256 36ffc1e9bab62e1f0934cd536d602488e1a9868e213b928588a709553f200ac0

See more details on using hashes here.

File details

Details for the file movici_geo_query-1.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for movici_geo_query-1.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c4d122dc9e76d63d1a6143ba68b7ace2df401ad789fe345719038b732059c328
MD5 b501ecd8df103d53692588380172a522
BLAKE2b-256 32ed4673a5e96026004df468bffc0c83593f01de772a87329860640e95981668

See more details on using hashes here.

File details

Details for the file movici_geo_query-1.5.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for movici_geo_query-1.5.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34f784deb9cfa0003bd52351d05fadc87025f3c56379ae432312a088637ffd94
MD5 2c94ebf5c0d029355e5127d116fc49d5
BLAKE2b-256 c70e19b085fd637d81801b9605ae27fe62c5e8ca2ebb5e066a1c2ee79f85efa1

See more details on using hashes here.

File details

Details for the file movici_geo_query-1.5.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for movici_geo_query-1.5.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 04e6d0f864ba074590c83caadf59086ba0039ba3800bb059707a5150badc446b
MD5 0b112c4c4389455decf052f022f47119
BLAKE2b-256 7b4f5d839a0fbb60be5251fb7675b3053b2055733d89dae9777d25d7f0991994

See more details on using hashes here.

File details

Details for the file movici_geo_query-1.5.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for movici_geo_query-1.5.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 006c43578620c7ead07c6db8044fcfdb8709f0b0b2921eedbf2073a9103b8afc
MD5 f73390e858b5676dc5f63eeac35f572c
BLAKE2b-256 1e5376aa51fd64632121a90a80d2aa63dd0d076cdfe5183b285971d3fbdc6c55

See more details on using hashes here.

File details

Details for the file movici_geo_query-1.5.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for movici_geo_query-1.5.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 397c0d63166d81321189d79b3892ee9eaa961c17d77dfd7e74aa506074d409bc
MD5 ee93003fb7af37d9ccae8f2b1d027ca8
BLAKE2b-256 a6c53c6500dcc70fbaa59d9a04fe652eb7c8c5580e60527ce60b56c87c01d485

See more details on using hashes here.

File details

Details for the file movici_geo_query-1.5.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for movici_geo_query-1.5.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 705243f1dafcc4671d2d82ea9f59b7de306e82735a3c7211a8ee4fdac2910a34
MD5 95acda38b8e43dc20164363cddfd07ca
BLAKE2b-256 a19079b3c6c1923b81808342b405d9273824fa7953e4f67fda993bcad8478ea5

See more details on using hashes here.

File details

Details for the file movici_geo_query-1.5.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for movici_geo_query-1.5.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 33df67cc1cdd5be8ef17791262cfdd0630f8c0296916f5d4c21ce010bd8a657f
MD5 22706dfd2b7a7f93adaece9a396564d5
BLAKE2b-256 99065041c50f9661450af2d5338c1cbfe2b9ee96748e8052aa31f47c76494478

See more details on using hashes here.

File details

Details for the file movici_geo_query-1.5.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for movici_geo_query-1.5.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 274a30d4e1e851acd5a81731a6892d6dca839a80ab2a6750def1a5a104366f10
MD5 978de66fafa0a40f04a56c266b82d84f
BLAKE2b-256 a643dc7688511c5bc6f217bc679724718e1fd40a2c6b62d97ebfe2c9bcf55dd2

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