use of org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttribute in project geo-platform by geosdi.
the class GeoserverConnectorLayersTest method o_publishDBLayer.
@Ignore
@Test
public void o_publishDBLayer() throws Exception {
GeoserverCreateFeatureTypeRequest createFeatureTypeRequest = this.geoserverConnectorStore.createFeatureTypeRequest();
createFeatureTypeRequest.withWorkspace("sf").withStore("store_vito");
IGPGeoserverFeatureTypeInfo featureTypeBody = new GPGeoserverFeatureTypeInfo();
featureTypeBody.setNativeCRS("GEOGCS["WGS 84", \n" + " DATUM["World Geodetic System 1984", \n" + " SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], \n" + " AUTHORITY["EPSG","6326"]], \n" + " PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], \n" + " UNIT["degree", 0.017453292519943295], \n" + " AXIS["Geodetic longitude", EAST], \n" + " AXIS["Geodetic latitude", NORTH], \n" + " AUTHORITY["EPSG","4326"]]");
featureTypeBody.setSrs("EPSG:4326");
featureTypeBody.setEnabled(TRUE);
featureTypeBody.setTitle("layer_test");
featureTypeBody.setName("test");
GPGeoserverNativeBoundingBox nativeBoundingBox = new GPGeoserverNativeBoundingBox();
nativeBoundingBox.setMinx(-74.0118315772888);
nativeBoundingBox.setMaxx(-74.00153046439813);
nativeBoundingBox.setMiny(40.70754683896324);
nativeBoundingBox.setMaxy(40.719885123828675);
nativeBoundingBox.setCrs("EPSG:4326");
featureTypeBody.setNativeBoundingBox(nativeBoundingBox);
GPGeoserverLatLonBoundingBox latLonBoundingBox = new GPGeoserverLatLonBoundingBox();
latLonBoundingBox.setMinx(-74.0118315772888);
latLonBoundingBox.setMaxx(-74.00857344353275);
latLonBoundingBox.setMiny(40.70754683896324);
latLonBoundingBox.setMaxy(40.711945649065406);
latLonBoundingBox.setCrs("EPSG:4326");
featureTypeBody.setLatLonBoundingBox(latLonBoundingBox);
IGPFeatureTypeAttribute featureTypeAttribute = new GPFeatureTypeAttribute();
featureTypeAttribute.setName("the_geom");
featureTypeAttribute.setBinding("org.locationtech.jts.geom.Point");
featureTypeAttribute.setNillable(TRUE);
featureTypeAttribute.setMinOccurs(0);
featureTypeAttribute.setMinOccurs(1);
IGPFeatureTypeAttributes featureTypeAttributes = new GPFeatureTypeAttributes();
featureTypeAttributes.setValues(asList(featureTypeAttribute));
featureTypeBody.setAttributes(featureTypeAttributes);
createFeatureTypeRequest.withFeatureTypeBody(featureTypeBody);
logger.info("################{}\n", createFeatureTypeRequest.getResponse());
}
use of org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttribute in project geo-platform by geosdi.
the class GPFeatureTypeAttributesJacksonTest method e_marshallGPFeatureTypeAttributeAsXmlStringTest.
@Test
public void e_marshallGPFeatureTypeAttributeAsXmlStringTest() throws Exception {
GPFeatureTypeAttribute featureTypeAttribute = toFeatureTypeAttribute(0);
logger.info("###############GP_FEATURE_TYPE_ATTRIBUTE : \n{}\n", JACKSON_JAXB_XML_SUPPORT.getDefaultMapper().writeValueAsString(featureTypeAttribute));
}
use of org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttribute in project geo-platform by geosdi.
the class GPFeatureTypeAttributesJacksonTest method f_unmarshallGPFeatureTypeAttributeFromXmlStringTest.
@Test
public void f_unmarshallGPFeatureTypeAttributeFromXmlStringTest() throws Exception {
GPFeatureTypeAttribute featureTypeAttribute = JACKSON_JAXB_XML_SUPPORT.getDefaultMapper().readValue(new StringReader("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<attribute>\n" + " <name>NAME#0</name>\n" + " <minOccurs>0</minOccurs>\n" + " <maxOccurs>0</maxOccurs>\n" + " <nillable>true</nillable>\n" + " <binding>BINDING#0</binding>\n" + "</attribute>"), GPFeatureTypeAttribute.class);
logger.info("@@@@@@@@@@@@@@GP_FEATURE_TYPE_ATTRIBUTE : {}\n", featureTypeAttribute);
}
use of org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttribute in project geo-platform by geosdi.
the class GPFeatureTypeAttributesJacksonTest method toFeatureTypeAttribute.
/**
* @param value
* @return {@link GPFeatureTypeAttribute}
*/
public static GPFeatureTypeAttribute toFeatureTypeAttribute(Integer value) {
checkArgument(value != null, "The Parameter value must not be null.");
GPFeatureTypeAttribute featureTypeAttribute = new GPFeatureTypeAttribute();
featureTypeAttribute.setBinding("BINDING#" + value);
featureTypeAttribute.setMaxOccurs(value);
featureTypeAttribute.setMinOccurs(value);
featureTypeAttribute.setName("NAME#" + value);
featureTypeAttribute.setNillable((value % 2 == 0) ? TRUE : FALSE);
return featureTypeAttribute;
}
use of org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttribute in project geo-platform by geosdi.
the class GPFeatureTypeAttributesJacksonTest method g_marshallGPFeatureAttributeAsJsonStringTest.
@Test
public void g_marshallGPFeatureAttributeAsJsonStringTest() throws Exception {
GPFeatureTypeAttribute featureTypeAttribute = toFeatureTypeAttribute(0);
logger.info("##############GP_FEATURE_TYPE_ATTRIBUTE : \n{}\n", jacksonSupport.getDefaultMapper().writeValueAsString(featureTypeAttribute));
}
Aggregations