C# 클래스 OSCodePointDataImport.CodePointDataImporter

Functionality to load Ordnance Survey Code-Point data files to SQL Server. The data files are available for download from: https://www.ordnancesurvey.co.uk/opendatadownload/products.html
상속: OSDataImporter
파일 보기 프로젝트 열기: AdaTheDev/Ordnance-Survey-Code-Point-Data-Importer 1 사용 예제들

공개 메소드들

메소드 설명
LoadData ( CodePointOptions options ) : int
LoadData ( string serverName, string databaseName, string schemaName, string tableName, string dataFileDirectory, string columnHeadersCsvFile ) : int

Loads Code-Point CSV data files into a new table in SQL Server, converting the provided Eastings & Northings coordinates into WGS84 Lon/Lat coordinates.

비공개 메소드들

메소드 설명
CalculateDistrictsAndSectors ( SqlConnection connection, string schemaName, string tableName ) : void

Calculates a simple average Lon/Lat for each postcode district (e.g. AB12) and sector (e.g. AB12 3), and creates a row in the db table for each one.

PrepareTable ( SqlConnection connection, string schemaName, string tableName ) : void

Creates a new table in the database ready to receive the Code-Point data.

ReadColumnHeaders ( string columnHeadersCsvFile ) : int>.Dictionary

Looks in the CSV headers file supplied with the Code-Point data download, and extracts all the columns defined with their index position.

ReadDataFromFiles ( string directory, int>.Dictionary columns ) : DataTable

Reads in all .csv files in the supplied directory, converts the Eastings & Northings coordinates into the WGS84 Lon/Lat system and stores each Post Code with the Lon/Lat coordinates in memory in a DataTable.

메소드 상세

LoadData() 공개 메소드

public LoadData ( CodePointOptions options ) : int
options CodePointOptions
리턴 int

LoadData() 공개 메소드

Loads Code-Point CSV data files into a new table in SQL Server, converting the provided Eastings & Northings coordinates into WGS84 Lon/Lat coordinates.
public LoadData ( string serverName, string databaseName, string schemaName, string tableName, string dataFileDirectory, string columnHeadersCsvFile ) : int
serverName string SQL Server name
databaseName string database to load the data into
schemaName string schema to create table in
tableName string table name to create and load the data into. The table must not already exist. If it does already /// exist, an exception will be thrown.
dataFileDirectory string directory where the Code-Point CSV data files are
columnHeadersCsvFile string CSV file containing the column header definition for the Code-Point CSV data files. /// Should be in ..\Doc\Code-Point_Open_column_headers.csv
리턴 int