Package net.opengis.cat.csw20

Examples of net.opengis.cat.csw20.QueryType


        GetFeatureType gf = (GetFeatureType) parse();
        assertNotNull(gf);
       
        assertEquals(BigInteger.valueOf(100), gf.getCount());
        assertEquals(1, gf.getAbstractQueryExpression().size());
        QueryType q = (QueryType) gf.getAbstractQueryExpression().get(0);
        assertNotNull(q);

        assertNotNull(q.getFilter());
        assertEquals(3, q.getPropertyNames().size());
       
        assertEquals(new QName("http://www.someserver.com/myns", "wkbGeom"), q.getPropertyNames().get(0));
        assertEquals(new QName("http://www.someserver.com/myns", "tileId"), q.getPropertyNames().get(1));
        assertEquals(new QName("http://www.someserver.com/myns", "facId"), q.getPropertyNames().get(2));
    }
View Full Code Here


        GetFeatureType gf = (GetFeatureType) parse();
        assertNotNull(gf);
       
        assertEquals(3, gf.getAbstractQueryExpression().size());
       
        QueryType q = (QueryType) gf.getAbstractQueryExpression().get(0);
        assertNotNull(q);
        assertEquals(new QName("http://www.someserver.com/myns", "InWaterA_1M"),
            q.getTypeNames().get(0));
       
        q = (QueryType) gf.getAbstractQueryExpression().get(1);
        assertNotNull(q);
        assertEquals(new QName("http://www.someserver.com/myns", "BuiltUpA_1M"),
            q.getTypeNames().get(0));
       
        q = (QueryType) gf.getAbstractQueryExpression().get(2);
        assertNotNull(q);
        assertEquals(new QName("http://demo.cubewerx.com/yourns", "RoadL_1M"),
            q.getTypeNames().get(0));
    }
View Full Code Here

        GetFeatureType gf = (GetFeatureType) parse();
        assertNotNull(gf);
        assertEquals(ResultTypeType.HITS, gf.getResultType());
       
        assertEquals(1, gf.getAbstractQueryExpression().size());
        QueryType q = (QueryType) gf.getAbstractQueryExpression().get(0);
        assertNotNull(q);
       
        Not f = (Not) q.getFilter();
        assertNotNull(f);
       
        Disjoint d = (Disjoint) f.getFilter();
        assertNotNull(d);
       
        assertEquals(2, q.getSortBy().size());
    }
View Full Code Here

       
        assertEquals(BigInteger.valueOf(124), gf.getExpiry());
        assertEquals(AllSomeType.ALL, gf.getLockAction());
       
        assertEquals(1, gf.getAbstractQueryExpression().size());
        QueryType q = (QueryType) gf.getAbstractQueryExpression().get(0);
        assertNotNull(q);
       
        assertEquals(new URI("epsg:4326"), q.getSrsName());
        assertEquals(1, q.getTypeNames().size());
        assertEquals(
            new QName("http://www.someserver.com/myns", "InWaterA_1M"), q.getTypeNames().get(0));
       
        Id f = (Id) q.getFilter();
        assertNotNull(f);
       
        assertEquals(1, f.getIdentifiers().size());
        assertEquals("InWaterA_1M.1234", f.getIdentifiers().iterator().next().getID());
    }
View Full Code Here

       
        GetFeatureType gf = (GetFeatureType) parse();
        assertNotNull(gf);
       
        assertEquals(1, gf.getAbstractQueryExpression().size());
        QueryType q = (QueryType) gf.getAbstractQueryExpression().get(0);
        assertNotNull(q);
       
        assertEquals(2, q.getTypeNames().size());
        assertEquals(2, q.getAliases().size());
    }
View Full Code Here

        buildDocument(xml);
       
        GetPropertyValueType gf = (GetPropertyValueType) parse();
        assertNotNull(gf);
        assertEquals("foo", gf.getValueReference());
        QueryType q = (QueryType) gf.getAbstractQueryExpression();
        assertNotNull(q);
       
        assertEquals(new URI("epsg:4326"), q.getSrsName());
        assertEquals(1, q.getTypeNames().size());
        assertEquals(
            new QName("http://www.someserver.com/myns", "InWaterA_1M"), q.getTypeNames().get(0));
       
        Id f = (Id) q.getFilter();
        assertNotNull(f);
       
        assertEquals(1, f.getIdentifiers().size());
        assertEquals("InWaterA_1M.1234", f.getIdentifiers().iterator().next().getID());
    }
View Full Code Here

    @Override
    protected void encode(Encoder encoder, Object value, OutputStream output, Operation op)
        throws IOException, ServiceException {

        GetPropertyValueType request = (GetPropertyValueType) op.getParameters()[0];
        QueryType query = (QueryType) request.getAbstractQueryExpression();
        QName typeName = (QName) query.getTypeNames().get(0);
       
        NamespaceInfo ns = gs.getCatalog().getNamespaceByURI(typeName.getNamespaceURI());
       
        encoder.getNamespaces().declarePrefix(ns.getPrefix(), ns.getURI());
        encoder.encode(value, WFS.ValueCollection, output);
View Full Code Here

          
           if (layer.getType() == LayerType.FEATURES){
               FeaturesLayer features = (FeaturesLayer) layer;
               QName ftName = features.getFeatureType();

               QueryType query = Wfs20Factory.eINSTANCE.createQueryType();
               query.getTypeNames().add(ftName);

               if (features.getSrs() == null) {
                   String ns = ftName.getNamespaceURI() != null
                       ? ftName.getNamespaceURI() : ftName.getPrefix();
                   FeatureTypeInfo ft =
                       catalog.getFeatureTypeByName(ns, ftName.getLocalPart());
                   if (ft != null) {
                       try {
                           query.setSrsName(new URI(ft.getSRS()));
                       } catch (URISyntaxException e) {
                           throw new RuntimeException(e);
                       }
                   }
               }
               else {
                   query.setSrsName(features.getSrs());
               }

               if (features.getPropertyNames() != null) {
                   query.getPropertyNames().addAll(features.getPropertyNames());
               }
               Filter filter = features.getFilter();

               //add bbox to filter if there is one
               if (features.getBbox() != null){
                   String defaultGeometry = catalog.getFeatureTypeByName(features.getFeatureType().getLocalPart())
                           .getFeatureType().getGeometryDescriptor().getLocalName();

                   Envelope e = features.getBbox();
                   // HACK: because we are going through wfs 2.0, flip the coordinates (specified in xy)
                   // which will then be later flipped back to xy
                   if (query.getSrsName() != null) {
                       try {
                           CoordinateReferenceSystem crs = CRS.decode(query.getSrsName().toString());
                           if (crs instanceof GeographicCRS) {
                               // flip the bbox
                               e = new Envelope(e.getMinY(), e.getMaxY(), e.getMinX(), e.getMaxX());
                           }
                       }
                       catch(Exception ex) {
                           throw new RuntimeException(ex);
                       }
                   }

                   Filter bboxFilter = filterFactory.bbox(filterFactory.property(defaultGeometry),
                       ReferencedEnvelope.reference(e));
                   if (filter == null) {
                       filter = bboxFilter;
                   } else {
                       filter = filterFactory.and(filter, bboxFilter);
                   }
               }
               query.setFilter(filter);
              
               GetFeatureType getFeature = Wfs20Factory.eINSTANCE.createGetFeatureType();
               getFeature.getAbstractQueryExpression().add(query);

               FeatureCollectionResponse fc = getFeatureDelegate.run(GetFeatureRequest.adapt(getFeature));
View Full Code Here

            }
           
            //parse
            Parser p = new Parser(new WFSConfiguration());
            try {
                QueryType compiled =
                    (QueryType) p.parse(new ByteArrayInputStream(sb.toString().getBytes()));
                list.add(compiled);
            }
            catch(Exception e) {
                throw new RuntimeException(e);
View Full Code Here

        getFeature.setCount(request.getCount());

        FeatureCollectionType fc = (FeatureCollectionType) delegate.run(
                GetFeatureRequest.adapt(getFeature)).getAdaptee();

        QueryType query = (QueryType) request.getAbstractQueryExpression();
        QName typeName = (QName) query.getTypeNames().iterator().next();
        FeatureTypeInfo featureType = catalog.getFeatureTypeByName(typeName.getNamespaceURI(),
                typeName.getLocalPart());

        try {
View Full Code Here

TOP

Related Classes of net.opengis.cat.csw20.QueryType

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.