question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

coordinate transform utils have misleading mnemonics

See original GitHub issue

The word points is used for very different ways of representing 8 coordinates for 4 corners:

  • points_from_xywh: a list of integer coordinates
  • points_from_x0y0x1y1, xywh_from_points and polygon_from_points: a string with space and comma as delimiters

Can we please rename them to be more precise and consistent? I suggest

  • points for the string (because it is also the name of PAGE’s CoordType attribute),
  • x0y0x1y0x1y1x0y1 for a list of strings (because it is straightforward and analogous to x0y0x1y1),
  • coords or bbox for a list of integers.

Or maybe tltrbrbl instead of x0y0x1y0x1y1x0y1 (but also tlbr instead of x0y0x1y1).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bertskycommented, Jul 18, 2019

It will become somewhat better, because all possible conversion options for all the different formats can be seen, and the docstrings are even more precise. But I have not touched the docstrings in ocrd_utils yet.

We now have the following mnemonics:

  • polygon – numeric polygon xy-pair list,
  • bbox – numeric bbox tuple,
  • x0y0x1y1 – string bbox tuple (this name is not ideal),
  • xywh – numeric bbox dict,
  • points – PAGE polygon xy-pair string

Routines can either convert (without loss of information) or construct (with loss of information or loss of detail).

0reactions
kbacommented, Aug 23, 2019

common.py has been merged into core, #268 and #254 should fix this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

D Coordinate Systems (Spatial Reference Systems)
This appendix describes the coordinate system transformation capabilities of Oracle ... (Coordinate systems are sometimes called spatial reference systems.).
Read more >
CoordinateTransformations - Intelligent Motion Lab
This chapter discusses how vectors and matrices are used in robotics to represent 2D and 3D positions, directions, rigid body motion, and coordinate...
Read more >
Coordinates transformation accuracy - Esri Community
I need coordinates transformation for Point Feature Clases. Situation: I have imported points in local projected coordinate system.
Read more >
Coordinate Transformation produces ValueError: Column year ...
Description I get an error when performing a coordinate transformation from ITRS to GCRS. I create an astropy coordinates object ap_coord ...
Read more >
Datum Transformation Using the autodt.ini File
When datum transformation is needed to transform coordinates between a specific set of datum values the entries from this file are used to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found