Skip to main content

macroneighborhoods

macroneighborhoods is a research-oriented Python package for constructing larger spatial regions, called macro-neighborhoods, from georeferenced observations.

The package generates local micro-neighborhoods, determines spatial adjacency, and merges neighboring regions based on feature similarity. It can also compute spatial autocorrelation outputs using Global Moran's I and Local Indicators of Spatial Association (LISA).

The package is intended to support reproducible research workflows in geospatial data mining, environmental informatics, remote sensing, climate analysis, urban analytics, and related fields.

Why use macro-neighborhoods?

Spatial datasets often contain many point observations, grid cells, or small local regions. Although these fine-scale units preserve detail, they can be difficult to analyze and interpret collectively.

macroneighborhoods helps organize these units into larger, spatially connected regions that reflect both geographic adjacency and similarity in selected attributes.

Main capabilities

  • Generate Voronoi-based micro-neighborhoods from spatial observations
  • Determine spatial adjacency among local regions
  • Compare neighboring regions using selected feature variables
  • Merge adjacent and similar micro-neighborhoods into macro-neighborhoods
  • Export reusable GeoJSON files
  • Generate PNG maps for visual inspection
  • Optionally compute Global Moran's I
  • Optionally generate LISA cluster outputs for a selected feature

Installation

Install the package from PyPI:

pip install macroneighborhoods

For local development from the project repository:

pip install -e .

Command-line usage

Display the available command-line options:

macro-nbds --help

A general command follows this structure:

macro-nbds \
  --input path/to/input_data.parquet \
  --output path/to/output_macro_neighborhoods.geojson \
  --lisa-feature feature_name

Replace the input path, output path, and feature name with values appropriate for your dataset.

Repository demonstration

When working from the project repository, the included satellite snowmelt demonstration can be run using:

macro-nbds \
  --input demo_data/SATELLITE_with_smlt.parquet \
  --output outputs/live_satellite_snowmelt_demo.geojson \
  --lisa-feature smlt

Outputs

Depending on the selected options, the package can produce:

  • a micro-neighborhood map and GeoJSON file;
  • a macro-neighborhood map and GeoJSON file;
  • a LISA cluster map and GeoJSON file when a feature is specified;
  • spatial autocorrelation statistics for the selected feature.

PNG outputs support quick visual inspection. GeoJSON outputs can be opened in QGIS, ArcGIS, GeoPandas, or other geospatial analysis environments.

Research and reproducibility

The resulting macro-neighborhoods depend on the input data, coordinate reference system, selected feature variables, preprocessing decisions, and similarity settings.

Researchers should document these choices when reporting results so that the analysis can be interpreted and reproduced.

Citation

When using this package in academic research, please cite:

  • the macroneighborhoods package;
  • the specific software version used;
  • the associated publication or archived software record, when available.

Development status

macroneighborhoods is early-stage research software and is under active development.

Version 0.0.2 improves the package documentation and PyPI metadata. Future development may include additional tests, expanded examples, threshold sensitivity summaries, and broader documentation.

Metadata

Release files for macroneighborhoods 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for macroneighborhoods 0.0.2
File Size Uploaded
macroneighborhoods-0.0.2.tar.gz 6.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for macroneighborhoods 0.0.2
File Interpreter ABI Platform
macroneighborhoods-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 14.0 kB

Release files / macroneighborhoods-0.0.2.tar.gz

Download URL macroneighborhoods-0.0.2.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9f1d6459f3b09a564b981c4b7d91661162e0d475255557766213691f3df9408b
BLAKE2b-256 checksum
How to use checksums
4dd88fc8de46a6512b1a43c25e51f561eb5496527897131b9ee732903e79e424
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.4

Release files / macroneighborhoods-0.0.2-py3-none-any.whl

Download URL macroneighborhoods-0.0.2-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
455c126b8a6bf164a4ec90e9ed96f6eb8a2cd1f8ea6d5ce0233f9dec036c72fc
BLAKE2b-256 checksum
How to use checksums
114d3d4696958ba28ba937e309f0361fa63d65d920816923c6377ccb16e98283
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page