skip to main content
Defense > Programmer's documentation > Programming with JViews Maps for Defense > Creating defense data source objects > Vector data sources
 
Vector data sources
Describes the vector data sources provided.
*Overview
*Lists defense-specific vector image formats.
*Creating a data source from a VMAP database
*Explains how to implement the various options available when you create data source objects for a VMAP database.
*Creating a data source from a DAFIF file
*Explains how to create a DAFIF data source and select the features to be imported.
*Creating a Data Source from an S57 File or Catalog
*Explains how to create an S57 data source and select the features to be imported.
Overview
The defense-specific vector image formats used in JViews Maps for Defense are DAFIF file format, VMAP format and S57 standard format. The Map Builder demonstration, which contains all of the code described in this section, can be found at <installdir> /jviews-maps/samples/mapbuilder/index.html
Creating a data source from a VMAP database
To use tiling:
*Load data with tiling:
 
IlvVMAPDataSource source = new IlvVMAPDataSource(fileName);
source.setManager(getView().getManager());
VMAPs can be loaded with or without a tiling mechanism. When using tiling, data is loaded in a background thread:
To select features to Import using FACC codes:
*VMAP data contains many different features. Select the features to import into your map by choosing the appropriate FACC code:
 
source.setFaccCodeList stringTable;
To select the area of interest:
*You can restrict the area you want to import (typical VMAP Data level 0 spans a continent) by choosing latitude and longitude bounds. For example, JViews Maps for Defense provides a bean to let users select their own areas:
 
// Building GUI.
cPanel = IlvCoordinatePanelFactory.
   createCoordRectangleInputPanel(view,prefs.getCoordinateFormatter());
...
// When user presses OK.
source.setAreaOfinterest(cPanel.getLonMin(),cPanel.getLatMin(),
   cPanel.getLonMax(),cPanel.getLatMax());
To use load-on-demand
*You can use a load-on-demand tiling mechanism with VMAP data by setting the data source tiling parameters, for example:
 
source.setTilingParameters(true,numRows,numColumns);
For further information about data sources, see Creating data source objects.
Creating a data source from a DAFIF file
To create a DAFIF data source:
1. Create data source objects for a DAFIF file:
 
IlvDAFIFDataSource source = new IlvDAFIFDataSource
   ("C:/maps/dafif_0606_ed8/DAFIFT");
source.setManager(getView().getManager());
2. DAFIF data contains many different features. Select the features you want to import into your map by choosing the feature codes:
 
source.setAcceptedCodeList(new String[] { "ARPT/ARPT" });
Creating a Data Source from an S57 File or Catalog
1. To create data source objects for an S57 file or catalog:
 
IlvS57DataSource source = new IlvS57DataSource (fileName);
source.setManager(getView().getManager());
2. S57 data contains many different features. Select the features you want to import into your map by choosing the feature codes:
 
source.setCodelist(codes);
For further information about data sources, see Creating data source objects

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.