Documentation ¶
Index ¶
- func InitNSISP() nsiStreamProvider
- func InitNSISPwithOcctypeFilePath(occtypefp string) nsiStreamProvider
- func InitStructureProvider(filepath string, layername string, driver string) (*gdalDataSet, error)
- func InitStructureProviderwithOcctypePath(filepath string, layername string, driver string, occtypefp string) (*gdalDataSet, error)
- func NsiFeaturetoStructure(f NsiFeature, m map[string]structures.OccupancyTypeStochastic, ...) structures.StructureStochastic
- func OptionalSchema() []string
- func StructureSchema() []string
- type NsiFeature
- type NsiProperties
- type NsiStreamProcessor
- type Stats
- type StructureProvider
- type StructureProviderInfo
- type StructureProviderType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitNSISPwithOcctypeFilePath ¶
func InitNSISPwithOcctypeFilePath(occtypefp string) nsiStreamProvider
func InitStructureProvider ¶
func NsiFeaturetoStructure ¶
func NsiFeaturetoStructure(f NsiFeature, m map[string]structures.OccupancyTypeStochastic, defaultOcctype structures.OccupancyTypeStochastic, useUncertainty bool, fh *structures.FoundationUncertainty) structures.StructureStochastic
NsiFeaturetoStructure converts an nsi.NsiFeature to a structures.Structure
func OptionalSchema ¶
func OptionalSchema() []string
func StructureSchema ¶
func StructureSchema() []string
Types ¶
type NsiFeature ¶
type NsiFeature struct {
Properties NsiProperties `json:"properties"`
}
NsiFeature is a feature which contains the properties of a structure from the NSI API
type NsiProperties ¶
type NsiProperties struct { Name int `json:"fd_id"` X float64 `json:"x"` Y float64 `json:"y"` Occtype string `json:"occtype"` FoundHt float64 `json:"found_ht"` FoundType string `json:"found_type"` DamCat string `json:"st_damcat"` StructVal float64 `json:"val_struct"` ContVal float64 `json:"val_cont"` CB string `json:"cbfips"` Pop2amu65 int32 `json:"pop2amu65"` Pop2amo65 int32 `json:"pop2amo65"` Pop2pmu65 int32 `json:"pop2pmu65"` Pop2pmo65 int32 `json:"pop2pmo65"` NumStories int32 `json:"num_story"` FirmZone string `json:"firmzone"` GroundElevation float64 `json:"ground_elv"` ConstructionType string `json:"bldgtype"` }
NsiProperties is a reflection of the JSON feature property attributes from the NSI-API
type NsiStreamProcessor ¶
type NsiStreamProcessor func(str NsiFeature)
NsiStreamProcessor is a function used to process an in memory NsiFeature through the NsiStreaming service endpoints
type Stats ¶
type Stats struct { TotalCount int TotalValue float64 CountByCategory map[string]int ValueByCategory map[string]float64 TotalResPop2AM int32 //total population to calculate percapita losses WorkingResPop2AM int32 //working population to calculate percapita losses NonResidentialValue float64 //for capital loss ratio for indirect economics }
func StatsByFips ¶
func StatsByFips(fips string, sp StructureProvider) Stats
type StructureProvider ¶
type StructureProvider interface { // TODO regulate more common methods ByFips(fipscode string, sp consequences.StreamProcessor) ByBbox(bbox geography.BBox, sp consequences.StreamProcessor) }
StructureProvider can be a gpkDataSet, nsiStreamProvider, or shpDataSet
type StructureProviderInfo ¶
type StructureProviderInfo struct { StructureProviderDriver string `json:"structure_provider_driver,omitempty"` // ESRI SHP, GPKG, PARQUET (OGR DRIVERS...) StructureProviderType StructureProviderType `json:"structure_provider_type"` // Provider_NSI or Provider_Local StructureFilePath string `json:"structure_file_path,omitempty"` // Required if StructureProviderType == Provider_Local OccTypeFilePath string `json:"occtype_file_path,omitempty"` // optional LayerName string `json:"layername,omitempty"` // required if specified a geopackage StructureFilePath }
func (StructureProviderInfo) CreateStructureProvider ¶
func (spi StructureProviderInfo) CreateStructureProvider() (StructureProvider, error)
NewStructureProvider generates a structure provider
type StructureProviderType ¶
type StructureProviderType string
const ( Unknown StructureProviderType = "UNKNOWN" //0 NSIAPI StructureProviderType = "NSIAPI" //1 GPKG StructureProviderType = "GPKG" //2 SHP StructureProviderType = "SHP" OGR StructureProviderType = "OGR" )
func (StructureProviderType) String ¶
func (spt StructureProviderType) String() string
Click to show internal directories.
Click to hide internal directories.