Geographical detectors for measuring spatial stratified heterogeneity, as described in Jinfeng Wang (2010) <doi:10.1080/13658810802443457> and Jinfeng Wang (2016) <doi:10.1016/j.ecolind.2016.02.052>. Includes the optimal discretization of continuous data, four primary functions of geographical detectors, comparison of size effects of spatial unit and the visualizations of results. The descriptions of the package, methods and case datasets refer to the citation information below.