|
|
@@ -9,6 +9,63 @@ Lib::loadClass('Core_XmlWriter');
|
|
|
|
|
|
class Api_Wfs_GetCapabilities {
|
|
|
|
|
|
+ public function getCapabilitiesCsv($wfsServerUrl, $serviceTitle, $serviceDescription, $aclList) {
|
|
|
+ header('Content-Type: text/csv; charset=utf-8');
|
|
|
+ $csvLineSepartor = "\n";
|
|
|
+ $csvValueSepartor = ",";
|
|
|
+ $csvText = function ($value) {
|
|
|
+ return '"' . str_replace(['"'], ['\"'], $value) . '"';
|
|
|
+ };
|
|
|
+
|
|
|
+ echo implode(",", [
|
|
|
+ "Name",
|
|
|
+ "Title",
|
|
|
+ "namespace url",
|
|
|
+ "Keywords",
|
|
|
+ "Abstract",
|
|
|
+ "SRS",
|
|
|
+ "LatLongBoundingBox - minx",
|
|
|
+ "LatLongBoundingBox - miny",
|
|
|
+ "LatLongBoundingBox - maxx",
|
|
|
+ "LatLongBoundingBox - maxy",
|
|
|
+ ]);
|
|
|
+ echo $csvLineSepartor;
|
|
|
+
|
|
|
+ echo implode($csvLineSepartor, array_map(function ($acl) use ($csvText, $csvValueSepartor) {
|
|
|
+ $ns = Core_AclHelper::parseNamespaceUrl($acl->getNamespace());
|
|
|
+ return implode($csvValueSepartor, [
|
|
|
+ "p5_{$ns['prefix']}:{$ns['name']}", // Name
|
|
|
+ $csvText($acl->getRawLabel()), // Title
|
|
|
+ Api_WfsNs::getNsUri($ns['prefix']), // namespace url
|
|
|
+ $csvText(implode(', ', [ $acl->getID(), $acl->getName(), $acl->getRawLabel() ])), // Keywords
|
|
|
+ $csvText($acl->getRawOpis()), // Abstract
|
|
|
+ 'EPSG:4326', // SRS
|
|
|
+ "8.12328509871721", // LatLongBoundingBox - minx
|
|
|
+ "38.8575126897477", // LatLongBoundingBox - miny
|
|
|
+ "9.838674658246807", // LatLongBoundingBox - maxx
|
|
|
+ "41.31378404137082", // LatLongBoundingBox - maxy
|
|
|
+ ]);
|
|
|
+ }, $aclList));
|
|
|
+ echo $csvLineSepartor;
|
|
|
+
|
|
|
+ echo implode($csvLineSepartor, array_map(function ($typeName) use ($csvText, $csvValueSepartor) {
|
|
|
+ list($prefix, $name) = explode(':', $typeName);
|
|
|
+ return implode($csvValueSepartor, [
|
|
|
+ "p5_{$prefix}:{$name}", // Name
|
|
|
+ $csvText($name), // Title
|
|
|
+ Api_WfsNs::getNsUri($prefix), // namespace url
|
|
|
+ $csvText($name), // Keywords
|
|
|
+ $csvText($name), // Abstract
|
|
|
+ 'EPSG:4326', // SRS
|
|
|
+ "8.12328509871721", // LatLongBoundingBox - minx
|
|
|
+ "38.8575126897477", // LatLongBoundingBox - miny
|
|
|
+ "9.838674658246807", // LatLongBoundingBox - maxx
|
|
|
+ "41.31378404137082", // LatLongBoundingBox - maxy
|
|
|
+ ]);
|
|
|
+ }, Core_AclHelper::getCustomAclList()));
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+
|
|
|
public function getCapabilitiesXml($wfsServerUrl, $serviceTitle, $serviceDescription, $aclList) {
|
|
|
// if (V::get('DBG_ACL', '', $_GET)) {
|
|
|
// {
|