Documentation
¶
Index ¶
- Constants
- func CSVToMap(reader io.Reader) ([]string, []map[string]string)
- func FilterCompanies(companies ...string) func(*Row) bool
- func FilterNumericalProductCodes(numericalProductCodes ...string) func(*Row) bool
- func FilterPointToPoint(row *Row) bool
- func FilterValidNGR(row *Row) bool
- func GetProductCodeLookup() map[string]string
- type Collection
- type FilterFn
- type Row
Constants ¶
const ( HeadingOsEasting = "OS Easting" HeadingOsNorthing = "OS Northing" HeadingWgs84Longitude = "WGS84 Longitude" HeadingWgs84Latitude = "WGS84 Latitude" )
Variables ¶
This section is empty.
Functions ¶
func CSVToMap ¶
CSVToMap takes a reader and returns a slice of maps. Uses the header row as the keys. From a Gist on GitHub
func FilterCompanies ¶
func FilterNumericalProductCodes ¶
FilterNumericalProductCodes returns a function with the FilterFn signature. The returned function returns true if a Row numerical product code matches any numerical product code in numericalProductCodes.
func FilterPointToPoint ¶
FilterPointToPoint is a specialised version of FilterNumericalProductCodes that omits the intermediate FilterFn function.
func FilterValidNGR ¶
FilterValidNGR ensures that there is a valid NGR
func GetProductCodeLookup ¶
GetProductCodeLookup returns a map of numerical product code vs product description (not OFCOM's verbatim).
Types ¶
type Collection ¶
func ReadCSV ¶ added in v0.0.19
func ReadCSV(reader io.Reader) *Collection
ReadCSV to read in the OFCOM WTR csv.
func (*Collection) Filter ¶
func (collection *Collection) Filter(filterFuncs ...FilterFn) *Collection
Filter returns a filtered Collection. Every filterFunc is called on each Row in Collection. Every filterFunc has to return true for the Row to be added to the filtered Collection.
func (*Collection) FilterInPlace ¶
func (collection *Collection) FilterInPlace(filterFuncs ...FilterFn) *Collection
FilterInPlace is as Filter but overwrites the original backing array with the filtered.
func (*Collection) GetCompanies ¶
func (collection *Collection) GetCompanies() []string
GetCompanies returns a slice of strings of unique Company names from all the licence rows in the licence collection.
func (*Collection) WriteCSV ¶ added in v0.0.19
func (collection *Collection) WriteCSV(writer io.Writer)
WriteCSV writes the csv header, then writes the rows.
type Row ¶
type Row struct {
LicenceNumber string
LicenceIssueDate string
SidLatNS string
SidLatDeg string
SidLatMin string
SidLatSec string
SidLongEW string
SidLongDeg string
SidLongMin string
SidLongSec string
NGR string
Frequency string
FrequencyType string
StationType string
ChannelWidth string
ChannelWidthType string
HeightAboveSeaLevel string
AntennaErp string
AntennaErpType string
AntennaType string
AntennaGain string
AntennaAzimuth string
HorizontalElements string
VerticalElements string
AntennaHeight string // Resolution to 0.5m
AntennaLocation string
EflUpperLower string
AntennaDirection string
AntennaElevation string
AntennaPolarisation string
AntennaName string
FeedingLoss string
FadeMargin string
EmissionCode string
ApCommentIntern string
Vector string
LicenseeSurname string
LicenseeFirstName string
LicenseeCompany string
Status string
Tradeable string
Publishable string
ProductCode string
ProductDescription string
ProductDescription31 string
ProductDescription32 string
Wgs84LongitudeAsString string // Persistent representation
Wgs84LatitudeAsString string
Wgs84Longitude float64 // Converted from persistent
Wgs84Latitude float64
OsEasting int
OsNorthing int
}