Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pyhaloxml

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyhaloxml

Read and write the annotation files from Halo

  • 3.1.2
  • PyPI
  • Socket score

Maintainers
1

Mypy Black Pytest Docs

PyHaloXML

Python code to read/write .annotation files from Halo. Can export as .geojson for further analysis.

Examples

Example 1 : Move rectangles to a different layer and save as .annotation.

Example 2 : Check if annotations have holes in them and save as .geojson.

Example 3 : Show the wkt representation of the shapely polygon.

Example 4 : Create a .annotation file from coordinates.

Installation

pip install pyhaloxml

Note on version 3

The matching of negative to positive regions now needs to be done by the user after loading the data. The examples have been updated. This needed to happen because negative regions can be unmatched in Halo. This would cause errors when loading.

Loading speed

Rust is used to match the negative regions to positive regions, thanks to Wim Pomp!

It takes 41 seconds to load a 30.9MB file with 856454 vertices in 5769 regions with 731 holes.

Development

  • Install Rust
  • Clone the repository
  • pip install -e .

Notes on development

  • The xml is relatively simple. There are Annotations and an annotation contains regions.
  • Regions can be either positive or negative. However regions in an annotation are not hierarchical. So there is no telling what negative region should go with what positive region.
  • This package expects a negative region to be fully enclosed by one positive region. The matching is done by taking a single point that is inside or on the border of the negative region and checking if it is inside a positive region.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc