Tech

有时,我们无法直接获取某些地理数据的精确位置信息,仅能从网络中下载他人的地图作品。因而,我请教了一名规划师同学,参考网络图像,通过适配地理范围,手工获取其实际地理属性。本文以我国集中采暖南北分界线的绘制为例,简述QGIS软件的具体实现步骤。

Read More

Sometimes, we need to clip or extract the raster image with polygon features, e.g., only focus on the percipitation within China using global dataset. This post will introduce two methods to mask the 2-d array-like dataset by a specific geometry using Python.

  • The first method use GeoPandas module to test those raster coordidnates within/out of the shapefile
  • The second method which I strongly recommended with faster speed was based on shapely module.

Read More

Welcome to my collection of Python scripts and code snippets for everyday use. This document contains a variety of scripts and code snippets that can be used to automate repetitive tasks, process data, and perform various other operations. Whether you are a beginner or an experienced Python programmer, this collection of scripts and code snippets will provide you with useful tools and shortcuts for your everyday work.

In this document, you will find code snippets and scripts for tasks such as:

  • Data processing
  • File manipulation
  • Web scraping
  • Automating tasks
  • And more!

This document is organized into sections for easy navigation, so you can quickly find the script or code snippet that you need. Many of them were collected from stackoverflow.

On 2022.03.31, I re-organize all the scripts into Python 3.x version and post again.
On 2023.02.12, I edited the whole content with help from ChatGPT

Read More

网络中有丰富的地理信息数据资源,此处介绍我采用Python工具实现地形地貌、行政区划、城市交通路网等数据获取及可视化的部分实例,供大家参考学习。

Read More

Jupyter(即原来的Ipython Notebook Project)基于Web端的实时交互,拥有着极佳的用户体验。同时,Jupyter体系可直接使用其他语言,用户呢能够在同一界面下调用R内核或Python内核(共支持49种),功能十分强大。
在Mac OS下尝试在Jupyter中添加R语言内核,遇到了一些问题,在此记录个人安装过程和诸问题的解决方法。

STEP1 基本软件准备

  • Python和IPython.作为初学者,我直接安装了Python的科学计算发行版Anaconda,其包含了Python2.7并内置很多有用的Package(numpy, SciPy, Matplotlib),Jupyter(Ipython Notebook)以及Spyder(个人感觉类似于R studio的集成开发环境)
  • R 3.2.1(World-Famous Astronaut),官网下载安装即可。

STEP2 有关库的安装

主要工作是为R语言添加IRkernal这一新的Package, 以实现Jupyter对R语言的支持。主要的步骤如下(依照IRkernal的README文档):

Read More

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×