[Mapbender-commits] r7002 - branches/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Oct 1 15:09:38 EDT 2010


Author: christoph
Date: 2010-10-01 19:09:38 +0000 (Fri, 01 Oct 2010)
New Revision: 7002

Modified:
   branches/mapbender/http/php/mod_evalArea.php
Log:
refactoring spatial function

Modified: branches/mapbender/http/php/mod_evalArea.php
===================================================================
--- branches/mapbender/http/php/mod_evalArea.php	2010-10-01 18:55:33 UTC (rev 7001)
+++ branches/mapbender/http/php/mod_evalArea.php	2010-10-01 19:09:38 UTC (rev 7002)
@@ -65,7 +65,6 @@
 }
 
 
-if(SYS_DBTYPE=='pgsql'){
 	if(count($posX) > 3){
 	  $sql = "SELECT area2d(GeometryFromText('MULTIPOLYGON(((";
 	  for($i=0; $i<count($posX); $i++){
@@ -81,36 +80,6 @@
 	else{
 	   echo "Fl&auml;che: 0 m<sup>2</sup>";
 	}
-}else{
-	#echo "Fl�chenberechnung f�r MySQL liegt derzeit nicht vor<br></sup>";
-	#$con = db_connect($GEOS_DBSERVER,$GEOS_PORT,$GEOS_OWNER,$GEOS_PW);
-	#db_select_db($GEOS_DBSERVER,$con);
-	$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");
-	
-	
-	if(count($posX) > 3){
-	  $sql = "SELECT area2d(GeometryFromText('MULTIPOLYGON(((";
-	  $i==0;
-	  for($i=0; $i<count($posX); $i++){
-	  	if($i>0){$sql .= ",";}
-	  	$sql .= $posX[$i] . " " . $posY[$i];
-	  }
-	  $sql .= ")))',".rawurldecode($epsg).")) as myArea";
-	  $res = pg_query($con,$sql);
-	  
-	  $cnt = 0;
-	  while(pg_fetch_row($res)){
-	  	 $area = pg_fetch_result($res,$cnt,0);
-	     echo "Fl&auml;che: ".round($area*100)/100 . " m<sup>2</sup>";
-	     $cnt++;
-	  }
-	}
-	else{
-	   echo "Fl&auml;che: 0 m<sup>2</sup>";
-	}
-}
 
 echo "<br>";
 echo "Umfang: ". htmlentities($length,ENT_QUOTES) . " m";



More information about the Mapbender_commits mailing list