Polylabel

Finds pole of inaccessibility for a given polygon. Based on Vladimir Agafonkin's https://github.com/mapbox/polylabel

https://github.com/asinghvi17/polylabel.jl

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
Last synced: 10 months ago · JSON representation ·

Repository

Finds pole of inaccessibility for a given polygon. Based on Vladimir Agafonkin's https://github.com/mapbox/polylabel

Basic Info
Statistics
  • Stars: 5
  • Watchers: 2
  • Forks: 0
  • Open Issues: 2
  • Releases: 1
Created over 3 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License Citation

README.md

Polylabel.jl

Stable Dev Build Status

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

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
documentation (1) good first issue (1)
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

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 21 Total
Rankings
Dependent repos count: 9.9%
Average: 24.6%
Dependent packages count: 39.2%
Last synced: 10 months ago

Dependencies

.github/workflows/CI.yml actions
  • 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
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/register.yml actions
  • julia-actions/RegisterAction latest composite
.github/workflows/CompatHelper.yml actions