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.4.0.tar.gz (90.8 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.4.0-cp313-cp313-win_amd64.whl (358.7 kB view details)

Uploaded CPython 3.13Windows x86-64

movici_geo_query-1.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (646.5 kB view details)

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

movici_geo_query-1.4.0-cp313-cp313-macosx_11_0_arm64.whl (563.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

movici_geo_query-1.4.0-cp312-cp312-win_amd64.whl (358.7 kB view details)

Uploaded CPython 3.12Windows x86-64

movici_geo_query-1.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (646.4 kB view details)

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

movici_geo_query-1.4.0-cp312-cp312-macosx_11_0_arm64.whl (563.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

movici_geo_query-1.4.0-cp311-cp311-win_amd64.whl (356.7 kB view details)

Uploaded CPython 3.11Windows x86-64

movici_geo_query-1.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (644.0 kB view details)

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

movici_geo_query-1.4.0-cp311-cp311-macosx_11_0_arm64.whl (562.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

movici_geo_query-1.4.0-cp310-cp310-win_amd64.whl (356.3 kB view details)

Uploaded CPython 3.10Windows x86-64

movici_geo_query-1.4.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (642.7 kB view details)

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

movici_geo_query-1.4.0-cp310-cp310-macosx_11_0_arm64.whl (561.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for movici_geo_query-1.4.0.tar.gz
Algorithm Hash digest
SHA256 f32ffc796cb249d70ee5ebb019ef0eec121a29ccbd8dd90e1f01c79993f20596
MD5 71ae6a4e79458cb8a650f0e3204a1157
BLAKE2b-256 b582ec3dc2a8897b14baa4a669d96a49e9bef4fe3574dbc13e3baae8e4f26f07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for movici_geo_query-1.4.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 69690bf0a15274702616398c932a52bfb2436f396e0aa5a7e3ecc938defef898
MD5 a7a7266112c2a0ad69e2915c4d6ea044
BLAKE2b-256 1566ab4b38178296161a389cf363455750070642d1c0e52fe69c90fadb3f5758

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for movici_geo_query-1.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7ee5331400cb8e21941b974e407e2b738eb841145a2c0ff637bf3a29da259a3c
MD5 e35850002ea21881db33740e3241a261
BLAKE2b-256 4a645b177b98d01282734830531befecc3a43132ef45c9316d350476a25a4083

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for movici_geo_query-1.4.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6b8320ee2390eb67ba6bea9b0132af1d5404f5dbe58ac64473239c195d906840
MD5 19722d0b36737a2dfd00744e4d61e275
BLAKE2b-256 198d5ce5f4c2f8c3c797c13b585ce960e2116d285992186f7321b37b8d3d5e96

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for movici_geo_query-1.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7dc2b3c8487b7fa8c1442c6fc2761b5ab4fdf9d2f3437a3cb04d40eb5c7d1375
MD5 38301b861a7c563054c91f16f91f1ebc
BLAKE2b-256 af7b9973b165ed06bc6c6d1d34f71a22e72aeaf5fb2170d7ca68a540c4223caa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for movici_geo_query-1.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7a23a001c5e1fa4f2a097f483db24f5a371e2698eb01a1e92c1e3ec850a7ac9b
MD5 95a33ff797ce5155b4d064841173fe7e
BLAKE2b-256 7c31ce84786f4c3ea9dfc8e1280f685d41aff07c87456ba8f83b1ebcf8eab32c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for movici_geo_query-1.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2eae1f4db4d9eacece3c3707df2e2e8a228805d917d4b25c76b3511b1982c011
MD5 c65b4dc4cf6818406222d3376d982498
BLAKE2b-256 fd19954e3495cf2ccccd27df18f0b52016a046240ab501c3ae1ecb304eabb9eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for movici_geo_query-1.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fc5552819b6a402a20015447ac50f4042e905f7f77283d9647d5bbdda62bc238
MD5 0cbc2ad64b51bddbb32b2847cb8ebdf6
BLAKE2b-256 a078e740ff70a5684e7942d12ea3f83cc4eb2ac894ad0b0681882f3790993331

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for movici_geo_query-1.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b0db3a473736508dffc52085ad0f4e6a2099807d3194f3ca2c76828b972c6a3b
MD5 a35ec477275f803cd7543795c3d269c8
BLAKE2b-256 23ee016b3f1d96d4b24e11e5e2015183b5f50cdb5878c2a6f49aedcbb390e681

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for movici_geo_query-1.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 db3a82985aeac2c71e7b417dbca1f3c45a12102da06ab6245e41e4bb0c76bc89
MD5 7adca4c42df233fe4c3090abb8ec16dd
BLAKE2b-256 59f435bff01dd8d7bd7fa04f430cda236f383bce7f09a51c98ca0a581487399f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for movici_geo_query-1.4.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bc4171f418d0f0f82649e1428a490530decd517b429f142ece254479151ea997
MD5 f1feadfde783b4d665f6e0c21e568348
BLAKE2b-256 9cd8872c8f27f563f04aaca7230518452c245c52a158334338caf051ba1fd5a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for movici_geo_query-1.4.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d3d23ffae2c0db971b73a495f7e6def94e627755f2b4fbf24bc8ffdeaa6cad13
MD5 ae33541a8bead9c3105c92afea2f811a
BLAKE2b-256 79550477d635f71782cd181be979813f65a227bd54cb843599725a2e46828b70

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for movici_geo_query-1.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 506903f2f85474addd35ece9c0e15d8decd233ce6df53c06917d6213dc9fb435
MD5 56778361f831ae3c836a0da5618ff28d
BLAKE2b-256 efc982f916b806b033c48f90cfd80480981e5bb7cb74a2d26bac38525ef2b992

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