ewestern / geos

This is a Haskell binding to Geos, the open-source geometry library
MIT License
13 stars 9 forks source link

Fixes #35 - export constructors for geometry data types #37

Closed durgaBahadur closed 3 years ago

durgaBahadur commented 3 years ago

As discussed in #35, I exported the data constructors so we can easily access the underlying data.

To retrieve the coordinates of a point as double as requested in #36, we could do something like:

pointToDoubleArray :: Geo Point -> [Double]
pointToDoubleArray (GeoPoint (Point (Coordinate2 x y))) = [x,y]
pointToDoubleArray (GeoPoint (Point (Coordinate3 x y z))) = [x,y,z]

However, I am a little confused about the current geos.cabal. The latest version mentioned there is 0.4.0 whereas the newest version on Hackage is 0.4.1. Is there a specific reason why the latest cabal file was not committed?

ewestern commented 3 years ago

Thank you! The hackage version was probably an oversight. I'll prepare a new release.