C# Class Azavea.NijPredictivePolicing.ACSAlchemistLibrary.Transfer.AcsDataManager

This class does most of the heavy lifting of the ACS Alchemist
Inheritance: IDisposable
Afficher le fichier Open project: azavea/acs-alchemist Class Usage Examples

Méthodes publiques

Свойство Type Description
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 Properties

Свойство Type Description
_cancelled bool
_summaryLevel string

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
GetShapeRowsByLOGRECNO ( DbConnection conn ) : DataRow>.Dictionary
InitDatabase ( ) : bool

Call this anyway, should only execute code inside safe blocks

Method Details

AcsDataManager() public méthode

public AcsDataManager ( ) : System
Résultat System

AcsDataManager() public méthode

public AcsDataManager ( AcsState aState ) : System
aState AcsState
Résultat System

AcsDataManager() public méthode

public AcsDataManager ( AcsState aState, string workingFolder, string year ) : System
aState AcsState
workingFolder string
year string
Résultat System

Cancel() public méthode

public Cancel ( ) : void
Résultat void

CheckAllGeometriesFile() public méthode

Downloads the census DATA for the given state
public CheckAllGeometriesFile ( ) : bool
Résultat bool

CheckBlockGroupFile() public méthode

Downloads the census DATA for the given state
public CheckBlockGroupFile ( ) : bool
Résultat bool

CheckBuildVariableTable() public méthode

Gets the filtered LogicalRecordNumbers, and the requested variables, and builds a table of their crossjoin
public CheckBuildVariableTable ( string tableName ) : bool
tableName string
Résultat bool

CheckCensusAggregatedDataFile() public méthode

public CheckCensusAggregatedDataFile ( ) : bool
Résultat bool

CheckColumnMappingsFile() public méthode

public CheckColumnMappingsFile ( ) : bool
Résultat bool

CheckDatabase() public méthode

Checks to see if the database exists, and if not, initializes it with the provided inputs
public CheckDatabase ( ) : bool
Résultat bool

CheckShapefiles() public méthode

Downloads the SHAPE FILEs, must be run before initializing the database! Since this will be imported into the database!
public CheckShapefiles ( ) : bool
Résultat bool

CreateColumnMappingsTable() public méthode

public CreateColumnMappingsTable ( DbConnection conn ) : bool
conn System.Data.Common.DbConnection
Résultat bool

CreateGeographiesTable() public méthode

public CreateGeographiesTable ( DbConnection conn ) : bool
conn System.Data.Common.DbConnection
Résultat bool

Dispose() public méthode

public Dispose ( ) : void
Résultat void

DownloadAndImportShapefile() public méthode

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
Résultat bool

ExportGriddedShapefile() public méthode

Retrieves the contents of the specified table, and writes them to a shapefile
public ExportGriddedShapefile ( string tableName ) : bool
tableName string
Résultat bool

ExportShapefile() public méthode

Retrieves the contents of the specified table, and writes them to a shapefile
public ExportShapefile ( string tableName ) : bool
tableName string
Résultat bool

GetAggregateDataPath() public méthode

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
Résultat string

GetAllSequenceVariables() public méthode

Returns all the variable names in the columnMappings table
public GetAllSequenceVariables ( ) : DataTable
Résultat System.Data.DataTable

GetFilteredLRUs() public méthode

public GetFilteredLRUs ( DbConnection conn ) : HashSet
conn System.Data.Common.DbConnection
Résultat HashSet

GetFilteringGeometries() public méthode

public GetFilteringGeometries ( string filename, ICoordinateSystem outputCrs ) : List
filename string
outputCrs ICoordinateSystem
Résultat List

GetGeographyTablename() public méthode

public GetGeographyTablename ( ) : string
Résultat string

GetGeometryRowKeyGenerator() public méthode

public GetGeometryRowKeyGenerator ( ) : GetGeometryRowKey
Résultat GetGeometryRowKey

GetGridEnvelope() public méthode

public GetGridEnvelope ( ) : GisSharpBlog.NetTopologySuite.Geometries.Envelope
Résultat GisSharpBlog.NetTopologySuite.Geometries.Envelope

GetLocalAllGeometriesZipFileName() public méthode

public GetLocalAllGeometriesZipFileName ( ) : string
Résultat string

GetLocalBlockGroupZipFileName() public méthode

public GetLocalBlockGroupZipFileName ( ) : string
Résultat string

GetLocalColumnMappingsDirectory() public méthode

public GetLocalColumnMappingsDirectory ( ) : string
Résultat string

GetLocalGeographyFileName() public méthode

public GetLocalGeographyFileName ( ) : string
Résultat string

GetRequestedVariables() public méthode

Currently rebuilds the requested variables table every time
public GetRequestedVariables ( DbConnection conn ) : DataTable
conn System.Data.Common.DbConnection
Résultat System.Data.DataTable

GetShapeFeaturesToExport() public méthode

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?
Résultat List

GetShapeRowsByLOGRECNO() protected méthode

protected GetShapeRowsByLOGRECNO ( DbConnection conn ) : DataRow>.Dictionary
conn System.Data.Common.DbConnection
Résultat DataRow>.Dictionary

Init() public méthode

Initialize our properties, and ensure our path structure is intact
public Init ( ) : void
Résultat void

InitDatabase() protected méthode

Call this anyway, should only execute code inside safe blocks
protected InitDatabase ( ) : bool
Résultat bool

IsCancelled() public méthode

public IsCancelled ( ) : bool
Résultat bool

IsIncluded() public méthode

public IsIncluded ( IGeometry geom, List filteringGeoms ) : bool
geom IGeometry
filteringGeoms List
Résultat bool

SetGridParam() public méthode

public SetGridParam ( string gridArgs ) : void
gridArgs string
Résultat void

Property Details

AddGeometryAttributesToOutput public_oe property

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
Résultat bool

AddStrippedGEOIDcolumn public_oe property

If true, add column GEOID_STRP to the shapefile output with values the same as GEOID except without the "15000US" prefix
public bool AddStrippedGEOIDcolumn
Résultat bool

CurrentDataPath public_oe property

public string CurrentDataPath
Résultat string

DBFilename public_oe property

public string DBFilename
Résultat string

DbClient public_oe property

public IDataClient DbClient
Résultat IDataClient

DesiredVariablesFilename public_oe property

If set, the manager will read in as a CSV, and import the variable values into the provided job table
public string DesiredVariablesFilename
Résultat string

ExportFilterFilename public_oe property

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
Résultat string

GridCellHeight public_oe property

public double GridCellHeight
Résultat double

GridCellWidth public_oe property

public double GridCellWidth
Résultat double

GridEnvelopeFilename public_oe property

If set, the manager will use this envelope while calculating the export grid (minx, miny, maxx, maxy)
public string GridEnvelopeFilename
Résultat string

IncludeEmptyGridCells public_oe property

public bool IncludeEmptyGridCells
Résultat bool

OutputFolder public_oe property

public string OutputFolder
Résultat string

OutputProjectionFilename public_oe property

public string OutputProjectionFilename
Résultat string

PreserveJam public_oe property

public bool PreserveJam
Résultat bool

ReusePreviousJobTable public_oe property

If set, the manager will re-use a previous job with the same name, instead of replacing it
public bool ReusePreviousJobTable
Résultat bool

ShapePath public_oe property

public string ShapePath
Résultat string

State public_oe property

Selected State
public AcsState State
Résultat AcsState

WorkingPath public_oe property

public string WorkingPath
Résultat string

_cancelled protected_oe property

protected bool _cancelled
Résultat bool

_summaryLevel protected_oe property

protected string _summaryLevel
Résultat string