NHibernate.Spatial and Sql 2008 Geography type - How to configure

后端 未结 5 1662
你的背包
你的背包 2020-12-13 07:02

I am trying to use Nhibernate with the Sql 2008 Geography type and am having difficulty. I am using Fluent Nhibernate to configure which I am fairly new to so that may be th

5条回答
  •  醉酒成梦
    2020-12-13 07:31

    Not really an answer but questions ;-)

    • Are you setting a SRID on the GisSharpBlog.NetTopologySuite.Geometries.Point object?

    The default (since the point is a geometry) is 0 and will give you a SQL error when trying to persist the LocationLog.Location property as a geography. 0 is not a valid SRID for sql geography fields. You will need to specify one from the sys.spatial_reference_systems view.

    • Have you tried without Fluent NHibernate?

    To eliminate as many components from the problem.

提交回复
热议问题