Giter Club home page Giter Club logo

spatbox's Introduction

SpatBox

A Python Library For GeoSpatial Data Proressing and Modeling!

Now it only consists of few tools, we will maintain it and add more geospatial-propressing-tools!

How to install spatbox in your own PC?

We recommend to use the conda to install SpatBox

First, install the anaconda / miniconda in your own computer.

Go to anaconda or miniconda to

download the conda; you can also see my zhihu-blog miniconda安装

Second, create a conda env and install the dependence of SpatBox.

Open the "Anaconda Prompt" and input the code conda create -n spat-env python=3.9, then enter,

After that, activate the conda-env you have created, use conda activate spat-env, and you will get in the "spat-env" conda-env

Then we install the mamba package to get a rapid installation:

conda install -c conda-forge mamba

(if you are in China, you can use conda install mamba -c https://mirrors.sustech.edu.cn/anaconda/cloud/conda-forge)

The SpatBox Library depends on GDAL;Geopandas;rasterio..... , all of the dependence are include in pysal's dependence,

you can use mamba install -c conda-forge pysal to get all of the spatbox dependence installed.

(if you are in China, you can use mamba install pysal -c https://mirrors.sustech.edu.cn/anaconda/cloud/conda-forge)

Finally, install SpatBox.

Input the code pip install spatbox in your "spat-env" conda-env,

(if you are in China, you can use pip install spatbox -i https://pypi.douban.com/simple)

Check Whether the spatbox can work?

Open the Jupyter Notebook or VSCode, run:

import spatbox as stx
import geopandas as gpd
import matplotlib.pyplot as plt  

lp = gpd.read_file(stx.utils.get_path('lp'))

stx.make_grid(inputfile=stx.utils.get_path('lp'),
              outfile='square',
              gridsize=10000,
              square=True)

lp_square = gpd.read_file('square')
fig, ax = plt.subplots(1,1, figsize=(12,9))
lp_square.plot(ax=ax, fc='w', ec='grey') 
lp.plot(ax=ax, fc='none', ec='r')

stx.make_grid(inputfile=stx.utils.get_path('lp'),
              outfile='honeycomb',
              gridsize=10000,
              square=False)

lp_honeycomb = gpd.read_file('honeycomb')
fig, ax = plt.subplots(1,1, figsize=(12,9))
lp_honeycomb.plot(ax=ax, fc='w', ec='grey') 
lp.plot(ax=ax, fc='none', ec='r')

spatbox's People

Contributors

spatlyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

yilvzhishi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.