[Mapbender-commits] r1965 - trunk/mapbender/http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Jan 15 03:24:31 EST 2008
Author: christoph
Date: 2008-01-15 03:24:29 -0500 (Tue, 15 Jan 2008)
New Revision: 1965
Added:
trunk/mapbender/http/classes/class_point.php
Modified:
trunk/mapbender/http/classes/class.ezpdf.php
trunk/mapbender/http/classes/class.pdf.php
trunk/mapbender/http/classes/class_administration.php
trunk/mapbender/http/classes/class_bbox.php
trunk/mapbender/http/classes/class_keyword.php
trunk/mapbender/http/classes/class_kml.php
trunk/mapbender/http/classes/class_layer_monitor.php
trunk/mapbender/http/classes/class_locale.php
trunk/mapbender/http/classes/class_metadata.php
trunk/mapbender/http/classes/class_monitor.php
trunk/mapbender/http/classes/class_wfs_conf.php
trunk/mapbender/http/classes/class_wmc.php
trunk/mapbender/http/classes/class_wms.php
Log:
added svn keywords
Property changes on: trunk/mapbender/http/classes/class.ezpdf.php
___________________________________________________________________
Name: svn:keywords
+ HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
Property changes on: trunk/mapbender/http/classes/class.pdf.php
___________________________________________________________________
Name: svn:keywords
+ HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
Modified: trunk/mapbender/http/classes/class_administration.php
===================================================================
--- trunk/mapbender/http/classes/class_administration.php 2008-01-15 08:11:29 UTC (rev 1964)
+++ trunk/mapbender/http/classes/class_administration.php 2008-01-15 08:24:29 UTC (rev 1965)
@@ -977,7 +977,17 @@
}
function is_utf8_string($string) {
- return preg_match('%(?:
+ if (is_array($string))
+ {
+ $enc = implode('', $string);
+ return @!((ord($enc[0]) != 239) && (ord($enc[1]) != 187) && (ord($enc[2]) != 191));
+ }
+ else
+ {
+ return (utf8_encode(utf8_decode($string)) == $string);
+ }
+ /*
+ return preg_match('%(?:
[\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
|\xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
@@ -986,6 +996,7 @@
|[\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
|\xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
)+%xs', $string);
+ */
}
function is_utf8_xml($xml) {
Modified: trunk/mapbender/http/classes/class_bbox.php
===================================================================
--- trunk/mapbender/http/classes/class_bbox.php 2008-01-15 08:11:29 UTC (rev 1964)
+++ trunk/mapbender/http/classes/class_bbox.php 2008-01-15 08:24:29 UTC (rev 1965)
@@ -23,138 +23,6 @@
db_select_db(DB,$con);
/**
- * A Mapbender_point is a 2-dimensional point with an EPSG.
- */
-class Mapbender_point {
- var $x;
- var $y;
- var $epsg;
-
- /**
- * @constructor
- */
- function __construct($x, $y, $epsg) {
- if (!$x || !$y || !$epsg) {
- $e = new mb_exception("Mapbender_point: constructor: some parameters are not set (set (x: ".$x.", y: ".$y.", epsg:".$epsg.")!");
- }
- $this->x = $x;
- $this->y = $y;
- $this->epsg = $epsg;
- }
-
- /**
- * computes a new point with the minimal coordinates of this point and $point
- */
- static function min ($point1, $point2) {
- if ($point1->epsg == $point2->epsg) {
- if ($point1->isWestOf($point2)) {
- $minx = $point1->x;
- }
- else {
- $minx = $point2->x;
- }
- if ($point1->isSouthOf($point2)) {
- $miny = $point1->y;
- }
- else {
- $miny = $point2->y;
- }
- return new Mapbender_point($minx, $miny, $point1->epsg);
- }
- else {
- $e = new mb_exception("Mapbender_point: cannot process min with different EPSG codes");
- }
- }
-
- /**
- * computes a new point with the maximal coordinates of this point and $point
- */
- static function max ($point1, $point2) {
- if ($point1->epsg == $point2->epsg) {
- if ($point1->isWestOf($point2)) {
- $maxx = $point2->x;
- }
- else {
- $maxx = $point1->x;
- }
- if ($point1->isSouthOf($point2)) {
- $maxy = $point2->y;
- }
- else {
- $maxy = $point1->y;
- }
- return new Mapbender_point($maxx, $maxy, $point1->epsg);
- }
- else {
- $e = new mb_exception("Mapbender_point: cannot process min with different EPSG codes");
- }
- }
-
- function isWestOf($point) {
- if ($this->x < $point->x) {
- return true;
- }
- }
-
- function isSouthOf($point) {
- if ($this->y < $point->y) {
- return true;
- }
- }
-
- /**
- * Addition
- *
- * @param anotherPoint another Mapbender_point
- */
- function plus ($anotherPoint) {
- return new Mapbender_point($this->x + $anotherPoint->x, $this->y + $anotherPoint->y, $this->epsg);
- }
-
- /**
- * Subtraction
- *
- * @param anotherPoint another Mapbender_point
- */
- function minus ($anotherPoint) {
- return $this->plus($anotherPoint->times(-1));
- }
-
- /**
- * Scalar multiplication
- *
- * @param aFloat a floating point number
- */
- function times ($aFloat) {
- return new Mapbender_point($this->x * $aFloat, $this->y * $aFloat, $this->epsg);
- }
-
- /**
- * transforms this point to another EPSG
- */
- function transform($toEpsg) {
- if(SYS_DBTYPE=='pgsql'){
- $currentEpsg = preg_replace("/EPSG:/", "", $this->epsg);
- $targetEpsg = preg_replace("/EPSG:/", "", $toEpsg);
- $sql = "SELECT X(transform(GeometryFromText('POINT(".$this->x." ".$this->y.")',".$currentEpsg."),".$targetEpsg.")) as x, ";
- $sql .= "Y(transform(GeometryFromText('POINT(".$this->x." ".$this->y.")',".$currentEpsg."),".$targetEpsg.")) as y";
- $res = db_query($sql);
- $point = new Mapbender_point(db_result($res,0,"x"), db_result($res,0,"y"), $toEpsg);
- $this->x = $point->x;
- $this->y = $point->y;
- $this->epsg = $point->epsg;
- }
- else {
- $e = new mb_exception("transformCoordinates needs PostgreSQL");
- }
- }
-
- function __toString() {
- return (string) "(" . $this->x . "," . $this->y . "," . $this->epsg . ")";
- }
-}
-
-/**
* A bounding box consisting of an lower left and an upper right point, and an EPSG.
*/
class Mapbender_bbox {
Property changes on: trunk/mapbender/http/classes/class_bbox.php
___________________________________________________________________
Name: svn:keywords
- Id
+ HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
Property changes on: trunk/mapbender/http/classes/class_keyword.php
___________________________________________________________________
Name: svn:keywords
+ HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
Modified: trunk/mapbender/http/classes/class_kml.php
===================================================================
--- trunk/mapbender/http/classes/class_kml.php 2008-01-15 08:11:29 UTC (rev 1964)
+++ trunk/mapbender/http/classes/class_kml.php 2008-01-15 08:24:29 UTC (rev 1965)
@@ -1,5 +1,5 @@
<?php
-# $Id: class_wmc.php,v 1.31 2006/03/16 14:49:30 c_baudson Exp $
+# $Id$
# http://www.mapbender.org/index.php/class_wmc.php
# Copyright (C) 2002 CCGIS
#
Property changes on: trunk/mapbender/http/classes/class_kml.php
___________________________________________________________________
Name: svn:keywords
+ HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
Modified: trunk/mapbender/http/classes/class_layer_monitor.php
===================================================================
--- trunk/mapbender/http/classes/class_layer_monitor.php 2008-01-15 08:11:29 UTC (rev 1964)
+++ trunk/mapbender/http/classes/class_layer_monitor.php 2008-01-15 08:24:29 UTC (rev 1965)
@@ -1,5 +1,5 @@
<?php
-# $Id: class_layer_monitor.php 791 2007-08-10 10:36:04Z baudson $
+# $Id$
# http://www.mapbender.org/index.php/
# Copyright (C) 2002 CCGIS
#
Property changes on: trunk/mapbender/http/classes/class_layer_monitor.php
___________________________________________________________________
Name: svn:keywords
+ HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
Property changes on: trunk/mapbender/http/classes/class_locale.php
___________________________________________________________________
Name: svn:keywords
+ HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
Property changes on: trunk/mapbender/http/classes/class_metadata.php
___________________________________________________________________
Name: svn:keywords
+ HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
Modified: trunk/mapbender/http/classes/class_monitor.php
===================================================================
--- trunk/mapbender/http/classes/class_monitor.php 2008-01-15 08:11:29 UTC (rev 1964)
+++ trunk/mapbender/http/classes/class_monitor.php 2008-01-15 08:24:29 UTC (rev 1965)
@@ -1,5 +1,5 @@
<?php
-# $Id: class_layer_monitor.php 791 2007-08-10 10:36:04Z baudson $
+# $Id$
# http://www.mapbender.org/index.php/
# Copyright (C) 2002 CCGIS
#
Property changes on: trunk/mapbender/http/classes/class_monitor.php
___________________________________________________________________
Name: svn:keywords
+ HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
Added: trunk/mapbender/http/classes/class_point.php
===================================================================
--- trunk/mapbender/http/classes/class_point.php (rev 0)
+++ trunk/mapbender/http/classes/class_point.php 2008-01-15 08:24:29 UTC (rev 1965)
@@ -0,0 +1,158 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
+$con = db_connect(DBSERVER,OWNER,PW);
+db_select_db(DB,$con);
+
+/**
+ * A Mapbender_point is a 2-dimensional point with an EPSG.
+ */
+class Mapbender_point {
+ var $x;
+ var $y;
+ var $epsg;
+
+ /**
+ * @constructor
+ */
+ function __construct($x, $y, $epsg) {
+ if (!$x || !$y || !$epsg) {
+ $e = new mb_exception("Mapbender_point: constructor: some parameters are not set (set (x: ".$x.", y: ".$y.", epsg:".$epsg.")!");
+ }
+ $this->x = $x;
+ $this->y = $y;
+ $this->epsg = $epsg;
+ }
+
+ /**
+ * computes a new point with the minimal coordinates of this point and $point
+ */
+ static function min ($point1, $point2) {
+ if ($point1->epsg == $point2->epsg) {
+ if ($point1->isWestOf($point2)) {
+ $minx = $point1->x;
+ }
+ else {
+ $minx = $point2->x;
+ }
+ if ($point1->isSouthOf($point2)) {
+ $miny = $point1->y;
+ }
+ else {
+ $miny = $point2->y;
+ }
+ return new Mapbender_point($minx, $miny, $point1->epsg);
+ }
+ else {
+ $e = new mb_exception("Mapbender_point: cannot process min with different EPSG codes");
+ }
+ }
+
+ /**
+ * computes a new point with the maximal coordinates of this point and $point
+ */
+ static function max ($point1, $point2) {
+ if ($point1->epsg == $point2->epsg) {
+ if ($point1->isWestOf($point2)) {
+ $maxx = $point2->x;
+ }
+ else {
+ $maxx = $point1->x;
+ }
+ if ($point1->isSouthOf($point2)) {
+ $maxy = $point2->y;
+ }
+ else {
+ $maxy = $point1->y;
+ }
+ return new Mapbender_point($maxx, $maxy, $point1->epsg);
+ }
+ else {
+ $e = new mb_exception("Mapbender_point: cannot process min with different EPSG codes");
+ }
+ }
+
+ function isWestOf($point) {
+ if ($this->x < $point->x) {
+ return true;
+ }
+ }
+
+ function isSouthOf($point) {
+ if ($this->y < $point->y) {
+ return true;
+ }
+ }
+
+ /**
+ * Addition
+ *
+ * @param anotherPoint another Mapbender_point
+ */
+ function plus ($anotherPoint) {
+ return new Mapbender_point($this->x + $anotherPoint->x, $this->y + $anotherPoint->y, $this->epsg);
+ }
+
+ /**
+ * Subtraction
+ *
+ * @param anotherPoint another Mapbender_point
+ */
+ function minus ($anotherPoint) {
+ return $this->plus($anotherPoint->times(-1));
+ }
+
+ /**
+ * Scalar multiplication
+ *
+ * @param aFloat a floating point number
+ */
+ function times ($aFloat) {
+ return new Mapbender_point($this->x * $aFloat, $this->y * $aFloat, $this->epsg);
+ }
+
+ /**
+ * transforms this point to another EPSG
+ *
+ * @param {Integer} toEpsg the coordinates are transformed to this EPSG code.
+ */
+ function transform($toEpsg) {
+ if(SYS_DBTYPE=='pgsql'){
+ $currentEpsg = preg_replace("/EPSG:/", "", $this->epsg);
+ $targetEpsg = preg_replace("/EPSG:/", "", $toEpsg);
+ $sql = "SELECT X(transform(GeometryFromText('POINT(".$this->x." ".$this->y.")',".$currentEpsg."),".$targetEpsg.")) as x, ";
+ $sql .= "Y(transform(GeometryFromText('POINT(".$this->x." ".$this->y.")',".$currentEpsg."),".$targetEpsg.")) as y";
+ $res = db_query($sql);
+ $point = new Mapbender_point(db_result($res,0,"x"), db_result($res,0,"y"), $toEpsg);
+ $this->x = $point->x;
+ $this->y = $point->y;
+ $this->epsg = $point->epsg;
+ }
+ else {
+ $e = new mb_exception("transformCoordinates needs PostgreSQL");
+ }
+ }
+
+ function __toString() {
+ return (string) "(" . $this->x . "," . $this->y . "," . $this->epsg . ")";
+ }
+}
+?>
\ No newline at end of file
Property changes on: trunk/mapbender/http/classes/class_point.php
___________________________________________________________________
Name: svn:keywords
+ HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
Modified: trunk/mapbender/http/classes/class_wfs_conf.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_conf.php 2008-01-15 08:11:29 UTC (rev 1964)
+++ trunk/mapbender/http/classes/class_wfs_conf.php 2008-01-15 08:24:29 UTC (rev 1965)
@@ -1,5 +1,5 @@
<?php
-# $Id: class_wfs_conf.php 1032 2007-10-09 10:37:42Z baudson $
+# $Id$
# http://www.mapbender.org/index.php/class_wfs_conf.php
# Copyright (C) 2002 CCGIS
#
Property changes on: trunk/mapbender/http/classes/class_wfs_conf.php
___________________________________________________________________
Name: svn:keywords
+ HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
Modified: trunk/mapbender/http/classes/class_wmc.php
===================================================================
--- trunk/mapbender/http/classes/class_wmc.php 2008-01-15 08:11:29 UTC (rev 1964)
+++ trunk/mapbender/http/classes/class_wmc.php 2008-01-15 08:24:29 UTC (rev 1965)
@@ -1,5 +1,5 @@
<?php
-# $Id: class_wmc.php 1233 2007-10-19 14:28:21Z baudson $
+# $Id$
# http://www.mapbender.org/index.php/class_wmc.php
# Copyright (C) 2002 CCGIS
#
Property changes on: trunk/mapbender/http/classes/class_wmc.php
___________________________________________________________________
Name: svn:keywords
+ HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php 2008-01-15 08:11:29 UTC (rev 1964)
+++ trunk/mapbender/http/classes/class_wms.php 2008-01-15 08:24:29 UTC (rev 1965)
@@ -94,7 +94,8 @@
xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1);
xml_parser_set_option($parser,XML_OPTION_TARGET_ENCODING,CHARSET);
- xml_parse_into_struct($parser,$this->wms_getcapabilities_doc,$values,$tags);
+// xml_parse_into_struct($parser,$this->wms_getcapabilities_doc,$values,$tags);
+ xml_parse_into_struct($parser,$data,$values,$tags);
$code = xml_get_error_code($parser);
if ($code) {
More information about the Mapbender_commits
mailing list