Documentation ¶
Index ¶
- func GetCDLFileByBbox(year string, minx string, miny string, maxx string, maxy string) (nassTiffReader, error)
- func GetCDLFileByFIPS(year string, fips string) (nassTiffReader, error)
- func GetCDLFileByFIPSFiltered(year string, fips string, cropType string) bool
- func GetCDLValue(year string, x string, y string) crops.Crop
- func Init(fp string) nassTiffReader
- type NassCropProvider
- type NoCropFoundError
- type StatisticsResult
- type StatisticsRow
- type XMLCDLValueResponse
- type XMLExtractResponse
- type XMLFileURLResponse
- type XMLStatsURLResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCDLFileByBbox ¶
func GetCDLFileByBbox(year string, minx string, miny string, maxx string, maxy string) (nassTiffReader, error)
GetCDLFileByBbox stores a NASS CDL Geotif for a given year and bounding box
func GetCDLFileByFIPS ¶
GetCDLFileByFIPS stores a NASS CDL Geotif for a given year and county FIPS
func GetCDLFileByFIPSFiltered ¶
GetCDLFileByFIPSFiltered provides a filtered geotif for a fips code. croptype is the list of values to keep and can be provided as a comma separated array of values to include
func GetCDLValue ¶
GetCDLValue returns a crop type for a year and x,y coordinates in the projection of USA Contiguous Albers Equal Area Conic (USGS version).
Types ¶
type NassCropProvider ¶
func InitNassCropProvider ¶
func InitNassCropProvider(year string, cropFilter []string) NassCropProvider
func (NassCropProvider) ByBbox ¶
func (n NassCropProvider) ByBbox(bbox geography.BBox, sp consequences.StreamProcessor)
func (NassCropProvider) ByFips ¶
func (n NassCropProvider) ByFips(fipscode string, sp consequences.StreamProcessor)
type NoCropFoundError ¶
type NoCropFoundError struct {
Input string
}
func (NoCropFoundError) Error ¶
func (c NoCropFoundError) Error() string
type StatisticsResult ¶
type StatisticsResult struct { Success bool `json:"success"` ErrorMessage string `json:"errorMessage"` Rows []StatisticsRow `json:"rows"` }
StatisticsResult describes the structure of the result from the NASS stats endpoint
func GetStatsByBbox ¶
func GetStatsByBbox(year string, minx string, miny string, maxx string, maxy string) StatisticsResult
GetStatsByBbox returns the statistics of crops in a bounding box in the projection of USA Contiguous Albers Equal Area Conic (USGS version).
type StatisticsRow ¶
type StatisticsRow struct { Value int `json:"value"` Count int `json:"count"` Category string `json:"category"` Color string `json:"color"` Acreage float64 `json:"acreage"` }
StatisticsRow describes a row in the statistics result from the NASS stats endpoint
type XMLCDLValueResponse ¶
type XMLCDLValueResponse struct { XMLName xml.Name `xml:"GetCDLValueResponse"` Result string `xml:"Result"` }
XMLCDLValueResponse is the xml return for a getCDLValue response from the NASS API
type XMLExtractResponse ¶
type XMLExtractResponse struct { XMLName xml.Name `xml:"ExtractCDLByValuesResponse"` ReturnURL string `xml:"returnURL"` }
XMLExtractResponse is the xml return for the Export NASS endpoint
type XMLFileURLResponse ¶
type XMLFileURLResponse struct { XMLName xml.Name `xml:"GetCDLFileResponse"` ReturnURL string `xml:"returnURL"` }
XMLFileURLResponse is the xml return for the File NASS endpoint
type XMLStatsURLResponse ¶
type XMLStatsURLResponse struct { XMLName xml.Name `xml:"GetCDLStatResponse"` ReturnURL string `xml:"returnURL"` }
XMLStatsURLResponse is the xml return for a stats endpoint query