Polylabel
Finds pole of inaccessibility for a given polygon. Based on Vladimir Agafonkin's https://github.com/mapbox/polylabel
Science Score: 31.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.5%) to scientific vocabulary
Repository
Finds pole of inaccessibility for a given polygon. Based on Vladimir Agafonkin's https://github.com/mapbox/polylabel
Basic Info
- Host: GitHub
- Owner: asinghvi17
- License: isc
- Language: Julia
- Default Branch: main
- Homepage: https://asinghvi17.github.io/Polylabel.jl/
- Size: 2.57 MB
Statistics
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 2
- Releases: 1
Metadata Files
README.md
Polylabel.jl

Polylabel.jl finds the pole of inaccessibility of a polygon, the most distant internal point from the polygon outline. This is useful for visual techniques like labelling polygons.
The main entry point is Polylabel.polylabel(polygon; atol, rtol) which processes any GeoInterface-compatible polygon (from GeometryBasics.jl, ArchGDAL.jl, LibGEOS.jl, Shapefile.jl, etc.) and returns a point as a 2-tuple of (x, y). It uses GeometryOps.jl to compute distances.
This algorithm was originally written (and taken from) mapbox/polylabel - you can find a lot more information there! To summarize, the algorithm is basically a quad-tree search across the polygon which finds the point which is most distant from any edge. There are alternative Julia implementations that are essentially the same algorithm in DelaunayTriangulation.jl
In the plot above, the pole of inaccessibility is shown in orange, while the input polygon (multipolygon in this case) is shown in blue.
Quick start
First, get your polygon through whatever means: ```julia using GeoInterface p = GeoInterface.Polygon([[(0, 0), (0, 1), (1, 1), (1, 0), (0, 0)]])
or load from a table from Shapefile, GeoJSON, GeoDataFrames, ArchGDAL, WellKnownGeometry, etc.
```
Now, assuming p is your polygon or multipolygon (it can be from any GeoInterface package, like LibGEOS, ArchGDAL, GeometryBasics, Shapefile, GeoJSON, etc),
julia
using Polylabel
polylabel(p) # (0.5, 0.5)
will give you a result!
To shorten the time to compute, increase the keyword argument rtol (currently a 1% difference) or set atol to something at the scale you want.
Owner
- Name: Anshul Singhvi
- Login: asinghvi17
- Kind: user
- Location: New York, NY
- Company: Columbia University
- Repositories: 5
- Profile: https://github.com/asinghvi17
BA student in Applied Physics, graduating May 2022.
Citation (CITATION.bib)
@misc{Polylabel.jl,
author = {Anshul Singhvi <anshulsinghvi@gmail.com> and contributors},
title = {Polylabel.jl},
url = {https://github.com/asinghvi17/Polylabel.jl},
version = {v0.2.0},
year = {2024},
month = {1}
}
GitHub Events
Total
- Issues event: 1
Last Year
- Issues event: 1
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 5
- Total pull requests: 2
- Average time to close issues: 6 months
- Average time to close pull requests: about 14 hours
- Total issue authors: 3
- Total pull request authors: 1
- Average comments per issue: 1.8
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: about 10 hours
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- asinghvi17 (3)
- NicolasRiel (1)
- JuliaTagBot (1)
Pull Request Authors
- asinghvi17 (4)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- julia 21 total
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 2
juliahub.com: Polylabel
Finds pole of inaccessibility for a given polygon. Based on Vladimir Agafonkin's https://github.com/mapbox/polylabel
- Homepage: https://asinghvi17.github.io/Polylabel.jl/
- Documentation: https://docs.juliahub.com/General/Polylabel/stable/
- License: ISC
-
Latest release: 0.2.0
published about 2 years ago
Rankings
Dependencies
- actions/checkout v2 composite
- julia-actions/cache v1 composite
- julia-actions/julia-buildpkg v1 composite
- julia-actions/julia-docdeploy v1 composite
- julia-actions/julia-runtest v1 composite
- julia-actions/setup-julia v1 composite
- JuliaRegistries/TagBot v1 composite
- julia-actions/RegisterAction latest composite