[Thuban-commits] r2732 - in trunk/thuban: . Extensions/svgexport

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Feb 27 00:02:27 CET 2007


Author: bernhard
Date: 2007-02-27 00:02:25 +0100 (Tue, 27 Feb 2007)
New Revision: 2732

Modified:
   trunk/thuban/ChangeLog
   trunk/thuban/Extensions/svgexport/TODO
   trunk/thuban/Extensions/svgexport/svgmapwriter.py
Log:
* Extensions/svgexport/TODO: Added findings about how to write raster
in SVG.

* Extensions/svgexport/svgmapwriter.py: untabified two lines. 
Fixed a typo.


Modified: trunk/thuban/ChangeLog
===================================================================
--- trunk/thuban/ChangeLog	2007-02-26 23:00:14 UTC (rev 2731)
+++ trunk/thuban/ChangeLog	2007-02-26 23:02:25 UTC (rev 2732)
@@ -1,5 +1,11 @@
 007-02-26 Bernhard Reiter <bernhard at intevation.de>
 
+	* Extensions/svgexport/TODO: Added findings about how to write raster
+	in SVG.
+
+	* Extensions/svgexport/svgmapwriter.py: untabified two lines. 
+	Fixed a typo.
+
 	* Doc/ThubanModel.xmi: Updated the format of the umbrello file.
 	Loaded and saved with umbrello 1.3.2, manually changed the
 	codegeneration tag to be empty again and change the XMI.model

Modified: trunk/thuban/Extensions/svgexport/TODO
===================================================================
--- trunk/thuban/Extensions/svgexport/TODO	2007-02-26 23:00:14 UTC (rev 2731)
+++ trunk/thuban/Extensions/svgexport/TODO	2007-02-26 23:02:25 UTC (rev 2732)
@@ -2,8 +2,40 @@
 
 For 1.0.2:
 
-* Enable Raster file export.
+* Add raster file export.
 
+  Spec REC-SVG11-20030114 includes no indication about embedding raster images.
+  Thus we probably have to write extra files.
+	
+	Substeps:
+		a) write shown raster file as .png, no matter which
+		   filename.
+		b) add filename construction based on used svg file.
+		   Difficulty: There can be several raster layers.
+		c) add <image> tag to .svg file
+
+	Considerations:
+		q1) What resolution to use for the PNG file? 
+
+		    As high as possible to avoid losing information.
+		    Will probably not be easy to decide if there are 
+		    complicated projections.
+
+		q2) Should be there one PNG file or is tiling better?
+
+		    One PNG per tile that Thuban is using seems to be
+		    a good approach.
+
+		q3) Image processing is happening in UI/renderer.py with
+		    the help of gdalwarp and and wx image function. 
+		    Shall we use wx as well? This would make this extension
+		    depend on wx and a GUI, but if we use something else like
+		    PIL (python-imaging) the results might be significantly
+		    different to what the user sees on screen. On the other 
+		    hand, this will already depend on the screen resolution.
+		    Or refactor renderer.py to use PIL as well? Probably not
+		    because of speed reasons.
+
 For 1.0.x, x>2:
 
 * find out why the memory shapes in class Testobjectexport

Modified: trunk/thuban/Extensions/svgexport/svgmapwriter.py
===================================================================
--- trunk/thuban/Extensions/svgexport/svgmapwriter.py	2007-02-26 23:00:14 UTC (rev 2731)
+++ trunk/thuban/Extensions/svgexport/svgmapwriter.py	2007-02-26 23:02:25 UTC (rev 2732)
@@ -326,11 +326,11 @@
                 data = shape.Points()
 
             if shapeType==SHAPETYPE_POINT:
-            	draw_func(draw_func_param, data, pen, brush,
+                draw_func(draw_func_param, data, pen, brush,
                            size = group.GetProperties().GetSize())
             elif shapeType==SHAPETYPE_ARC:
-	    	# do not fill the polylines in linestring layers
-            	draw_func(draw_func_param, data, pen, TRANSPARENT_BRUSH)
+            # do not fill the polylines in linestring layers
+                draw_func(draw_func_param, data, pen, TRANSPARENT_BRUSH)
             else:
                  draw_func(draw_func_param, data, pen, brush)
             # compatibility
@@ -380,7 +380,7 @@
     All shapes and graphic objects will be turned into 
     SVG elements and will be written into a file.
     Any properties, such as stroke width or stroke color,
-    will be written together with the SVG elementents.
+    will be written together with the SVG elements.
     """
     def __init__(self, file, dim=(0,0), units=''):
         """Setup some variables and objects for property collection."""



More information about the Thuban-commits mailing list