[Mapbender-commits] r8697 - in trunk/mapbender: http/classes http/plugins resources/db/pgsql/UTF-8/update
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Aug 28 13:04:37 PDT 2013
Author: armin11
Date: 2013-08-28 13:04:37 -0700 (Wed, 28 Aug 2013)
New Revision: 8697
Modified:
trunk/mapbender/http/classes/class_iso19139.php
trunk/mapbender/http/plugins/mb_metadata_addon.php
trunk/mapbender/http/plugins/mb_metadata_server.php
trunk/mapbender/http/plugins/mb_metadata_showMetadataAddonWfs.js
trunk/mapbender/http/plugins/mb_metadata_wfs_server.php
trunk/mapbender/http/plugins/wfsConfTree.js
trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.3_to_2.7.4_pgsql_UTF-8.sql
Log:
Allow bequeath spatial extent from layer/featuretype to coupled metadata resource.
Modified: trunk/mapbender/http/classes/class_iso19139.php
===================================================================
--- trunk/mapbender/http/classes/class_iso19139.php 2013-08-28 06:37:01 UTC (rev 8696)
+++ trunk/mapbender/http/classes/class_iso19139.php 2013-08-28 20:04:37 UTC (rev 8697)
@@ -26,12 +26,12 @@
var $title;
var $abstract;
var $metadata;
+ var $wgs84Bbox = array(); //minx, miny, maxx, maxy in EPSG:4326
var $datasetId;
var $datasetIdCodeSpace;
var $keywords = array();
var $keywordsThesaurusName = array();
var $isoCategoryKeys = array();
-
var $isoCategories = array();
var $inspireCategories = array();
var $customCategories = array();
@@ -69,6 +69,7 @@
$this->createDate = "1900-01-01";
$this->changeDate = "1900-01-01";
$this->metadata = "";
+ $this->wgs84Bbox = array(-180.0,-90.0,180.0,90.0); //minx, miny, maxx, maxy in EPSG:4326
$this->datasetId = "";
$this->datasetIdCodeSpace = "";
$this->keywords = array();
@@ -232,6 +233,17 @@
foreach ($this->customCategories as $category) {
$e = new mb_exception("class_iso19139.php: customcat: ".$category);
}
+ /*<gmd:extent><gmd:EX_Extent><gmd:geographicElement><gmd:EX_GeographicBoundingBox><gmd:westBoundLongitude><gco:Decimal>5</gco:Decimal></gmd:westBoundLongitude><gmd:eastBoundLongitude><gco:Decimal>10</gco:Decimal></gmd:eastBoundLongitude><gmd:southBoundLatitude><gco:Decimal>48</gco:Decimal></gmd:southBoundLatitude><gmd:northBoundLatitude><gco:Decimal>52</gco:Decimal></gmd:northBoundLatitude></gmd:EX_GeographicBoundingBox></gmd:geographicElement></gmd:EX_Extent></gmd:extent>*/
+ //get bbox from xml:
+ $minx = $iso19139Xml->xpath('/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:westBoundLongitude/gco:Decimal');
+ $minx = $minx[0];
+ $miny = $iso19139Xml->xpath('/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:southBoundLatitude/gco:Decimal');
+ $miny = $miny[0];
+ $maxx = $iso19139Xml->xpath('/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:eastBoundLongitude/gco:Decimal');
+ $maxx = $maxx[0];
+ $maxy = $iso19139Xml->xpath('/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:northBoundLatitude/gco:Decimal');
+ $maxy = $maxy[0];
+ $this->wgs84Bbox = array($minx,$miny,$maxx,$maxy);
$this->hierachyLevel = $iso19139Xml->xpath('/gmd:MD_Metadata/gmd:hierarchyLevel/gmd:MD_ScopeCode');
$this->hierachyLevel = $this->hierachyLevel[0];
$this->tmpExtentBegin = $iso19139Xml->xpath('/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition');
@@ -660,7 +672,7 @@
}
public function createFromDBInternalId($metadataId){
- $sql = "SELECT * from mb_metadata WHERE metadata_id = $1";
+ $sql = "SELECT * , box2d(the_geom) as bbox2d from mb_metadata WHERE metadata_id = $1";
$v = array($metadataId);
$t = array('i');
$res = db_prep_query($sql,$v,$t);
@@ -677,7 +689,11 @@
//some possibilities:
$this->datasetId = $row['datasetid'];
$this->datasetIdCodeSpace = $row['datasetid_codespace'];
-
+ if (isset($row['bbox2d']) && $row['bbox2d'] != '') {
+ $bbox = str_replace(' ',',',str_replace(')','',str_replace('BOX(','',$row['bbox2d'])));
+ $e = new mb_exception("class_iso19139.php: got bbox for metadata: ".$bbox);
+ $this->wgs84Bbox = explode(',',$bbox);
+ }
//fill keywords and categories later cause they are stored in relations!
/*$this->keywords = array();
$this->keywordsThesaurusName = array();
@@ -995,6 +1011,13 @@
return false;
}
}
+
+ private function createWktBboxFromArray($bboxArray) {
+ $postGisBbox = "";
+ //"SRID=4326;POLYGON((-140 -80,-140 80,170 80,170 -80,-140 -80))"
+ $postGisBbox = "SRID=4326;POLYGON((".$bboxArray[0]." ".$bboxArray[1].",".$bboxArray[0]." ".$bboxArray[3].",".$bboxArray[2]." ".$bboxArray[3].",".$bboxArray[2]." ".$bboxArray[1].",".$bboxArray[0]." ".$bboxArray[1]."))";
+ return $postGisBbox;
+ }
public function insertKeywordsAndCategoriesIntoDB($metadataId,$resourceType,$resourceId){
//first delete old classifications - after that create new ones
@@ -1281,7 +1304,7 @@
public function insertMetadataIntoDB() {
//insert an instance for iso19139 into mapbenders database
$sql = <<<SQL
-INSERT INTO mb_metadata (lastchanged, link, origin, md_format, data, linktype, uuid, title, createdate, changedate, abstract, searchtext, type, tmp_reference_1, tmp_reference_2, export2csw, datasetid, datasetid_codespace, randomid, fkey_mb_user_id, harvestresult, harvestexception, lineage, inspire_top_consistence, spatial_res_type, spatial_res_value, update_frequency, format, inspire_charset, ref_system) VALUES(now(), $1, $18, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29)
+INSERT INTO mb_metadata (lastchanged, link, origin, md_format, data, linktype, uuid, title, createdate, changedate, abstract, searchtext, type, tmp_reference_1, tmp_reference_2, export2csw, datasetid, datasetid_codespace, randomid, fkey_mb_user_id, harvestresult, harvestexception, lineage, inspire_top_consistence, spatial_res_type, spatial_res_value, update_frequency, format, inspire_charset, ref_system, the_geom) VALUES(now(), $1, $18, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30)
SQL;
$v = array(
$this->href,
@@ -1312,9 +1335,10 @@
$this->updateFrequency,
$this->dataFormat,
$this->inspireCharset,
- $this->refSystem
+ $this->refSystem,
+ $this->createWktBboxFromArray($this->wgs84Bbox)
);
- $t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','b','s','s','s','s','i','i','s','s','b','s','s','s','s','s','s');
+ $t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','b','s','s','s','s','i','i','s','s','b','s','s','s','s','s','s','POLYGON');
$res = db_prep_query($sql,$v,$t);
return $res;
}
@@ -1328,7 +1352,7 @@
$sql .= "linktype = $4, uuid = $5, title = $6, createdate = $7, changedate = $8, lastchanged = now(), ";
$sql .= "abstract = $9, searchtext = $10, type = $11, tmp_reference_1 = $12, tmp_reference_2 = $13, export2csw = $14, datasetid = $15, ";
$sql .= "datasetid_codespace = $16, randomid = $17, harvestresult = $20, harvestexception = $21, lineage = $22, inspire_top_consistence = $23, ";
- $sql .= "spatial_res_type = $24, spatial_res_value = $25, update_frequency = $26, format = $27, inspire_charset = $28, ref_system = $29 WHERE metadata_id = $19";
+ $sql .= "spatial_res_type = $24, spatial_res_value = $25, update_frequency = $26, format = $27, inspire_charset = $28, ref_system = $29, the_geom = $30 WHERE metadata_id = $19";
$v = array(
$this->href,
@@ -1360,9 +1384,10 @@
$this->updateFrequency,
$this->dataFormat,
$this->inspireCharset,
- $this->refSystem
+ $this->refSystem,
+ $this->createWktBboxFromArray($this->wgs84Bbox)
);
- $t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','b','s','s','s','s','i','i','s','s','b','s','s','s','s','s','s');
+ $t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','b','s','s','s','s','i','i','s','s','b','s','s','s','s','s','s','POLYGON');
$res = db_prep_query($sql,$v,$t);
return $res;
}
Modified: trunk/mapbender/http/plugins/mb_metadata_addon.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_addon.php 2013-08-28 06:37:01 UTC (rev 8696)
+++ trunk/mapbender/http/plugins/mb_metadata_addon.php 2013-08-28 20:04:37 UTC (rev 8697)
@@ -67,6 +67,9 @@
<li><a href="#tabs-3"><?php echo _mb("Temporal extent");?></a></li>
<li><a href="#tabs-4"><?php echo _mb("Quality");?></a></li>
<li><a href="#tabs-5"><?php echo _mb("Spatial Extent");?></a></li>
+ <li><a href="#tabs-6"><?php echo _mb("Download");?></a></li>
+ <li><a href="#tabs-7"><?php echo _mb("Covering Area");?></a></li>
+ <li><a href="#tabs-8"><?php echo _mb("Licences/Constraints");?></a></li>
</ul>
<!--<legend><?php echo _mb("Simple metadata editor");?></legend>-->
<div id="tabs-1">
@@ -213,8 +216,40 @@
</div>
<div id="tabs-5">
- undefined
+ <fieldset>
+ <legend><?php echo _mb("Bounding Box");?><img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("This is the bounding box of the dataset given in geographic coordinates in WGS84 (EPSG:4326). The bounding box may be inherited by the calling service contents bounding box (layer/featuretype) or defined by the registrating person later on.");?>'}" src="../img/questionmark.png" alt="" /></legend>
+ <label for="west">
+ <?php echo _mb("West [decimal degrees]");?>
+ <input class="required" name="west" id="west"/>
+
+ </label><br>
+ <label for="north">
+ <?php echo _mb("North [decimal degrees]");?>
+ <input class="required" name="north" id="north"/>
+
+ </label><br>
+ <label for="east">
+ <?php echo _mb("East [decimal degrees]");?>
+ <input class="required" name="east" id="east"/>
+
+ </label><br>
+ <label for="south">
+ <?php echo _mb("South [decimal degrees]");?>
+ <input class="required" name="south" id="south"/>
+
+ </label>
+ </fieldset>
+ <fieldset>
+ <legend><?php echo _mb("User defined region");?><img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("You can define your own bounding box or region if you upload an gml geometry object. Only bbox and polygons are accepted at the moment!");?>'}" src="../img/questionmark.png" alt="" /></legend>
+ <table id='geometryuploadtable' name='geometryuploadtable'><tr><td><img onclick='initUploadForm();' src='../img/button_blue_red/up.png' id='uploadImage' title='upload' /></td><td><?php echo _mb("Upload a surronding geometry for this dataset");?><img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Help for geometry upload possibility");?>'}" src="../img/questionmark.png" alt="" /></td></tr></table>
+ </fieldset>
</div>
+ <div id="tabs-6">
+ </div>
+ <div id="tabs-7">
+ </div>
+ <div id="tabs-8">
+ </div>
</div><!--accordion-->
</div><!--demo-->
</fieldset>
Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php 2013-08-28 06:37:01 UTC (rev 8696)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php 2013-08-28 20:04:37 UTC (rev 8697)
@@ -221,10 +221,10 @@
case "getLayerMetadata" :
$layerId = $ajaxResponse->getParameter("id");
getLayer($layerId);
-
+ //new - only layers with latlonbboxes are supported!
$sql = <<<SQL
-SELECT layer_id, layer_name, layer_title, layer_abstract, layer_searchable, inspire_download, fkey_wms_id as wms_id
+SELECT layer_id, layer_name, layer_title, layer_abstract, layer_searchable, inspire_download, fkey_wms_id as wms_id
FROM layer WHERE layer_id = $layerId;
SQL;
@@ -280,9 +280,14 @@
}
$resultObj['inspire_download'] = $resultObj['inspire_download'] == 1 ? true : false;
-
-
-
+ //get wgs84Bbox for relevant layer - to be bequeathed to the metadata
+ /*$sql = <<<SQL
+SELECT minx, miny, maxx, maxy from layer_epsg WHERE fkey_layer_id = $1 AND epsg = 'EPSG:4326'
+SQL;
+ $res = db_query($sql);*/
+
+ //read out values
+
//get coupled MetadataURLs from md_metadata and ows_relation_metadata table
$sql = <<<SQL
SELECT metadata_id, uuid, link, linktype, md_format, relation.relation_type, origin FROM mb_metadata
@@ -488,7 +493,7 @@
"layer_inspire_category_id",
"layer_custom_category_id"
);
- //extract relevant information from json and fill them into the wms object
+ //extract relevant information from json and fill them into the wms object // both are filled together!!
foreach ($columns as $c) {
$value = $data->layer->$c;
$e = new mb_notice("plugins/mb_metadata_server.php: layer entry for ".$c.": ".$data->layer->$c);
@@ -659,6 +664,10 @@
$resultObj["lineage"] = $mbMetadata->lineage; //text
$resultObj["tmp_reference_1"] = $mbMetadata->tmpExtentBegin; //text
$resultObj["tmp_reference_2"] = $mbMetadata->tmpExtentEnd; //text
+ $resultObj["west"] = $mbMetadata->wgs84Bbox[0];
+ $resultObj["south"] = $mbMetadata->wgs84Bbox[1];
+ $resultObj["east"] = $mbMetadata->wgs84Bbox[2];
+ $resultObj["north"] = $mbMetadata->wgs84Bbox[3];
$export2csw = $mbMetadata->export2Csw; //boolean
$resultObj["update_frequency"] = $mbMetadata->updateFrequency; //text
switch ($export2csw) {
@@ -707,7 +716,8 @@
$layerId = $ajaxResponse->getParameter("layerId");
$metadataId = $ajaxResponse->getParameter("metadataId");
$sql = <<<SQL
-SELECT layer_title, layer_abstract from layer where layer_id = $1
+SELECT layer_title, layer_abstract, minx as west, miny as south, maxx as east, maxy as north
+FROM layer INNER JOIN layer_epsg ON layer.layer_id = layer_epsg.fkey_layer_id WHERE layer_id = $1 AND epsg = 'EPSG:4326';
SQL;
$v = array($layerId);
$t = array('i');
@@ -717,6 +727,10 @@
$row = db_fetch_assoc($res);
$resultObj["title"]= $row['layer_title']; //serial
$resultObj["abstract"] = $row["layer_abstract"]; //char
+ $resultObj["west"]= $row['west']; //double
+ $resultObj["south"] = $row["south"]; //double
+ $resultObj["east"]= $row['east']; //double
+ $resultObj["north"] = $row["north"]; //double
}
$ajaxResponse->setResult($resultObj);
$ajaxResponse->setSuccess(true);
@@ -754,6 +768,7 @@
$mbMetadata->spatialResValue = $data->spatial_res_value;
$mbMetadata->inspireCharset = $data->inspire_charset;
$mbMetadata->updateFrequency = $data->update_frequency;
+
//categories ...
//new for keywords and classifications:
if (isset($data->keywords) && $data->keywords != "") {
@@ -772,6 +787,19 @@
if (isset($data->md_custom_category_id)) {
$mbMetadata->customCategories = $data->md_custom_category_id;
}
+ //use information from bbox!
+ if (isset($data->west)) {
+ $mbMetadata->wgs84Bbox[0] = $data->west;
+ }
+ if (isset($data->east)) {
+ $mbMetadata->wgs84Bbox[2] = $data->east;
+ }
+ if (isset($data->north)) {
+ $mbMetadata->wgs84Bbox[3] = $data->north;
+ }
+ if (isset($data->south)) {
+ $mbMetadata->wgs84Bbox[1] = $data->south;
+ }
//try to update metadata object (only mb_metadata)
$res = $mbMetadata->updateMetadataById($metadataId);
if (!$res) {
@@ -931,6 +959,19 @@
if (isset($data->md_custom_category_id)) {
$mbMetadata->customCategories = $data->md_custom_category_id;
}
+ //use information from bbox!
+ if (isset($data->west)) {
+ $mbMetadata->wgs84Bbox[0] = $data->west;
+ }
+ if (isset($data->east)) {
+ $mbMetadata->wgs84Bbox[2] = $data->east;
+ }
+ if (isset($data->north)) {
+ $mbMetadata->wgs84Bbox[3] = $data->north;
+ }
+ if (isset($data->south)) {
+ $mbMetadata->wgs84Bbox[1] = $data->south;
+ }
//Check if origin is external and export2csw is activated!
if ($origin == 'external' ) {
//harvest link from location, parse the content for datasetid and push xml into data column
Modified: trunk/mapbender/http/plugins/mb_metadata_showMetadataAddonWfs.js
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_showMetadataAddonWfs.js 2013-08-28 06:37:01 UTC (rev 8696)
+++ trunk/mapbender/http/plugins/mb_metadata_showMetadataAddonWfs.js 2013-08-28 20:04:37 UTC (rev 8697)
@@ -317,6 +317,16 @@
$metadataAddonPopup.dialog("open");
};
+ initGeometryUpload = function () {
+ //start upload form
+ //check if edit or create new - or store it in tmp folder to hold it later
+ //
+ //after upload send
+ //generate bbox if upload successful
+ //
+
+ }
+
initUploadForm = function (featuretypeId) {
$metadataAddonPopup.dialog("close");
initXmlImport(featuretypeId);
Modified: trunk/mapbender/http/plugins/mb_metadata_wfs_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_wfs_server.php 2013-08-28 06:37:01 UTC (rev 8696)
+++ trunk/mapbender/http/plugins/mb_metadata_wfs_server.php 2013-08-28 20:04:37 UTC (rev 8697)
@@ -324,8 +324,10 @@
case "getInitialFeaturetypeMetadata" :
$featuretypeId = $ajaxResponse->getParameter("featuretypeId");
$metadataId = $ajaxResponse->getParameter("metadataId");
+ //TODO: check like operator and ambigious wfs_featuretype_epsg - are they not deleted on update? Get rid of the limit 1
$sql = <<<SQL
-SELECT featuretype_title, featuretype_abstract from wfs_featuretype where featuretype_id = $1
+SELECT featuretype_title, featuretype_abstract, minx as west, miny as south, maxx as east, maxy as north
+FROM wfs_featuretype INNER JOIN wfs_featuretype_epsg ON wfs_featuretype.featuretype_id = wfs_featuretype_epsg.fkey_featuretype_id WHERE featuretype_id = $1 AND epsg like '%:4326' LIMIT 1
SQL;
$v = array($featuretypeId);
$t = array('i');
@@ -335,6 +337,10 @@
$row = db_fetch_assoc($res);
$resultObj["title"]= $row['featuretype_title']; //serial
$resultObj["abstract"] = $row["featuretype_abstract"]; //char
+ $resultObj["west"]= $row['west']; //double
+ $resultObj["south"] = $row["south"]; //double
+ $resultObj["east"]= $row['east']; //double
+ $resultObj["north"] = $row["north"]; //double
}
$ajaxResponse->setResult($resultObj);
$ajaxResponse->setSuccess(true);
Modified: trunk/mapbender/http/plugins/wfsConfTree.js
===================================================================
--- trunk/mapbender/http/plugins/wfsConfTree.js 2013-08-28 06:37:01 UTC (rev 8696)
+++ trunk/mapbender/http/plugins/wfsConfTree.js 2013-08-28 20:04:37 UTC (rev 8697)
@@ -20,11 +20,8 @@
//Mapbender.modules.i18n.localize(Mapbender.languageId);
}
-
-
var $confTree = $(this);
var ConfTree = function(o){
-
var that = this;
var wfsConfIdString = o.wfsConfIdString || "";
var wfsconfs = wfsConfIdString.split(',');
@@ -35,8 +32,6 @@
}
wfsConfIdString = wfsconfs.join(',');
var currentWFSConf = {};
-
-
if(Mapbender.modules.loadwmc){
Mapbender.modules.loadwmc.events.loaded.register(function (obj) {
if (obj.extensionData && obj.extensionData.WFSCONFIDSTRING) {
@@ -54,7 +49,6 @@
}
});
}
-
var $wfsConfDialog = $("<div></div>").dialog({
width: 500,
height: 600,
@@ -75,7 +69,6 @@
}
});
-
var reset = function(aWFSConf){
wfsconfs = [];
$confTree.children().remove();
@@ -97,7 +90,6 @@
}else{
$featuretypeList = $featuretypeFolder.find("ul");
};
-
//parseInt because one version of wfsConf creates this as a string, the other as an int
switch(parseInt(aWFSConf[i].type,10)){
/* search */
@@ -112,7 +104,7 @@
/* download */
case 2:
- $wfsconfEntry = $('<li class="download" ><img src="../img/gnome/document_save.png" /><button class="remove">remo</button><img class="meta" src="../img/button_blue_red/getArea_over.png" /> <a href="#" class="dialogopen">'+ aWFSConf[i].label +'</a></li>');
+ $wfsconfEntry = $('<li class="download" ><img src="../img/gnome/document-save.png" /><button class="remove">remo</button><img class="meta" src="../img/button_blue_red/getArea_over.png" /> <a href="#" class="dialogopen">'+ aWFSConf[i].label +'</a></li>');
break;
}
@@ -127,8 +119,6 @@
$wfsConfDialog.empty();
$wfsConfDialog.append($iframe);
$wfsConfDialog.dialog("open");
-
-
};
})(aWFSConf[i]));
Modified: trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.3_to_2.7.4_pgsql_UTF-8.sql
===================================================================
--- trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.3_to_2.7.4_pgsql_UTF-8.sql 2013-08-28 06:37:01 UTC (rev 8696)
+++ trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.3_to_2.7.4_pgsql_UTF-8.sql 2013-08-28 20:04:37 UTC (rev 8697)
@@ -597,3 +597,14 @@
ALTER TABLE wfs ADD COLUMN inspire_daily_requests double precision;
+-- Check: enforce_geotype_the_geom - allow also polygons!
+
+ALTER TABLE mb_metadata DROP CONSTRAINT enforce_geotype_the_geom;
+
+
+
+ALTER TABLE mb_metadata
+ ADD CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL OR geometrytype(the_geom) = 'POLYGON'::text);
+
+
+
More information about the Mapbender_commits
mailing list