logo       

cvs: pear /Image_GIS GIS.php Map.php package.xml: msg#00288

Subject: cvs: pear /Image_GIS GIS.php Map.php package.xml
sebastian               Mon Dec 30 05:04:45 2002 EDT

  Added files:                 
    /pear/Image_GIS     GIS.php 

  Removed files:               
    /pear/Image_GIS     Map.php 

  Modified files:              
    /pear/Image_GIS     package.xml 
  Log:
  Rename Image_GIS_Map to Image_GIS.
  
Index: pear/Image_GIS/package.xml
diff -u pear/Image_GIS/package.xml:1.3 pear/Image_GIS/package.xml:1.4
--- pear/Image_GIS/package.xml:1.3      Mon Dec 30 04:16:43 2002
+++ pear/Image_GIS/package.xml  Mon Dec 30 05:04:44 2002
@@ -37,19 +37,22 @@
 ]]>
     </notes>
     <filelist>
-      <dir name="/" baseinstalldir="Image/GIS">
-        <dir name="Parser">
-          <file role="php" name="GD.php"/>
-          <file role="php" name="SVG.php"/>
-        </dir>
+      <dir name="/" baseinstalldir="Image">
+        <dir name="GIS">
+          <dir name="Parser">
+            <file role="php" name="GD.php"/>
+            <file role="php" name="SVG.php"/>
+          </dir>
+
+          <dir name="Renderer">
+            <file role="php" name="E00.php"/>
+          </dir>
 
-        <dir name="Renderer">
-          <file role="php" name="E00.php"/>
+          <file role="php" name="Parser.php"/>
+          <file role="php" name="Renderer.php"/>
         </dir>
 
-        <file role="php" name="Map.php"/>
-        <file role="php" name="Parser.php"/>
-        <file role="php" name="Renderer.php"/>
+        <file role="php" name="GIS.php"/>
       </dir>
     </filelist>
     <deps>

Index: pear/Image_GIS/GIS.php
+++ pear/Image_GIS/GIS.php
<?php
//
// +------------------------------------------------------------------------+
// | PEAR :: Image :: GIS                                                   |
// +------------------------------------------------------------------------+
// | Copyright (c) 2002-2003 Jan Kneschke <jan@xxxxxxxxxxx> and             |
// |                         Sebastian Bergmann <sb@xxxxxxxxxxxxxxxxxxxxx>. |
// +------------------------------------------------------------------------+
// | This source file is subject to version 3.00 of the PHP License,        |
// | that is available at http://www.php.net/license/3_0.txt.               |
// | If you did not receive a copy of the PHP license and are unable to     |
// | obtain it through the world-wide-web, please send a note to            |
// | license@xxxxxxx so we can mail you a copy immediately.                 |
// +------------------------------------------------------------------------+
//
// $Id: GIS.php,v 1.1 2002/12/30 10:04:44 sebastian Exp $
//

require_once 'Image/Color.php';
require_once 'Image/GIS/Parser.php';
require_once 'Image/GIS/Renderer.php';

/**
* ...
*
* The following example draws the region around the
* Germany city of Kiel which is Jan's home town:
*
*   <?php
*   require_once 'Image/GIS.php';
*
*   $map = new Image_GIS(960, 1280);
*   $map->setRange(9.7, 10.5, 54.2, 54.7);
*
*   $map->draw('germany_rdline.e00', 'gray');
*   $map->draw('germany_pppoly.e00', 'green');
*   $map->draw('germany_dnnet.e00',  'blue');
*   $map->draw('germany_ponet.e00',  'black');
*
*   $map->saveImage('kiel.png');
*   ?>
*
* @version  $Revision: 1.1 $
* @since    Image_GIS 1.0.0
*/
class Image_GIS {
    /**
    * Set to TRUE to enable debugging.
    *
    * @var boolean $debug
    */
    var $debug;

    /**
    * Image_GIS_Parser sub-class object.
    *
    * @var Image_GIS_Parser $parser
    */
    var $parser;

    /**
    * Image_GIS_Renderer sub-class object.
    *
    * @var Image_GIS_Renderer $renderer
    */
    var $renderer;

    /**
    * Constructor.
    *
    * @param  mixed   $width
    * @param  integer $height
    * @param  string  $parser
    * @param  string  $renderer
    * @param  boolean $debug
    * @access public
    */
    function Image_GIS($width, $height = -1, $parser = 'E00', $renderer = 'GD', 
$debug = false) {
        $this->debug = $debug;

        $this->setRenderer($renderer, $width, $height);
        $this->setParser($parser);
        $this->setRange(9, 11, 55, 54);
    }

    /**
    * Draws a datafile.
    *
    * @param  string  $dataFile
    * @param  mixed   $color
    * @return boolean
    * @access public
    */
    function draw($dataFile, $color) {
        return $this->parser->draw($dataFile, $color);
    }

    /**
    * Saves the rendered image to a given file.
    *
    * @param  string  $filename
    * @return boolean
    * @access public
    */
    function saveImage($filename) {
        return $this->renderer->saveImage($filename);
    }

    /**
    * Sets the Image_GIS_Parser sub-class to be used
    * to parse a data file.
    *
    * @param  string  $parser
    * @access public
    */
    function setParser($parser) {
        $this->parser = &Image_GIS_Parser::factory($parser, $this->renderer, 
$this->debug);
    }

    /**
    * Sets the range of the data to be rendered.
    *
    * @param  float $x1
    * @param  float $x2
    * @param  float $y1
    * @param  float $y2
    * @access public
    */
    function setRange($x1, $x2, $y1, $y2) {
        $this->renderer->setRange($x1, $x2, $y1, $y2);
    }

    /**
    * Sets the Image_GIS_Renderer sub-class to be used
    * to render an image.
    *
    * @param  string  $renderer
    * @access public
    */
    function setRenderer($renderer, $width, $height) {
        $this->renderer = &Image_GIS_Renderer::factory($renderer, $width, 
$height, $this->debug);
    }

    /**
    * Shows the rendered image.
    *
    * @access public
    */
    function showImage() {
        $this->renderer->showImage();
    }
}
?>



-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe