Getting Started | Issues | Contribute | Citation | Authors
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:
- Transportation (Yan, Yuchen, et al. (2024))
- Housing Submarkets (Liu, Xinrui, et al. (2021))
- Culture (Zhang, Haiping, et al. (2021))
- Ecology (Qian, Chunhua, et al. (2021))
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.
We recommend starting your GeoHD journey with the documentation.
The package is available in PyPi and requires Python 3.11 or higher. It can be installed using:
$ pip install GeoHD
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)
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.
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
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
- Yuchen Yan