ucar.unidata.gis.shapefile
Class ProjFile

java.lang.Object
  extended by ucar.unidata.gis.shapefile.ProjFile

public class ProjFile
extends Object

Class to read a shapefile .prj file


Constructor Summary
ProjFile(File file)
          Create a new Projfile from the location spec
ProjFile(InputStream s)
          Initialize the ProjFile from an input stream
ProjFile(String spec)
          Create a new Projfile from the location spec
ProjFile(URL url)
          Create a new Projfile from the URL
 
Method Summary
 double[][] convertToLonLat(double[][] xy)
          Convert the xy values to lat/lon
 ucar.unidata.geoloc.ProjectionImpl getProjection()
          Get the projection defined by this file
 void init(InputStream s)
          Process the file contents from the stream
 String toString()
          _more_
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProjFile

public ProjFile(URL url)
         throws Exception
Create a new Projfile from the URL

Parameters:
url - URL to the *.prj file
Throws:
Exception - problem reading or parsing the file

ProjFile

public ProjFile(String spec)
         throws Exception
Create a new Projfile from the location spec

Parameters:
spec - Location of the *.prj file, as either a URL or filename
Throws:
Exception - problem reading or parsing the file

ProjFile

public ProjFile(File file)
         throws Exception
Create a new Projfile from the location spec

Parameters:
file - A file object of the *.prj file.
Throws:
Exception - problem reading or parsing the file

ProjFile

public ProjFile(InputStream s)
         throws Exception
Initialize the ProjFile from an input stream

Parameters:
s - the input stream
Throws:
Exception - problem reading or parsing the file
Method Detail

init

public void init(InputStream s)
Process the file contents from the stream

Parameters:
s - the input stream from the .prj file

toString

public String toString()
_more_

Overrides:
toString in class Object
Returns:
_more_

getProjection

public ucar.unidata.geoloc.ProjectionImpl getProjection()
Get the projection defined by this file

Returns:
the projection or null

convertToLonLat

public double[][] convertToLonLat(double[][] xy)
Convert the xy values to lat/lon

Parameters:
xy - the xy
Returns:
the lat/lon values or xy if no projection