Using the IlvS57DataSource Class to Create Vector Data

To read S57 features using the IlvS57DataSource object:
  1. Create an IlvS57DataSource. Note that if the file name ends with 000, it will point to a single S57 cell. If it ends with 030, it will point to a S57 catalog that merges many S57 cells:
    String s57path = "C:/S57/sxx.000";
    IlvS57DataSource S57Source = new IlvS57DataSource(s57path);
    
  2. Connect this data source with the manager of the view:
    S57Source.setManager(getView().getManager());
    
  3. Select the map features you want to read by specifying the S57 object codes for those features (for further information about object codes, refer to the S57 format specification). For example, to read only roads you can use:
    S57Source.setAcceptedCodeList(new String[]{"116"});
    
  4. Select the way you want to render S52 symbology. For example:
    S57Source.setSimplifiedRendering(false);
    S57Source.setColorSet("DUSK"); 
    
  5. Start the S57 data source:
    S57Source.start(); S57Source.start();
    
For further information about defense-specific data sources, see: