Class ProjFile

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

public class ProjFile extends Object
Class to read a shapefile .prj file
  • Constructor Details

    • 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 Details

    • 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