Skip to main content

[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?

Sorry, missed your email earlier Andrea. I wasn't able to do exactly what I wanted. I ended up writing the coverage to a TIF file and then loading the file as a layer. A bit of a round about solution, but it worked well enough for my needs.

Jody's response makes sense. The temporary resource was only working for FeatureTypes before.

Graham.


Jody Garnett wrote:
The concept of "temporary resource" has its own extension-point; looks like you can add a placeholder for an in memory grid coverage; right now I just see a single implementation for turning a FeatureType into a temporary MemoryDataStore.

What would a good descriptor be in this case? Probably a GridCoverage2D (I think that is the in memory implementation of grid coverage is it not).

Cheers,
Jody

On Mon, Jan 12, 2009 at 1:07 AM, andrea antonello <andrea.antonello@xxxxxxxxx <mailto:andrea.antonello@xxxxxxxxx>> wrote:

    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 <mailto:gdavis@xxxxxxxxxxxxxxx>
    >
    > _______________________________________________
    > User-friendly Desktop Internet GIS (uDig)
    > http://udig.refractions.net
    > http://lists.refractions.net/mailman/listinfo/udig-devel
    >
    _______________________________________________
    User-friendly Desktop Internet GIS (uDig)
    http://udig.refractions.net
    http://lists.refractions.net/mailman/listinfo/udig-devel


------------------------------------------------------------------------

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


--
Graham Davis
Refractions Research Inc.
gdavis@xxxxxxxxxxxxxxx



Back to the top