packages feed

hgis-0.1.3.6: test/Spec.hs

import           GIS.Graphics.PlotPNG
import           GIS.Graphics.PlotSVG
import           GIS.Hylo
import           GIS.Math.Projections
import           GIS.Math.Spherical
import           Test.Hspec

main :: IO ()
main = hspec $ do
    describe "distance" $ do
        it "computes distances along geodesics" $ do
            distance ((-74.0059), 40.7128) ((-118.2347), 34.0522) `shouldBe` 3934.997673163554
    describe "mercatorFullPng" $ do
        it "Reads a map and writes a .png with the mercator projection" $ do
            (mkMapPng "test/testmap.png" =<< districtToMapP bonne <$> getDistricts "test/data/worldmap/TM_WORLD_BORDERS-0.3.shp") >>= (`shouldBe` ())
    describe "mercatorFullSVG" $ do
        it "Reads a map and writes a .svg with the mercator projection" $ do
            (mkMapSVG "test/testmap.svg" =<< districtToMapP bonne <$> getDistricts "test/data/worldmap/TM_WORLD_BORDERS-0.3.shp") >>= (`shouldBe` ())