Skip to main content

This python 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.

Project description

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)

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

PointInPolygon-1.0.2.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

PointInPolygon-1.0.2-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

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