jschuengel: thuban/Extensions/umn_mapserver mapfile.py,1.4,1.5

cvs@intevation.de cvs at intevation.de
Wed Jul 7 14:51:45 CEST 2004


Author: jschuengel

Update of /thubanrepository/thuban/Extensions/umn_mapserver
In directory doto:/tmp/cvs-serv26443

Modified Files:
	mapfile.py 
Log Message:
Added some new settings to edit (outputformat, label, imagetype)


Index: mapfile.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/umn_mapserver/mapfile.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- mapfile.py	6 Jul 2004 14:28:52 -0000	1.4
+++ mapfile.py	7 Jul 2004 12:51:42 -0000	1.5
@@ -59,11 +59,16 @@
              4:"kilometers",
              5:"dd"}
 
+# TODO: generate the list dynamical by alle supported formats.
+#       At the moment outputformat only get by name.
+image_type = ["png","jpeg","wbmp","GTiff"]
+
 legend_status_type = { 0:"OFF",
                         1:"ON",
                         3:"embed" } 
                         # 2 = Default but will not be imported because 
                         # mapscript dont support it and its not allowed
+
 scalebar_status_type = { 0:"OFF",
                         1:"ON",
                         3:"embed" } 
@@ -97,8 +102,19 @@
                     3:"large",
                     4:"giant" }
 
-label_font_type = { 0:"truetype",
-                    1:"bitmap" }
+#TODO: build in truetype (0:"truetype") support
+label_font_type = { 1:"bitmap" }
+
+label_position_type = { 0:"ul",
+                         1:"lr",
+                         2:"ur",
+                         3:"ll",
+                         4:"cr",
+                         5:"cl",
+                         6:"uc",
+                         7:"lc",
+                         8:"cc",
+                         10:"auto"}
 
 
 # ##################################################
@@ -241,6 +257,15 @@
 # ##################################################
 # Classes for MapServer Objects as they are
 # explicitly defined in a mapfile
+class MF_Outputformat:
+
+    def __init__(self, mf_outputformat):
+        self._outputformat = mf_outputformat
+    
+    def get_name(self):
+        return self._outputformat.name
+    
+
 
 class MF_Symbol:
     """
@@ -706,6 +731,7 @@
         self._web = MF_Web(self._mf_map.web)
         self._legend = MF_Legend(self._mf_map.legend)
         self._scalebar = MF_Scalebar(self._mf_map.scalebar)
+        self._outputformat = MF_Outputformat(self._mf_map.outputformat)
         
         # symbols
         self._symbolset = MF_SymbolSet(self._mf_map.symbolset)
@@ -744,14 +770,29 @@
                 self._metadata.add_metadata(self._metafkey,self._metakeydata)
                 self._metafkey = self._mf_map.getNextMetaDataKey(self._metafkey)
     
+    def get_outputformat(self):
+        return self._outputformat
+    
+    def get_imagetype(self):
+        return self._mf_map.imagetype
+    
+    def set_imagetype(self, new_imagetype):
+        self._mf_map.setImageType(new_imagetype)
+    
     def get_symbolset(self):
         return self._symbolset
     
     def get_status(self):
-        if layer_status_type[self._mf_map.status] == "OFF":
-            return false
+        if self._mf_map.status == 1:
+            return True
         else:
-            return true
+            return False
+    
+    def set_status(self, new_status):
+        if new_status:
+            self._mf_map.status = 1
+        else:
+            self._mf_map.status = 0
 
     def get_scalebar(self):
         return self._scalebar
@@ -778,7 +819,7 @@
         return self._shapepath # where are the shape files located..
     
     def get_imagetype(self):
-        return self._imagetype
+        return self._mf_map.imagetype
     
     def get_layerorder(self):
         # shows the order of layer as list
@@ -961,6 +1002,50 @@
             self._label.partials = 0
         else:
             print "Boolean exspected"
+    
+    def get_buffer(self):
+        return self._label.buffer
+    
+    def set_buffer(self, new_buffer):
+        self._label.buffer = new_buffer
+    
+    def get_mindistance(self):
+        return self._label.mindistance
+    
+    def set_mindistance(self, new_mindistance):
+        self._label.mindistance = new_mindistance
+    
+    def get_minfeaturesize(self):
+        return self._label.minfeaturesize
+    
+    def set_minfeaturesize(self, new_minfeaturesize):
+        self._label.minfeaturesize = new_minfeaturesize
+    
+    def get_position(self, art="integer"):
+        if art == "string":
+            return label_position_type[self._label.position]
+        else:
+            return self._label.position
+    
+    def set_position(self, new_position):
+        if label_position_type.has_key(new_position):
+            self._label.position = new_position
+        else:
+            for label_position_type_nr in label_position_type:
+                if label_position_type[label_position_type_nr] == new_position:
+                    self._label.position = label_position_type_nr
+    
+    def get_force(self):
+        if self._label.force == 1:
+            return True
+        else:
+            return False
+    
+    def set_force(self, new_force):
+        if new_force:
+            self._label.force = 1
+        else:
+            self._label.force = 0
     
     def get_type(self):
         return label_font_type[self._label.type]





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)