![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jun 2011
Location: Liège, Belgium
Posts: 18
![]() |
Hi,
I load some layers from WMS server and I use the technic of WMSLayerManager (Getting capabilities and then call a factory to make a layer of it). This works fine but I'm at a point where I want to make these layers persistent between two usages of my application. I was wondering if there is a way already defined to save a layer (converting properties needed under an xml or something like that). If not, what should be saved? Only capabilities? For now I'm just saving layer name and server URI but then I need network to get all capabilities. The problem is that I want these layers to work offline using cache and I can't build the layer without all capabilities. So can you give me some advice or way of research for me to make the job? Thanks in advance, Anthra |
|
|
|
|
|
#2 |
|
Super Moderator
Join Date: Nov 2006
Location: Mojave & Oxnard California
Posts: 2,623
![]() |
Take one of the WMS layers in the SDK and modify it for the data you want.
It's a bit complicated to code just starting. The data needs to be installed in your cache Also their is a read and write location, usually the same but the write is checked first then the read, if the data is not found then it will hit a server. Start with a layer that works. Last edited by nlneilson; 08-14-2012 at 11:09 AM. Reason: typo |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jun 2011
Location: Liège, Belgium
Posts: 18
![]() |
Thanks for your advices.
After some further investigations and test I can generate the XML, at least partially doing this: Code:
WMSCapabilities wmsc = defaultListModel.get(i).getCaps();
AVList params = defaultListModel.get(i).getParams();
String[] formatOrderPreference = new String[]
{
"image/dds", "image/png", "image/jpeg"
};
AVList configParams = DataConfigurationUtils.getWMSLayerConfigParams(wmsc, formatOrderPreference, params);
Document doc = WMSTiledImageLayer.createTiledImageLayerConfigDocument(configParams);
try {
printDocument(doc, System.out);
} catch (IOException ex) {
...
} catch (TransformerException ex) {
...
}
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Layer layerType="TiledImageLayer" version="1">
<DisplayName>Ortofotografía Rigurosa Color de Andalucía 2008-2009</DisplayName>
<DatasetName>OCA10_2009</DatasetName>
<DataCacheName>www.ideandalucia.es\_wms_ortofoto2009\OCA10_2009</DataCacheName>
<Service serviceName="OGC:WMS">
<URL>http://www.ideandalucia.es/wms/ortofoto2009?service=wms&</URL>
</Service>
<Sector>
<SouthWest>
<LatLon latitude="35.9471" longitude="-7.58724" units="degrees"/>
</SouthWest>
<NorthEast>
<LatLon latitude="38.7485" longitude="-1.60187" units="degrees"/>
</NorthEast>
</Sector>
<ImageFormat>image/jpeg</ImageFormat>
</Layer>
|
|
|
|
|
|
#4 |
|
WWJ Technical Manager
Join Date: May 2007
Location: Seattle
Posts: 1,033
![]() |
TiledImageLayer implements Restorable. Will that help you?
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jun 2011
Location: Liège, Belgium
Posts: 18
![]() |
I didn't think about that, I'll give it a try. Thx tag.
For the begin of solution I gave, that's not fully correct, for example layer name is stored in DatasetName so when rebuilding the layer and when the request is build the layername is not found. |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Jun 2011
Location: Liège, Belgium
Posts: 18
![]() |
It works like a charm! I never did take a look a this mechanism, that is simple and powerful! Thanks a lot for your help.
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SQUID configuration to cache WMS server responses | garakl | Server Discussion | 1 | 08-08-2011 02:16 PM |
| set zoom in level for wms layer in wwj | jalwan | Development Help | 1 | 04-01-2010 02:54 PM |
| WMS Layer for the online ArcGIS WMS | jgib | Development Help | 1 | 03-25-2010 09:52 AM |
| WW1.3.2-Plugin: Layer Edit | canosso | Add-ons & Scripts | 21 | 02-27-2010 04:37 AM |
| How to install NASA World Wind WMS server | garakl | Server Discussion | 0 | 01-26-2010 10:14 AM |