O'Reilly logo

NHibernate 4.x Cookbook - Second Edition by Jason Dentler, Alexander Zaytsev, Gunnar Liljas

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, we'll show you how to use NHibernate Spatial with Microsoft SQL Server 2014 to query for a geographic region containing a point.

Getting ready

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

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

  1. Inside the solution directory, create a directory named SpatialData.
  2. Download the Shape file containing all 50 states, D.C., and Puerto Rico from the United States Census website at https://www.census.gov/geo/maps-data/data/cbf/cbf_counties.html or from the code download for this book. The file is named st99_d00_shp.zip ...

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