Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAGE validator: handle empty points #877

Open
bertsky opened this issue Jun 8, 2022 · 0 comments
Open

PAGE validator: handle empty points #877

bertsky opened this issue Jun 8, 2022 · 0 comments

Comments

@bertsky
Copy link
Collaborator

bertsky commented Jun 8, 2022

Currently when there is a @points="" the validator crashes:

  File "ocrd_validators/page_validator.py", line 274, in validate_consistency
    node_poly = make_poly(polygon_from_points(parent_points))
  File "ocrd_utils/image.py", line 148, in polygon_from_points
    polygon.append([float(x_y[0]), float(x_y[1])])
ValueError: could not convert string to float: 

We should be more robust. To make the CoordinateValidityError usable, we could instantiate an empty Polygon().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant