hgis 0.1.1.2 → 0.1.2.0
raw patch · 8 files changed
+75/−28 lines, 8 filesdep ~Chartdep ~Chart-cairodep ~Chart-diagramsbinary-added
Dependency ranges changed: Chart, Chart-cairo, Chart-diagrams, ansi-wl-pprint, base, binary, bytestring, colour, composition, data-binary-ieee754, data-default, directory, filepath, hgis, hspec, lens, monad-loops, optparse-applicative, transformers
Files
- LICENSE +1/−1
- LICENSE-readshp +20/−0
- docs/manual.pdf binary
- hgis.cabal +26/−23
- src/GIS/Hylo.hs +4/−2
- src/GIS/Math/Spherical.hs +3/−1
- src/depends/readshp/LICENSE +20/−0
- stack.yaml +1/−1
LICENSE view
@@ -1,4 +1,4 @@-Copyright Vanessa McHale (c) 2017+Copyright Vanessa McHale (c) 2016-2017 All rights reserved.
+ LICENSE-readshp view
@@ -0,0 +1,20 @@+Copyright (c) 2015 Sam van Herwaarden++Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be included+in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ docs/manual.pdf view
binary file changed (absent → 98118 bytes)
hgis.cabal view
@@ -1,5 +1,5 @@ name: hgis-version: 0.1.1.2+version: 0.1.2.0 cabal-version: >=1.10 build-type: Simple license: BSD3@@ -18,6 +18,9 @@ README.md stack.yaml docs/manual.tex+ docs/manual.pdf+ src/depends/readshp/LICENSE+ LICENSE-readshp source-repository head type: git@@ -39,23 +42,23 @@ GIS.Math.Projections build-depends: base >=4.7 && <5,- optparse-applicative >=0.13.1.0,- Chart >=1.8.2,- Chart-cairo >=1.8.2,- Chart-diagrams >=1.8.2,- lens >=4.15.1,- composition >=1.0.2.1,- ansi-wl-pprint >=0.6.7.3,- transformers >=0.5.2.0,- directory >=1.3.0.0,- colour >=2.3.3,- data-default >=0.7.1.1,- binary >=0.8.3.0,- bytestring >=0.10.8.1,- data-binary-ieee754 >=0.4.4,- filepath >=1.4.1.1,- monad-loops >=0.4.3- pkgconfig-depends: cairo >=0.13.3.1+ optparse-applicative >=0.13.2.0 && <0.14,+ Chart >=1.8.2 && <1.9,+ Chart-cairo >=1.8.2 && <1.9,+ Chart-diagrams >=1.8.2 && <1.9,+ lens >=4.15.1 && <4.16,+ composition >=1.0.2.1 && <1.1,+ ansi-wl-pprint >=0.6.7.3 && <0.7,+ transformers >=0.5.2.0 && <0.6,+ directory >=1.3.0.0 && <1.4,+ colour >=2.3.3 && <2.4,+ data-default >=0.7.1.1 && <0.8,+ binary >=0.8.3.0 && <0.9,+ bytestring >=0.10.8.1 && <0.11,+ data-binary-ieee754 >=0.4.4 && <0.5,+ filepath >=1.4.1.1 && <1.5,+ monad-loops >=0.4.3 && <0.5+ pkgconfig-depends: cairo >=0.13.3.1 && <0.14 default-language: Haskell2010 default-extensions: DeriveGeneric OverloadedStrings hs-source-dirs: src src/depends/readshp@@ -81,8 +84,8 @@ ghc-options: -threaded -rtsopts -with-rtsopts=-N main-is: MainPng.hs build-depends:- base >=4.9.1.0,- hgis >=0.1.1.2+ base >=4.9.1.0 && <4.10,+ hgis >=0.1.2.0 && <0.2 default-language: Haskell2010 hs-source-dirs: app @@ -90,9 +93,9 @@ type: exitcode-stdio-1.0 main-is: Spec.hs build-depends:- base >=4.9.1.0,- hgis >=0.1.1.2,- hspec >=2.4.2+ base >=4.9.1.0 && <4.10,+ hgis >=0.1.2.0 && <0.2,+ hspec >=2.4.2 && <2.5 default-language: Haskell2010 hs-source-dirs: test ghc-options: -threaded -rtsopts -with-rtsopts=-N
src/GIS/Hylo.hs view
@@ -5,6 +5,7 @@ import Geometry.Shapefile.ReadShp import Geometry.Shapefile.Types import Data.List+import Data.Char import Data.Maybe import Data.Monoid import GIS.Math.Projections@@ -45,7 +46,8 @@ -- | Given a list of districts, return a list of maps. districtToMapFiles :: [District] -> [Map]-districtToMapFiles = map (\(District polygons label _ _) -> title .~ label $ labelledDistricts .~ (zip polygons (nullLabel polygons)) $ def)+districtToMapFiles = map (\(District polygons label _ area) -> title .~ label ++ "-" ++ (show . sum $ area) $ labelledDistricts .~ (zip polygons (nullLabel polygons)) $ def)+--districtToMapFiles = map (\(District polygons label _ _) -> title .~ label $ labelledDistricts .~ (zip polygons (nullLabel polygons)) $ def) where nullLabel polys = map (const "") [1..(length polys)] -- | Given the path to a shapefile, return a list of districts@@ -56,7 +58,7 @@ let districtLabels = fromJust $ (fmap labels) $ mapM (shpRecLabel) . shpRecs $ file -- <$> for print? let shapes = (map (getPolygon . fromJust . shpRecContents)) . shpRecs $ file let perimeters = map (getPerimeter . getPolygon . fromJust . shpRecContents) . shpRecs $ file- let areas = map (fmap areaPolyRectangular . getPolygon . fromJust . shpRecContents) . shpRecs $ file+ let areas = map (fmap areaPolygon . getPolygon . fromJust . shpRecContents) . shpRecs $ file let tuple = zip4 shapes districtLabels perimeters areas pure $ fmap (\(a,b,c,d) -> District a b c d) tuple
src/GIS/Math/Spherical.hs view
@@ -38,8 +38,10 @@ -- | Uses areal projection; then finds area of the polygon. -- WARNING: not yet to scale. +-- (need to compute jacobian; ideally km^2/steridian areaPolygon :: Polygon -> Double-areaPolygon = {--(*((6371*pi)^2)) . --}areaPolyRectangular . (fmap bonne)+areaPolygon = (*factor) . areaPolyRectangular . (fmap bonne)+ where factor = 1 -- 1717856/227.5506494212687 -- | Find the area of a polygon with rectangular coördinates given. areaPolyRectangular :: Polygon -> Double
+ src/depends/readshp/LICENSE view
@@ -0,0 +1,20 @@+Copyright (c) 2015 Sam van Herwaarden++Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be included+in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
stack.yaml view
@@ -15,7 +15,7 @@ # resolver: # name: custom-snapshot # location: "./custom-snapshot.yaml"-resolver: lts-8.3+resolver: lts-8.5 # User packages to be built. # Various formats can be used as shown in the example below.