| Programming with JViews Maps > Creating a Map Application Using the API > Creating Data Source Objects > Raster Data Sources |
Raster Data Sources |
INDEX
PREVIOUS
NEXT
|
All raster (image) data sources have a common API. To create your data source, you need to create an IlvRasterAbstractReader for the type of data to be read, and then use this reader to build a tiled image data source.
The raster reader class table for the different image formats is as follows:
GEOTIFF | IlvRasterGeoTiffReader |
DTED | IlvRasterDTEDReader |
GTOPO30 | IlvGTopo30Reader |
Non-geo-referenced images(*) | IlvRasterBasicImageReader |
Images from OpenGIS compliant Web Map Servers | IlvWMSReader |
(*) Non geo-referenced images must be geo-referenced, see Geo-referencing a Non Geo-referenced Image.
To create a raster reader and add all image files to be read you can, for example, use the following code:
IlvRasterDTEDReader reader = new IlvRasterDTEDReader();
for(int i=0;i<fileName.length;i++) {
reader.addMap(fileName[i]);
}
To create a data source for the reader:
IlvMapDataSource DTEDDataSource = IlvRasterDataSourceFactory.buildTiledImageDataSource(manager,reader,true,true,null);
DTEDDataSource.setName("name in data source panel");
The IlvTiledRasterDataSource returned by the IlvRasterDataSourceFactory executes image reading in a background thread.
To geo-reference a non geo-referenced image, you can set the longitude and latitude image bounds:
reader.setImageBounds(0,-Math.PI,Math.PI/2,Math.PI,-Math.PI/2);
Alternatively, you can compute a more complex mathematical transformation and set it on the reader:
reader.setInternalTransformation(trans);
| Note |
| The non geo-referenced image reader does not support multiple calls to addMap. |
This section gives information about the OpenGIS® Web Map Server (WMS) Standard. This International Standard specifies the behavior of a service that produces spatially referenced maps dynamically from geographic information. It specifies operations to retrieve a description of the maps offered by a server and to query a server about features displayed on a map. The standard is not applicable to the retrieval of actual feature data or coverage data values, but is applicable to pictorial renderings of maps in a graphical format. These capabilities are provided by a Web Feature and Web Coverage Service.
In a basic WMS, only a limited number of predefined styles can be applied to features. The mechanism that enables users to define their own styles is defined in the OGC Styled Layer Descriptor Implementation Specification. An SLD-enabled WMS retrieves feature data from a Web Feature Service and applies explicit styling information provided by the user in order to render a map.
The ISO/TC 211 also defines a standard for Web Map Servers, see ISO 19128.
JViews Maps supports the import of images from a WMS server.
To create a WMS data source, use the following code:
URL url = new URL("http://geo.compusult.net/scripts/mapman.dll?
Name=weather&REQUEST=GetCapabilities");
IlvWMSReader reader = new IlvWMSReader(url);
IlvWMSDataSource source = new IlvWMSDataSource(reader);
source.setManager(manager);
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. Legal terms. | PREVIOUS NEXT |