Source Code Cross Referenced for WMSCapabilitiesDocument_1_3_0.java in  » GIS » deegree » org » deegree » ogcwebservices » wms » capabilities » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » deegree » org.deegree.ogcwebservices.wms.capabilities 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/trunk/src/org/deegree/ogcwebservices/wms/capabilities/WMSCapabilitiesDocument_1_3_0.java $
0002:        /*----------------    FILE HEADER  ------------------------------------------
0003:
0004:         This file is part of deegree.
0005:         Copyright (C) 2001-2008 by:
0006:         EXSE, Department of Geography, University of Bonn
0007:         http://www.giub.uni-bonn.de/deegree/
0008:         lat/lon GmbH
0009:         http://www.lat-lon.de
0010:
0011:         This library is free software; you can redistribute it and/or
0012:         modify it under the terms of the GNU Lesser General Public
0013:         License as published by the Free Software Foundation; either
0014:         version 2.1 of the License, or (at your option) any later version.
0015:
0016:         This library is distributed in the hope that it will be useful,
0017:         but WITHOUT ANY WARRANTY; without even the implied warranty of
0018:         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0019:         Lesser General Public License for more details.
0020:
0021:         You should have received a copy of the GNU Lesser General Public
0022:         License along with this library; if not, write to the Free Software
0023:         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
0024:
0025:         Contact:
0026:
0027:         Andreas Poth
0028:         lat/lon GmbH
0029:         Aennchenstr. 19
0030:         53115 Bonn
0031:         Germany
0032:         E-Mail: poth@lat-lon.de
0033:
0034:         Prof. Dr. Klaus Greve
0035:         Department of Geography
0036:         University of Bonn
0037:         Meckenheimer Allee 166
0038:         53115 Bonn
0039:         Germany
0040:         E-Mail: greve@giub.uni-bonn.de
0041:
0042:        
0043:         ---------------------------------------------------------------------------*/
0044:        package org.deegree.ogcwebservices.wms.capabilities;
0045:
0046:        import java.io.IOException;
0047:        import java.net.MalformedURLException;
0048:        import java.net.URI;
0049:        import java.net.URISyntaxException;
0050:        import java.net.URL;
0051:        import java.util.ArrayList;
0052:        import java.util.Arrays;
0053:        import java.util.Date;
0054:        import java.util.List;
0055:
0056:        import org.deegree.datatypes.Code;
0057:        import org.deegree.datatypes.QualifiedName;
0058:        import org.deegree.datatypes.values.TypedLiteral;
0059:        import org.deegree.framework.log.ILogger;
0060:        import org.deegree.framework.log.LoggerFactory;
0061:        import org.deegree.framework.util.StringTools;
0062:        import org.deegree.framework.xml.XMLParsingException;
0063:        import org.deegree.framework.xml.XMLTools;
0064:        import org.deegree.i18n.Messages;
0065:        import org.deegree.model.crs.CRSFactory;
0066:        import org.deegree.model.crs.CoordinateSystem;
0067:        import org.deegree.model.crs.UnknownCRSException;
0068:        import org.deegree.model.metadata.iso19115.Address;
0069:        import org.deegree.model.metadata.iso19115.CitedResponsibleParty;
0070:        import org.deegree.model.metadata.iso19115.Constraints;
0071:        import org.deegree.model.metadata.iso19115.ContactInfo;
0072:        import org.deegree.model.metadata.iso19115.Keywords;
0073:        import org.deegree.model.metadata.iso19115.Linkage;
0074:        import org.deegree.model.metadata.iso19115.OnlineResource;
0075:        import org.deegree.model.metadata.iso19115.Phone;
0076:        import org.deegree.model.spatialschema.Envelope;
0077:        import org.deegree.model.spatialschema.GeometryFactory;
0078:        import org.deegree.model.spatialschema.Position;
0079:        import org.deegree.ogcbase.CommonNamespaces;
0080:        import org.deegree.ogcwebservices.getcapabilities.InvalidCapabilitiesException;
0081:        import org.deegree.ogcwebservices.getcapabilities.MetadataURL;
0082:        import org.deegree.ogcwebservices.getcapabilities.OGCCapabilities;
0083:        import org.deegree.owscommon_new.DCP;
0084:        import org.deegree.owscommon_new.DomainType;
0085:        import org.deegree.owscommon_new.HTTP;
0086:        import org.deegree.owscommon_new.Operation;
0087:        import org.deegree.owscommon_new.OperationsMetadata;
0088:        import org.deegree.owscommon_new.Parameter;
0089:        import org.deegree.owscommon_new.ServiceIdentification;
0090:        import org.deegree.owscommon_new.ServiceProvider;
0091:        import org.w3c.dom.Element;
0092:        import org.w3c.dom.Node;
0093:        import org.xml.sax.SAXException;
0094:
0095:        /**
0096:         * <code>WMSCapabilitiesDocument_1_3_0</code> is a parser class for capabilities documents
0097:         * according to the OGC WMS 1.3.0 specification.
0098:         * 
0099:         * @author <a href="mailto:schmitz@lat-lon.de">Andreas Schmitz</a>
0100:         * @author last edited by: $Author: apoth $
0101:         * 
0102:         * @version 2.0, $Revision: 9348 $, $Date: 2007-12-27 08:59:14 -0800 (Thu, 27 Dec 2007) $
0103:         * 
0104:         * @since 2.0
0105:         */
0106:
0107:        public class WMSCapabilitiesDocument_1_3_0 extends
0108:                WMSCapabilitiesDocument {
0109:
0110:            private static final long serialVersionUID = -5085466301546020723L;
0111:
0112:            private static final String XML_TEMPLATE = "WMSCapabilitiesTemplate_1_3_0.xml";
0113:
0114:            private static final ILogger LOG = LoggerFactory
0115:                    .getLogger(WMSCapabilitiesDocument_1_3_0.class);
0116:
0117:            private static final String PWMS = CommonNamespaces.WMS_PREFIX
0118:                    + ":";
0119:
0120:            private static final String PSLD = CommonNamespaces.SLD_PREFIX
0121:                    + ":";
0122:
0123:            /*
0124:             * Just using a different XML_TEMPLATE.
0125:             */
0126:            @Override
0127:            public void createEmptyDocument() throws IOException, SAXException {
0128:
0129:                URL url = WMSCapabilitiesDocument.class
0130:                        .getResource(XML_TEMPLATE);
0131:                if (url == null) {
0132:                    throw new IOException("The resource '" + XML_TEMPLATE
0133:                            + " could not be found.");
0134:                }
0135:                load(url);
0136:            }
0137:
0138:            @Override
0139:            protected List<String> parseExceptionFormats(Element elem)
0140:                    throws XMLParsingException {
0141:                String[] formats = XMLTools.getRequiredNodesAsStrings(elem,
0142:                        PWMS + "Format", nsContext);
0143:                return Arrays.asList(formats);
0144:            }
0145:
0146:            /*
0147:             * Prefix added, not parsing UserDefinedSymbolization. Parsing new LayerLimit, MaxWidth,
0148:             * MaxHeight elements.
0149:             */
0150:            @Override
0151:            public OGCCapabilities parseCapabilities()
0152:                    throws InvalidCapabilitiesException {
0153:                ServiceIdentification serviceIdentification = null;
0154:                ServiceProvider serviceProvider = null;
0155:                OperationsMetadata metadata = null;
0156:                Layer layer = null;
0157:                String version = parseVersion();
0158:                String updateSeq = parseUpdateSequence();
0159:                List<String> exceptions;
0160:
0161:                Element root = getRootElement();
0162:
0163:                int layerLimit = 0;
0164:                int maxWidth = 0;
0165:                int maxHeight = 0;
0166:
0167:                try {
0168:                    Element serviceElement = (Element) XMLTools
0169:                            .getRequiredNode(root, PWMS + "Service", nsContext);
0170:
0171:                    layerLimit = XMLTools.getNodeAsInt(serviceElement, PWMS
0172:                            + "LayerLimit", nsContext, 0);
0173:                    maxWidth = XMLTools.getNodeAsInt(serviceElement, PWMS
0174:                            + "MaxWidth", nsContext, 0);
0175:                    maxHeight = XMLTools.getNodeAsInt(serviceElement, PWMS
0176:                            + "MaxHeight", nsContext, 0);
0177:
0178:                    serviceIdentification = parseServiceIdentification();
0179:                    serviceProvider = parseServiceProvider();
0180:                    metadata = parseOperationsMetadata();
0181:
0182:                    Element exceptionElement = XMLTools.getRequiredElement(
0183:                            getRootElement(), PWMS + "Capability/" + PWMS
0184:                                    + "Exception", nsContext);
0185:                    exceptions = parseExceptionFormats(exceptionElement);
0186:
0187:                    Element layerElem = (Element) XMLTools.getRequiredNode(
0188:                            root, PWMS + "Capability/" + PWMS + "Layer",
0189:                            nsContext);
0190:                    layer = parseLayers(layerElem, null, null);
0191:                } catch (XMLParsingException e) {
0192:                    LOG.logError(e.getLocalizedMessage(), e);
0193:                    throw new InvalidCapabilitiesException(e.getMessage()
0194:                            + StringTools.stackTraceToString(e));
0195:                } catch (Exception e) {
0196:                    LOG.logError(e.getLocalizedMessage(), e);
0197:                    throw new InvalidCapabilitiesException(e.getMessage()
0198:                            + StringTools.stackTraceToString(e));
0199:                }
0200:
0201:                WMSCapabilities_1_3_0 wmsCapabilities = new WMSCapabilities_1_3_0(
0202:                        version, updateSeq, serviceIdentification,
0203:                        serviceProvider, metadata, layer, layerLimit, maxWidth,
0204:                        maxHeight, exceptions);
0205:                return wmsCapabilities;
0206:            }
0207:
0208:            /*
0209:             * Prefix added. Name is now "WMS" instead of "OGC:WMS"
0210:             */
0211:            @Override
0212:            protected ServiceIdentification parseServiceIdentification()
0213:                    throws XMLParsingException {
0214:
0215:                String name = XMLTools.getNodeAsString(getRootElement(), PWMS
0216:                        + "Service/" + PWMS + "Name", nsContext, null);
0217:                String title = XMLTools.getNodeAsString(getRootElement(), PWMS
0218:                        + "Service/" + PWMS + "Title", nsContext, name);
0219:                String serviceAbstract = XMLTools.getNodeAsString(
0220:                        getRootElement(),
0221:                        PWMS + "Service/" + PWMS + "Abstract", nsContext, null);
0222:
0223:                String[] kw = XMLTools.getNodesAsStrings(getRootElement(),
0224:                        PWMS + "Service/" + PWMS + "KeywordList/" + PWMS
0225:                                + "Keyword", nsContext);
0226:
0227:                Keywords[] keywordArray = new Keywords[] { new Keywords(kw) };
0228:                List<Keywords> keywords = Arrays.asList(keywordArray);
0229:
0230:                String fees = XMLTools.getNodeAsString(getRootElement(), PWMS
0231:                        + "Service/" + PWMS + "Fees", nsContext, null);
0232:
0233:                List<Constraints> accessConstraints = new ArrayList<Constraints>();
0234:
0235:                String[] constraints = XMLTools.getNodesAsStrings(
0236:                        getRootElement(), PWMS + "Service/" + PWMS
0237:                                + "AccessConstraints", nsContext);
0238:
0239:                for (String constraint : constraints) {
0240:                    List<String> limits = new ArrayList<String>();
0241:                    limits.add(constraint);
0242:                    accessConstraints.add(new Constraints(fees, null, null,
0243:                            null, limits, null, null, null));
0244:                }
0245:
0246:                List<String> versions = new ArrayList<String>();
0247:                versions.add("1.0.0");
0248:                versions.add("1.1.0");
0249:                versions.add("1.1.1");
0250:                versions.add("1.2.0");
0251:                versions.add("1.3.0");
0252:
0253:                ServiceIdentification serviceIdentification = new ServiceIdentification(
0254:                        new Code("WMS"), versions, title, null, new Date(System
0255:                                .currentTimeMillis()), title, serviceAbstract,
0256:                        keywords, accessConstraints);
0257:
0258:                return serviceIdentification;
0259:            }
0260:
0261:            /*
0262:             * Prefix added.
0263:             */
0264:            @Override
0265:            protected ServiceProvider parseServiceProvider()
0266:                    throws XMLParsingException {
0267:                Node ci = XMLTools.getNode(getRootElement(), PWMS + "Service/"
0268:                        + PWMS + "ContactInformation", nsContext);
0269:
0270:                // according to WMS 1.1.1 specification this element is mandatory
0271:                // but there are several services online which does not contain
0272:                // this element in its capabilities :-(
0273:                String s = XMLTools.getNodeAsString(getRootElement(), PWMS
0274:                        + "Service/" + PWMS + "OnlineResource/@xlink:href",
0275:                        nsContext, null);
0276:
0277:                OnlineResource providerSite = null;
0278:
0279:                if (s != null) {
0280:                    try {
0281:                        providerSite = new OnlineResource(new Linkage(
0282:                                new URL(s)));
0283:                    } catch (MalformedURLException e) {
0284:                        throw new XMLParsingException(
0285:                                "could not parse service online resource", e);
0286:                    }
0287:                } else {
0288:                    // use default if no online resource is contained in the
0289:                    // capabilities (see comment above)
0290:                    try {
0291:                        providerSite = new OnlineResource(new Linkage(new URL(
0292:                                "http://www.opengeospatial.org/")));
0293:                    } catch (MalformedURLException neverHappens) {
0294:                        // useless exception
0295:                    }
0296:                }
0297:
0298:                String person = null;
0299:                String orga = null;
0300:                String position = null;
0301:                if (ci != null) {
0302:                    person = XMLTools.getNodeAsString(ci, PWMS
0303:                            + "ContactPersonPrimary/" + PWMS + "ContactPerson",
0304:                            nsContext, null);
0305:                    orga = XMLTools.getNodeAsString(ci, PWMS
0306:                            + "ContactPersonPrimary/" + PWMS
0307:                            + "ContactOrganization", nsContext, null);
0308:                    position = XMLTools.getNodeAsString(ci, PWMS
0309:                            + "ContactPosition", nsContext, null);
0310:                }
0311:                ContactInfo contact = parseContactInfo();
0312:
0313:                CitedResponsibleParty party = new CitedResponsibleParty(
0314:                        new ContactInfo[] { contact }, new String[] { person },
0315:                        new String[] { orga }, new String[] { position }, null);
0316:                ServiceProvider sp = new ServiceProvider(person, providerSite,
0317:                        party);
0318:
0319:                return sp;
0320:            }
0321:
0322:            /*
0323:             * Prefix added.
0324:             */
0325:            @Override
0326:            protected ContactInfo parseContactInfo() throws XMLParsingException {
0327:                Node ci = XMLTools.getNode(getRootElement(), PWMS + "Service/"
0328:                        + PWMS + "ContactInformation", nsContext);
0329:                ContactInfo cont = null;
0330:                if (ci != null) {
0331:                    String[] addr = XMLTools.getNodesAsStrings(ci, PWMS
0332:                            + "ContactAddress/" + PWMS + "Address", nsContext);
0333:                    // String addrType =
0334:                    // XMLTools.getNodeAsString( ci, "./ContactAddress/AddressType", nsContext, null );
0335:                    String city = XMLTools.getNodeAsString(ci, PWMS
0336:                            + "ContactAddress/" + PWMS + "City", nsContext,
0337:                            null);
0338:                    String state = XMLTools.getNodeAsString(ci, PWMS
0339:                            + "ContactAddress/" + PWMS + "StateOrProvince",
0340:                            nsContext, null);
0341:                    String pc = XMLTools.getNodeAsString(ci, PWMS
0342:                            + "ContactAddress/" + PWMS + "PostCode", nsContext,
0343:                            null);
0344:                    String country = XMLTools.getNodeAsString(ci, PWMS
0345:                            + "ContactAddress/" + PWMS + "Country", nsContext,
0346:                            null);
0347:                    String[] mail = XMLTools.getNodesAsStrings(ci, PWMS
0348:                            + "ContactElectronicMailAddress", nsContext);
0349:                    Address address = new Address(state, city, country, addr,
0350:                            mail, pc);
0351:
0352:                    String[] phone = XMLTools.getNodesAsStrings(ci, PWMS
0353:                            + "ContactVoiceTelephone", nsContext);
0354:                    String[] fax = XMLTools.getNodesAsStrings(ci, PWMS
0355:                            + "ContactFacsimileTelephone", nsContext);
0356:
0357:                    Phone ph = new Phone(fax, phone);
0358:
0359:                    cont = new ContactInfo(address, null, null, null, ph);
0360:                }
0361:
0362:                return cont;
0363:            }
0364:
0365:            /*
0366:             * Prefix added.
0367:             */
0368:            @Override
0369:            protected OperationsMetadata parseOperationsMetadata()
0370:                    throws XMLParsingException {
0371:
0372:                Node opNode = XMLTools.getNode(getRootElement(), PWMS
0373:                        + "Capability/" + PWMS + "Request/" + PWMS
0374:                        + "GetCapabilities", nsContext);
0375:
0376:                if (opNode == null) {
0377:                    // may it is a WMS 1.0.0 capabilities document
0378:                    opNode = XMLTools.getRequiredNode(getRootElement(), PWMS
0379:                            + "Capability/" + PWMS + "Request/" + PWMS
0380:                            + "Capabilities", nsContext);
0381:                }
0382:                Operation getCapa = parseOperation(opNode);
0383:
0384:                opNode = XMLTools.getNode(getRootElement(), PWMS
0385:                        + "Capability/" + PWMS + "Request/" + PWMS + "GetMap",
0386:                        nsContext);
0387:                if (opNode == null) {
0388:                    // may it is a WMS 1.0.0 capabilities document
0389:                    opNode = XMLTools.getRequiredNode(getRootElement(), PWMS
0390:                            + "Capability/" + PWMS + "Request/" + PWMS + "Map",
0391:                            nsContext);
0392:                }
0393:                Operation getMap = parseOperation(opNode);
0394:
0395:                opNode = XMLTools.getNode(getRootElement(), PWMS
0396:                        + "Capability/" + PWMS + "Request/" + PWMS
0397:                        + "GetFeatureInfo", nsContext);
0398:                Operation getFI = null;
0399:                if (opNode != null) {
0400:                    getFI = parseOperation(opNode);
0401:                } else {
0402:                    // maybe its WMS 1.0.0
0403:                    opNode = XMLTools.getNode(getRootElement(), PWMS
0404:                            + "Capability/" + PWMS + "Request/" + PWMS
0405:                            + "FeatureInfo", nsContext);
0406:                    if (opNode != null) {
0407:                        getFI = parseOperation(opNode);
0408:                    }
0409:                }
0410:
0411:                opNode = XMLTools.getNode(getRootElement(), PWMS
0412:                        + "Capability/" + PWMS + "Request/" + PSLD
0413:                        + "GetLegendGraphic", nsContext);
0414:                Operation getLG = null;
0415:                if (opNode != null) {
0416:                    getLG = parseOperation(opNode);
0417:                }
0418:
0419:                opNode = XMLTools.getNode(getRootElement(), PWMS
0420:                        + "Capability/" + PWMS + "Request/" + PSLD
0421:                        + "DescribeLayer", nsContext);
0422:                Operation descL = null;
0423:                if (opNode != null) {
0424:                    descL = parseOperation(opNode);
0425:                }
0426:
0427:                opNode = XMLTools.getNode(getRootElement(), PWMS
0428:                        + "Capability/" + PWMS + "Request/" + PSLD
0429:                        + "GetStyles", nsContext);
0430:                Operation getStyles = null;
0431:                if (opNode != null) {
0432:                    getStyles = parseOperation(opNode);
0433:                }
0434:
0435:                opNode = XMLTools.getNode(getRootElement(), PWMS
0436:                        + "Capability/" + PWMS + "Request/" + PSLD
0437:                        + "PutStyles", nsContext);
0438:                Operation putStyles = null;
0439:                if (opNode != null) {
0440:                    putStyles = parseOperation(opNode);
0441:                }
0442:
0443:                List<Operation> operations = new ArrayList<Operation>();
0444:
0445:                StringBuffer debug = new StringBuffer();
0446:
0447:                if (getCapa != null) {
0448:                    operations.add(getCapa);
0449:                    debug.append(" GetCapabilities");
0450:                }
0451:                if (getMap != null) {
0452:                    operations.add(getMap);
0453:                    debug.append(" GetMap");
0454:                }
0455:                if (getFI != null) {
0456:                    operations.add(getFI);
0457:                    debug.append(" GetFeatureInfo");
0458:                }
0459:                if (getLG != null) {
0460:                    operations.add(getLG);
0461:                    debug.append(" GetLegendGraphic");
0462:                }
0463:                if (descL != null) {
0464:                    operations.add(descL);
0465:                    debug.append(" DescribeLayer");
0466:                }
0467:                if (getStyles != null) {
0468:                    operations.add(getStyles);
0469:                    debug.append(" GetStyles");
0470:                }
0471:                if (putStyles != null) {
0472:                    operations.add(putStyles);
0473:                    debug.append(" PutStyles");
0474:                }
0475:
0476:                LOG.logDebug("Configured request types:" + debug);
0477:
0478:                OperationsMetadata metadata = new OperationsMetadata(null,
0479:                        null, operations, null);
0480:
0481:                return metadata;
0482:            }
0483:
0484:            /*
0485:             * Prefix added.
0486:             */
0487:            @Override
0488:            protected Operation parseOperation(Node node)
0489:                    throws XMLParsingException {
0490:                // use node name as name of the Operation to be defined
0491:                String name = node.getNodeName();
0492:                if (name.equals("Capabilities")) {
0493:                    name = "GetCapabilities";
0494:                } else if (name.equals("Map")) {
0495:                    name = "GetMap";
0496:                } else if (name.equals("FeatureInfo")) {
0497:                    name = "GetFeatureInfo";
0498:                }
0499:
0500:                String[] tmp = XMLTools.getRequiredNodesAsStrings(node, PWMS
0501:                        + "Format", nsContext);
0502:                List<TypedLiteral> values = new ArrayList<TypedLiteral>();
0503:
0504:                URI stringURI = null;
0505:                try {
0506:                    stringURI = new URI(null, "String", null);
0507:                } catch (URISyntaxException e) {
0508:                    // cannot happen, why do I have to catch this?
0509:                }
0510:
0511:                for (String str : tmp)
0512:                    values.add(new TypedLiteral(str, stringURI));
0513:
0514:                DomainType owsDomainType = new DomainType(false, true, null, 0,
0515:                        new QualifiedName("Format"), values, null, null, false,
0516:                        null, false, null, null, null, null);
0517:                List<Parameter> parameters = new ArrayList<Parameter>();
0518:                parameters.add(owsDomainType);
0519:
0520:                List<?> nl = XMLTools.getRequiredNodes(node, PWMS + "DCPType",
0521:                        nsContext);
0522:                List<DCP> dcps = new ArrayList<DCP>();
0523:
0524:                for (Object element : nl) {
0525:                    dcps.add(parseDCP((Element) element));
0526:                }
0527:
0528:                return new Operation(new QualifiedName(name), dcps, parameters,
0529:                        null, null, null);
0530:            }
0531:
0532:            /*
0533:             * Prefix added.
0534:             */
0535:            @Override
0536:            protected DCP parseDCP(Element element) throws XMLParsingException {
0537:                List<HTTP.Type> types = new ArrayList<HTTP.Type>();
0538:                List<OnlineResource> links = new ArrayList<OnlineResource>();
0539:
0540:                Element elem = (Element) XMLTools.getRequiredNode(element, PWMS
0541:                        + "HTTP", nsContext);
0542:                String s = null;
0543:                try {
0544:                    List<?> nl = XMLTools.getNodes(elem, PWMS + "Get",
0545:                            nsContext);
0546:
0547:                    for (int i = 0; i < nl.size(); i++) {
0548:                        s = XMLTools.getNodeAsString((Node) nl.get(i),
0549:                                "./@xlink:href", nsContext, null);
0550:                        if (s == null) {
0551:                            s = XMLTools.getRequiredNodeAsString((Node) nl
0552:                                    .get(i), PWMS
0553:                                    + "OnlineResource/@xlink:href", nsContext);
0554:                        }
0555:                        types.add(HTTP.Type.Get);
0556:                        links.add(new OnlineResource(new Linkage(new URL(s))));
0557:                    }
0558:                } catch (Exception e) {
0559:                    throw new XMLParsingException(Messages.getMessage(
0560:                            "WMS_DCPGET", s));
0561:                }
0562:                try {
0563:                    List<?> nl = XMLTools.getNodes(elem, PWMS + "Post",
0564:                            nsContext);
0565:
0566:                    for (int i = 0; i < nl.size(); i++) {
0567:                        s = XMLTools.getNodeAsString((Node) nl.get(i),
0568:                                "./@xlink:href", nsContext, null);
0569:                        if (s == null) {
0570:                            s = XMLTools.getRequiredNodeAsString((Node) nl
0571:                                    .get(i), PWMS
0572:                                    + "OnlineResource/@xlink:href", nsContext);
0573:                        }
0574:                        types.add(HTTP.Type.Post);
0575:                        links.add(new OnlineResource(new Linkage(new URL(s))));
0576:                    }
0577:
0578:                } catch (MalformedURLException e) {
0579:                    throw new XMLParsingException(Messages.getMessage(
0580:                            "WMS_DCPPOST", s));
0581:                }
0582:                HTTP http = new HTTP(links, null, types);
0583:
0584:                return http;
0585:            }
0586:
0587:            /*
0588:             * Prefix added. Removed parsing of Extent. Removed parsing of ScaleHint. Changed SRS to CRS.
0589:             */
0590:            @Override
0591:            protected Layer parseLayers(Element layerElem, Layer parent,
0592:                    ScaleHint scaleHint) throws XMLParsingException,
0593:                    UnknownCRSException {
0594:
0595:                boolean queryable = XMLTools.getNodeAsBoolean(layerElem,
0596:                        "./@queryable", nsContext, false);
0597:
0598:                int cascaded = XMLTools.getNodeAsInt(layerElem, "./@cascaded",
0599:                        nsContext, 0);
0600:                boolean opaque = XMLTools.getNodeAsBoolean(layerElem,
0601:                        "./@opaque", nsContext, false);
0602:                boolean noSubsets = XMLTools.getNodeAsBoolean(layerElem,
0603:                        "./@noSubsets", nsContext, false);
0604:                int fixedWidth = XMLTools.getNodeAsInt(layerElem,
0605:                        "./@fixedWidth", nsContext, 0);
0606:                int fixedHeight = XMLTools.getNodeAsInt(layerElem,
0607:                        "./@fixedHeight", nsContext, 0);
0608:                String name = XMLTools.getNodeAsString(layerElem,
0609:                        PWMS + "Name", nsContext, null);
0610:                String title = XMLTools.getRequiredNodeAsString(layerElem, PWMS
0611:                        + "Title", nsContext);
0612:                String layerAbstract = XMLTools.getNodeAsString(layerElem, PWMS
0613:                        + "Abstract", nsContext, null);
0614:                String[] keywords = XMLTools.getNodesAsStrings(layerElem, PWMS
0615:                        + "KeywordList/" + PWMS + "Keyword", nsContext);
0616:                String[] srs = XMLTools.getNodesAsStrings(layerElem, PWMS
0617:                        + "CRS", nsContext);
0618:
0619:                List<Element> nl = XMLTools.getElements(layerElem, PWMS
0620:                        + "BoundingBox", nsContext);
0621:                // TODO
0622:                // substitue with Envelope
0623:                LayerBoundingBox[] bboxes = null;
0624:                if (nl.size() == 0 && parent != null) {
0625:                    // inherit BoundingBoxes from parent layer
0626:                    bboxes = parent.getBoundingBoxes();
0627:                } else {
0628:                    bboxes = parseLayerBoundingBoxes(nl);
0629:                }
0630:
0631:                Element llBox = (Element) XMLTools.getNode(layerElem, PWMS
0632:                        + "EX_GeographicBoundingBox", nsContext);
0633:                Envelope llBoundingBox = null;
0634:
0635:                if (llBox == null && parent != null) {
0636:                    // inherit LatLonBoundingBox parent layer
0637:                    llBoundingBox = parent.getLatLonBoundingBox();
0638:                } else if (llBox != null) {
0639:                    llBoundingBox = parseEX_GeographicBoundingBox(llBox);
0640:                } else {
0641:                    llBoundingBox = GeometryFactory.createEnvelope(-180, -90,
0642:                            180, 90, CRSFactory.create("EPSG:4326"));
0643:                }
0644:
0645:                Dimension[] dimensions = parseDimensions(layerElem);
0646:
0647:                Attribution attribution = parseAttribution(layerElem);
0648:
0649:                AuthorityURL[] authorityURLs = parseAuthorityURLs(layerElem);
0650:
0651:                MetadataURL[] metadataURLs = parseMetadataURLs(layerElem);
0652:
0653:                DataURL[] dataURLs = parseDataURL(layerElem);
0654:
0655:                Identifier[] identifiers = parseIdentifiers(layerElem);
0656:
0657:                FeatureListURL[] featureListURLs = parseFeatureListURL(layerElem);
0658:
0659:                Style[] styles = parseStyles(layerElem);
0660:
0661:                scaleHint = parseScaleHint(layerElem, scaleHint);
0662:
0663:                Layer layer = new Layer(queryable, cascaded, opaque, noSubsets,
0664:                        fixedWidth, fixedHeight, name, title, layerAbstract,
0665:                        llBoundingBox, attribution, scaleHint, keywords, srs,
0666:                        bboxes, dimensions, null, authorityURLs, identifiers,
0667:                        metadataURLs, dataURLs, featureListURLs, styles, null,
0668:                        null, parent);
0669:
0670:                // get Child layers
0671:                nl = XMLTools.getElements(layerElem, PWMS + "Layer", nsContext);
0672:                Layer[] layers = new Layer[nl.size()];
0673:                for (int i = 0; i < layers.length; i++) {
0674:                    layers[i] = parseLayers(nl.get(i), layer, scaleHint);
0675:                }
0676:
0677:                // set child layers
0678:                layer.setLayer(layers);
0679:
0680:                return layer;
0681:            }
0682:
0683:            /*
0684:             * Prefix added. Changed to Min/MaxScaleDenominator.
0685:             */
0686:            @Override
0687:            protected ScaleHint parseScaleHint(Element layerElem,
0688:                    ScaleHint scaleHint) throws XMLParsingException {
0689:
0690:                Node min = XMLTools.getNode(layerElem, PWMS
0691:                        + "MinScaleDenominator", nsContext);
0692:                Node max = XMLTools.getNode(layerElem, PWMS
0693:                        + "MaxScaleDenominator", nsContext);
0694:                if (min != null) {
0695:                    double mn = XMLTools.getRequiredNodeAsDouble(min, ".",
0696:                            nsContext);
0697:                    double mx = XMLTools.getRequiredNodeAsDouble(max, ".",
0698:                            nsContext);
0699:                    scaleHint = new ScaleHint(mn, mx);
0700:                }
0701:
0702:                if (scaleHint == null) {
0703:                    scaleHint = new ScaleHint(0, Double.MAX_VALUE);
0704:                }
0705:
0706:                return scaleHint;
0707:            }
0708:
0709:            /*
0710:             * Prefix added. The following attributes have to be implemented: TODO
0711:             */
0712:            // <attribute name="name" type="string" use="required"/>
0713:            // <attribute name="units" type="string" use="required"/>
0714:            // <attribute name="unitSymbol" type="string"/>
0715:            // <attribute name="default" type="string"/>
0716:            // <attribute name="multipleValues" type="boolean"/>
0717:            // <attribute name="nearestValue" type="boolean"/>
0718:            // <attribute name="current" type="boolean"/>
0719:            @Override
0720:            protected Dimension[] parseDimensions(Element layerElem)
0721:                    throws XMLParsingException {
0722:
0723:                List<?> nl = XMLTools.getNodes(layerElem, PWMS + "Dimension",
0724:                        nsContext);
0725:                Dimension[] dimensions = new Dimension[nl.size()];
0726:                for (int i = 0; i < dimensions.length; i++) {
0727:                    String name = XMLTools.getNodeAsString((Node) nl.get(i),
0728:                            "./@name", nsContext, null);
0729:                    String units = XMLTools.getNodeAsString((Node) nl.get(i),
0730:                            "./@units", nsContext, null);
0731:                    String unitSymbol = XMLTools.getNodeAsString((Node) nl
0732:                            .get(i), "./@unitSymbol", nsContext, null);
0733:                    dimensions[i] = new Dimension(name, units, unitSymbol);
0734:                }
0735:
0736:                return dimensions;
0737:            }
0738:
0739:            /*
0740:             * Prefix added.
0741:             */
0742:            @Override
0743:            protected Attribution parseAttribution(Element layerElem)
0744:                    throws XMLParsingException {
0745:
0746:                Attribution attribution = null;
0747:                Node node = XMLTools.getNode(layerElem, PWMS + "Attribution",
0748:                        nsContext);
0749:                if (node != null) {
0750:                    String title = XMLTools.getRequiredNodeAsString(layerElem,
0751:                            PWMS + "Attribution/" + PWMS + "Title", nsContext);
0752:                    OnlineResource onLineResource = parseOnLineResource((Element) XMLTools
0753:                            .getRequiredNode(node, PWMS + "OnlineResource",
0754:                                    nsContext));
0755:                    node = XMLTools.getNode(node, PWMS + "LogoURL", nsContext);
0756:                    LogoURL logoURL = null;
0757:                    if (node != null) {
0758:                        int width = XMLTools.getRequiredNodeAsInt(node,
0759:                                "./@width", nsContext);
0760:                        int height = XMLTools.getRequiredNodeAsInt(node,
0761:                                "./@height", nsContext);
0762:                        String format = XMLTools.getRequiredNodeAsString(node,
0763:                                "./Format", nsContext);
0764:                        OnlineResource logoOR = parseOnLineResource((Element) XMLTools
0765:                                .getRequiredNode(node, PWMS + "OnlineResource",
0766:                                        nsContext));
0767:                        logoURL = new LogoURL(width, height, format, logoOR
0768:                                .getLinkage().getHref());
0769:                    }
0770:                    attribution = new Attribution(title, onLineResource
0771:                            .getLinkage().getHref(), logoURL);
0772:                }
0773:
0774:                return attribution;
0775:            }
0776:
0777:            /*
0778:             * Prefix added.
0779:             */
0780:            @Override
0781:            protected AuthorityURL[] parseAuthorityURLs(Element layerElem)
0782:                    throws XMLParsingException {
0783:
0784:                List<?> nl = XMLTools.getNodes(layerElem,
0785:                        PWMS + "AuthorityURL", nsContext);
0786:                AuthorityURL[] authorityURLs = new AuthorityURL[nl.size()];
0787:                for (int i = 0; i < authorityURLs.length; i++) {
0788:                    String name = XMLTools.getRequiredNodeAsString((Node) nl
0789:                            .get(i), "./@name", nsContext);
0790:                    Element tmp = (Element) XMLTools.getRequiredNode((Node) nl
0791:                            .get(i), PWMS + "OnlineResource", nsContext);
0792:                    OnlineResource olr = parseOnLineResource(tmp);
0793:                    authorityURLs[i] = new AuthorityURL(name, olr.getLinkage()
0794:                            .getHref());
0795:                }
0796:
0797:                return authorityURLs;
0798:            }
0799:
0800:            /*
0801:             * Prefix added.
0802:             */
0803:            @Override
0804:            protected MetadataURL[] parseMetadataURLs(Element layerElem)
0805:                    throws XMLParsingException {
0806:
0807:                List<?> nl = XMLTools.getNodes(layerElem, PWMS + "MetadataURL",
0808:                        nsContext);
0809:                MetadataURL[] metadataURL = new MetadataURL[nl.size()];
0810:                for (int i = 0; i < metadataURL.length; i++) {
0811:                    String type = XMLTools.getRequiredNodeAsString((Node) nl
0812:                            .get(i), "./@type", nsContext);
0813:                    String format = XMLTools.getRequiredNodeAsString((Node) nl
0814:                            .get(i), PWMS + "Format", nsContext);
0815:                    Element tmp = (Element) XMLTools.getRequiredNode((Node) nl
0816:                            .get(i), PWMS + "OnlineResource", nsContext);
0817:                    OnlineResource olr = parseOnLineResource(tmp);
0818:                    metadataURL[i] = new MetadataURL(type, format, olr
0819:                            .getLinkage().getHref());
0820:
0821:                }
0822:
0823:                return metadataURL;
0824:            }
0825:
0826:            /*
0827:             * Prefix added.
0828:             */
0829:            @Override
0830:            protected DataURL[] parseDataURL(Element layerElem)
0831:                    throws XMLParsingException {
0832:
0833:                List<?> nl = XMLTools.getNodes(layerElem, PWMS + "DataURL",
0834:                        nsContext);
0835:                DataURL[] dataURL = new DataURL[nl.size()];
0836:                for (int i = 0; i < dataURL.length; i++) {
0837:
0838:                    String format = XMLTools.getRequiredNodeAsString((Node) nl
0839:                            .get(i), PWMS + "Format", nsContext);
0840:                    Element tmp = (Element) XMLTools.getRequiredNode((Node) nl
0841:                            .get(i), PWMS + "OnlineResource", nsContext);
0842:                    OnlineResource olr = parseOnLineResource(tmp);
0843:                    dataURL[i] = new DataURL(format, olr.getLinkage().getHref());
0844:
0845:                }
0846:
0847:                return dataURL;
0848:            }
0849:
0850:            /*
0851:             * Prefix added.
0852:             */
0853:            @Override
0854:            protected FeatureListURL[] parseFeatureListURL(Element layerElem)
0855:                    throws XMLParsingException {
0856:
0857:                List<?> nl = XMLTools.getNodes(layerElem, PWMS
0858:                        + "FeatureListURL", nsContext);
0859:                FeatureListURL[] flURL = new FeatureListURL[nl.size()];
0860:                for (int i = 0; i < flURL.length; i++) {
0861:
0862:                    String format = XMLTools.getRequiredNodeAsString((Node) nl
0863:                            .get(i), "./Format", nsContext);
0864:                    Element tmp = (Element) XMLTools.getRequiredNode((Node) nl
0865:                            .get(i), PWMS + "OnlineResource", nsContext);
0866:                    OnlineResource olr = parseOnLineResource(tmp);
0867:                    flURL[i] = new FeatureListURL(format, olr.getLinkage()
0868:                            .getHref());
0869:
0870:                }
0871:
0872:                return flURL;
0873:            }
0874:
0875:            /*
0876:             * Prefix added.
0877:             */
0878:            @Override
0879:            protected Style[] parseStyles(Element layerElem)
0880:                    throws XMLParsingException {
0881:
0882:                List<?> nl = XMLTools.getNodes(layerElem, PWMS + "Style",
0883:                        nsContext);
0884:                Style[] styles = new Style[nl.size()];
0885:                for (int i = 0; i < styles.length; i++) {
0886:                    String name = XMLTools.getRequiredNodeAsString((Node) nl
0887:                            .get(i), PWMS + "Name", nsContext);
0888:
0889:                    if (name == null) {
0890:                        throw new XMLParsingException(Messages
0891:                                .getMessage("WMS_STYLENAME"));
0892:                    }
0893:                    String title = XMLTools.getNodeAsString((Node) nl.get(i),
0894:                            PWMS + "Title", nsContext, null);
0895:                    if (title == null) {
0896:                        throw new XMLParsingException(Messages
0897:                                .getMessage("WMS_STYLETITLE"));
0898:                    }
0899:                    String styleAbstract = XMLTools.getNodeAsString((Node) nl
0900:                            .get(i), PWMS + "Abstract", nsContext, null);
0901:                    LegendURL[] legendURLs = parseLegendURL((Node) nl.get(i));
0902:                    StyleURL styleURL = parseStyleURL((Node) nl.get(i));
0903:                    StyleSheetURL styleSheetURL = parseStyleSheetURL((Node) nl
0904:                            .get(i));
0905:
0906:                    styles[i] = new Style(name, title, styleAbstract,
0907:                            legendURLs, styleSheetURL, styleURL, null);
0908:                }
0909:
0910:                return styles;
0911:            }
0912:
0913:            /*
0914:             * Prefix added.
0915:             */
0916:            @Override
0917:            protected LegendURL[] parseLegendURL(Node node)
0918:                    throws XMLParsingException {
0919:
0920:                List<?> nl = XMLTools.getNodes(node, PWMS + "LegendURL",
0921:                        nsContext);
0922:                LegendURL[] lURL = new LegendURL[nl.size()];
0923:                for (int i = 0; i < lURL.length; i++) {
0924:                    int width = XMLTools.getRequiredNodeAsInt((Node) nl.get(i),
0925:                            "./@width", nsContext);
0926:                    int height = XMLTools.getRequiredNodeAsInt(
0927:                            (Node) nl.get(i), "./@height", nsContext);
0928:                    String format = XMLTools.getRequiredNodeAsString((Node) nl
0929:                            .get(i), PWMS + "Format", nsContext);
0930:                    Element tmp = (Element) XMLTools.getRequiredNode((Node) nl
0931:                            .get(i), PWMS + "OnlineResource", nsContext);
0932:                    OnlineResource olr = parseOnLineResource(tmp);
0933:                    lURL[i] = new LegendURL(width, height, format, olr
0934:                            .getLinkage().getHref());
0935:
0936:                }
0937:
0938:                return lURL;
0939:            }
0940:
0941:            /*
0942:             * Prefix added.
0943:             */
0944:            @Override
0945:            protected StyleURL parseStyleURL(Node node)
0946:                    throws XMLParsingException {
0947:
0948:                StyleURL styleURL = null;
0949:                Node styleNode = XMLTools.getNode(node, PWMS + "StyleURL",
0950:                        nsContext);
0951:
0952:                if (styleNode != null) {
0953:                    String format = XMLTools.getRequiredNodeAsString(styleNode,
0954:                            PWMS + "Format", nsContext);
0955:                    Element tmp = (Element) XMLTools.getRequiredNode(styleNode,
0956:                            PWMS + "OnlineResource", nsContext);
0957:                    OnlineResource olr = parseOnLineResource(tmp);
0958:                    styleURL = new StyleURL(format, olr.getLinkage().getHref());
0959:
0960:                }
0961:
0962:                return styleURL;
0963:            }
0964:
0965:            /*
0966:             * Prefix added.
0967:             */
0968:            @Override
0969:            protected StyleSheetURL parseStyleSheetURL(Node node)
0970:                    throws XMLParsingException {
0971:
0972:                StyleSheetURL styleSheetURL = null;
0973:                Node styleNode = XMLTools.getNode(node, PWMS + "StyleSheetURL",
0974:                        nsContext);
0975:
0976:                if (styleNode != null) {
0977:                    String format = XMLTools.getRequiredNodeAsString(styleNode,
0978:                            PWMS + "Format", nsContext);
0979:                    Element tmp = (Element) XMLTools.getRequiredNode(styleNode,
0980:                            PWMS + "OnlineResource", nsContext);
0981:                    OnlineResource olr = parseOnLineResource(tmp);
0982:                    styleSheetURL = new StyleSheetURL(format, olr.getLinkage()
0983:                            .getHref());
0984:
0985:                }
0986:
0987:                return styleSheetURL;
0988:            }
0989:
0990:            /*
0991:             * Prefix added.
0992:             */
0993:            @Override
0994:            protected Identifier[] parseIdentifiers(Element layerElem)
0995:                    throws XMLParsingException {
0996:
0997:                List<?> nl = XMLTools.getNodes(layerElem, PWMS + "Identifier",
0998:                        nsContext);
0999:                Identifier[] identifiers = new Identifier[nl.size()];
1000:                for (int i = 0; i < identifiers.length; i++) {
1001:                    String value = XMLTools.getStringValue((Node) nl.get(i));
1002:                    String authority = XMLTools.getNodeAsString(layerElem,
1003:                            "./@authority", nsContext, null);
1004:                    identifiers[i] = new Identifier(value, authority);
1005:                }
1006:
1007:                return identifiers;
1008:            }
1009:
1010:            /*
1011:             * Changed SRS to CRS.
1012:             */
1013:            @Override
1014:            protected LayerBoundingBox[] parseLayerBoundingBoxes(
1015:                    List<Element> nl) throws XMLParsingException {
1016:                LayerBoundingBox[] llBoxes = new LayerBoundingBox[nl.size()];
1017:                for (int i = 0; i < llBoxes.length; i++) {
1018:                    double minx = XMLTools.getRequiredNodeAsDouble(nl.get(i),
1019:                            "./@minx", nsContext);
1020:                    double maxx = XMLTools.getRequiredNodeAsDouble(nl.get(i),
1021:                            "./@maxx", nsContext);
1022:                    double miny = XMLTools.getRequiredNodeAsDouble(nl.get(i),
1023:                            "./@miny", nsContext);
1024:                    double maxy = XMLTools.getRequiredNodeAsDouble(nl.get(i),
1025:                            "./@maxy", nsContext);
1026:                    double resx = XMLTools.getNodeAsDouble(nl.get(i),
1027:                            "./@resx", nsContext, -1);
1028:                    double resy = XMLTools.getNodeAsDouble(nl.get(i),
1029:                            "./@resx", nsContext, -1);
1030:                    String srs = XMLTools.getRequiredNodeAsString(nl.get(i),
1031:                            "./@CRS", nsContext);
1032:                    if (srs.startsWith("EPSG")) {
1033:                        Position min = GeometryFactory.createPosition(miny,
1034:                                minx);
1035:                        Position max = GeometryFactory.createPosition(maxy,
1036:                                maxx);
1037:                        llBoxes[i] = new LayerBoundingBox(min, max, srs, resx,
1038:                                resy);
1039:                    } else {
1040:                        Position min = GeometryFactory.createPosition(minx,
1041:                                miny);
1042:                        Position max = GeometryFactory.createPosition(maxx,
1043:                                maxy);
1044:                        llBoxes[i] = new LayerBoundingBox(min, max, srs, resx,
1045:                                resy);
1046:                    }
1047:                }
1048:
1049:                return llBoxes;
1050:            }
1051:
1052:            /**
1053:             * 
1054:             * @param llBox
1055:             * @return the envelope
1056:             * @throws XMLParsingException
1057:             * @throws UnknownCRSException
1058:             */
1059:            protected Envelope parseEX_GeographicBoundingBox(Element llBox)
1060:                    throws XMLParsingException, UnknownCRSException {
1061:
1062:                double minx = XMLTools.getRequiredNodeAsDouble(llBox, PWMS
1063:                        + "westBoundLongitude", nsContext);
1064:                double maxx = XMLTools.getRequiredNodeAsDouble(llBox, PWMS
1065:                        + "eastBoundLongitude", nsContext);
1066:                double miny = XMLTools.getRequiredNodeAsDouble(llBox, PWMS
1067:                        + "southBoundLatitude", nsContext);
1068:                double maxy = XMLTools.getRequiredNodeAsDouble(llBox, PWMS
1069:                        + "northBoundLatitude", nsContext);
1070:                CoordinateSystem crs = CRSFactory.create("EPSG:4326");
1071:
1072:                Envelope env = GeometryFactory.createEnvelope(minx, miny, maxx,
1073:                        maxy, crs);
1074:
1075:                return env;
1076:            }
1077:
1078:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.