use of org.geotoolkit.gml.xml.v311.FeatureCollectionType in project geo-platform by geosdi.
the class WFSGetFeatureWithSpatialRestrictionsTest method a_stateQueryRestrictionBboxTest.
@Test
public void a_stateQueryRestrictionBboxTest() 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.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() == 4);
logger.info("#############################a_stateQueryBboxTest#ResponseAsString {}\n", request.formatResponseAsString(2));
}
use of org.geotoolkit.gml.xml.v311.FeatureCollectionType in project geo-platform by geosdi.
the class WFSGetFeatureWithSpatialRestrictionsTest method f_queryWithBboxTest.
@Test
public void f_queryWithBboxTest() throws Exception {
WFSGetFeatureRequest<FeatureCollectionType> request = serverConnector.createGetFeatureRequest();
request.setResultType(ResultTypeType.RESULTS.value());
request.setTypeName(new QName("topp:admin_shp_com2016_wgs84_g"));
request.setBBox(new BBox(16.13123416900635, 40.83818500873241, 16.138143539428714, 40.84040902994519));
request.setSRS("EPSG:4326");
logger.info("######################\n{}\n", request.showRequestAsString());
FeatureCollectionType response = request.getResponse();
logger.info("########################FEATURES : {}\n", response.getNumberOfFeatures());
}
use of org.geotoolkit.gml.xml.v311.FeatureCollectionType in project geo-platform by geosdi.
the class WFSGetFeatureTest method i_statesSecureContainsRestrictionTest.
@Test
public void i_statesSecureContainsRestrictionTest() throws Exception {
WFSGetFeatureRequest<FeatureCollectionType> request = secureServerConnector.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("###################################statesSecureContainsRestrictionTest#Features : {}\n", response.getNumberOfFeatures().intValue());
}
use of org.geotoolkit.gml.xml.v311.FeatureCollectionType in project geo-platform by geosdi.
the class GPWFSGetFeatureLayerTempoTest method d_searchEndsWithLayerTempoTest.
@Test
public void d_searchEndsWithLayerTempoTest() throws Exception {
WFSGetFeatureRequest<FeatureCollectionType> request = serverConnector.createGetFeatureRequest();
request.setResultType(RESULTS.value());
request.setTypeName(new QName("admin:tempo"));
QueryDTO queryDTO = new QueryDTO();
queryDTO.setMatchOperator("ALL");
AttributeDTO attributeDTO = new AttributeDTO();
attributeDTO.setName("string");
attributeDTO.setType("string");
QueryRestrictionDTO queryRestrictionDTO = new QueryRestrictionDTO(attributeDTO, OperatorType.ENDS_WITH, "sto1");
queryDTO.setQueryRestrictionList(Arrays.asList(queryRestrictionDTO));
request.setQueryDTO(queryDTO);
logger.info("######################\n{}\n", request.showRequestAsString());
FeatureCollectionType response = request.getResponse();
assertTrue(response.getNumberOfFeatures().intValue() == 1);
}
use of org.geotoolkit.gml.xml.v311.FeatureCollectionType in project geo-platform by geosdi.
the class GPWFSGetFeatureLayerTempoTest method a_searchStartWithLayerTempoTest.
@Test
public void a_searchStartWithLayerTempoTest() throws Exception {
WFSGetFeatureRequest<FeatureCollectionType> request = serverConnector.createGetFeatureRequest();
request.setResultType(RESULTS.value());
request.setTypeName(new QName("admin:tempo"));
QueryDTO queryDTO = new QueryDTO();
queryDTO.setMatchOperator("ALL");
AttributeDTO attributeDTO = new AttributeDTO();
attributeDTO.setName("string");
attributeDTO.setType("string");
QueryRestrictionDTO queryRestrictionDTO = new QueryRestrictionDTO(attributeDTO, OperatorType.STARTS_WITH, "te");
queryDTO.setQueryRestrictionList(Arrays.asList(queryRestrictionDTO));
request.setQueryDTO(queryDTO);
logger.info("######################\n{}\n", request.showRequestAsString());
FeatureCollectionType response = request.getResponse();
assertTrue(response.getNumberOfFeatures().intValue() == 7);
}
Aggregations