O'Reilly logo

NHibernate 3.0 Cookbook by Jason Dentler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using NHibernate Spatial

NHibernate Spatial brings the spatial capabilities of several relational databases to the NHibernate API. In this recipe, I'll show you how to use NHibernate Spatial with Microsoft SQL Server 2008 to query for a geographic region containing a point.

Getting ready

In SQL Server 2008 Express, create a new, blank database named Spatial.

Download the State shapes from the US Census website by following these steps:

  1. Inside the solution directory, create a directory named SpatialData.
  2. Download the Shapefile containing all 50 states, D.C. and Puerto Rico from the United States Census website at http://www.census.gov/geo/www/cob/st2000.html or from the code download for this book. The file is named st99_d00_shp.zip.
  3. Extract all three ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required