gnis

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	GeoNames *GeoNamesService
	// contains filtered or unexported fields
}

Client provides access to the GNIS database

func NewClient

func NewClient(opts ...Option) (*Client, error)

NewClient creates a new client and applies all provided Options

type GeoNamesService

type GeoNamesService service

GeoNamesService used to query geonames

func (*GeoNamesService) Query

func (s *GeoNamesService) Query(ctx context.Context, state string) ([]*GeographicName, error)

Query GNIS for geonames

type GeographicName

type GeographicName struct {
	ID     string      `json:"id,omitempty"`
	Name   string      `json:"name,omitempty"`
	Source string      `json:"source,omitempty"`
	Class  string      `json:"class,omitempty"`
	Locale string      `json:"locale,omitempty"`
	Point  *geom.Point `json:"point,omitempty"`
}

GeographicName information about the official name for places, features, and areas

func (*GeographicName) GeoJSON

func (g *GeographicName) GeoJSON() (*geojson.Feature, error)

func (*GeographicName) MarshalJSON

func (g *GeographicName) MarshalJSON() ([]byte, error)

type Option

type Option func(*Client) error

Option provides a configuration mechanism for a Client

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient sets the underlying http client.

func WithHTTPTracing

func WithHTTPTracing(debug bool) Option

WithHTTPTracing enables tracing http calls.

func WithTransport

func WithTransport(t http.RoundTripper) Option

WithTransport sets the underlying http client transport.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL