Class PRJUtil


  • public class PRJUtil
    extends Object
    A class to manage PRJ file
    Author:
    Erwan Bocher
    • Constructor Detail

      • PRJUtil

        public PRJUtil()
    • Method Detail

      • getSRID

        public static int getSRID​(File prjFile)
                           throws IOException
        Return the SRID value stored in a prj file If the the prj file - is null, - is empty then a default srid equals to 0 is added.
        Parameters:
        prjFile -
        Returns:
        Throws:
        IOException
      • getValidSRID

        public static int getValidSRID​(Connection connection,
                                       File prjFile)
                                throws SQLException,
                                       IOException
        Get a valid SRID value from a prj file. If the the prj file - is null, - doesn't contain a valid srid code, - is empty * then a default srid equals to 0 is added.
        Parameters:
        connection -
        prjFile -
        Returns:
        Throws:
        SQLException
        IOException
      • isSRIDValid

        public static boolean isSRIDValid​(int srid,
                                          Connection connection)
                                   throws SQLException
        This method checks if a SRID value is valid according a list of SRID's avalaible on spatial_ref table of the datababase.
        Parameters:
        srid -
        connection -
        Returns:
        Throws:
        SQLException