Package net.opengis.wcs10.impl

Examples of net.opengis.wcs10.impl.WCSCapabilitiesTypeImpl


   * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
   * @generated
   */
    public NotificationChain basicSetRequest(RequestType newRequest, NotificationChain msgs) {
    RequestType oldRequest = request;
    request = newRequest;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs10Package.WCS_CAPABILITY_TYPE__REQUEST, oldRequest, newRequest);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here


   * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
   * @generated
   */
    public NotificationChain basicSetResponsibleParty(ResponsiblePartyType newResponsibleParty, NotificationChain msgs) {
    ResponsiblePartyType oldResponsibleParty = responsibleParty;
    responsibleParty = newResponsibleParty;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs10Package.SERVICE_TYPE__RESPONSIBLE_PARTY, oldResponsibleParty, newResponsibleParty);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
   * @generated
   */
    public NotificationChain basicSetService(ServiceType newService, NotificationChain msgs) {
    ServiceType oldService = service;
    service = newService;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs10Package.WCS_CAPABILITIES_TYPE__SERVICE, oldService, newService);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
   * @generated
   */
    public NotificationChain basicSetSpatialDomain(SpatialDomainType newSpatialDomain, NotificationChain msgs) {
    SpatialDomainType oldSpatialDomain = spatialDomain;
    spatialDomain = newSpatialDomain;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs10Package.DOMAIN_SET_TYPE__SPATIAL_DOMAIN, oldSpatialDomain, newSpatialDomain);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

     */
    public Object parse(ElementInstance instance, Node node, Object value)
            throws Exception {
        DomainSubsetType domainSubset = Wcs10Factory.eINSTANCE.createDomainSubsetType();
       
        SpatialSubsetType spatialSubset = (SpatialSubsetType) node.getChildValue("spatialSubset");
        if (spatialSubset != null)
            domainSubset.setSpatialSubset(spatialSubset);
        return domainSubset;
    }
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
            throws Exception {
        SpatialSubsetType spatialSubset = Wcs10Factory.eINSTANCE.createSpatialSubsetType();
       
        List<Node> envelopes = node.getChildren("Envelope");
        for (Node envelopeNode : envelopes) {
            ReferencedEnvelope envelope = (ReferencedEnvelope) envelopeNode.getValue();
            EnvelopeType env = Gml4wcsFactory.eINSTANCE.createEnvelopeType();
           
            env.setSrsName(CRS.lookupIdentifier(envelope.getCoordinateReferenceSystem(), true));
           
            DirectPositionType pos1 = Gml4wcsFactory.eINSTANCE.createDirectPositionType();
            DirectPositionType pos2 = Gml4wcsFactory.eINSTANCE.createDirectPositionType();
           
            pos1.setDimension(BigInteger.valueOf(2));
            pos2.setDimension(BigInteger.valueOf(2));
           
            pos1.setValue(Arrays.asList(envelope.getMinX(), envelope.getMinY()));
            pos2.setValue(Arrays.asList(envelope.getMaxX(), envelope.getMaxY()));

            env.getPos().add(pos1);
            env.getPos().add(pos2);
           
            spatialSubset.getEnvelope().add(envelope);
        }
       
        List<Node> gridsNode = node.getChildren("Grid");
        for (Node grid : gridsNode)
            spatialSubset.getGrid().add(grid.getValue());
       
        return spatialSubset;
    }
View Full Code Here

   * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
   * @generated
   */
    public NotificationChain basicSetSpatialSubset(SpatialSubsetType newSpatialSubset, NotificationChain msgs) {
    SpatialSubsetType oldSpatialSubset = spatialSubset;
    spatialSubset = newSpatialSubset;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs10Package.DOMAIN_SUBSET_TYPE__SPATIAL_SUBSET, oldSpatialSubset, newSpatialSubset);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

     * @param kvp
     * @return
     */
    private DomainSubsetType parseDomainSubset(Map kvp) {
        final DomainSubsetType domainSubset = Wcs10Factory.eINSTANCE.createDomainSubsetType();
        final SpatialSubsetType spatialSubset = Wcs10Factory.eINSTANCE.createSpatialSubsetType();

        //
        // check for CRS
        //
        String crsName = (String) kvp.get("crs");
        if (crsName == null)
            throw new WcsException("CRS parameter is mandatory", MissingParameterValue, "crs");
        final CoordinateReferenceSystem crs = decodeCRS100(crsName);
        if(crs==null)
          throw new WcsException("CRS parameter is invalid:"+crsName,InvalidParameterValue , "crs");
//        final VerticalCRS verticalCRS = CRS.getVerticalCRS(crs);
//        final boolean hasVerticalCRS = verticalCRS != null;

        //
        // at least one between BBOX and TIME must be there
        //
        final GeneralEnvelope bbox = (GeneralEnvelope) kvp.get("BBOX");
        if (bbox == null)
            throw new WcsException("bbox parameter is mandatory", MissingParameterValue, "bbox");
       
        // afabiani: consider Elevation as band, forcing the bbox to be 2D only
        if (bbox.getDimension() != 2)
            throw new WcsException("Requested bounding box is not 2-dimensional: " + bbox.getDimension(), InvalidParameterValue, "bbox");
       
        final GeneralEnvelope envelope = new GeneralEnvelope(/* TODO: ignore 3D CRS for now crs */ bbox.getDimension() == 3 ? DefaultGeographicCRS.WGS84_3D : crs);
        if (/* TODO: ignore 3D CRS for now !hasVerticalCRS */ bbox.getDimension() == 2)
            envelope.setEnvelope(bbox.getLowerCorner().getOrdinate(0), bbox.getLowerCorner()
                    .getOrdinate(1), bbox.getUpperCorner().getOrdinate(0), bbox.getUpperCorner()
                    .getOrdinate(1));
//        else if (/* TODO: ignore 3D CRS for now hasVerticalCRS */ bbox.getDimension() == 3)
//            // 3D
//            envelope.setEnvelope(bbox.getLowerCorner().getOrdinate(0), bbox.getLowerCorner()
//                    .getOrdinate(1), bbox.getLowerCorner().getOrdinate(2), bbox.getUpperCorner()
//                    .getOrdinate(0), bbox.getUpperCorner().getOrdinate(1), bbox.getUpperCorner()
//                    .getOrdinate(2));
        else
            throw new WcsException("bbox not compliant with the specified CRS", InvalidParameterValue, "bbox");
       
        //
        // TIME
        //
        TimeSequenceType timeSequence = null;
        Object time = kvp.get("TIME");
        if (time != null && time instanceof TimeSequenceType) {
            timeSequence = (TimeSequenceType) time;
        } else if (time != null && time instanceof List) {
            timeSequence = Wcs10Factory.eINSTANCE.createTimeSequenceType();
            for (Date tPos : (List<Date>) time) {
                final TimePositionType timePosition = Gml4wcsFactory.eINSTANCE
                        .createTimePositionType();
                timePosition.setValue(tPos);
                timeSequence.getTimePosition().add(timePosition);
            }
        }
        if (timeSequence == null && bbox == null)
            throw new WcsException("Bounding box cannot be null, TIME has not been specified",
                    WcsExceptionCode.MissingParameterValue, "BBOX");

        //
        // GRID management
        //
        final RectifiedGridType grid = Gml4wcsFactory.eINSTANCE.createRectifiedGridType();
        final Object w = kvp.get("width");
        final Object h = kvp.get("height");
        if (w != null && h != null) {
            //
            // normal grid management, only the envelope and the raster dimensions have been specified,
          // we need to compute RESX, RESY, RESZ afterwards
            //

            // get W and H
            int width =  w instanceof Integer?((Integer)w):Integer.parseInt((String)w);
            int height =w instanceof Integer?((Integer)h):Integer.parseInt((String)h);
            grid.getAxisName().add("x");
            grid.getAxisName().add("y");

            final Object d = kvp.get("depth");
            if (d != null) {
                // afabiani: we consider 2D grdis only
                throw new WcsException("3D grids are not supported.", InvalidParameterValue, "depth");
//                // check that the envelope is 3D or throw an error
//                if (bbox.getDimension() != 3)
//                    throw new WcsException("Found depth but envelope is of dimension "
//                            + bbox.getDimension(), InvalidParameterValue, "");
//
//                // notice that as for the spec this element represents the number of ticks on the
//                // third dimension
//                grid.getAxisName().add("z");
//
//                final int depth = Integer.parseInt((String) d);
//                grid.setDimension(BigInteger.valueOf(3));
//                // notice that the third element indicates how many layers we do have requested on the third dimension
//                grid.setLimits(new GeneralGridEnvelope(new int[] { 0, 0, 0 }, new int[] {width, height, depth }, false));
//
//
//                // 3D grid
//                grid.setDimension(BigInteger.valueOf(3));
            } else {
                // 2d grid
                grid.setDimension(BigInteger.valueOf(2));
                grid.setLimits(new GridEnvelope2D(0, 0, width, height));

            }
        } else {
            //
            // we might be working with a rectified grid request there we need
            // to try and use that type. we cannot build a raster grid at this
            // stage yet since we have no idea about how the envelope will be intersected with the
            // native envelope for this raster
            //
            final Object rx = kvp.get("resx");
            final Object ry = kvp.get("resy");
            if (rx != null && ry != null) {
                // get resx e resy but correct also the sign for them taking into account
              final CoordinateSystem cs=crs.getCoordinateSystem();
              final AxisDirection northingDirection=cs.getAxis(1).getDirection();
              final int yAxisCorrection=AxisDirection.NORTH.equals(northingDirection)?-1:1;
              final AxisDirection eastingDirection=cs.getAxis(0).getDirection();
              final int xAxisCorrection=AxisDirection.EAST.equals(eastingDirection)?1:-1;
                final double resX = Double.parseDouble((String) rx)*xAxisCorrection;
                final double resY = Double.parseDouble((String) ry)*yAxisCorrection;
               

                // now compute offset vector for the transform from the envelope
                // Following ISO 19123 we use the CELL_CENTER convention but with the raster
                final double origX = envelope.getLowerCorner().getOrdinate(0)+resX/2;
                final double origY = envelope.getUpperCorner().getOrdinate(1)+resY/2;

                // create offset point
                final PointType origin = Gml4wcsFactory.eINSTANCE.createPointType();
                final DirectPositionType dp = Gml4wcsFactory.eINSTANCE.createDirectPositionType();
                origin.setPos(dp);
                origin.setSrsName(crsName);

                // create resolutions vector
                final VectorType resolutionVector = Gml4wcsFactory.eINSTANCE.createVectorType();

                //
                // Third dimension management
                //
                final Object rz = kvp.get("resz");
                if (rz != null) {
                    // afabiani: we consider 2D grdis only
                    throw new WcsException("3D grids are not supported.", InvalidParameterValue, "resz");
//                    // eventual depth
//                    final double resZ = Double.parseDouble((String) rz);
//                    // check that the envelope is 3D or throw an error
//                    if (bbox.getDimension() != 3)
//                        throw new WcsException("Found ResZ but envelope is of dimension "
//                                + bbox.getDimension(), InvalidParameterValue, "");
//                    final double origZ = bbox.getLowerCorner().getOrdinate(2);
//
//                    // 3D grid
//                    grid.setDimension(BigInteger.valueOf(3));
//                    // set the origin position
//                    dp.setDimension(grid.getDimension());
//                    dp.setValue(Arrays.asList(origX, origY, origZ));
//                    grid.setOrigin(origin);
//
//                    // set the resolution vector
//                    resolutionVector.setDimension(grid.getDimension());
//                    resolutionVector.setValue(Arrays.asList(resX, resY, resZ));
//                    grid.getOffsetVector().add(resolutionVector);
                } else {
                    // 2d grid
                    grid.setDimension(BigInteger.valueOf(2));
                    // set the origin position
                    dp.setDimension(grid.getDimension());
                    dp.setValue(Arrays.asList(origX, origY));
                    grid.setOrigin(origin);

                    // set the resolution vector
                    resolutionVector.setDimension(grid.getDimension());
                    resolutionVector.setValue(Arrays.asList(resX, resY));
                    grid.getOffsetVector().add(resolutionVector);
                }

            } else
                throw new WcsException("Could not recognize grid resolution",
                        InvalidParameterValue, "");
        }

        spatialSubset.getEnvelope().add(envelope);
        spatialSubset.getGrid().add(grid);
        domainSubset.setSpatialSubset(spatialSubset);
        domainSubset.setTemporalSubset(timeSequence);

        return domainSubset;
    }
View Full Code Here

   * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
   * @generated
   */
    public NotificationChain basicSetSupportedCRSs(SupportedCRSsType newSupportedCRSs, NotificationChain msgs) {
    SupportedCRSsType oldSupportedCRSs = supportedCRSs;
    supportedCRSs = newSupportedCRSs;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs10Package.COVERAGE_OFFERING_TYPE__SUPPORTED_CR_SS, oldSupportedCRSs, newSupportedCRSs);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
   * @generated
   */
    public NotificationChain basicSetSupportedFormats(SupportedFormatsType newSupportedFormats, NotificationChain msgs) {
    SupportedFormatsType oldSupportedFormats = supportedFormats;
    supportedFormats = newSupportedFormats;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs10Package.COVERAGE_OFFERING_TYPE__SUPPORTED_FORMATS, oldSupportedFormats, newSupportedFormats);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

TOP

Related Classes of net.opengis.wcs10.impl.WCSCapabilitiesTypeImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.