NASA World Wind WMS

gov.nasa.worldwind.servers.wms
Interface MapGenerator

All Known Implementing Classes:
BlueMarbleNG500MGenerator, EsatGenerator, RPFGenerator

public interface MapGenerator

Concrete implementations of MapGenerator are the means by which geospatial data are introduced and served by the WMS. A MapGenerator embodies all the knowledge necessary to read a particular class of geospatial data. This includes interpretation of the file formats, along with awareness of any spatial indexing scheme or other organization of files on the disk. It also includes the ability to extract subregions of the data and likely mosaic pieces together in response to arbitrary WMS GetMap requests.

Instances of MapGenerator classes further embody the state needed to manage a particular set of data. Multiple instances of the same class might therefore be used to manage differing collections of the same data type that might be organized by region, scale, or other arbitrary organization. The initialize() method is called once at startup time to give the MapGenerator instance a chance to perform any processing required before GetMap requests can be satisfied.

Per-request state is managed by instances of ServiceInstance. As the WMS identifies a particular MapGenerator to field a GetMap request, it obtains an instance of ServiceInstance from the MapGenerator via a call to getServiceInstance(). The WMS then invokes the serviceRequest() method of the ServiceInstance, in which the MapGenerator attempts to generate the requested imagery. If successful, an instance of ImageFormatter is returned, which the WMS uses to deliver the map in the requested image format. Finally, the WMS calls the freeResources() on the ServiceInstance, which gives the MapGenerator a chance to reclaim any resources, such as temporary files, etc. If the MapGenerator is unable to satisfy the GetMap request, it should throw a WMSServiceException with appropriate descriptive text as to why the request failed.

MapGenerators are configured into the WMS via <MapSource> elements in the WEB-INF/config.xml file. See the javadoc Overview for details.


Nested Class Summary
static interface MapGenerator.ServiceInstance
          Encapsulates per-request state needed to generate a response to a GetMap request.
 
Method Summary
 gov.nasa.worldwind.geom.Sector getBBox()
          Returns the bounding-box for the geospatial dataset managed by the MapGenerator instance.
 String[] getCRS()
          Returns the coordinate-reference systems (CRS) that the MapGenerator is capable of using to generate map requests.
 MapGenerator.ServiceInstance getServiceInstance()
          Called by the WMS to return an instance of ServiceInstance to field a GetMap request.
 boolean initialize(MapSource mapSource)
          Gives the MapGenerator implementation an opportunity to perform any needed initialization, prior to fielding GetMap requests.
 

Method Detail

getBBox

gov.nasa.worldwind.geom.Sector getBBox()
Returns the bounding-box for the geospatial dataset managed by the MapGenerator instance.

Returns:

getCRS

String[] getCRS()
Returns the coordinate-reference systems (CRS) that the MapGenerator is capable of using to generate map requests.

Returns:

getServiceInstance

MapGenerator.ServiceInstance getServiceInstance()
Called by the WMS to return an instance of ServiceInstance to field a GetMap request.

Returns:

initialize

boolean initialize(MapSource mapSource)
                   throws IOException,
                          WMSServiceException
Gives the MapGenerator implementation an opportunity to perform any needed initialization, prior to fielding GetMap requests. This typically includes extraction of any MapGenerator-specific properties that were given in the MapSource configuration. Called once at WMS start-up time.

Parameters:
mapSource -
Returns:
Throws:
IOException
WMSServiceException

NASA World Wind WMS