This commit is contained in:
Fabio Sinibaldi 2013-09-18 15:35:20 +00:00
parent 6dc947cf8a
commit 0ebd46285a
2 changed files with 29 additions and 21 deletions

View File

@ -5,12 +5,14 @@ import it.geosolutions.geoserver.rest.GeoServerRESTReader;
import it.geosolutions.geoserver.rest.decoder.RESTWorkspaceList.RESTShortWorkspace;
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy;
import java.awt.Color;
import java.io.File;
import java.util.Iterator;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.spatial.data.geonetwork.LoginLevel;
import org.gcube.spatial.data.gis.model.Costants;
import org.gcube.spatial.data.gis.symbology.StyleUtils;
import org.geotoolkit.metadata.iso.DefaultMetadata;
import org.opengis.metadata.Metadata;
@ -35,18 +37,32 @@ public class PublishTest {
}
String geoTiffPath = "/home/fabio/Downloads/aquamaps-lprognathodesfalcifer20121207161043540cet.geotiff";
File geoTiff=new File(geoTiffPath);
String workspace="aquamaps";
String storeName=geoTiff.getName()+"_store";
String coverageName="";
String srs="EPSG:4326";
ProjectionPolicy policy=ProjectionPolicy.REPROJECT_TO_DECLARED;
String defaultStyle="raster";
double[] bbox=Costants.WORLD_BOUNDING_BOX;
Metadata theMeta=new DefaultMetadata();
GNInsertConfiguration config=new GNInsertConfiguration("view-group", "datasets", "_none_", true);
gisInterface.addGeoTIFF(workspace, storeName, coverageName, geoTiff, srs, policy, defaultStyle, bbox, theMeta, config,LoginLevel.DEFAULT);
// String geoTiffPath = "/home/fabio/Downloads/aquamaps-lprognathodesfalcifer20121207161043540cet.geotiff";
// File geoTiff=new File(geoTiffPath);
// String workspace="aquamaps";
// String storeName=geoTiff.getName()+"_store";
// String coverageName="";
// String srs="EPSG:4326";
// ProjectionPolicy policy=ProjectionPolicy.REPROJECT_TO_DECLARED;
// String defaultStyle="raster";
// double[] bbox=Costants.WORLD_BOUNDING_BOX;
// Metadata theMeta=new DefaultMetadata();
// GNInsertConfiguration config=new GNInsertConfiguration("view-group", "datasets", "_none_", true);
// gisInterface.addGeoTIFF(workspace, storeName, coverageName, geoTiff, srs, policy, defaultStyle, bbox, theMeta, config,LoginLevel.DEFAULT);
String nameStyle="TestStyle"+System.currentTimeMillis();
String attributeName="probability";
Integer maxClasses=5;
Color c1= Color.YELLOW;
Color c2= Color.RED;
Class typeValue =Double.class;
Double maxValue=1d;
Double minValue=0d;
String sldStyle=StyleUtils.createStyle(nameStyle, attributeName, maxClasses, c1, c2, typeValue, maxValue, minValue);
System.out.println("Generated Style is : ");
System.out.println(sldStyle);
// System.out.println(gisInterface.publishStyle(, nameStyle));
}

View File

@ -1,12 +1,4 @@
log4j.rootLogger=DEBUG, A1, stdout
log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.File=log.txt
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
# ***** Max file size is set to 100KB
log4j.appender.A1.MaxFileSize=100MB
# ***** Keep one backup file
log4j.appender.A1.MaxBackupIndex=1
log4j.rootLogger=DEBUG, stdout
#CONSOLE
log4j.appender.stdout=org.apache.log4j.ConsoleAppender