All Projects → dotMorten → Microsoft.SqlServer.Types

dotMorten / Microsoft.SqlServer.Types

Licence: Apache-2.0 license
a .NET Standard implementation of the spatial types in `Microsoft.SqlServer.Types`

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Microsoft.SqlServer.Types

Geoserver
geoserver is a Go library for manipulating a GeoServer instance via the GeoServer REST API.
Stars: ✭ 48 (-25%)
Mutual labels:  mapping, gis, geography
geog595
Humanistic GIS @ UW-Seattle
Stars: ✭ 33 (-48.44%)
Mutual labels:  gis, geography
earthengine-apps
A collection of Earth Engine Apps created using geemap, voila, and heroku
Stars: ✭ 20 (-68.75%)
Mutual labels:  mapping, gis
CesiumJsFirstPersonCameraController
cesiumgis.com/
Stars: ✭ 20 (-68.75%)
Mutual labels:  mapping, gis
leafmap
A Python package for interactive mapping and geospatial analysis with minimal coding in a Jupyter environment
Stars: ✭ 1,299 (+1929.69%)
Mutual labels:  mapping, gis
deck.gl-time-series-widget
A React Time Slider implementation for DECK.GL - (non)temporal data - by CPU filtering ⌛
Stars: ✭ 19 (-70.31%)
Mutual labels:  mapping, gis
envelope ex
Utilities for calculating and comparing envelopes from geometries
Stars: ✭ 15 (-76.56%)
Mutual labels:  geometry, gis
Azuremapscodesamples
A set of code samples for the Azure Maps web control.
Stars: ✭ 167 (+160.94%)
Mutual labels:  mapping, gis
d3-geomap
A library for creating geographical maps based on D3.js
Stars: ✭ 124 (+93.75%)
Mutual labels:  mapping, geography
batyr
Microservice for on-demand synchronization of geographical vector datasources to a PostgreSQL/PostGIS database. The service provides an HTTP API for easy integration into other applications.
Stars: ✭ 25 (-60.94%)
Mutual labels:  geometry, gis
CesiumJs3DTileServer
cesiumgis.com/
Stars: ✭ 25 (-60.94%)
Mutual labels:  mapping, gis
python-for-gis-progression-path
Progression path for a GIS analyst who wants to become proficient in using Python for GIS: from apprentice to guru
Stars: ✭ 98 (+53.13%)
Mutual labels:  gis, geography
gridviz
visualization of gridded statistics
Stars: ✭ 108 (+68.75%)
Mutual labels:  mapping, gis
wkb-parser
Well-known binary (WKB) Parser.
Stars: ✭ 69 (+7.81%)
Mutual labels:  geometry, geography
Contextily
Context geo-tiles in Python
Stars: ✭ 254 (+296.88%)
Mutual labels:  mapping, geography
EOmaps
A library to create interactive maps of geographical datasets
Stars: ✭ 193 (+201.56%)
Mutual labels:  mapping, gis
esri-experiments
Fly in space and look across the sea: demos and experiments with the ArcGIS API for JavaScript
Stars: ✭ 29 (-54.69%)
Mutual labels:  mapping, geography
Gwt Ol
GWT wrapper for OpenLayers 3+ using JSInterop
Stars: ✭ 57 (-10.94%)
Mutual labels:  mapping, gis
Simple Tiles
Simple tile generation for maps.
Stars: ✭ 106 (+65.63%)
Mutual labels:  mapping, gis
topo
A Geometry library for Elixir that calculates spatial relationships between two geometries
Stars: ✭ 125 (+95.31%)
Mutual labels:  geometry, gis

Microsoft.SqlServer.Types

a .NET Standard implementation of the spatial types in Microsoft.SqlServer.Types

Difference between v1.x and v2.x

The v1.x and v2.x versions are identical and kept in sync. The only difference is the dependency:

  • v1.x : Depends on the legacy System.Data.SqlClient package.
  • v2.x : Depends on updated Microsoft.Data.SqlClient package.

Sponsoring

If you like this library and use it a lot, consider sponsoring me. Anything helps and encourages me to keep going.

See here for details: https://github.com/sponsors/dotMorten

NuGet:

Install the package dotMorten.Microsoft.SqlServer.Types from NuGet.

Examples

Input parameter

Assigning SqlGeometry or SqlGeography to a command parameter:

   command.Parameters.AddWithValue("@GeographyColumn", mySqlGeography);
   command.Parameters["@GeometryColumn"].UdtTypeName = "Geography";

   command.Parameters.AddWithValue("@GeographyColumn", mySqlGeometry);
   command.Parameters["@GeometryColumn"].UdtTypeName = "Geometry" 

The geometry will automatically be correctly serialized.

Reading geometry and geography

Use the common methods for getting fields of specific types:

   var geom1 = reader.GetValue(geomColumn) as SqlGeometry;
   var geom2 = reader.GetFieldValue<SqlGeometry>(geomColumn);
   var geom3 = SqlGeometry.Deserialize(reader.GetSqlBytes(geomColumn)); //Avoids any potential assembly-redirect issue. See https://docs.microsoft.com/en-us/previous-versions/sql/2014/sql-server/install/warning-about-client-side-usage-of-geometry-geography-and-hierarchyid?view=sql-server-2014#corrective-action

Notes:

The spatial operations like intersection, area etc are not included here. You can perform these as part of your query instead and get them returned in a column.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].