Skip to main content

地理建模与可视化工具库

Project description

GeoModelingZ

这是一个地理建模与可视化工具库,专为Jupyter Notebook环境优化,提供了丰富的交互式地理数据可视化功能。

主要功能

  • 环境检测: 自动检测Jupyter Notebook环境
  • 交互式图表: 支持matplotlib交互式图表绘制
  • 地理地图可视化: 强大的交互式地理地图功能
  • GeoJSON支持: 完整支持GeoJSON数据格式
  • 多几何类型: 支持点、线、多边形和Multi类型几何数据
  • 自动聚焦: 智能聚焦到数据区域
  • 多底图支持: 支持Mapbox和OpenStreetMap等多种底图

安装

基本安装

pip install GeoModelingZ

安装Jupyter支持(推荐)

pip install GeoModelingZ[jupyter]

使用方法

环境检测

from GeoModelingZ import is_jupyter

# 检查是否在Jupyter环境中运行
if is_jupyter():
    print("当前在Jupyter环境中运行")
else:
    print("当前在普通Python环境中运行")

交互式图表

from GeoModelingZ import plot_simple_chart

# 创建简单的交互式图表
fig = plot_simple_chart(title="我的图表")

# 在Jupyter环境中,可以交互调整参数
# 在普通环境中,返回matplotlib图表对象

地理地图可视化

from GeoModelingZ import create_geo_map

# 创建基本地图
map_obj = create_geo_map(
    width=1000, 
    height=700,
    center=[39.9042, 116.4074],  # 北京坐标
    zoom_start=10
)

# 加载GeoJSON数据
map_with_data = create_geo_map(
    geojson_file="path/to/your/data.geojson",
    mapbox_token="your_mapbox_token",  # 可选
)

# 显示地图(在Jupyter中)
map_with_data

支持的GeoJSON几何类型

  • Point: 单点数据
  • MultiPoint: 多点数据
  • LineString: 线数据
  • MultiLineString: 多线数据
  • Polygon: 多边形数据
  • MultiPolygon: 复杂多边形数据

底图类型

  • streets: 矢量街道地图(默认)
  • satellite: 卫星影像地图
  • outdoors: 地形图
  • light: 浅色底图
  • dark: 深色底图
  • OpenStreetMap: 开源街道地图

依赖

  • Python >= 3.6
  • numpy
  • matplotlib
  • ipython
  • folium

可选依赖(用于Jupyter功能)

  • ipywidgets >= 7.0.0
  • jupyterlab_widgets

更新日志

v0.0.4

  • 重构代码结构,移除冗余功能
  • 专注于地理数据可视化核心功能
  • 优化GeoJSON数据处理逻辑
  • 改进地图渲染性能
  • 增强错误处理和调试信息

v0.0.3

  • 修改了可视化地图的渲染样式
  • 优化了GeoJSON数据处理

v0.0.2

  • 添加了交互式地理地图功能 (create_geo_map)
  • 支持GeoJSON数据的可视化
  • 支持点、线、多边形和Multi类型几何数据
  • 自动聚焦到数据区域

v0.0.1

  • 初始版本发布
  • 基本功能实现

贡献

欢迎提交Issue和Pull Request来改进这个库!

许可证

MIT License

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

geomodelingz-0.0.4.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geomodelingz-0.0.4-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file geomodelingz-0.0.4.tar.gz.

File metadata

  • Download URL: geomodelingz-0.0.4.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for geomodelingz-0.0.4.tar.gz
Algorithm Hash digest
SHA256 9deb7b30942e31f1a1be82c3efb24f0c68fb8c416ec8f3f101e29f4a1b7b4509
MD5 65a47d1732b013f24b4234012ab35292
BLAKE2b-256 e5a43601a44a6c09838a4ec3ccf7ae2e61c2a77fcd06bed44220e330ee632849

See more details on using hashes here.

File details

Details for the file geomodelingz-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: geomodelingz-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for geomodelingz-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7dc58ab3d2ee9927b45b622a020ee83d5b7b682fd87e72cd7451e1e19f4716e9
MD5 3c914fbc70b0a4822903fb6c339405de
BLAKE2b-256 ebbae6a4bb7db131109c49b0b30d676ead2b0a6ced790544bb765d6b0f2f4e98

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page