Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Twista/python-polylabel

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python-Polylabel

Port of polylabel library from MapBox

Official repo: https://github.com/mapbox/polylabel Article - https://www.mapbox.com/blog/polygon-center/

Requirements

Python2.7+ or Python3+

Installation

pip install python-polylabel

Usage

from polylabel import polylabel

polylabel([[[0, 0], [1, 0], [2, 0], [0, 0]]])  # [0, 0]

polylabel([[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]], with_distance=True)  # ([0.5, 0.5], 0.5)

Changelog

0.6

  • fix problem with Queue on windows (support comparison on Cell class) #5

0.5

  • add support for floats in polygon

0.4

  • with_distance parameter, returns also distance

0.3

  • python2 support

About

Port of MapBox's polylabel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
Morty Proxy This is a proxified and sanitized view of the page, visit original site.