Hello community,

here is the log from the commit of package ghc-vectortiles for openSUSE:Factory 
checked in at 2017-04-20 20:56:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-vectortiles (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-vectortiles.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-vectortiles"

Thu Apr 20 20:56:15 2017 rev:2 rq:487963 version:1.2.0.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-vectortiles/ghc-vectortiles.changes  
2017-04-07 13:53:35.289093001 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-vectortiles.new/ghc-vectortiles.changes     
2017-04-20 20:56:25.737478248 +0200
@@ -1,0 +2,5 @@
+Mon Mar 27 12:41:51 UTC 2017 - psim...@suse.com
+
+- Update to version 1.2.0.4 with cabal2obs.
+
+-------------------------------------------------------------------

Old:
----
  vectortiles-1.2.0.2.tar.gz

New:
----
  vectortiles-1.2.0.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-vectortiles.spec ++++++
--- /var/tmp/diff_new_pack.s7gOD2/_old  2017-04-20 20:56:29.664922844 +0200
+++ /var/tmp/diff_new_pack.s7gOD2/_new  2017-04-20 20:56:29.668922278 +0200
@@ -19,7 +19,7 @@
 %global pkg_name vectortiles
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        1.2.0.2
+Version:        1.2.0.4
 Release:        0
 Summary:        GIS Vector Tiles, as defined by Mapbox
 License:        Apache-2.0

++++++ vectortiles-1.2.0.2.tar.gz -> vectortiles-1.2.0.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vectortiles-1.2.0.2/CHANGELOG.md 
new/vectortiles-1.2.0.4/CHANGELOG.md
--- old/vectortiles-1.2.0.2/CHANGELOG.md        2017-01-13 19:17:37.000000000 
+0100
+++ new/vectortiles-1.2.0.4/CHANGELOG.md        2017-03-24 03:12:04.000000000 
+0100
@@ -1,6 +1,11 @@
 Changelog
 =========
 
+1.2.0.3
+-------
+
+- Performance improvements during metadata encoding.
+
 1.2.0.2
 -------
 - Bump `vector` upper bound.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/vectortiles-1.2.0.2/Geography/VectorTile/Protobuf/Internal.hs 
new/vectortiles-1.2.0.4/Geography/VectorTile/Protobuf/Internal.hs
--- old/vectortiles-1.2.0.2/Geography/VectorTile/Protobuf/Internal.hs   
2017-01-08 16:52:45.000000000 +0100
+++ new/vectortiles-1.2.0.4/Geography/VectorTile/Protobuf/Internal.hs   
2017-03-24 02:57:49.000000000 +0100
@@ -8,7 +8,7 @@
 
 -- |
 -- Module    : Geography.VectorTile.Protobuf.Internal
--- Copyright : (c) Azavea, 2016
+-- Copyright : (c) Azavea, 2016 - 2017
 -- License   : Apache 2
 -- Maintainer: Colin Woodbury <cwoodb...@azavea.com>
 --
@@ -56,7 +56,7 @@
 import           Data.Bits
 import           Data.Foldable (foldrM, foldlM)
 import           Data.Int
-import           Data.List (nub, elemIndex)
+import           Data.List (nub)
 import qualified Data.Map.Lazy as M
 import           Data.Maybe (fromJust)
 import           Data.Monoid
@@ -113,9 +113,10 @@
                           , _values = putField $ map toProtobuf vs
                           , _extent = putField . Just . fromIntegral $ 
VT._extent l }
     where (ks,vs) = totalMeta (VT._points l) (VT._linestrings l) (VT._polygons 
l)
-          fs = V.toList $ V.concat [ V.map (unfeature ks vs Point) (VT._points 
l)
-                                   , V.map (unfeature ks vs LineString) 
(VT._linestrings l)
-                                   , V.map (unfeature ks vs Polygon) 
(VT._polygons l) ]
+          (km,vm) = (M.fromList $ zip ks [0..], M.fromList $ zip vs [0..])
+          fs = V.toList $ V.concat [ V.map (unfeature km vm Point) (VT._points 
l)
+                                   , V.map (unfeature km vm LineString) 
(VT._linestrings l)
+                                   , V.map (unfeature km vm Polygon) 
(VT._polygons l) ]
 
 instance Protobuffable VT.Val where
   fromProtobuf v = mtoe "Value decode: No legal Value type offered" $ fmap 
VT.St (getField $ _string v)
@@ -360,19 +361,18 @@
 totalMeta ps ls polys = (keys, vals)
   where keys = S.toList . S.unions $ f ps <> f ls <> f polys
         vals = nub . concat $ g ps <> g ls <> g polys  -- `nub` is O(n^2)
-        f = V.foldr (\x acc -> M.keysSet (VT._metadata x) : acc) []
-        g = V.foldr (\x acc -> M.elems (VT._metadata x) : acc) []
+        f = V.foldr (\feat acc -> M.keysSet (VT._metadata feat) : acc) []
+        g = V.foldr (\feat acc -> M.elems (VT._metadata feat) : acc) []
 
 -- | Encode a high-level `Feature` back into its mid-level `RawFeature` form.
-unfeature :: ProtobufGeom g => [Text] -> [VT.Val] -> GeomType -> VT.Feature g 
-> RawFeature
+unfeature :: ProtobufGeom g => M.Map Text Int -> M.Map VT.Val Int -> GeomType 
-> VT.Feature g -> RawFeature
 unfeature keys vals gt fe = RawFeature
                             { _featureId = putField . Just . fromIntegral $ 
VT._featureId fe
                             , _tags = putField $ tags fe
                             , _geom = putField $ Just gt
-                            , _geometries = putField . uncommands . toCommands 
$ VT._geometries fe
-                            }
+                            , _geometries = putField . uncommands . toCommands 
$ VT._geometries fe }
   where tags = unpairs . map f . M.toList . VT._metadata
-        f (k,v) = both (fromIntegral . fromJust) (k `elemIndex` keys, v 
`elemIndex` vals)
+        f (k,v) = both (fromIntegral . fromJust) (M.lookup k keys, M.lookup v 
vals)
 
 {- UTIL -}
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/vectortiles-1.2.0.2/Geography/VectorTile/VectorTile.hs 
new/vectortiles-1.2.0.4/Geography/VectorTile/VectorTile.hs
--- old/vectortiles-1.2.0.2/Geography/VectorTile/VectorTile.hs  2016-12-31 
06:55:52.000000000 +0100
+++ new/vectortiles-1.2.0.4/Geography/VectorTile/VectorTile.hs  2017-03-24 
03:05:22.000000000 +0100
@@ -3,7 +3,7 @@
 
 -- |
 -- Module    : Geography.VectorTile.VectorTile
--- Copyright : (c) Azavea, 2016
+-- Copyright : (c) Azavea, 2016 - 2017
 -- License   : Apache 2
 -- Maintainer: Colin Woodbury <cwoodb...@azavea.com>
 --
@@ -137,6 +137,6 @@
 -- | Legal Metadata /Value/ types. Note that `S64` are Z-encoded automatically
 -- by the underlying "Data.ProtocolBuffers" library.
 data Val = St Text | Fl Float | Do Double | I64 Int64 | W64 Word64 | S64 Int64 
| B Bool
-         deriving (Eq,Show,Generic)
+         deriving (Eq,Ord,Show,Generic)
 
 instance NFData Val
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vectortiles-1.2.0.2/test/Test.hs 
new/vectortiles-1.2.0.4/test/Test.hs
--- old/vectortiles-1.2.0.2/test/Test.hs        2016-07-28 16:43:30.000000000 
+0200
+++ new/vectortiles-1.2.0.4/test/Test.hs        2017-03-03 16:12:36.000000000 
+0100
@@ -24,22 +24,25 @@
   ls <- BS.readFile "test/linestring.mvt"
   pl <- BS.readFile "test/polygon.mvt"
   rd <- BS.readFile "test/roads.mvt"
-  defaultMain $ suite op ls pl rd
+  cl <- BS.readFile "test/clearlake.mvt"
+  defaultMain $ suite op ls pl rd cl
 
 {- SUITES -}
 
-suite :: BS.ByteString -> BS.ByteString -> BS.ByteString -> BS.ByteString -> 
TestTree
-suite op ls pl rd = testGroup "Unit Tests"
+suite :: BS.ByteString -> BS.ByteString -> BS.ByteString -> BS.ByteString -> 
BS.ByteString -> TestTree
+suite op ls pl rd cl = testGroup "Unit Tests"
   [ testGroup "Protobuf"
     [ testGroup "Decoding"
       [ testCase "onepoint.mvt -> Raw.Tile" $ testOnePoint op
       , testCase "linestring.mvt -> Raw.Tile" $ testLineString ls
       , testCase "polygon.mvt -> Raw.Tile" $ testPolygon pl
       , testCase "roads.mvt -> Raw.Tile" $ testDecode rd
+      , testCase "clearlake.mvt -> Raw.Tile" $ testDecode cl
       , testCase "onepoint.mvt -> VectorTile" $ tileDecode op
       , testCase "linestring.mvt -> VectorTile" $ tileDecode ls
       , testCase "polygon.mvt -> VectorTile" $ tileDecode pl
       , testCase "roads.mvt -> VectorTile" $ tileDecode rd
+      , testCase "clearlake.mvt -> VectorTile" $ tileDecode cl
       ]
     , testGroup "Encoding"
       [ testGroup "RawVectorTile <-> VectorTile"
Binary files old/vectortiles-1.2.0.2/test/clearlake.mvt and 
new/vectortiles-1.2.0.4/test/clearlake.mvt differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vectortiles-1.2.0.2/vectortiles.cabal 
new/vectortiles-1.2.0.4/vectortiles.cabal
--- old/vectortiles-1.2.0.2/vectortiles.cabal   2017-01-08 16:53:11.000000000 
+0100
+++ new/vectortiles-1.2.0.4/vectortiles.cabal   2017-03-24 16:11:16.000000000 
+0100
@@ -2,7 +2,7 @@
 -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                vectortiles
-version:             1.2.0.2
+version:             1.2.0.4
 synopsis:            GIS Vector Tiles, as defined by Mapbox.
 description:         GIS Vector Tiles, as defined by Mapbox.
                      .
@@ -35,6 +35,7 @@
                      , test/onepoint.mvt
                      , test/linestring.mvt
                      , test/polygon.mvt
+                     , test/clearlake.mvt
                      , README.md
                      , CHANGELOG.md
 


Reply via email to