Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Method to directly acquire a layer from WMS

If you have the WMS in the catalog you can find it directly by:

CatalogPlugin catalog = CatalogPlugin.getDefault();
catalog.getLocalCatalog().findByID( new URL( “http://localhost:8080/geoserver/wms?lService=WMS&Version=1.1.1&Request=GetCapabilities#tiger:tiger_roads” );

On 22-Apr-08, at 12:13 AM, Joe Dente wrote:

Hi,
I’ve been playing around with directly acquiring a layer from my WMS server using the following code:
 
 
CatalogPlugin catalog = CatalogPlugin.getDefault();
IServiceFactory factory = catalog.getServiceFactory();
IResolve resolve1 = factory.acquire(URL1);
IResolve resolve2 = factory.acquire(URL2);
 
According to the Geotools documentation, URL2 should resolve directly to the tiger:tiger_roads layer.  However, when I step through the code with a debugger, resolve1 and resolve2 are both instances of WMSServiceImpl.  If I do resolve1.members(monitor) and resolve2.members(monitor), they both return the same list of every layer deployed on my Geoserver.  How can I directly retrieve the tiger:tiger_roads layer using something similar to URL2? I don’t want to iterate through every layer looking for the 1 layer I’m interested in.
 
Thanks,
Joe
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


Back to the top