use of org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverLatLonBoundingBox in project geo-platform by geosdi.
the class GPGeoserverLayerGroupsConnectorStoreV22XTest method toBody.
/**
* @return {@link GPGeoserverLayerGroupBody}
*/
GPGeoserverLayerGroupBody toBody(String theName, String theTitle) {
GPGeoserverLayerGroupBody layerGroupBody = new GPGeoserverLayerGroupBody();
layerGroupBody.setName(theName);
layerGroupBody.setTitle(theTitle);
layerGroupBody.setMode(CONTAINER);
// layerGroupBody.setWorkspace(new GeoserverCreateWorkspaceBody("topp"));
layerGroupBody.setBounds(new GPGeoserverLatLonBoundingBox() {
{
super.setMaxx(-73.907005);
super.setMaxy(40.882078);
super.setMinx(-74.047185);
super.setMiny(40.679648);
super.setCrs("EPSG:4326");
}
});
GPGeoserverLayerGroupPublishables layerGroupBodyPublishables = new GPGeoserverLayerGroupPublishables();
List<GPGeoserverLayerPublished> layers = Lists.newArrayList();
layers.add(new GPGeoserverLayerPublished() {
{
super.setLayerName("tiger:giant_polygon");
}
});
// layers.add(new GPGeoserverLayerPublished() {
// {
// super.setLayerName("topp:states");
// }
// });
layers.add(new GPGeoserverLayerPublished() {
{
super.setLayerName("tiger:poly_landmarks");
}
});
layerGroupBodyPublishables.setLayers(layers);
layerGroupBody.setLayers(layerGroupBodyPublishables);
return layerGroupBody;
}
use of org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverLatLonBoundingBox 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.bbox.GPGeoserverLatLonBoundingBox in project geo-platform by geosdi.
the class GPGeoserverCoverageInfoJacksonTest method toCoverageInfo.
/**
* @return {@link GPGeoserverCoverageInfo}
*/
public static GPGeoserverCoverageInfo toCoverageInfo() {
GPGeoserverCoverageInfo coverageInfo = new GPGeoserverCoverageInfo();
coverageInfo.setAbstractText("Digital elevation model for the Spearfish region. nsfdem is a Tagged Image File Format with Geographic information");
coverageInfo.setDefaultInterpolationMethod("nearest neighbor");
coverageInfo.setEnabled(TRUE);
coverageInfo.setTitle("Spearfish elevation");
coverageInfo.setGrid(toCoverageGrid());
IGPCoverageInterpolationMethod interpolationMethod = new GPCoverageInterpolationMethod();
interpolationMethod.setValues(iterate(0, n -> n + 1).limit(15).boxed().map(String::valueOf).collect(toList()));
coverageInfo.setInterpolationMethod(interpolationMethod);
GPGeoserverLatLonBoundingBox latLonBoundingBox = new GPGeoserverLatLonBoundingBox();
latLonBoundingBox.setMinx(-74.0118315772888);
latLonBoundingBox.setMaxx(-74.00857344353275);
latLonBoundingBox.setMiny(40.70754683896324);
latLonBoundingBox.setMaxy(40.711945649065406);
latLonBoundingBox.setCrs("EPSG:4326");
coverageInfo.setLatLonBoundingBox(latLonBoundingBox);
coverageInfo.setNativeBoundingBox(toNativeBoundingBox());
coverageInfo.setKeywords(toKeyword());
coverageInfo.setMetadata(toMapParams());
coverageInfo.setNativeCRS(new GPGeoserverCRS("PROJCS[\\\"NAD27 / UTM zone 13N\\\", \\n GEOGCS[\\\"NAD27\\\", \\n " + " DATUM[\\\"North American Datum 1927\\\", \\n " + "SPHEROID[\\\"Clarke 1866\\\", 6378206.4, 294.9786982138982, AUTHORITY[\\\"EPSG\\\",\\\"7008\\\"]], \\n " + " TOWGS84[2.478, 149.752, 197.726, 0.526, -0.498, 0.501, 0.685], \\n " + " AUTHORITY[\\\"EPSG\\\",\\\"6267\\\"]], \\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\\\",\\\"4267\\\"]], \\n " + " PROJECTION[\\\"Transverse_Mercator\\\"], \\n PARAMETER[\\\"central_meridian\\\", -105.0], \\n" + " PARAMETER[\\\"latitude_of_origin\\\", 0.0], \\n PARAMETER[\\\"scale_factor\\\", 0.9996], \\n " + " PARAMETER[\\\"false_easting\\\", 500000.0], \\n PARAMETER[\\\"false_northing\\\", 0.0], \\n " + " UNIT[\\\"m\\\", 1.0], \\n AXIS[\\\"Easting\\\", EAST], \\n AXIS[\\\"Northing\\\", NORTH], \\n " + " AUTHORITY[\\\"EPSG\\\",\\\"26713\\\"]]", "projected"));
coverageInfo.setNativeFormat("GeoTIFF");
coverageInfo.setNativeName("sfdem");
coverageInfo.setSrs("EPSG:26713");
coverageInfo.setResponseSRS(toResponseSRS());
GPGeoserverRequestSRS requestSRS = new GPGeoserverRequestSRS();
requestSRS.setValues(iterate(0, n -> n + 1).limit(15).boxed().map(String::valueOf).collect(toList()));
coverageInfo.setRequestSRS(requestSRS);
GPGeoserverCoverageStoreInfo coverageStoreInfo = new GPGeoserverCoverageStoreInfo();
coverageStoreInfo.setHref("http://localhost:/geoserver/restng/workspaces/sf/coveragestores/sfdem.json");
coverageStoreInfo.setName("sf:sfdem");
coverageInfo.setStore(coverageStoreInfo);
IGPGeoserverSupportedFormat supportedFormat = new GPGeoserverSupportedFormat();
supportedFormat.setFormats(of("ARCGRID", "IMAGEMOSAIC", "GTOPO30", "GEOTIFF", "GIF", "PNG", "JPEG", "TIFF").collect(toList()));
coverageInfo.setSupportedFormats(supportedFormat);
coverageInfo.setPolicy(FORCE_DECLARED);
return coverageInfo;
}
use of org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverLatLonBoundingBox in project geo-platform by geosdi.
the class GPGeoserverFeatureTypeInfoJacksonTest method toFeatureTypeInfo.
/**
* @return {@link GPGeoserverFeatureTypeInfo}
*/
public static GPGeoserverFeatureTypeInfo toFeatureTypeInfo() {
GPGeoserverFeatureTypeInfo featureType = new GPGeoserverFeatureTypeInfo();
featureType.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"]]");
featureType.setSrs("EPSG:4326");
featureType.setEnabled(TRUE);
featureType.setTitle("layer_test");
featureType.setName("test");
featureType.setAbstractText("ABSTRACT_TEXT");
featureType.setNativeBoundingBox(toNativeBoundingBox());
GPGeoserverLatLonBoundingBox latLonBoundingBox = new GPGeoserverLatLonBoundingBox();
latLonBoundingBox.setMinx(-74.0118315772888);
latLonBoundingBox.setMaxx(-74.00857344353275);
latLonBoundingBox.setMiny(40.70754683896324);
latLonBoundingBox.setMaxy(40.711945649065406);
latLonBoundingBox.setCrs("EPSG:4326");
featureType.setLatLonBoundingBox(latLonBoundingBox);
featureType.setAttributes(toFeatureTypeAttributes(15));
featureType.setDataLinks(toDataLinks(20));
featureType.setMetadataLinks(toMetadataLinks(25));
featureType.setMetadata(toMapParams());
featureType.setProjectionPolicy(FORCE_DECLARED);
featureType.setMaxFeatures(40);
featureType.setKeywords(toKeyword());
GPGeoserverFeatureTypesStoreInfo featureTypesStoreInfo = new GPGeoserverFeatureTypesStoreInfo();
featureTypesStoreInfo.setName("tiger:nyc");
featureTypesStoreInfo.setHref("http://localhost:8080/geoserver/rest/workspaces/tiger/datastores/nyc.xml");
featureType.setStore(featureTypesStoreInfo);
featureType.setResponseSRS(toResponseSRS());
return featureType;
}
use of org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverLatLonBoundingBox 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());
}
Aggregations