[Mapbender-commits] r9103 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Oct 21 01:48:41 PDT 2014


Author: armin11
Date: 2014-10-21 01:48:40 -0700 (Tue, 21 Oct 2014)
New Revision: 9103

Modified:
   trunk/mapbender/http/plugins/mb_metadata_server.php
Log:
Bugfixes for managing polygons in class_iso19139 and metadata addon editor

Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php	2014-10-21 08:48:28 UTC (rev 9102)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php	2014-10-21 08:48:40 UTC (rev 9103)
@@ -808,7 +808,8 @@
 			$export2csw = $mbMetadata->export2Csw; //boolean
 			$resultObj["update_frequency"] = $mbMetadata->updateFrequency; //text
 			//check for existing polygon
-			if (count($mbMetadata->polygonalExtentExterior) > 2) {	
+			//$e = new mb_exception("mb_metadata_server.php: count of polygon points ".count($mbMetadata->polygonalExtentExterior));
+			if (count($mbMetadata->polygonalExtentExterior) >= 1) {	
 				$e = new mb_notice("mb_metadata_server.php: count of polygon points ".count($mbMetadata->polygonalExtentExterior));
 				$resultObj["has_polygon"] = true;
 			} else {
@@ -928,7 +929,7 @@
 			$mbMetadata->inspireCharset = $data->inspire_charset;
 			$mbMetadata->updateFrequency = $data->update_frequency;
 			$mbMetadata->downloadLinks = array($data->downloadlink);
-			$mbMetadata->polygonalExtentExterior = null;
+			//$mbMetadata->polygonalExtentExterior = null; //this will delete existing polygons!
 			if (isset($data->inspire_whole_area) && $data->inspire_whole_area != "") {
 				$mbMetadata->inspireWholeArea = $data->inspire_whole_area;
 			} else {
@@ -1076,6 +1077,7 @@
 		} else {
 			$mbMetadata->export2Csw = 'f';
 		}
+		
 		if (isset($data->title)) {
 			$mbMetadata->title = $data->title;
 		}
@@ -1090,6 +1092,8 @@
 		}
 		if (isset($data->inspire_top_consistence)) {
 			$mbMetadata->inspireTopConsistence = $data->inspire_top_consistence;
+		} else {
+			$mbMetadata->inspireTopConsistence = "f";
 		}
 		if (isset($data->tmp_reference_1)) {
 			$mbMetadata->tmpExtentBegin = $data->tmp_reference_1;
@@ -1157,9 +1161,9 @@
 			$mbMetadata->inspireActualCoverage = 0;
 		}
 		if ($data->inspire_download == "on") {
-			$mbMetadata->inspire_download = 1;
+			$mbMetadata->inspireDownload = 1;
 		} else {
-			$mbMetadata->inspire_download = 0;
+			$mbMetadata->inspireDownload = 0;
 		}
 		//Check if origin is external and export2csw is activated!
 		if ($origin == 'external' ) {
@@ -1229,7 +1233,7 @@
 UPDATE mb_metadata SET bounding_geom = $2 WHERE metadata_id = $1			
 SQL;
 			$v = array($metadataId, $wktPolygon);
-			$e = new mb_exception($metadataId);
+			//$e = new mb_exception($metadataId);
 			$t = array('i','POLYGON');
 			$res = db_prep_query($sql,$v,$t);
 			if (!$res) {
@@ -1249,7 +1253,7 @@
 	break;
 	case "deleteGmlPolygon" :
 		$metadataId = $ajaxResponse->getParameter("metadataId");
-		$e = new mb_exception("metadataId: ".$metadataId);
+		$e = new mb_notice("metadataId: ".$metadataId);
 		$sql = <<<SQL
 UPDATE mb_metadata SET bounding_geom = NULL WHERE metadata_id = $1			
 SQL;



More information about the Mapbender_commits mailing list