Skip to content

Fix LineFloat to store coordinates as float instead of double (#89) - #289

Open
pangwangshu wants to merge 2 commits into
davidmoten:masterfrom
pangwangshu:wapang/issue89
Open

Fix LineFloat to store coordinates as float instead of double (#89)#289
pangwangshu wants to merge 2 commits into
davidmoten:masterfrom
pangwangshu:wapang/issue89

Conversation

@pangwangshu

Copy link
Copy Markdown

Problem

LineFloat was declaring its x1, y1, x2, y2 fields (and constructor/factory parameters) as double instead of float, defeating the purpose of having a separate float-precision Line implementation alongside LineDouble.

Fixes #89

Changes

  • Changed LineFloat's fields, private constructor, and create() factory method to use float instead of double for coordinates (LineFloat.java)
  • Added tests verifying:
    • LineFloat fields are declared as float while LineDouble fields remain double (via reflection)
    • Geometries.line(...) created from float coordinates reports isDoublePrecision() == false, and from double coordinates reports true

Test plan

  • mvn test passes, including new LineTest cases

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

Successfully merging this pull request may close these issues.

Difference between LineDouble and LineFloat

1 participant