GIS_DB.java [src/java/c] Revision: 95faef4c0711cc06cca672ad885649ce96de8ec9  Date: Mon Sep 26 13:38:03 MDT 2016
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package c;


import csip.ServiceException;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;


/**
 *
 * @author Shaun Case
 */
public interface GIS_DB extends AutoCloseable {

    public static class FileQryResult {

        public String id;
        public String file_path;
        public String file_name;

        @Override
        public String toString() {
            return "{" + id + "|" + file_path + "|" + file_name + "}";
        }
    }

    public static class Soil {

        public String coFips;
        public String muSym;
        public String muKey;
        public String r2Path;
        public String r2Name;
        public String wepsPath;
        public String wepsName;
        public String muName;
        public String compName;
        public String kffact;
        public double tfact;
        public String tfactUnits = "ton/acre/year";
        public double lengthR = 0.0;
        public String lengthRUnits = "feet";
        public double slopeR;
        public String slopeRUnits = "%";
        public double sandtotalR;
        public String sandtotalRUnits = "%";
        public String coKey;
        public double percentAoi;
        public String percentAoiUnits = "percent";
        public double sizeAoi;
        public String sizeAoiUnits = "acres";
        public double perWind = 0.0;
        public String perWindUnits = "ton/acre/year";
        public double perWater = 0.0;
        public String perWaterUnits = "ton/acre/year";
    }

    public static class StationResult {

        public String country;
        public String state;
        public String name;
        public String stationId;
        public String stationX;
        public String stationY;
        public double distance;
        public String elevation;

        @Override
        public String toString() {
            return "{" + state + "|" + stationId + "|" + stationX + "|" + stationY + "|" + elevation + "}";
        }
    }

    public static class County {

        public String st_abbr;
        public String county_code;
        public String name;
        public String county_centroid_X;
        public String county_centroid_Y;

        @Override
        public String toString() {
            return "{" + st_abbr + county_code + "|" + name + "|" + county_centroid_X + "|" + county_centroid_Y + "}";
        }
    }

    // Look up table for slope length 
    static final double[][] LightleWeesiesSlopeLength = {{0, .75, 100},
    {.75, 1.5, 200},
    {1.5, 2.5, 300},
    {2.5, 3.5, 200},
    {3.5, 4.5, 180},
    {4.5, 5.5, 160},
    {5.5, 6.5, 150},
    {6.5, 7.5, 140},
    {7.5, 8.5, 130},
    {8.5, 9.5, 125},
    {9.5, 10.5, 120},
    {10.5, 11.5, 110},
    {11.5, 12.5, 100},
    {12.5, 13.5, 90},
    {13.5, 14.5, 80},
    {14.5, 15.5, 70},
    {15.5, 17.5, 60},
    {17.5, -1, 50}};
    static final double[][] PalouseSlopeLength = {{0, 5.5, 350},
    {5.5, 10.5, 275},
    {10.5, 15.5, 225},
    {15.5, 20.5, 175},
    {20.5, 25.5, 150},
    {25.5, 35.5, 125},
    {35.5, -1, 100}};
    static final List<String> PalouseAreas = Arrays.asList("ID607", "ID610", "OR021", "OR049", "OR055", "OR625",
            "OR667", "OR670", "OR673", "WA001", "WA021", "WA025",
            "WA043", "WA063", "WA071", "WA075", "WA603", "WA605",
            "WA613", "WA617", "WA623", "WA639", "WA676", "WA677");

    public boolean IsValidCliCoord(double lat, double lon) throws SQLException;

    public boolean IsValidManCoord(double lat, double lon) throws SQLException;

    public boolean IsValidSoiCoord(double lat, double lon) throws SQLException;

    public boolean IsValidGisCoord(double lat, double lon) throws SQLException;

    public boolean IsValidRusle2Soil(double lat, double lon) throws SQLException;

    public boolean IsValidWepsSoil(double lat, double lon) throws SQLException;

    public boolean IsInInterpolateBoundary(double lat, double lon) throws SQLException;

    public FileQryResult findSoils(double lat, double lon) throws SQLException;

    public FileQryResult findSoilsByCokey(String cokey, double lon) throws SQLException;

    public Collection<Soil> findSoilsForPolygon(String _polygon, double poly_longitude) throws SQLException;

    public Collection<Soil> findSoilsForPolygonWithSand(String _polygon, double poly_longitude) throws SQLException;

    public Collection<Soil> findSoilsForPolygonWeps(String _polygon, double poly_longitude) throws SQLException;

    public FileQryResult findSoilsWeps(double lat, double lon) throws SQLException;

    public FileQryResult findSoilsWepsByCokey(String cokey, double lon) throws SQLException;

    public FileQryResult findClimate(double lat, double lon) throws SQLException;

    public County findCounty(double lat, double lon) throws SQLException, ServiceException;

    public StationResult findCligenStation(double lat, double lon) throws SQLException;

    public StationResult findWindgenStation(double lat, double lon) throws SQLException;

    public StationResult cliGeomIntersect(double lat, double lon) throws SQLException;

    public StationResult windGeomIntersect(double lat, double lon) throws SQLException;

    public County countyCentroid(double lat, double lon) throws SQLException;

    public String findCmz(double lat, double lon) throws SQLException;

    public List<FileQryResult> findManagements(double lat, double lon) throws SQLException;

    public List<FileQryResult> findManagementsFilter(double lat, double lon, String filter1, String filter2) throws SQLException;

    public void close() throws SQLException;

}