IRI.Maptor.Infrastructure.SqlServer
Persistence adapter for SQL Server Spatial — a Maptor vector data source for reading spatial
features stored in SQL Server geometry / geography columns, materialized through
Microsoft.SqlServer.Types (SqlGeometry) and converted to native Geometry<Point> objects.
Installation
dotnet add package IRI.Maptor.Infrastructure.SqlServer
Features
SqlServerDataSource— Maptor vector data source (VectorDataSource,IEditableVectorDataSource) over a SQL Server spatial table or a free-form select query (CreateForQueryString)- Reads spatial rows as
SqlGeometryand converts them to nativeGeometry<Point>objects - Spatial filtering: bounding-box queries (
GetAsFeatureSetAsync(BoundingBox)), WKT/WKB intersects filters (GetGeometriesWhereIntersects), and custom where clauses FeatureSetloading for map display, including a map-scale-aware overloadSqlServerInfrastructure— connection helpers, feature selection to dictionaries, bulkDataTableinsert (Insert,InsertTable),ExecuteNonQuery, and table deleteSqlServerSourceParameter— strongly-typed source parameters (connection string, table, spatial/label columns, query string)
Usage
using IRI.Maptor.Infrastructure.SqlServer;
var source = new SqlServerDataSource(
connectionString, "Roads", spatialColumnName: "SHAPE", labelColumnName: "Name");
// features inside a bounding box
var featureSet = await source.GetAsFeatureSetAsync(boundingBox);
// geometries intersecting a WKT polygon
var geometries = source.GetGeometriesWhereIntersects(
"POLYGON((51 35, 52 35, 52 36, 51 36, 51 35))");
Limitations
- Windows only (depends on
Microsoft.SqlServer.Types). - Editing is partially implemented:
Add/Removedelegate to caller-suppliedAddAction/RemoveActioncallbacks;UpdateGeometry,UpdateAttributes,SaveChangesAsync, andSearchAsyncare not implemented yet.
NuGet package · Report issues · Back to IRI.Maptor.Infrastructure