C# Класс Azavea.NijPredictivePolicing.ACSAlchemistLibrary.Transfer.AcsDataManager

This class does most of the heavy lifting of the ACS Alchemist
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
AddGeometryAttributesToOutput bool
AddStrippedGEOIDcolumn bool
CurrentDataPath string
DBFilename string
DbClient IDataClient
DesiredVariablesFilename string
ExportFilterFilename string
GridCellHeight double
GridCellWidth double
GridEnvelopeFilename string
IncludeEmptyGridCells bool
OutputFolder string
OutputProjectionFilename string
PreserveJam bool
ReusePreviousJobTable bool
ShapePath string
State AcsState
WorkingPath string

Защищенные свойства (Protected)

Свойство Тип Описание
_cancelled bool
_summaryLevel string

Открытые методы

Метод Описание
AcsDataManager ( ) : System
AcsDataManager ( AcsState aState ) : System
AcsDataManager ( AcsState aState, string workingFolder, string year ) : System
Cancel ( ) : void
CheckAllGeometriesFile ( ) : bool

Downloads the census DATA for the given state

CheckBlockGroupFile ( ) : bool

Downloads the census DATA for the given state

CheckBuildVariableTable ( string tableName ) : bool

Gets the filtered LogicalRecordNumbers, and the requested variables, and builds a table of their crossjoin

CheckCensusAggregatedDataFile ( ) : bool
CheckColumnMappingsFile ( ) : bool
CheckDatabase ( ) : bool

Checks to see if the database exists, and if not, initializes it with the provided inputs

CheckShapefiles ( ) : bool

Downloads the SHAPE FILEs, must be run before initializing the database! Since this will be imported into the database!

CreateColumnMappingsTable ( DbConnection conn ) : bool
CreateGeographiesTable ( DbConnection conn ) : bool
Dispose ( ) : void
DownloadAndImportShapefile ( string desiredUrl, string destFilepath, string niceName, string tablename ) : bool

Helper function for retrieving a given zip file from a URL, decompressing it, finding a shapefile in it, and importing that into the database

ExportGriddedShapefile ( string tableName ) : bool

Retrieves the contents of the specified table, and writes them to a shapefile

ExportShapefile ( string tableName ) : bool

Retrieves the contents of the specified table, and writes them to a shapefile

GetAggregateDataPath ( ) : string

Gets either the standard data path based on year, or appends an 'all' if we're not doing tracts or block-groups

GetAllSequenceVariables ( ) : DataTable

Returns all the variable names in the columnMappings table

GetFilteredLRUs ( DbConnection conn ) : HashSet
GetFilteringGeometries ( string filename, ICoordinateSystem outputCrs ) : List
GetGeographyTablename ( ) : string
GetGeometryRowKeyGenerator ( ) : GetGeometryRowKey
GetGridEnvelope ( ) : GisSharpBlog.NetTopologySuite.Geometries.Envelope
GetLocalAllGeometriesZipFileName ( ) : string
GetLocalBlockGroupZipFileName ( ) : string
GetLocalColumnMappingsDirectory ( ) : string
GetLocalGeographyFileName ( ) : string
GetRequestedVariables ( DbConnection conn ) : DataTable

Currently rebuilds the requested variables table every time

GetShapeFeaturesToExport ( string tableName, bool spatialFilter ) : List

Given a table, returns a list of features to export. Assumes table geometries are in WGS84

Init ( ) : void

Initialize our properties, and ensure our path structure is intact

IsCancelled ( ) : bool
IsIncluded ( IGeometry geom, List filteringGeoms ) : bool
SetGridParam ( string gridArgs ) : void

Защищенные методы

Метод Описание
GetShapeRowsByLOGRECNO ( DbConnection conn ) : DataRow>.Dictionary
InitDatabase ( ) : bool

Call this anyway, should only execute code inside safe blocks

Описание методов

AcsDataManager() публичный Метод

public AcsDataManager ( ) : System
Результат System

AcsDataManager() публичный Метод

public AcsDataManager ( AcsState aState ) : System
aState AcsState
Результат System

AcsDataManager() публичный Метод

public AcsDataManager ( AcsState aState, string workingFolder, string year ) : System
aState AcsState
workingFolder string
year string
Результат System

Cancel() публичный Метод

public Cancel ( ) : void
Результат void

CheckAllGeometriesFile() публичный Метод

Downloads the census DATA for the given state
public CheckAllGeometriesFile ( ) : bool
Результат bool

CheckBlockGroupFile() публичный Метод

Downloads the census DATA for the given state
public CheckBlockGroupFile ( ) : bool
Результат bool

CheckBuildVariableTable() публичный Метод

Gets the filtered LogicalRecordNumbers, and the requested variables, and builds a table of their crossjoin
public CheckBuildVariableTable ( string tableName ) : bool
tableName string
Результат bool

CheckCensusAggregatedDataFile() публичный Метод

public CheckCensusAggregatedDataFile ( ) : bool
Результат bool

CheckColumnMappingsFile() публичный Метод

public CheckColumnMappingsFile ( ) : bool
Результат bool

CheckDatabase() публичный Метод

Checks to see if the database exists, and if not, initializes it with the provided inputs
public CheckDatabase ( ) : bool
Результат bool

CheckShapefiles() публичный Метод

Downloads the SHAPE FILEs, must be run before initializing the database! Since this will be imported into the database!
public CheckShapefiles ( ) : bool
Результат bool

CreateColumnMappingsTable() публичный Метод

public CreateColumnMappingsTable ( DbConnection conn ) : bool
conn System.Data.Common.DbConnection
Результат bool

CreateGeographiesTable() публичный Метод

public CreateGeographiesTable ( DbConnection conn ) : bool
conn System.Data.Common.DbConnection
Результат bool

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

DownloadAndImportShapefile() публичный Метод

Helper function for retrieving a given zip file from a URL, decompressing it, finding a shapefile in it, and importing that into the database
public DownloadAndImportShapefile ( string desiredUrl, string destFilepath, string niceName, string tablename ) : bool
desiredUrl string
destFilepath string
niceName string
tablename string
Результат bool

ExportGriddedShapefile() публичный Метод

Retrieves the contents of the specified table, and writes them to a shapefile
public ExportGriddedShapefile ( string tableName ) : bool
tableName string
Результат bool

ExportShapefile() публичный Метод

Retrieves the contents of the specified table, and writes them to a shapefile
public ExportShapefile ( string tableName ) : bool
tableName string
Результат bool

GetAggregateDataPath() публичный Метод

Gets either the standard data path based on year, or appends an 'all' if we're not doing tracts or block-groups
public GetAggregateDataPath ( ) : string
Результат string

GetAllSequenceVariables() публичный Метод

Returns all the variable names in the columnMappings table
public GetAllSequenceVariables ( ) : DataTable
Результат System.Data.DataTable

GetFilteredLRUs() публичный Метод

public GetFilteredLRUs ( DbConnection conn ) : HashSet
conn System.Data.Common.DbConnection
Результат HashSet

GetFilteringGeometries() публичный Метод

public GetFilteringGeometries ( string filename, ICoordinateSystem outputCrs ) : List
filename string
outputCrs ICoordinateSystem
Результат List

GetGeographyTablename() публичный Метод

public GetGeographyTablename ( ) : string
Результат string

GetGeometryRowKeyGenerator() публичный Метод

public GetGeometryRowKeyGenerator ( ) : GetGeometryRowKey
Результат GetGeometryRowKey

GetGridEnvelope() публичный Метод

public GetGridEnvelope ( ) : GisSharpBlog.NetTopologySuite.Geometries.Envelope
Результат GisSharpBlog.NetTopologySuite.Geometries.Envelope

GetLocalAllGeometriesZipFileName() публичный Метод

public GetLocalAllGeometriesZipFileName ( ) : string
Результат string

GetLocalBlockGroupZipFileName() публичный Метод

public GetLocalBlockGroupZipFileName ( ) : string
Результат string

GetLocalColumnMappingsDirectory() публичный Метод

public GetLocalColumnMappingsDirectory ( ) : string
Результат string

GetLocalGeographyFileName() публичный Метод

public GetLocalGeographyFileName ( ) : string
Результат string

GetRequestedVariables() публичный Метод

Currently rebuilds the requested variables table every time
public GetRequestedVariables ( DbConnection conn ) : DataTable
conn System.Data.Common.DbConnection
Результат System.Data.DataTable

GetShapeFeaturesToExport() публичный Метод

Given a table, returns a list of features to export. Assumes table geometries are in WGS84
public GetShapeFeaturesToExport ( string tableName, bool spatialFilter ) : List
tableName string Name of the sqlite table
spatialFilter bool Should we load and use a spatial filter?
Результат List

GetShapeRowsByLOGRECNO() защищенный Метод

protected GetShapeRowsByLOGRECNO ( DbConnection conn ) : DataRow>.Dictionary
conn System.Data.Common.DbConnection
Результат DataRow>.Dictionary

Init() публичный Метод

Initialize our properties, and ensure our path structure is intact
public Init ( ) : void
Результат void

InitDatabase() защищенный Метод

Call this anyway, should only execute code inside safe blocks
protected InitDatabase ( ) : bool
Результат bool

IsCancelled() публичный Метод

public IsCancelled ( ) : bool
Результат bool

IsIncluded() публичный Метод

public IsIncluded ( IGeometry geom, List filteringGeoms ) : bool
geom IGeometry
filteringGeoms List
Результат bool

SetGridParam() публичный Метод

public SetGridParam ( string gridArgs ) : void
gridArgs string
Результат void

Описание свойств

AddGeometryAttributesToOutput публичное свойство

If true, this feature will add a number of columns to the end of the export with calculated values about the projected geometries Area, Perimeter, and Centroid It should also truncate requested variables to make sure things fit, but should warn the user.
public bool AddGeometryAttributesToOutput
Результат bool

AddStrippedGEOIDcolumn публичное свойство

If true, add column GEOID_STRP to the shapefile output with values the same as GEOID except without the "15000US" prefix
public bool AddStrippedGEOIDcolumn
Результат bool

CurrentDataPath публичное свойство

public string CurrentDataPath
Результат string

DBFilename публичное свойство

public string DBFilename
Результат string

DbClient публичное свойство

public IDataClient DbClient
Результат IDataClient

DesiredVariablesFilename публичное свойство

If set, the manager will read in as a CSV, and import the variable values into the provided job table
public string DesiredVariablesFilename
Результат string

ExportFilterFilename публичное свойство

If set, the manager will look for a file of WKTs that it will use to ensure all exported geometries at least intersect
public string ExportFilterFilename
Результат string

GridCellHeight публичное свойство

public double GridCellHeight
Результат double

GridCellWidth публичное свойство

public double GridCellWidth
Результат double

GridEnvelopeFilename публичное свойство

If set, the manager will use this envelope while calculating the export grid (minx, miny, maxx, maxy)
public string GridEnvelopeFilename
Результат string

IncludeEmptyGridCells публичное свойство

public bool IncludeEmptyGridCells
Результат bool

OutputFolder публичное свойство

public string OutputFolder
Результат string

OutputProjectionFilename публичное свойство

public string OutputProjectionFilename
Результат string

PreserveJam публичное свойство

public bool PreserveJam
Результат bool

ReusePreviousJobTable публичное свойство

If set, the manager will re-use a previous job with the same name, instead of replacing it
public bool ReusePreviousJobTable
Результат bool

ShapePath публичное свойство

public string ShapePath
Результат string

State публичное свойство

Selected State
public AcsState State
Результат AcsState

WorkingPath публичное свойство

public string WorkingPath
Результат string

_cancelled защищенное свойство

protected bool _cancelled
Результат bool

_summaryLevel защищенное свойство

protected string _summaryLevel
Результат string