Logo

NHibernate

The object-relational mapper for .NET

Spatial

This page is converted from the old nhforge.org Wiki. First published by: Ricardo Stuven on 09-26-2008, Last revision by: Ricardo Stuven on 10-06-2010

Introduction

NHibernate.Spatial, spatial extensions for NHibernate, allows you to connect NHibernate to a spatially enabled database and manipulate geometries in HQL or in .NET code using NetTopologySuite, providing you with a fully integrated GIS programming experience.

There is also a similar but independent effort for Java: Hibernate Spatial.

Features: 

  • Geometry types: Geometry columns are mapped to .NET geometry types compliant with OGC specifications.
  • Dialects: MsSqlSpatial, PostGIS  MySQL and SQL Server 2008 are supported. The most common spatial functions are registered for use within HQL, providing compatible queries among different dialects.
  • Criteria: Spatial relations functions such as IntersectsWithinCrosses, etc.
  • Projections: Spatial aggregate, analysis and tranformation functions.
  • Schema generation: Support for automatic creation and droping of auxiliary data objects (eg. registering of geometry columns in metadata table).
  • Metadata mappings: Built-in mappings to spatial metadata through GeometryColumns and SpatialReferenceSystem classes. 

Requirements:

  • .NET 2.0
  • NHibernate 2.1.2.GA

Installation:

  • Download latest sources and build. Copy the binaries to your project's libraries folder.
  • In you project, add references to NHibernate.dll, NHibernate.Spatial.dll, NetTopologySuite.dll, GeoAPI.dll and to provider assembly (eg. NHibernate.Spatial.PostGis.dll).
© NHibernate Community 2024