cityaq

package module
v0.0.0-...-be1e2e0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MIT Imports: 58 Imported by: 0

Documentation

Overview

Code generated for package cityaq by go-bindata DO NOT EDIT. (@generated) sources: gui/html/cityaq.wasm.br gui/html/index.html gui/html/wasm_exec.js

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type CityAQ

type CityAQ struct {
	// CityGeomDir is the location of the directory that holds the
	// GeoJSON geometries of cities.
	CityGeomDir string

	aeputil.SpatialConfig

	// Location where temporary results should be stored.
	CacheLoc string

	// InMAPCityMarginalConfigFile specifies the path to the file with InMAP
	// configuration information for city marginal simulations.
	InMAPCityMarginalConfigFile string

	// InMAPCityTotalConfigFile specifies the path to the file with InMAP
	// configuration information for a city-specific total-concentration simulation.
	InMAPCityTotalConfigFile string

	// InMAPTotalConfigFile specifies the path to the file with InMAP
	// configuration information for a total-concentration simulation.
	InMAPTotalConfigFile string

	// Version specifies the version of the InMAP Docker image that should be
	// used for running simulations, for example "latest" or "v1.7.2".
	Version string
	// contains filtered or unexported fields
}

CityAQ estimates the air quality impacts of activities in cities.

func (*CityAQ) Cities

func (c *CityAQ) Cities(ctx context.Context, _ *rpc.CitiesRequest) (*rpc.CitiesResponse, error)

Cities returns the files in the CityGeomDir directory field of the receiver.

func (*CityAQ) CityGeometry

func (c *CityAQ) CityGeometry(ctx context.Context, req *rpc.CityGeometryRequest) (*rpc.CityGeometryResponse, error)

CityGeometry returns the geometry of the requested city.

func (*CityAQ) EmissionsGridBounds

EmissionsGridBounds returns the bounds of the grid to be used for mapping gridded information about the requested city.

func (*CityAQ) EmissionsInventorySectors

EmissionsInventorySectors returns the available emissions source types in the emissions inventory.

func (*CityAQ) GriddedConcentrations

GriddedConcentrations returns PM2.5 concentrations calculated by the InMAP air quality model.

func (*CityAQ) GriddedEmissions

GriddedEmissions returns gridded emissions for the request. If req.SourceType has the suffix "_egugrid", emissions will be allocated to the smaller of country that the city is in or the intersection of the country with a 5.4 degree radius buffer around the city, otherwise they will be allocated within the city itself.

func (*CityAQ) GriddedPopulation

GriddedPopulation returns population counts on the same grid as the gridded concentrations.

func (*CityAQ) ImpactSummary

func (c *CityAQ) ImpactSummary(ctx context.Context, req *rpc.ImpactSummaryRequest) (*rpc.ImpactSummaryResponse, error)

ImpactSummary returns a summary of the impacts from the given request.

func (*CityAQ) MapScale

func (c *CityAQ) MapScale(ctx context.Context, req *rpc.MapScaleRequest) (*rpc.MapScaleResponse, error)

MapScale returns statistics about map data.

type GRPCServer

type GRPCServer struct {
	CityAQ

	Log logrus.FieldLogger
	// contains filtered or unexported fields
}

GRPCSServer is a GRPC server for city AQ simulation data.

func NewGRPCServer

func NewGRPCServer(c *CityAQ) *GRPCServer

NewGRPCServer creates a new GRPC server for c.

func (*GRPCServer) ServeHTTP

func (s *GRPCServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

type MapSpecification

type MapSpecification struct {
	CityName       string
	ImpactType     rpc.ImpactType
	Emission       rpc.Emission
	SourceType     string
	SimulationType rpc.SimulationType
	// contains filtered or unexported fields
}

MapSpecification holds information to specify the map data to serve.

func (*MapSpecification) Key

func (ms *MapSpecification) Key() string

Key returns a unique identifier for the receiver.

func (*MapSpecification) Run

func (ms *MapSpecification) Run(ctx context.Context, r requestcache.Result) error

type MapTileServer

type MapTileServer struct {
	// contains filtered or unexported fields
}

MapTileServer serves map tiles for visualizing simulation results.

func NewMapTileServer

func NewMapTileServer(c *CityAQ, cacheSize int) *MapTileServer

NewMapTileServer creates a new map tile server, where cacheSize specifies the number of map layers to hold in an in-memory cache.

func (*MapTileServer) Layers

func (s *MapTileServer) Layers(ctx context.Context, ms *MapSpecification) (mvt.Layers, error)

Layers returns the vector tile layers associated with ms.

func (*MapTileServer) ServeHTTP

func (s *MapTileServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis
mock_cityaqrpc
Package mock_cityaqrpc is a generated GoMock package.
Package mock_cityaqrpc is a generated GoMock package.
gui
Package gui implements a web interface for the CityAQ service.
Package gui implements a web interface for the CityAQ service.
cmd
internal
addtags
Command addtags adds the specified build tags to the specified Go source file.
Command addtags adds the specified build tags to the specified Go source file.

Jump to

Keyboard shortcuts

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