Skip to main content

A Python toolkit for geospatial hotspot detection, Avisualization, and analysis using urban data

Project description

GeoHD

python GitHub release pypi license

Getting Started | Issues | Contribute | Citation | Authors

What is GeoHD?

GeoHD is a Python toolkit for geospatial hotspot detection, visualization, and analysis using urban data. Density-based hotspot detection is an important theory and method in urban research, which realizes the extraction of local research hotspots by combining density analysis and raster algebra. It has been widely used in different fields such as transportation, culture, climate, ecology and so on:

The main functions of GeoHD are fast visualization and hotspot detection based on geospatial point data, and it realizes fixed-bandwidth hotspot detection with adjustable parameters and adaptive-bandwidth hotspot detection. In addition, GeoHD provides spatial point pattern distribution analysis such as Ripley G-function calculation and fast comparison image drawing.

Getting Started

Documentation

We recommend starting your GeoHD journey with the documentation.

Install with pip

The package is available in PyPi and requires Python 3.11 or higher. It can be installed using:

$ pip install GeoHD

Usage

A case-testing approach:

$ cd test
$ python -m test_automation

You can also run test.ipynb in jupyter notebook

Visualization of hotspots on real maps:

visualize_shapefile('data.shp', output_image_path='custom_image.png')

Analytic Plane Point Patterns: Ripley G, Ripley F, Ripley J, Ripley K, Ripley L, etc. through the plotting function.

plot_g_function('data.shp')

The study area was divided into a quadrilateral (hexagonal) grid and fast visualization was achieved based on the density of point data within the divided area.

create_cell_zones(area_file, crash_file)
create_hex_grid_zones(area_file, crash_file)
create_cell_heatmap(area_file, crash_file)
create_hexagonal_heatmap(area_file, crash_file)

Realization of kernel density analysis with fixed bandwidth:

density_raster = process_shapefile(input_file_path)
plot_density_raster(density_raster,output_data_path, *gpd.read_file(input_file_path).total_bounds)

Kernel density analysis for realizing adaptive bandwidth:

adaptiveKDE(shp_file,output_data_path)

Hotspot Identification:

hotspots = extract_hotspots(density_data_path)
visualize_hotspots(np.load(density_data_path), hotspots)

Issues

If you encounter any bugs or problems with GeoHD, please create a post using our package issue tracker. Please provide a clear and concise description of the problem, with images or code-snippets where appropriate. We will do our best to address these problems as fast and efficiently as possible.

Contribute

The authors of the GeoHD package welcome external contributions to the source code. This process will be easiest if users adhere to the contribution policy:

  • Open an issue on the package issue tracker clearly describing your intentions on code modifications or additions
  • Ensure your modifications or additions adhere to the existing standard of the GeoHD package, specifically detailed documentation for new methods (see existing methods for example documentation)
  • Test your modifications to ensure that the core functionality of the package has not been altered by running the unit tests
  • Once the issue has been discussed with a package author, you may open a pull request containing your modifications

Citation

Yan, Y., 2024. GeoHD: A Python Toolkit for Geospatial Hotspot Detection, Visualization, and Analysis. SSRN Electron. J. https://doi.org/10.2139/ssrn.4799686

Yan, Y., Quan, W., Wang, H., 2024. A data‐driven adaptive geospatial hotspot detection approach in smart cities. Trans. GIS tgis.13137. https://doi.org/10.1111/tgis.13137

Authors

  • Yuchen Yan

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

geohd-0.2.7.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

GeoHD-0.2.7-py3-none-any.whl (34.4 kB view details)

Uploaded Python 3

File details

Details for the file geohd-0.2.7.tar.gz.

File metadata

  • Download URL: geohd-0.2.7.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.13

File hashes

Hashes for geohd-0.2.7.tar.gz
Algorithm Hash digest
SHA256 c9c8ca2378ed81c32869a4aad17a8ce09198ca96ed69d8537809c86e52ccd451
MD5 c2d3f44289f0ffb9a91bf4b208395ed8
BLAKE2b-256 59d164a104ba271767afb4425a68192035f4c5b515daa2b1ffcbe6e8fb37b927

See more details on using hashes here.

File details

Details for the file GeoHD-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: GeoHD-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 34.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.13

File hashes

Hashes for GeoHD-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 56ecd12c7561ec167c56d704a1100993f0263815041e0067a72721c420ca7ab8
MD5 47b6f7e3c5a16cb2816b85a2ec1ab715
BLAKE2b-256 2f7ad43ed2294cb50fff7a5cc981918d4ad6eb4a75adfc2335af84fdf8230633

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