Package ucar.visad
Class ShapefileAdapter
java.lang.Object
ucar.visad.ShapefileAdapter
Provides support for ShapeFiles in VisAD.
- Author:
- Don Murray?
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
map xml attributeprotected UnionSet
resulting maplinesprotected EsriShapefile
shapefilestatic final String
map xml tag -
Constructor Summary
ConstructorsConstructorDescriptionShapefileAdapter
(InputStream iStream) Read an ESRI shapefile and extract all features into an in-memory structure.ShapefileAdapter
(InputStream iStream, Rectangle2D bBox) Read an ESRI shapefile and extract all features into an in-memory structure.ShapefileAdapter
(InputStream iStream, Rectangle2D bBox, double coarseness) Read an ESRI shapefile and extract all features into an in-memory structure.ShapefileAdapter
(InputStream iStream, String filename) constructorShapefileAdapter
(InputStream iStream, String filename, Rectangle2D dBox, double coarseness) _more_ShapefileAdapter
(String filename) Read an ESRI shapefile and extract all features into an in-memory structure.ShapefileAdapter
(String filename, double coarseness) Read an ESRI shapefile and extract all features into an in-memory structure.ShapefileAdapter
(String filename, Rectangle2D bBox) Read an ESRI shapefile and extract all features into an in-memory structure.ShapefileAdapter
(String filename, Rectangle2D bBox, double coarseness) Read an ESRI shapefile and extract all features into an in-memory structure.ShapefileAdapter
(URL url) Read an ESRI shapefile from a URL and extract all features into an in-memory structure.ShapefileAdapter
(URL url, double coarseness) Read an ESRI shapefile from a URL and extract all features into an in-memory structure.ShapefileAdapter
(URL url, Rectangle2D bBox) Read an ESRI shapefile and extract the subset of features that have bounding boxes that intersect a specified bounding boxShapefileAdapter
(URL url, Rectangle2D bBox, double coarseness) Read an ESRI shapefile and extract the subset of features that have bounding boxes that intersect a specified bounding boxShapefileAdapter
(EsriShapefile shapefile) From an ESRI shapefile extract all features into an in-memory structure. -
Method Summary
-
Field Details
-
TAG_POLYGON
map xml tag- See Also:
-
ATTR_POINTS
map xml attribute- See Also:
-
shapefile
shapefile -
mapLines
resulting maplines
-
-
Constructor Details
-
ShapefileAdapter
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
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
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 shapefilebBox
- 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
Read an ESRI shapefile and extract all features into an in-memory structure.- Parameters:
filename
- name of ESRI shapefilebBox
- 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
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
Read an ESRI shapefile from a URL and extract all features into an in-memory structure.- Parameters:
url
- URL of ESRI shapefilecoarseness
- 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 shapefilebBox
- bounding box specifying which features to select, namely those whose bounding boxes intersect this one. If null, bounding box of whole shapefile is usedcoarseness
- 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 shapefilebBox
- bounding box specifying which features to select, namely those whose bounding boxes intersect this one. If null, bounding box of whole shapefile is usedcoarseness
- resolution vs. speed parameter. 0.0 for best resolution, 0.1 for good resolution with 10:1 zooms, etc.- Throws:
IOException
VisADException
-
ShapefileAdapter
Read an ESRI shapefile and extract all features into an in-memory structure.- Parameters:
iStream
- input from which to read- Throws:
IOException
VisADException
-
ShapefileAdapter
Read an ESRI shapefile and extract all features into an in-memory structure.- Parameters:
iStream
- input from which to readbBox
- 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
constructor- Parameters:
iStream
- Inputstreamfilename
- Filename where we got the input stream- Throws:
IOException
- On badnessVisADException
- 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 readbBox
- bounding box specifying which features to select, namely those whose bounding boxes intersect this one. If null, bounding box of whole shapefile is usedcoarseness
- 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
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
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
Get the db file. May be null.- Returns:
- db file
-
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
Test this out- Parameters:
args
- filename- Throws:
Exception
- problem
-