File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
NHibernate.Spatial.PostGis/Type Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -66,14 +66,15 @@ protected override byte[] FromGeometry(object value)
66
66
67
67
// Determine the ordinality of the geometry to ensure 3D and 4D geometries are
68
68
// correctly serialized by PostGisWriter (see issue #66)
69
+ // NOTE: Cannot use InteriorPoint here as that always returns a 2D point (see #120)
69
70
// TODO: Is there a way of getting the ordinates directly from the geometry?
70
71
var ordinates = Ordinates . XY ;
71
- var interiorPoint = geometry . InteriorPoint ;
72
- if ( ! interiorPoint . IsEmpty && ! double . IsNaN ( interiorPoint . Z ) )
72
+ var coordinate = geometry . Coordinate ;
73
+ if ( coordinate != null && ! double . IsNaN ( coordinate . Z ) )
73
74
{
74
75
ordinates |= Ordinates . Z ;
75
76
}
76
- if ( ! interiorPoint . IsEmpty && ! double . IsNaN ( interiorPoint . M ) )
77
+ if ( coordinate != null && ! double . IsNaN ( coordinate . M ) )
77
78
{
78
79
ordinates |= Ordinates . M ;
79
80
}
You can’t perform that action at this time.
0 commit comments