[Mapbender-commits] r1593 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Aug 6 04:20:51 EDT 2007


Author: christoph
Date: 2007-08-06 04:20:51 -0400 (Mon, 06 Aug 2007)
New Revision: 1593

Modified:
   trunk/mapbender/http/php/mod_changeEPSG.php
   trunk/mapbender/http/php/mod_changeEPSG_dynamic.php
Log:
replaced old string functions by multibyte string function

Modified: trunk/mapbender/http/php/mod_changeEPSG.php
===================================================================
--- trunk/mapbender/http/php/mod_changeEPSG.php	2007-08-06 08:08:51 UTC (rev 1592)
+++ trunk/mapbender/http/php/mod_changeEPSG.php	2007-08-06 08:20:51 UTC (rev 1593)
@@ -54,45 +54,45 @@
 # transform coordinates
 if(isset($_REQUEST["srs"])){
 	require_once("../../conf/mapbender.conf");
-	$arraymapObj = split("###", $_REQUEST["srs"]);
+	$arraymapObj = mb_split("###", $_REQUEST["srs"]);
 	echo "<script type='text/javascript'>";
 	echo "var newExtent = new Array();";
 	for($i=0; $i < count($arraymapObj); $i++){
-		$temp = split(",",$arraymapObj[$i]);
+		$temp = mb_split(",",$arraymapObj[$i]);
 		if(SYS_DBTYPE=='pgsql'){
 			$con = db_connect($DBSERVER,$OWNER,$PW);
-			$sqlMinx = "SELECT X(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as minx";
+			$sqlMinx = "SELECT X(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as minx";
 			$resMinx = db_query($sqlMinx);
 			$minx = db_result($resMinx,0,"minx");
 			
-			$sqlMiny = "SELECT Y(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as miny";
+			$sqlMiny = "SELECT Y(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as miny";
 			$resMiny = db_query($sqlMiny);
 			$miny = db_result($resMiny,0,"miny");
 			
-			$sqlMaxx = "SELECT X(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxx";
+			$sqlMaxx = "SELECT X(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxx";
 			$resMaxx =db_query($sqlMaxx);
 			$maxx = db_result($resMaxx,0,"maxx");
 			
-			$sqlMaxy = "SELECT Y(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxy";
+			$sqlMaxy = "SELECT Y(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxy";
 			$resMaxy = db_query($sqlMaxy);
 			$maxy = db_result($resMaxy,0,"maxy");
 		}else{
 			$con_string = "host=$GEOS_DBSERVER port=$GEOS_PORT dbname=$GEOS_DB user=$GEOS_OWNER password=$GEOS_PW";
 			$con = pg_connect($con_string) or die ("Error while connecting database");
 			
-			$sqlMinx = "SELECT X(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as minx";
+			$sqlMinx = "SELECT X(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as minx";
 			$resMinx = pg_query($con,$sqlMinx);
 			$minx = pg_fetch_result($resMinx,0,"minx");
 			
-			$sqlMiny = "SELECT Y(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as miny";
+			$sqlMiny = "SELECT Y(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as miny";
 			$resMiny = pg_query($con,$sqlMiny);
 			$miny = pg_fetch_result($resMiny,0,"miny");
 			
-			$sqlMaxx = "SELECT X(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxx";
+			$sqlMaxx = "SELECT X(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxx";
 			$resMaxx = pg_query($con,$sqlMaxx);
 			$maxx = pg_fetch_result($resMaxx,0,"maxx");
 			
-			$sqlMaxy = "SELECT Y(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxy";
+			$sqlMaxy = "SELECT Y(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxy";
 			$resMaxy = pg_query($con,$sqlMaxy);
 			$maxy = pg_fetch_result($resMaxy,0,"maxy");
 		}

Modified: trunk/mapbender/http/php/mod_changeEPSG_dynamic.php
===================================================================
--- trunk/mapbender/http/php/mod_changeEPSG_dynamic.php	2007-08-06 08:08:51 UTC (rev 1592)
+++ trunk/mapbender/http/php/mod_changeEPSG_dynamic.php	2007-08-06 08:20:51 UTC (rev 1593)
@@ -113,27 +113,27 @@
 	require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
 	$con = pg_connect ($con_string) or die ("Error while connecting database DBname");
 	
-	$arraymapObj = split("###", $_REQUEST["srs"]);
+	$arraymapObj = mb_split("###", $_REQUEST["srs"]);
 	
 	echo "<script type='text/javascript'>";
 	echo "var newExtent = new Array();";
 	
 	for($i=0; $i < count($arraymapObj); $i++){
-		$temp = split(",",$arraymapObj[$i]);
+		$temp = mb_split(",",$arraymapObj[$i]);
 		
-		$sqlMinx = "SELECT X(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as minx";
+		$sqlMinx = "SELECT X(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as minx";
 		$resMinx = @pg_query($con,$sqlMinx);
 		$minx = pg_result($resMinx,0,"minx");
 		
-		$sqlMiny = "SELECT Y(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as miny";
+		$sqlMiny = "SELECT Y(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as miny";
 		$resMiny = @pg_query($con,$sqlMiny);
 		$miny = pg_result($resMiny,0,"miny");
 		
-		$sqlMaxx = "SELECT X(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxx";
+		$sqlMaxx = "SELECT X(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxx";
 		$resMaxx = @pg_query($con,$sqlMaxx);
 		$maxx = pg_result($resMaxx,0,"maxx");
 		
-		$sqlMaxy = "SELECT Y(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxy";
+		$sqlMaxy = "SELECT Y(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxy";
 		$resMaxy = @pg_query($con,$sqlMaxy);		 
 		$maxy = pg_result($resMaxy,0,"maxy");
 	



More information about the Mapbender_commits mailing list