[DebianGIS-dev] r1393 - in packages/gpsdrive/trunk/debian: . patches

nd-guest at alioth.debian.org nd-guest at alioth.debian.org
Thu Feb 28 23:43:06 UTC 2008


Author: nd-guest
Date: 2008-02-28 23:43:05 +0000 (Thu, 28 Feb 2008)
New Revision: 1393

Added:
   packages/gpsdrive/trunk/debian/NEWS
   packages/gpsdrive/trunk/debian/patches/97-osmxml.dpatch
   packages/gpsdrive/trunk/debian/patches/98-mapnik-exception.dpatch
Modified:
   packages/gpsdrive/trunk/debian/changelog
   packages/gpsdrive/trunk/debian/patches/00list
Log:
Add mapnik config file exception handling.
Add NEWS file.


Added: packages/gpsdrive/trunk/debian/NEWS
===================================================================
--- packages/gpsdrive/trunk/debian/NEWS	                        (rev 0)
+++ packages/gpsdrive/trunk/debian/NEWS	2008-02-28 23:43:05 UTC (rev 1393)
@@ -0,0 +1,11 @@
+gpsdrive (2.10~pre4-3) unstable; urgency=low
+
+    The mapnik library since version 0.5.0 introduces a more strict checking
+    of the map configuration file ~/.gpsdrive/osm.xml.
+    If gpsdrive fails to initialize mapnik during startup please either remove
+    ~/.gpsdrive/osm.xml or remove/fix all elements mapnik is complaining
+    about, usually missing world_boundaries or a database connection problem.
+    If removed, the file will be re-created during next start of gpsdrive with
+    these parts commented out.
+
+ -- Andreas Putzo <andreas at putzo.net>  Thu, 28 Feb 2008 23:20:02 +0000

Modified: packages/gpsdrive/trunk/debian/changelog
===================================================================
--- packages/gpsdrive/trunk/debian/changelog	2008-02-28 16:17:07 UTC (rev 1392)
+++ packages/gpsdrive/trunk/debian/changelog	2008-02-28 23:43:05 UTC (rev 1393)
@@ -1,3 +1,17 @@
+gpsdrive (2.10~pre4-3) unstable; urgency=low
+
+  * Fix regression of last upload in the mapnik handling.
+    Mapnik no longer tolerates errors in the map config file.
+    - Add 97-osmxml.dpatch to fix a syntax error and to comment
+      the world_boundaries and postgis rules.
+    - Add 98-mapnik-exception.dpatch to handle errors more gracefully.
+    - Add NEWS file to explain how to handle existing osm.xml files
+  * Updated 50-scripts.dpatch to search for osm.xml in user's home directory.
+    Thanks to Giovanni Mascellani.
+    (Closes: #466227)
+
+ -- Andreas Putzo <andreas at putzo.net>  Thu, 28 Feb 2008 23:16:23 +0000
+
 gpsdrive (2.10~pre4-2) unstable; urgency=low
 
   [ Andreas Putzo ]

Modified: packages/gpsdrive/trunk/debian/patches/00list
===================================================================
--- packages/gpsdrive/trunk/debian/patches/00list	2008-02-28 16:17:07 UTC (rev 1392)
+++ packages/gpsdrive/trunk/debian/patches/00list	2008-02-28 23:43:05 UTC (rev 1393)
@@ -12,3 +12,5 @@
 90-usage
 95-newapi
 96-mapnik-plugins-dir
+97-osmxml
+98-mapnik-exception

Added: packages/gpsdrive/trunk/debian/patches/97-osmxml.dpatch
===================================================================
--- packages/gpsdrive/trunk/debian/patches/97-osmxml.dpatch	                        (rev 0)
+++ packages/gpsdrive/trunk/debian/patches/97-osmxml.dpatch	2008-02-28 23:43:05 UTC (rev 1393)
@@ -0,0 +1,87 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 97-osmxml.dpatch by Andreas Putzo <andreas at putzo.net>
+##
+## DP: Fix hexadecimal color.
+## DP: Comment db connection and world_boundaries by default.
+
+ at DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/scripts/mapnik/osm-in.xml gpsdrive-2.10~pre4/scripts/mapnik/osm-in.xml
+--- gpsdrive-2.10~pre4~/scripts/mapnik/osm-in.xml	2008-02-28 23:35:09.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/mapnik/osm-in.xml	2008-02-28 23:36:50.000000000 +0000
+@@ -1,5 +1,11 @@
+ <?xml version="1.0" encoding="utf-8"?>
+ <!DOCTYPE Map>
++
++<!-- world_boundaries and database support are disabled by default.
++     See commented BLOCKs below.
++-->     
++
++
+ <Map bgcolor="#b5d0d0" srs="+proj=merc +datum=WGS84  +k=1.0 +units=m +over +no_defs">
+     <Style name="mapnik:selection">
+       <Rule>
+@@ -346,7 +352,7 @@
+       <Filter>[amenity] = 'parking'</Filter>
+       <MaxScaleDenominator>25000</MaxScaleDenominator>
+       <LineSymbolizer>
+-        <CssParameter name="stroke">eeeed1</CssParameter>
++        <CssParameter name="stroke">#eeeed1</CssParameter>
+ 	<CssParameter name="stroke-width">0.3</CssParameter>
+       </LineSymbolizer>
+     </Rule>
+@@ -1637,6 +1643,9 @@
+     </Rule>
+  </Style>
+ 
++
++<!-- BEGIN WORLD_BOUNDARIES BLOCK  Uncomment this part if you have world_boundaries installed
++
+   <Layer name="world-1" status="on" srs="+proj=merc +datum=WGS84 +over">
+     <StyleName>world-1</StyleName>
+     <Datasource>
+@@ -1677,7 +1686,20 @@
+       <Parameter name="file">@DATA_DIR@/world_boundaries/builtup_area</Parameter>
+     </Datasource>
+   </Layer>
+-  
++
++  <Layer name="places" status="on">
++    <StyleName>places</StyleName>
++    <Datasource>
++      <Parameter name="type">shape</Parameter>
++      <Parameter name="file">@DATA_DIR@/world_boundaries/places</Parameter>
++    </Datasource>
++  </Layer>
++
++END WORLD BOUNDARIES BLOCK -->
++
++
++<!-- BEGIN DATABASE BLOCK  Uncomment this block if you have a working postgresql database setup
++
+   <Layer name="leisure" status="on" srs="+proj=merc +datum=WGS84  +k=1.0 +units=m +over +no_defs">
+     <StyleName>leisure</StyleName>
+     <Datasource>
+@@ -1729,7 +1751,6 @@
+   </Layer>
+   
+   <Layer name="roads" status="on" srs="+proj=merc +datum=WGS84  +k=1.0 +units=m +over +no_defs">
+-    <!--StyleName>roads-casing</StyleName-->
+     <StyleName>roads</StyleName>
+     <Datasource>
+       <Parameter name="type">postgis</Parameter>
+@@ -1781,12 +1802,7 @@
+       <Parameter name="estimate_extent">true</Parameter>
+     </Datasource>
+   </Layer>
+-  
+-  <Layer name="places" status="on">
+-    <StyleName>places</StyleName>
+-    <Datasource>
+-      <Parameter name="type">shape</Parameter>
+-      <Parameter name="file">@DATA_DIR@/world_boundaries/places</Parameter>
+-    </Datasource>
+-  </Layer>
++
++END DATABASE BLOCK -->
++
+ </Map>


Property changes on: packages/gpsdrive/trunk/debian/patches/97-osmxml.dpatch
___________________________________________________________________
Name: svn:executable
   + *

Added: packages/gpsdrive/trunk/debian/patches/98-mapnik-exception.dpatch
===================================================================
--- packages/gpsdrive/trunk/debian/patches/98-mapnik-exception.dpatch	                        (rev 0)
+++ packages/gpsdrive/trunk/debian/patches/98-mapnik-exception.dpatch	2008-02-28 23:43:05 UTC (rev 1393)
@@ -0,0 +1,57 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 98-mapnik-exception.dpatch by Andreas Putzo <andreas at putzo.net>
+##
+## DP: Add exception handling for mapnik config file loading.
+
+ at DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/debian/patched/99-testing.dpatch gpsdrive-2.10~pre4/debian/patched/99-testing.dpatch
+--- gpsdrive-2.10~pre4~/debian/patched/99-testing.dpatch	1970-01-01 00:00:00.000000000 +0000
++++ gpsdrive-2.10~pre4/debian/patched/99-testing.dpatch	2008-02-28 23:37:07.000000000 +0000
+@@ -0,0 +1,2 @@
++patching file src/mapnik.cpp
++Hunk #3 succeeded at 127 (offset -6 lines).
+diff -urNad gpsdrive-2.10~pre4~/src/mapnik.cpp gpsdrive-2.10~pre4/src/mapnik.cpp
+--- gpsdrive-2.10~pre4~/src/mapnik.cpp	2008-02-28 23:37:07.000000000 +0000
++++ gpsdrive-2.10~pre4/src/mapnik.cpp	2008-02-28 23:37:46.000000000 +0000
+@@ -23,6 +23,7 @@
+ #include <mapnik/memory_datasource.hpp>
+ #include <mapnik/datasource_cache.hpp>
+ #include <mapnik/font_engine_freetype.hpp>
++#include <mapnik/config_error.hpp>
+ #include <string>
+ #include <fstream>
+ 
+@@ -37,6 +38,7 @@
+ using mapnik::feature_ptr;
+ using mapnik::geometry_ptr;
+ using mapnik::CoordTransform;
++using mapnik::config_error;
+ 
+ extern int mydebug;
+ extern int borderlimit;
+@@ -131,11 +133,22 @@
+     MapnikMap.BorderlimitInt = borderlimit;
+     MapnikMap.ScaleInt = -1; // <-- force creation of map if a map is set
+     MapnikMap.MapPtr = new mapnik::Map(MapnikMap.WidthInt, MapnikMap.HeightInt);
++
+     
+     //load map
+-    std::string mapnik_config_file (ConfigXML);
+-    mapnik::load_map(*MapnikMap.MapPtr, mapnik_config_file);
+-    MapnikInitYsn = -1;
++    try {
++        std::string mapnik_config_file (ConfigXML);
++        mapnik::load_map(*MapnikMap.MapPtr, mapnik_config_file);
++        MapnikInitYsn = -1;
++    }
++    catch(const mapnik::config_error &ex) {
++        cerr << "Cannot init mapnik. Mapnik support DISABLED: " << ex.what() << "\n" << endl;
++        cerr << "Mapnik now raises exceptions on syntax errors in the map file,\n" <<
++                "failed db connections, missing files, etc.\n" <<
++                "Please fix or remove ~/.gpsdrive/osm.xml.\n" <<
++                "See also NEWS.Debian." << endl;
++        MapnikInitYsn = 0;
++    }
+ }
+ 
+ /*


Property changes on: packages/gpsdrive/trunk/debian/patches/98-mapnik-exception.dpatch
___________________________________________________________________
Name: svn:executable
   + *




More information about the Pkg-grass-devel mailing list