Here is an example of my Java code adding a layer. How could I
specify non-antialiased and the octree quantizer for this layer so that I
*don’t* need to specify those options via WMS?
= = = = = = = = = = = = = = = = = = = = = = = =
= = = = = = = = = = = = = = = = = = = = = = = =
Map<String, Serializable> dsParams = new HashMap<>();
dsParams.put("shapefile", state.shapeFile.toURI().toURL());
dsParams.put("dbase_file", state.dbfFile.toURI().toURL());
dsParams.put("namespace", state.namespace.getURI());
dsParams.put("dbase_field", state.idFieldInDbf);
dsParams.put("lastUsedMS", System.currentTimeMillis());
DataStoreInfoImpl info = new DataStoreInfoImpl(catalog);
//A custom datastore created by Tom Kunicki
info.setType(DBASE_SHAPEFILE_JOIN_DATASTORE_NAME);
info.setWorkspace(state.workspace);
info.setEnabled(true);
info.setName(state.layerName);
info.setConnectionParameters(dsParams);
CatalogBuilder cb = new CatalogBuilder(catalog);
catalog.add(info);
DataAccess<? extends FeatureType, ? extends Feature> dataStore =
info.getDataStore(new NullProgressListener());
List<Name> names = dataStore.getNames();
Name allData = names.get(0);
ProjectionPolicy srsHandling = ProjectionPolicy.FORCE_DECLARED;
cb.setWorkspace(info.getWorkspace());
cb.setStore(info);
FeatureTypeInfo fti =
cb.buildFeatureType(dataStore.getFeatureSource(allData));
fti.setSRS(state.projectedSrs);
fti.setName(state.layerName);
fti.setTitle(state.layerName);
fti.setDescription(state.description);
fti.setAbstract(state.description);
fti.setProjectionPolicy(srsHandling);
cb.setupBounds(fti);
LayerInfo li = cb.buildLayer(fti);
if (state.defaultStyle != null) {
li.setDefaultStyle(state.defaultStyle);
}
catalog.add(fti);
catalog.add(li);
= = = = = = = = = = = = = = = = = = = = = = = =
= = = = = = = = = = = = = = = = = = = = = = = =
Eric Everman
CIDA - Center for Integrated Data Analytics
US Geological Survey
Middleton, WI
651-269-4735
http://cida.usgs.gov/
On Sun, Jan 18, 2015 at 3:25 PM, Everman, Eric <[email protected]> wrote:
> [Sorry if a double post - my first message didn’t show up]
>
> I’m adding data stores and layers in a WPS process. I’d like those layers
> to be tile-cached, non-antialiased and use the octree quantizer
> (non-default for this type of layer).
>
> So two questions:
> 1) Is there some way in the Java LayerInfo object (or some other catalog
> object) to force a layer to render as non-antialiased with the octree
> quantizer?
>
> 2) How do I set attributes that appear on the Tile Caching tab of the
> layer admin pages, particularly the parameter filters, via the Java API?
>
>
> I realize I can force the rendering options in WMS requests by adding this
> vendor param:
> format_options=antialiasing:none;quantizer:octree
> However, that causes caching misses without the appropriate GWC parameter
> filters set on the layer tile cache page (thus question #2).
>
>
>
>
> Thanks in advance for any suggestions or pointers,
>
>
> Eric Everman
>
> CIDA - Center for Integrated Data Analytics
> US Geological Survey
> Middleton, WI
> http://cida.usgs.gov/
>
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users