Skip to content

Iceloof/PointInPolygon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PointInPolygon

Build Status Coverage Status PyPI PyPI - Downloads PyPI - Python Version PyPI - Wheel GitHub contributors GitHub issues GitHub Action GitHub

This package is used to check point inside/outside of polygon/multipolygon. It is supported polygon to array, convert multipolygon dataframe to polygon, find the min and max item in 2D array.

Install

pip install PointInPolygon

or

pip install --upgrade PointInPolygon

Usage

  • Import package
import PointInPolygon as pnp
  • Geometry Polygon to Array (skip steps to simplify the data and reduce the size of array, if it is multipolygon, it needs to convert to polygon first)
pnp.Geo2Array(geo, skip=0)
  • Convert df multipolygon to polygon (the column name should be geometry)
pnp.MultiPolygon2Polygon(df)
  • Check point in polygon (list or 2D tuple)
pnp.PointInPolygon(point, polygon)
  • Get min value from array based on index
pnp.minValue(array, index)
  • Get max value from array based on index
pnp.maxValue(array, index)