[udig-devel] Method to directly acquire a layer from WMS
Jesse Eichar
jeichar.w at gmail.com
Tue Apr 22 03:54:31 PDT 2008
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:
>
> URL1 = new URL( “http://localhost:8080/geoserver/wms?lService=WMS&Version=1.1.1&Request=GetCapabilities
> ” )
> URL2 = new URL( “http://localhost:8080/geoserver/wms?lService=WMS&Version=1.1.1&Request=GetCapabilities#tiger
> :tiger_roads” )
>
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.refractions.net/pipermail/udig-devel/attachments/20080422/858aceba/attachment.html
More information about the udig-devel
mailing list