Search in sources :

Example 1 with IGPFeatureTypeAttributes

use of org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes 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());
}
Also used : GPGeoserverNativeBoundingBox(org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverNativeBoundingBox) GPFeatureTypeAttribute(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttribute) IGPFeatureTypeAttribute(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttribute) IGPGeoserverFeatureTypeInfo(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.IGPGeoserverFeatureTypeInfo) GPGeoserverFeatureTypeInfo(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.GPGeoserverFeatureTypeInfo) IGPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes) IGPFeatureTypeAttribute(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttribute) GPGeoserverLatLonBoundingBox(org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverLatLonBoundingBox) IGPGeoserverFeatureTypeInfo(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.IGPGeoserverFeatureTypeInfo) GPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttributes) IGPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes) GeoserverCreateFeatureTypeRequest(org.geosdi.geoplatform.connector.geoserver.request.featuretypes.GeoserverCreateFeatureTypeRequest) Ignore(org.junit.Ignore) GeoserverConnectorTest(org.geosdi.geoplatform.geoserver.GeoserverConnectorTest) Test(org.junit.Test)

Example 2 with IGPFeatureTypeAttributes

use of org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes in project geo-platform by geosdi.

the class GPFeatureTypeAttributesJacksonTest method m_marshallGPFeatureTypeAttributesJacksonAsJsonStringTest.

@Test
public void m_marshallGPFeatureTypeAttributesJacksonAsJsonStringTest() throws Exception {
    IGPFeatureTypeAttributes featureTypeAttributes = toFeatureTypeAttributes(9);
    GPFeatureTypeAttributesJackson featureTypeAttributesJackson = new GPFeatureTypeAttributesJackson();
    featureTypeAttributesJackson.setAttributes(featureTypeAttributes);
    logger.info("##############GP_FEATURE_TYPE_ATTRIBUTES_JACKSON : \n{}\n", jacksonSupport.getDefaultMapper().writeValueAsString(featureTypeAttributesJackson));
}
Also used : IGPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes) Test(org.junit.Test)

Example 3 with IGPFeatureTypeAttributes

use of org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes in project geo-platform by geosdi.

the class GPFeatureTypeAttributesJacksonTest method q_marshallGPFeatureTypeAttributesAsJsonStringTest.

@Test
public void q_marshallGPFeatureTypeAttributesAsJsonStringTest() throws Exception {
    IGPFeatureTypeAttribute featureTypeAttribute = new GPFeatureTypeAttribute();
    featureTypeAttribute.setName("the_geom");
    featureTypeAttribute.setBinding("org.locationtech.jts.geom.Point");
    featureTypeAttribute.setNillable(TRUE);
    featureTypeAttribute.setMinOccurs(0);
    IGPFeatureTypeAttributes featureTypeAttributes = new GPFeatureTypeAttributes();
    featureTypeAttributes.setValues(asList(featureTypeAttribute));
    logger.info("\n{}\n", jacksonSupport.getDefaultMapper().writeValueAsString(featureTypeAttributes));
}
Also used : GPFeatureTypeAttribute(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttribute) IGPFeatureTypeAttribute(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttribute) IGPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes) IGPFeatureTypeAttribute(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttribute) GPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttributes) IGPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes) Test(org.junit.Test)

Example 4 with IGPFeatureTypeAttributes

use of org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes in project geo-platform by geosdi.

the class GPFeatureTypeAttributesJacksonTest method o_marshallGPFeatureTypeAttributesJacksonWithNullPropertiesTest.

@Test
public void o_marshallGPFeatureTypeAttributesJacksonWithNullPropertiesTest() throws Exception {
    GPFeatureTypeAttributesJackson featureTypeAttributesJackson = new GPFeatureTypeAttributesJackson();
    IGPFeatureTypeAttributes featureTypeAttributes = new GPFeatureTypeAttributes();
    featureTypeAttributesJackson.setAttributes(featureTypeAttributes);
    logger.info("##############GP_FEATURE_TYPE_ATTRIBUTES_JACKSON : \n{}\n", jacksonSupport.getDefaultMapper().writeValueAsString(featureTypeAttributesJackson));
}
Also used : IGPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes) GPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttributes) IGPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes) Test(org.junit.Test)

Example 5 with IGPFeatureTypeAttributes

use of org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes in project geo-platform by geosdi.

the class GPGeoserverFeatureTypesConnectorTest method f_createFeatureTypeTest.

@Test
public void f_createFeatureTypeTest() throws Exception {
    GeoserverCreateFeatureTypeRequest createFeatureTypeRequest = geoserverConnectorStoreV2_21_x.createFeatureTypeRequest();
    createFeatureTypeRequest.withWorkspace("topp").withStore("Test");
    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("@@@@@@@@@@@@@@@@@@@@@@@@@@@@CREATE_FEATURE_TYPE_RESPONSE : {}\n", createFeatureTypeRequest.getResponse());
}
Also used : GPGeoserverNativeBoundingBox(org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverNativeBoundingBox) GPFeatureTypeAttribute(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttribute) IGPFeatureTypeAttribute(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttribute) IGPGeoserverFeatureTypeInfo(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.IGPGeoserverFeatureTypeInfo) GPGeoserverFeatureTypeInfo(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.GPGeoserverFeatureTypeInfo) IGPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes) IGPFeatureTypeAttribute(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttribute) GPGeoserverLatLonBoundingBox(org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverLatLonBoundingBox) IGPGeoserverFeatureTypeInfo(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.IGPGeoserverFeatureTypeInfo) GPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttributes) IGPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes) GeoserverCreateFeatureTypeRequest(org.geosdi.geoplatform.connector.geoserver.request.featuretypes.GeoserverCreateFeatureTypeRequest) Test(org.junit.Test) GPBaseGeoserverConnectorStoreTest(org.geosdi.geoplatform.connector.store.GPBaseGeoserverConnectorStoreTest)

Aggregations

IGPFeatureTypeAttributes (org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes)7 Test (org.junit.Test)7 GPFeatureTypeAttributes (org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttributes)6 GPFeatureTypeAttribute (org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttribute)5 IGPFeatureTypeAttribute (org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttribute)5 GPGeoserverLatLonBoundingBox (org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverLatLonBoundingBox)4 GPGeoserverNativeBoundingBox (org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverNativeBoundingBox)4 GPGeoserverFeatureTypeInfo (org.geosdi.geoplatform.connector.geoserver.model.featuretypes.GPGeoserverFeatureTypeInfo)4 IGPGeoserverFeatureTypeInfo (org.geosdi.geoplatform.connector.geoserver.model.featuretypes.IGPGeoserverFeatureTypeInfo)4 GeoserverCreateFeatureTypeRequest (org.geosdi.geoplatform.connector.geoserver.request.featuretypes.GeoserverCreateFeatureTypeRequest)4 GPBaseGeoserverConnectorStoreTest (org.geosdi.geoplatform.connector.store.GPBaseGeoserverConnectorStoreTest)1 GPBaseGeoserverConnectorStoreV220xTest (org.geosdi.geoplatform.connector.store.GPBaseGeoserverConnectorStoreV220xTest)1 GPBaseGeoserverConnectorStoreV22xTest (org.geosdi.geoplatform.connector.store.GPBaseGeoserverConnectorStoreV22xTest)1 GeoserverConnectorTest (org.geosdi.geoplatform.geoserver.GeoserverConnectorTest)1 Ignore (org.junit.Ignore)1