Package ucar.visad

Class ShapefileAdapter

java.lang.Object
ucar.visad.ShapefileAdapter

public class ShapefileAdapter extends Object
Provides support for ShapeFiles in VisAD.
Author:
Don Murray?
  • Field Details

  • Constructor Details

    • ShapefileAdapter

      public ShapefileAdapter(String filename) throws IOException, VisADException
      Read an ESRI shapefile and extract all features into an in-memory structure.
      Parameters:
      filename - name of ESRI shapefile (typically has ".shp" extension)
      Throws:
      IOException
      VisADException
    • ShapefileAdapter

      public ShapefileAdapter(URL url) throws IOException, VisADException
      Read an ESRI shapefile from a URL and extract all features into an in-memory structure.
      Parameters:
      url - URL of ESRI shapefile
      Throws:
      IOException
      VisADException
    • ShapefileAdapter

      public ShapefileAdapter(URL url, Rectangle2D bBox) throws IOException, VisADException
      Read an ESRI shapefile and extract the subset of features that have bounding boxes that intersect a specified bounding box
      Parameters:
      url - URL of ESRI shapefile
      bBox - bounding box specifying which features to select, namely those whose bounding boxes intersect this one. If null, bounding box of whole shapefile is used
      Throws:
      IOException
      VisADException
    • ShapefileAdapter

      public ShapefileAdapter(String filename, Rectangle2D bBox) throws IOException, VisADException
      Read an ESRI shapefile and extract all features into an in-memory structure.
      Parameters:
      filename - name of ESRI shapefile
      bBox - bounding box specifying which features to select, namely those whose bounding boxes intersect this one. If null, bounding box of whole shapefile is used
      Throws:
      IOException
      VisADException
    • ShapefileAdapter

      public ShapefileAdapter(String filename, double coarseness) throws IOException, VisADException
      Read an ESRI shapefile and extract all features into an in-memory structure.
      Parameters:
      filename - name of ESRI shapefile (typically has ".shp" extension)
      coarseness - resolution vs. speed parameter. 0.0 for best resolution, 0.1 for good resolution with 10:1 zooms, etc.
      Throws:
      IOException
      VisADException
    • ShapefileAdapter

      public ShapefileAdapter(URL url, double coarseness) throws IOException, VisADException
      Read an ESRI shapefile from a URL and extract all features into an in-memory structure.
      Parameters:
      url - URL of ESRI shapefile
      coarseness - resolution vs. speed parameter. 0.0 for best resolution, 0.1 for good resolution with 10:1 zooms, etc.
      Throws:
      IOException
      VisADException
    • ShapefileAdapter

      public ShapefileAdapter(URL url, Rectangle2D bBox, double coarseness) throws IOException, VisADException
      Read an ESRI shapefile and extract the subset of features that have bounding boxes that intersect a specified bounding box
      Parameters:
      url - URL of ESRI shapefile
      bBox - bounding box specifying which features to select, namely those whose bounding boxes intersect this one. If null, bounding box of whole shapefile is used
      coarseness - resolution vs. speed parameter. 0.0 for best resolution, 0.1 for good resolution with 10:1 zooms, etc.
      Throws:
      IOException
      VisADException
    • ShapefileAdapter

      public ShapefileAdapter(String filename, Rectangle2D bBox, double coarseness) throws IOException, VisADException
      Read an ESRI shapefile and extract all features into an in-memory structure.
      Parameters:
      filename - name of ESRI shapefile
      bBox - bounding box specifying which features to select, namely those whose bounding boxes intersect this one. If null, bounding box of whole shapefile is used
      coarseness - resolution vs. speed parameter. 0.0 for best resolution, 0.1 for good resolution with 10:1 zooms, etc.
      Throws:
      IOException
      VisADException
    • ShapefileAdapter

      public ShapefileAdapter(InputStream iStream) throws IOException, VisADException
      Read an ESRI shapefile and extract all features into an in-memory structure.
      Parameters:
      iStream - input from which to read
      Throws:
      IOException
      VisADException
    • ShapefileAdapter

      public ShapefileAdapter(InputStream iStream, Rectangle2D bBox) throws IOException, VisADException
      Read an ESRI shapefile and extract all features into an in-memory structure.
      Parameters:
      iStream - input from which to read
      bBox - bounding box specifying which features to select, namely those whose bounding boxes intersect this one. If null, bounding box of whole shapefile is used
      Throws:
      IOException
      VisADException
    • ShapefileAdapter

      public ShapefileAdapter(InputStream iStream, String filename) throws IOException, VisADException
      constructor
      Parameters:
      iStream - Inputstream
      filename - Filename where we got the input stream
      Throws:
      IOException - On badness
      VisADException - On badness
    • ShapefileAdapter

      public ShapefileAdapter(InputStream iStream, String filename, Rectangle2D dBox, double coarseness) throws IOException, VisADException
      _more_
      Parameters:
      iStream - _more_
      filename - _more_
      dBox - _more_
      coarseness - _more_
      Throws:
      IOException - _more_
      VisADException - _more_
    • ShapefileAdapter

      public ShapefileAdapter(InputStream iStream, Rectangle2D bBox, double coarseness) throws IOException, VisADException
      Read an ESRI shapefile and extract all features into an in-memory structure.
      Parameters:
      iStream - input from which to read
      bBox - bounding box specifying which features to select, namely those whose bounding boxes intersect this one. If null, bounding box of whole shapefile is used
      coarseness - of plotting, 0.0 for best resolution, 0.1 for good resoution at 10:1 zoom, etc. Higher values make things display a bit faster.
      Throws:
      IOException
      VisADException
    • ShapefileAdapter

      public ShapefileAdapter(EsriShapefile shapefile) throws VisADException
      From an ESRI shapefile extract all features into an in-memory structure.
      Parameters:
      shapefile - input from which to extract features
      Throws:
      VisADException
  • Method Details

    • makeSet

      public static UnionSet makeSet(List sets) throws VisADException
      Utility to make a set
      Parameters:
      sets - List of sets
      Returns:
      The set of sets
      Throws:
      VisADException - On badness
    • getFeatureType

      public int getFeatureType()
      What is the feature type
      Returns:
      Feature type
    • getDbFile

      public DbaseFile getDbFile()
      Get the db file. May be null.
      Returns:
      db file
    • getData

      public UnionSet getData()
      getData creates a VisAD UnionSet type with the MathType specified thru one of the other methods. By default, the MathType is a RealTupleType of Latitude,Longitude, so the UnionSet (a union of Gridded2DSets) will have lat/lon values. Each Gridded2DSet is a line segment that is supposed to be drawn as a continuous line. The UnionSet is null if there are no maplines in the domain of the display.
      Returns:
      the data as a UnionSet
    • main

      public static void main(String[] args) throws Exception
      Test this out
      Parameters:
      args - filename
      Throws:
      Exception - problem