use of org.geotoolkit.gml.xml.v311.FeatureCollectionType in project geo-platform by geosdi.
the class WFSGetFeatureTest method h_statesContainsRestrictionTest.
@Test
public void h_statesContainsRestrictionTest() throws Exception {
WFSGetFeatureRequest<FeatureCollectionType> request = serverConnector.createGetFeatureRequest();
request.setTypeName(statesName);
request.setResultType(HITS.value());
request.setQueryDTO(GPJAXBContextBuilder.newInstance().unmarshal(new StringReader("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<QueryDTO>\n" + " <matchOperator>ALL</matchOperator>\n" + " <queryRestrictionList>\n" + " <queryRestriction>\n" + " <attribute>\n" + " <maxOccurs>1</maxOccurs>\n" + " <minOccurs>0</minOccurs>\n" + " <name>SUB_REGION</name>\n" + " <nillable>true</nillable>\n" + " <type>string</type>\n" + " <value></value>\n" + " </attribute>\n" + " <operator>CONTAINS</operator>\n" + " <restriction>Mtn</restriction>\n" + " </queryRestriction>\n" + " </queryRestrictionList>\n" + "</QueryDTO>"), QueryDTO.class));
logger.info("#############################REQUEST_AS_STRING : \n{}\n", request.showRequestAsString());
FeatureCollectionType response = request.getResponse();
logger.info("##############################statesContainsRestrictionTest#Features : {}\n", response.getNumberOfFeatures().intValue());
}
use of org.geotoolkit.gml.xml.v311.FeatureCollectionType in project geo-platform by geosdi.
the class WFSGetFeatureTest method n_statesGreatherThanRestrictionTest.
@Test
public void n_statesGreatherThanRestrictionTest() throws Exception {
WFSGetFeatureRequest<FeatureCollectionType> request = serverConnector.createGetFeatureRequest();
request.setTypeName(statesName);
request.setResultType(HITS.value());
request.setQueryDTO(GPJAXBContextBuilder.newInstance().unmarshal(new StringReader("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<QueryDTO>\n" + " <matchOperator>ALL</matchOperator>\n" + " <queryRestrictionList>\n" + " <queryRestriction>\n" + " <attribute>\n" + " <maxOccurs>1</maxOccurs>\n" + " <minOccurs>0</minOccurs>\n" + " <name>WORKERS</name>\n" + " <nillable>true</nillable>\n" + " <type>double</type>\n" + " <value></value>\n" + " </attribute>\n" + " <operator>GREATER</operator>\n" + " <restriction>6000000</restriction>\n" + " </queryRestriction>\n" + " </queryRestrictionList>\n" + "</QueryDTO>"), QueryDTO.class));
logger.info("#############################REQUEST_AS_STRING : \n{}\n", request.showRequestAsString());
FeatureCollectionType response = request.getResponse();
logger.info("#########################################statesGreatherThanRestrictionTest#Features : {}\n", response.getNumberOfFeatures().intValue());
}
use of org.geotoolkit.gml.xml.v311.FeatureCollectionType in project geo-platform by geosdi.
the class WFSGetFeatureTest method e_statesResults.
@Test
public void e_statesResults() throws Exception {
WFSGetFeatureRequest<FeatureCollectionType> request = serverConnector.createGetFeatureRequest();
request.setResultType(ResultTypeType.RESULTS.value());
request.setTypeName(statesName);
request.setMaxFeatures(BigInteger.ONE);
logger.info("RESPONSE @@@@@@@@@@@@@@@@@@@@@@@@@@@@@ {}\n", request.getResponseAsString());
FeatureCollectionType response = request.getResponse();
logger.info("xxxxxxxxxxx {}", response.getNumberOfFeatures());
logger.info("xxxxxxxxxxx {}", response.getTimeStamp());
FeatureArrayPropertyType featureMembers = response.getFeatureMembers();
logger.info("----------- {}", featureMembers.isSetFeature());
logger.info("----------- {}", featureMembers.getFeature());
logger.info("----------- {}", featureMembers.getFeature().size());
logger.info("+++++++++++ {}", response.getFeatureMember());
logger.info("+++++++++++ {}\n\n", response.getFeatureMember().size());
}
use of org.geotoolkit.gml.xml.v311.FeatureCollectionType in project geo-platform by geosdi.
the class WFSGetFeatureWithSpatialRestrictionsTest method c_stateQueryRestrictionsNotInBboxTest.
@Test
public void c_stateQueryRestrictionsNotInBboxTest() throws Exception {
WFSGetFeatureRequest<FeatureCollectionType> request = serverConnector.createGetFeatureRequest();
request.setResultType(ResultTypeType.RESULTS.value());
request.setTypeName(statesName);
request.setPropertyNames(Arrays.asList(new String[] { "WORKERS", "MANUAL", "SUB_REGION" }));
request.setQueryDTO(GPJAXBContextBuilder.newInstance().unmarshal(new StringReader("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<QueryDTO>\n" + " <matchOperator>NONE</matchOperator>\n" + " <queryRestrictionList>\n" + " <queryRestriction>\n" + " <attribute>\n" + " <maxOccurs>1</maxOccurs>\n" + " <minOccurs>0</minOccurs>\n" + " <name>WORKERS</name>\n" + " <nillable>true</nillable>\n" + " <type>double</type>\n" + " <value></value>\n" + " </attribute>\n" + " <operator>GREATER_OR_EQUAL</operator>\n" + " <restriction>2248972.0</restriction>\n" + " </queryRestriction>\n" + " <queryRestriction>\n" + " <attribute>\n" + " <maxOccurs>1</maxOccurs>\n" + " <minOccurs>0</minOccurs>\n" + " <name>MANUAL</name>\n" + " <nillable>true</nillable>\n" + " <type>double</type>\n" + " <value></value>\n" + " </attribute>\n" + " <operator>GREATER_OR_EQUAL</operator>\n" + " <restriction>0.25</restriction>\n" + " </queryRestriction>\n" + " </queryRestrictionList>\n" + "</QueryDTO>"), QueryDTO.class));
request.setBBox(new BBox(-75.102613, 40.212597, -72.361859, 41.512517));
request.setSRS("EPSG:4326");
logger.info("######################\n{}\n", request.showRequestAsString());
FeatureCollectionType response = request.getResponse();
assertTrue(response.getNumberOfFeatures().intValue() == 46);
logger.info("#############################c_stateQueryRestrictionsNotInBboxTest#ResponseAsString {}\n", request.formatResponseAsString(2));
}
use of org.geotoolkit.gml.xml.v311.FeatureCollectionType in project geo-platform by geosdi.
the class WFSGetFeatureWithSpatialRestrictionsTest method e_stateQueryRestrictionNotInBboxTest.
@Test
public void e_stateQueryRestrictionNotInBboxTest() throws Exception {
WFSGetFeatureRequest<FeatureCollectionType> request = serverConnector.createGetFeatureRequest();
request.setResultType(ResultTypeType.RESULTS.value());
request.setTypeName(statesName);
request.setPropertyNames(Arrays.asList(new String[] { "WORKERS", "MANUAL", "SUB_REGION" }));
request.setQueryDTO(GPJAXBContextBuilder.newInstance().unmarshal(new StringReader("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<QueryDTO>\n" + " <matchOperator>NONE</matchOperator>\n" + " <queryRestrictionList>\n" + " <queryRestriction>\n" + " <attribute>\n" + " <maxOccurs>1</maxOccurs>\n" + " <minOccurs>0</minOccurs>\n" + " <name>WORKERS</name>\n" + " <nillable>true</nillable>\n" + " <type>double</type>\n" + " <value></value>\n" + " </attribute>\n" + " <operator>GREATER_OR_EQUAL</operator>\n" + " <restriction>1248972.0</restriction>\n" + " </queryRestriction>\n" + " </queryRestrictionList>\n" + "</QueryDTO>"), QueryDTO.class));
request.setBBox(new BBox(-75.102613, 40.212597, -72.361859, 41.512517));
request.setSRS("EPSG:4326");
logger.info("######################\n{}\n", request.showRequestAsString());
logger.info("#############################e_stateQueryRestrictionNotInBboxTest#ResponseAsString {}\n", request.formatResponseAsString(2));
}
Aggregations