C# Class OSCodePointDataImport.OSDataImporter

Exibir arquivo Open project: AdaTheDev/Ordnance-Survey-Code-Point-Data-Importer

Protected Methods

Method Description
ConvertToLonLat ( double northing, double easting ) : TDPG.GeoCoordConversion.PolarGeoCoordinate

Converts northing and easting coordinates into Longitude/Latitude coordinates in the WGS84 coordinate system.

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

Creates a spatial index on the GeoLocation column.

LoadRowsToDatabase ( SqlConnection connection, DataTable data, string schemaName, string tableName ) : int

Loads the supplied data to the newly created table in the database.

SetForeignKey ( SqlConnection connection, string schemaName, string primaryKeyTableName, string primaryKeyColumnName, string foreignKeyTableName, string foreignKeyColumnName ) : void

Adds a foreign key constraint.

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

Set the GeoLocation column in the supplied table, to a GEOGRAPHY point based on the Latitude and Longitude columns

SetPrimaryKey ( SqlConnection connection, string schemaName, string tableName, string pkColumnNames ) : void

Sets the primary key on the supplied table

Private Methods

Method Description
ExecCommand ( SqlConnection connection, string commandText ) : void

Executes the supplied SQL.

Method Details

ConvertToLonLat() protected method

Converts northing and easting coordinates into Longitude/Latitude coordinates in the WGS84 coordinate system.
protected ConvertToLonLat ( double northing, double easting ) : TDPG.GeoCoordConversion.PolarGeoCoordinate
northing double northing coordinate
easting double easting coordinate
return TDPG.GeoCoordConversion.PolarGeoCoordinate

CreateSpatialIndex() protected method

Creates a spatial index on the GeoLocation column.
protected CreateSpatialIndex ( SqlConnection connection, string schemaName, string tableName ) : void
connection System.Data.SqlClient.SqlConnection db conneciton to run the command against
schemaName string schema name
tableName string table name
return void

LoadRowsToDatabase() protected method

Loads the supplied data to the newly created table in the database.
protected LoadRowsToDatabase ( SqlConnection connection, DataTable data, string schemaName, string tableName ) : int
connection System.Data.SqlClient.SqlConnection SQL Server database connection
data System.Data.DataTable DataTable containing the data to load
schemaName string name of schema the table belongs to
tableName string table to load the data to
return int

SetForeignKey() protected method

Adds a foreign key constraint.
protected SetForeignKey ( SqlConnection connection, string schemaName, string primaryKeyTableName, string primaryKeyColumnName, string foreignKeyTableName, string foreignKeyColumnName ) : void
connection System.Data.SqlClient.SqlConnection db connection to run the command against
schemaName string schema name
primaryKeyTableName string name of the primary key table
primaryKeyColumnName string name of the primary key column
foreignKeyTableName string name of the foreign key table
foreignKeyColumnName string name of the foreign key column
return void

SetGeoColumn() protected method

Set the GeoLocation column in the supplied table, to a GEOGRAPHY point based on the Latitude and Longitude columns
protected SetGeoColumn ( SqlConnection connection, string schemaName, string tableName ) : void
connection System.Data.SqlClient.SqlConnection db connection to use
schemaName string name of schema the table belongs to
tableName string name of table to update
return void

SetPrimaryKey() protected method

Sets the primary key on the supplied table
protected SetPrimaryKey ( SqlConnection connection, string schemaName, string tableName, string pkColumnNames ) : void
connection System.Data.SqlClient.SqlConnection db connection to use
schemaName string name of schema the table belongs to
tableName string name of the table to add the PK constraint on
pkColumnNames string column or columns that form the PK
return void