File tree Expand file tree Collapse file tree 5 files changed +2
-90
lines changed
GeoJSON4EntityFramework5/Elements Expand file tree Collapse file tree 5 files changed +2
-90
lines changed Original file line number Diff line number Diff line change 12
12
f.Geometry.Add(Point.FromDbGeometry(inp))
13
13
Case "MultPoint"
14
14
f.Geometry.Add(MultiPoint.FromDbGeometry(inp))
15
- <<<<<<< HEAD
16
15
Case "LineString"
17
16
f.Geometry.Add(LineString.FromDbGeometry(inp))
18
17
Case "MultiLineString"
19
18
f.Geometry.Add(MultiLineString.FromDbGeometry(inp))
20
- Case Else
21
- Throw New NotImplementedException
22
- =======
23
19
Case "GeometryCollection"
24
20
f.Geometry.Add(GeometryCollection.FromDbGeometry(inp))
25
- >>>>>>> additions_2
21
+ Case Else
22
+ Throw New NotImplementedException
26
23
End Select
27
24
28
25
Return f
Original file line number Diff line number Diff line change 3
3
Implements IGeoJsonGeometry
4
4
5
5
<Newtonsoft.Json.JsonIgnore()>
6
- <<<<<<< HEAD
7
- Public Property PointsList As New List( Of CoordinateList)
8
-
9
- Public Overrides ReadOnly Property Coordinates()
10
- Get
11
- Try
12
- If PointsList.Count = 0 Then
13
- Return New Double () {}
14
- Else
15
- Dim out (PointsList.Count - 1 )()() As Double
16
- For k As Integer = 0 To PointsList.Count - 1
17
- Dim Points3 As CoordinateList = PointsList(k)
18
- If Points3.Count = 0 Then
19
- Return New Double () {}
20
- ElseIf Points3.Count = 1 Then
21
- Throw New Exception( "There must be an array of two or more points" )
22
- Else
23
- out (k) = New Double (Points3.Count - 1 )() {}
24
- '--Warning BC4232--
25
- 'Using the iteration variable In a lambda expression may have unexpected results.
26
- 'Instead, create a local variable within the Loop And assign it the value Of the iteration variable.
27
- For i As Integer = 0 To Points3.Count
28
- out (k)(i) = Points3(i).Coordinate
29
- Next
30
- '--
31
- End If
32
- Next
33
- Return out
34
- End If
35
- Catch ex As Exception
36
- Return New Double () {}
37
- End Try
38
- =======
39
6
Public Property Rings As New List( Of CoordinateList)
40
7
41
8
Public Overrides ReadOnly Property Coordinates()
42
9
Get
43
10
Return Rings
44
- >>>>>>> additions_2
45
11
End Get
46
12
End Property
47
-
48
13
End Class
Original file line number Diff line number Diff line change 1
1
Partial Class Polygon
2
- <<<<<<< HEAD
3
- Public Overrides Sub CreateFromDbGeometry(inp As Data.Entity.Spatial.DbGeometry)
4
- If inp.SpatialTypeName <> MyBase .TypeName Then Throw New ArgumentException
5
- PointsList.Clear()
6
-
7
- Ring2Coordinates(inp.ExteriorRing)
8
- Dim numRings = inp.InteriorRingCount
9
- If (numRings = 0 ) Then Return
10
- For i As Integer = 1 To numRings
11
- Dim ring = inp.InteriorRingAt(i)
12
- Ring2Coordinates(ring)
13
- Next
14
-
15
- End Sub
16
-
17
- Private Sub Ring2Coordinates(ring As Data.Entity.Spatial.DbGeometry)
18
- Dim Points = New CoordinateList
19
- For i As Integer = 1 To ring.PointCount
20
- Dim point = ring.PointAt(i)
21
- Points.AddNew(point.XCoordinate, point.YCoordinate)
22
- Next
23
- PointsList.Add(Points)
24
- =======
25
-
26
2
Private Function RingToCoordinateList(ring As Entity.Spatial.DbGeometry) As CoordinateList
27
3
Dim extRingCoords As New CoordinateList()
28
4
For i = 1 To ring.PointCount
47
23
Rings.Add(RingToCoordinateList(intRing))
48
24
Next
49
25
End If
50
- >>>>>>> additions_2
51
26
End Sub
52
27
53
28
End Class
Original file line number Diff line number Diff line change 81
81
<ItemGroup >
82
82
<Compile Include =" Base\GeoJsonGeometryEF6.vb" />
83
83
<Compile Include =" Elements\FeatureEF6.vb" />
84
- <<<<<<< HEAD
85
84
<Compile Include =" Elements\LineString.vb" />
86
85
<Compile Include =" Elements\LineStringEF6.vb" />
87
86
<Compile Include =" Elements\MultiLineStringEF6.vb" />
88
- =======
89
87
<Compile Include =" Elements\GeometryCollection.vb" />
90
- >>>>>>> additions_2
91
88
<Compile Include =" Elements\MultiPointEF6.vb" />
92
89
<Compile Include =" Elements\MultiPolygonEF6.vb" />
93
90
<Compile Include =" Elements\MultiLineString.vb" />
Original file line number Diff line number Diff line change 10
10
11
11
Public Overrides Sub CreateFromDbGeometry(inp As Data.Spatial.DbGeometry)
12
12
If inp.SpatialTypeName <> MyBase .TypeName Then Throw New ArgumentException
13
- <<<<<<< HEAD
14
- PointsList.Clear()
15
-
16
- Ring2Coordinates(inp.ExteriorRing)
17
- Dim numRings = inp.InteriorRingCount
18
- If (numRings = 0 ) Then Return
19
- For i As Integer = 1 To numRings
20
- Dim ring = inp.InteriorRingAt(i)
21
- Ring2Coordinates(ring)
22
- Next
23
-
24
- End Sub
25
-
26
- Private Sub Ring2Coordinates(ring As Data.Spatial.DbGeometry)
27
- Dim Points = New CoordinateList
28
- For i As Integer = 1 To ring.PointCount
29
- Dim point = ring.PointAt(i)
30
- Points.AddNew(point.XCoordinate, point.YCoordinate)
31
- Next
32
- PointsList.Add(Points)
33
- =======
34
13
Rings.Clear()
35
14
36
15
' Process exterior ring
44
23
Rings.Add(RingToCoordinateList(intRing))
45
24
Next
46
25
End If
47
- >>>>>>> additions_2
48
26
End Sub
49
27
50
28
End Class
You can’t perform that action at this time.
0 commit comments