[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [udig-devel] How to add a coverage layer in code?
|
Hi Graham,
were you able to solve this?
> I have a coverage object I've created in code by resampling an image. I
> want to place this coverage on the map as a layer. I can't seem to find any
> examples of how to add a coverage object as a layer. I've seen this:
>
> IGeoResource resource =
> CatalogPlugin.getDefault().getLocalCatalog().createTemporaryResource(descriptor);
>
> ApplicationGIS.addLayersToMap(map, Collections.singletonList(resource), -1);
>
> But I don't know what descriptor is in relation to my coverage object, or if
> this will even work for what I'm trying to do.
I assume you could have a look at the geotiff service implementation.
In the GeoTiffServiceExtension class the service is created.
>From a quick (very quick) look at extractId:
private URL extractID( Map<String, Serializable> params ) {
URL id;
if (params.containsKey(URL_PARAM)) {
Object param = params.get(URL_PARAM);
...
it looks to me that the url should be enough.
Humpf, now I see your point, you have an in memory thing? Is that the
real problem?
Andrea
>
> --
> Graham Davis
> Refractions Research Inc.
> gdavis@xxxxxxxxxxxxxxx
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>