Skip to content

Commit

Permalink
add doc
Browse files Browse the repository at this point in the history
  • Loading branch information
yan-yuchen committed Apr 11, 2024
1 parent 01fb935 commit 67f24e7
Show file tree
Hide file tree
Showing 20 changed files with 136 additions and 659 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
main.ipynb
.pypirc
test_local/
doc/build

651 changes: 0 additions & 651 deletions GeoHD/clustering.py

This file was deleted.

16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ visualize_shapefile('data.shp', output_image_path='custom_image.png')
```

<p align="center">
<img src="./doc/1.png" width="400" height="300"/>
<img src="./picture/1.png" width="400" height="300"/>
</p>


Expand All @@ -51,7 +51,7 @@ plot_g_function('data.shp')
```

<p align="center">
<img src="./doc/2.png" width="400" height="300"/>
<img src="./picture/2.png" width="400" height="300"/>
</p>

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.
Expand All @@ -64,13 +64,13 @@ create_hexagonal_heatmap(area_file, crash_file)
```

<p align="center">
<img src="./doc/3.png" width="400" height="300"/>
<img src="./doc/4.png" width="400" height="300"/>
<img src="./picture/3.png" width="400" height="300"/>
<img src="./picture/4.png" width="400" height="300"/>
</p>

<p align="center">
<img src="./doc/5.png" width="400" height="300"/>
<img src="./doc/6.png" width="400" height="300"/>
<img src="./picture/5.png" width="400" height="300"/>
<img src="./picture/6.png" width="400" height="300"/>
</p>

Realization of kernel density analysis with fixed bandwidth:
Expand All @@ -87,7 +87,7 @@ adaptiveKDE(shp_file,output_data_path)
```

<p align="center">
<img src="./doc/8.png" width="400" height="300"/>
<img src="./picture/8.png" width="400" height="300"/>
</p>


Expand All @@ -99,7 +99,7 @@ visualize_hotspots(np.load(density_data_path), hotspots)
```

<p align="center">
<img src="./doc/9.png" width="400" height="300"/>
<img src="./picture/9.png" width="400" height="300"/>
</p>


Expand Down
20 changes: 20 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
1 change: 1 addition & 0 deletions doc/source/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# API Reference
1 change: 1 addition & 0 deletions doc/source/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog
28 changes: 28 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'GeoHD'
copyright = '2024, Yuchen Yan'
author = 'Yuchen Yan'
release = 'v0.2.4'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ["myst_parser"]

templates_path = ['_templates']
exclude_patterns = []



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
1 change: 1 addition & 0 deletions doc/source/getting_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Getting started
40 changes: 40 additions & 0 deletions doc/source/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# GeoHD

![python](https://img.shields.io/badge/python-3.11-black)
![GitHub release](https://img.shields.io/badge/release-v0.2.4-blue)
![pypi](https://img.shields.io/badge/pypi-v0.2.4-orange)
![license](https://img.shields.io/badge/license-GNU%20AGPLv3-green)


## 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:

* Transportation ([Yan, Yuchen, et al. (2024)](https://doi.org/10.1111/tgis.13137))
* Housing Submarkets ([Liu, Xinrui, et al. (2021)](https://doi.org/10.1155/2022/2948352))
* Culture ([Zhang, Haiping, et al. (2021)](https://doi.org/10.1111/tgis.12682))
* Ecology ([Qian, Chunhua, et al. (2021)](https://doi.org/10.1177/15501477211039137))

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.


## Install with pip

The package is available in PyPi and requires [Python 3.11](https://www.python.org/downloads/) or higher. It can be installed using:

```bash
$ pip install GeoHD
```


```{toctree}
---
maxdepth: 2
caption: Documentation
hidden: true
---
installation
getting_started
api
changelog
GitHub <https://github.com/yan-yuchen/GeoHD>
```
1 change: 1 addition & 0 deletions doc/source/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Installation
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit 67f24e7

Please sign in to comment.