[Mapbender-commits] r10000 - trunk/mapbender/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Nov 21 06:50:49 PST 2018
Author: armin11
Date: 2018-11-21 06:50:49 -0800 (Wed, 21 Nov 2018)
New Revision: 10000
Modified:
trunk/mapbender/http/php/mod_dataISOMetadata.php
Log:
Fix multipolygon gml:id attribute generation for metadata from mb_metadata
Modified: trunk/mapbender/http/php/mod_dataISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_dataISOMetadata.php 2018-11-15 11:10:44 UTC (rev 9999)
+++ trunk/mapbender/http/php/mod_dataISOMetadata.php 2018-11-21 14:50:49 UTC (rev 10000)
@@ -144,15 +144,15 @@
$gml3 = simplexml_load_string($gml3->asXML());
if ($gml3->xpath('//gml:MultiSurface')) {
$e = new mb_notice("php/mod_dataISOMetadata.php: MultiSurface found!");
- $gml3->addAttribute('gml:gml:id', md5($gml3->asXML()));
+ $gml3->addAttribute('gml:gml:id', '_'.md5($gml3->asXML()));
//count surfaceMembers
$numberOfSurfaces = count($gml3->xpath('//gml:MultiSurface/gml:surfaceMember'));
$e = new mb_notice("php/mod_dataISOMetadata.php: number of polygons: ".$numberOfSurfaces);
for ($k = 0; $k < $numberOfSurfaces; $k++) {
- $polygon = $gml3->xpath('//gml:MultiSurface/gml:surfaceMember/gml:Polygon');
+ $polygon = $gml3->xpath('//gml:MultiSurface/gml:surfaceMember['.(integer)($k + 1).']/gml:Polygon');
//$e = new mb_exception($polygon[0]->asXML());
$polygon = $polygon[0];
- $polygon->addAttribute('gml:gml:id', md5($polygon->asXML()));
+ $polygon->addAttribute('gml:gml:id', '_'.md5($polygon->asXML()));
}
$mb_metadata['boundingGmlMultiPolygon'] = true;
} else {
@@ -159,7 +159,7 @@
$e = new mb_notice("php/mod_dataISOMetadata.php: no MultiSurface found - search for polygon!");
if($gml3->xpath('//gml:Polygon')) {
$e = new mb_notice("php/mod_dataISOMetadata.php: number of polygons: 1");
- $gml3->addAttribute('gml:gml:id', md5($gml3->asXML()));
+ $gml3->addAttribute('gml:gml:id', '_'.md5($gml3->asXML()));
}
}
}
More information about the Mapbender_commits
mailing list