C# Class Azavea.NijPredictivePolicing.ACSAlchemistLibrary.FileFormats.ShapefileHelper

This class contains a number of small utilities to simplify the use of shapefiles in the importer
Afficher le fichier Open project: azavea/acs-alchemist Class Usage Examples

Méthodes publiques

Méthode Description
AddColumn ( GisSharpBlog.NetTopologySuite.IO.DbaseFileHeader header, string columnName, Type t ) : void

Helper function for SetupHeader, correctly maps C# data types to DbaseFileHeader types

GetGeomFactory ( ) : GisSharpBlog.NetTopologySuite.Geometries.GeometryFactory

Constructs the default GeometryFactory for 4269 (census projection)

GetRemoteShapefileURL ( BoundaryLevels level, string stateFips ) : string

Helper function for constructing the correct census URL for a particular Boundary Level / State

GetSchema ( SqliteDataClient client ) : DataTable

Helper function for checking structure of existing Db

ImportShapefile ( DbConnection conn, IDataClient client, string filename, string tableName, int srid ) : bool

Imports the provided shapefile into a sqlite database using the VirtualShape extension

IsForbiddenShapefileName ( string name ) : bool

Checks to make sure a given table name doesn't conflict with any of the census shapefiles

LoadShapefile ( string filename, string tableName, IDataClient DbClient, ICoordinateSystem &CRS ) : bool

Imports a shapefile into the database. Do not use this to load census shapefiles.

MakeCensusProjFile ( string filename ) : bool

Generates a proj file for a given shapefile if it's missing

MakeOutputProjFile ( string sourceProjectionFilename, string destShapefilename ) : bool

Copies an existing .prj file next to an existing shapefile (with correct destination name)

OpenShapefile ( string filename, string tableName ) : bool

Helper function for testing the shapefile importer

SetupHeader ( DataTable table ) : GisSharpBlog.NetTopologySuite.IO.DbaseFileHeader

Consumes an ADO.net datatable and correctly initializes a Shapefile header object

Method Details

AddColumn() public static méthode

Helper function for SetupHeader, correctly maps C# data types to DbaseFileHeader types
public static AddColumn ( GisSharpBlog.NetTopologySuite.IO.DbaseFileHeader header, string columnName, Type t ) : void
header GisSharpBlog.NetTopologySuite.IO.DbaseFileHeader
columnName string
t System.Type
Résultat void

GetGeomFactory() public static méthode

Constructs the default GeometryFactory for 4269 (census projection)
public static GetGeomFactory ( ) : GisSharpBlog.NetTopologySuite.Geometries.GeometryFactory
Résultat GisSharpBlog.NetTopologySuite.Geometries.GeometryFactory

GetRemoteShapefileURL() public static méthode

Helper function for constructing the correct census URL for a particular Boundary Level / State
public static GetRemoteShapefileURL ( BoundaryLevels level, string stateFips ) : string
level BoundaryLevels
stateFips string
Résultat string

GetSchema() public static méthode

Helper function for checking structure of existing Db
public static GetSchema ( SqliteDataClient client ) : DataTable
client SqliteDataClient
Résultat System.Data.DataTable

ImportShapefile() public static méthode

Imports the provided shapefile into a sqlite database using the VirtualShape extension
public static ImportShapefile ( DbConnection conn, IDataClient client, string filename, string tableName, int srid ) : bool
conn System.Data.Common.DbConnection
client IDataClient
filename string
tableName string
srid int
Résultat bool

IsForbiddenShapefileName() public static méthode

Checks to make sure a given table name doesn't conflict with any of the census shapefiles
public static IsForbiddenShapefileName ( string name ) : bool
name string
Résultat bool

LoadShapefile() public static méthode

Imports a shapefile into the database. Do not use this to load census shapefiles.
public static LoadShapefile ( string filename, string tableName, IDataClient DbClient, ICoordinateSystem &CRS ) : bool
filename string The path of the file to import
tableName string
DbClient IDataClient The database to load the file into
CRS ICoordinateSystem
Résultat bool

MakeCensusProjFile() public static méthode

Generates a proj file for a given shapefile if it's missing
public static MakeCensusProjFile ( string filename ) : bool
filename string
Résultat bool

MakeOutputProjFile() public static méthode

Copies an existing .prj file next to an existing shapefile (with correct destination name)
public static MakeOutputProjFile ( string sourceProjectionFilename, string destShapefilename ) : bool
sourceProjectionFilename string
destShapefilename string
Résultat bool

OpenShapefile() public static méthode

Helper function for testing the shapefile importer
public static OpenShapefile ( string filename, string tableName ) : bool
filename string
tableName string
Résultat bool

SetupHeader() public static méthode

Consumes an ADO.net datatable and correctly initializes a Shapefile header object
public static SetupHeader ( DataTable table ) : GisSharpBlog.NetTopologySuite.IO.DbaseFileHeader
table System.Data.DataTable
Résultat GisSharpBlog.NetTopologySuite.IO.DbaseFileHeader