Package ucar.unidata.gis.shapefile
Class ProjFile
java.lang.Object
ucar.unidata.gis.shapefile.ProjFile
Class to read a shapefile .prj file
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[][]convertToLonLat(double[][] xy) Convert the xy values to lat/lonucar.unidata.geoloc.ProjectionImplGet the projection defined by this filevoidinit(InputStream s) Process the file contents from the streamtoString()_more_
-
Constructor Details
-
ProjFile
Create a new Projfile from the URL- Parameters:
url- URL to the *.prj file- Throws:
Exception- problem reading or parsing the file
-
ProjFile
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
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
Initialize the ProjFile from an input stream- Parameters:
s- the input stream- Throws:
Exception- problem reading or parsing the file
-
-
Method Details
-
init
Process the file contents from the stream- Parameters:
s- the input stream from the .prj file
-
toString
_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
-