-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
79 changed files
with
271,941 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ obj/ | |
*.suo | ||
*.user | ||
*.sln.docstates | ||
.vs/ | ||
|
||
# Build results | ||
[Dd]ebug/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<configSections> | ||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> | ||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/> | ||
</configSections> | ||
|
||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> | ||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections> | ||
<entityFramework> | ||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> | ||
<parameters> | ||
<parameter value="v11.0"/> | ||
<parameter value="v11.0" /> | ||
</parameters> | ||
</defaultConnectionFactory> | ||
<providers> | ||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/> | ||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> | ||
</providers> | ||
</entityFramework> | ||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration> | ||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /></startup></configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
Public Interface IGeoJsonGeometry | ||
|
||
Public Interface IGeoJsonGeometry | ||
|
||
End Interface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
Public Class FeatureCollection | ||
Inherits GeoJsonElement(Of FeatureCollection) | ||
|
||
<JsonConverter(GetType(GenericListConverter(Of Feature)))> | ||
<JsonProperty(PropertyName:="features")> | ||
Public Property Features As New List(Of Feature) | ||
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Partial Public Class GeometryCollection | ||
Inherits GeoJsonGeometry(Of GeometryCollection) | ||
Implements IGeoJsonGeometry | ||
|
||
<JsonProperty(PropertyName:="geometries")> | ||
Public Property Geometries As New List(Of IGeoJsonGeometry) | ||
|
||
<JsonIgnore> | ||
Public Overrides ReadOnly Property Coordinates() | ||
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Partial Public Class GeometryCollection | ||
Public Overrides Sub CreateFromDbGeometry(inp As Entity.Spatial.DbGeometry) | ||
If inp.SpatialTypeName <> "GeometryCollection" Then Throw New ArgumentException | ||
Geometries.Clear() | ||
|
||
For i As Integer = 1 To inp.ElementCount | ||
Dim element = inp.ElementAt(i) | ||
Select Case element.SpatialTypeName | ||
Case "MultiPolygon" | ||
Geometries.Add(MultiPolygon.FromDbGeometry(element)) | ||
Case "Polygon" | ||
Geometries.Add(Polygon.FromDbGeometry(element)) | ||
Case "Point" | ||
Geometries.Add(Point.FromDbGeometry(element)) | ||
Case "MultiPoint" | ||
Geometries.Add(MultiPoint.FromDbGeometry(element)) | ||
Case Else | ||
Throw New NotImplementedException | ||
End Select | ||
Next | ||
End Sub | ||
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Public Class LineString | ||
Inherits GeoJsonGeometry(Of LineString) | ||
Implements IGeoJsonGeometry | ||
|
||
<Newtonsoft.Json.JsonIgnore()> | ||
Public Property Points As New CoordinateList | ||
|
||
Public Overrides ReadOnly Property Coordinates() | ||
Get | ||
Try | ||
If Points.Count = 0 Then | ||
Return New Double() {} | ||
ElseIf Points.Count = 1 Then | ||
Throw New Exception("There must be an array of two or more points") | ||
Else | ||
Dim out()() As Double | ||
out = New Double(Points.Count - 1)() {} | ||
Parallel.For(0, Points.Count, Sub(i) | ||
out(i) = Points(i).Coordinate | ||
End Sub) | ||
Return out | ||
End If | ||
Catch ex As Exception | ||
Return New Double() {} | ||
End Try | ||
End Get | ||
End Property | ||
|
||
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Partial Class LineString | ||
Public Overrides Sub CreateFromDbGeometry(inp As Entity.Spatial.DbGeometry) | ||
If inp.SpatialTypeName <> MyBase.TypeName Then Throw New ArgumentException | ||
Points.Clear() | ||
|
||
For i As Integer = 1 To inp.PointCount | ||
Dim point = inp.PointAt(i) | ||
Points.AddNew(point.XCoordinate, point.YCoordinate) | ||
Next | ||
End Sub | ||
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Public Class MultiLineString | ||
Inherits GeoJsonGeometry(Of MultiLineString) | ||
Implements IGeoJsonGeometry | ||
|
||
<JsonIgnore()> | ||
Public Property LineStrings As New List(Of LineString) | ||
|
||
Public Overrides ReadOnly Property Coordinates As Object | ||
Get | ||
Return (From ls In LineStrings Let c = ls.Coordinates Select c).ToArray | ||
End Get | ||
End Property | ||
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Partial Class MultiLineString | ||
Public Overrides Sub CreateFromDbGeometry(inp As Entity.Spatial.DbGeometry) | ||
If inp.SpatialTypeName <> MyBase.TypeName Then Throw New ArgumentException | ||
LineStrings.Clear() | ||
|
||
For i As Integer = 1 To inp.ElementCount | ||
Dim element = inp.ElementAt(i) | ||
If element.SpatialTypeName <> "LineString" Then Throw New ArgumentException | ||
LineStrings.Add(LineString.FromDbGeometry(element)) | ||
Next | ||
End Sub | ||
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,28 @@ | ||
Partial Class Polygon | ||
Private Function RingToCoordinateList(ring As Entity.Spatial.DbGeometry) As CoordinateList | ||
Dim extRingCoords As New CoordinateList() | ||
For i = 1 To ring.PointCount | ||
Dim pt = ring.PointAt(i) | ||
extRingCoords.Add(New Coordinate(pt.XCoordinate, pt.YCoordinate)) | ||
Next | ||
Return extRingCoords | ||
End Function | ||
|
||
Public Overrides Sub CreateFromDbGeometry(inp As Entity.Spatial.DbGeometry) | ||
If inp.SpatialTypeName <> MyBase.TypeName Then Throw New ArgumentException | ||
Points.Clear() | ||
Rings.Clear() | ||
|
||
For i As Integer = 1 To inp.PointCount | ||
Dim point = inp.PointAt(i) | ||
Points.AddNew(point.XCoordinate, point.YCoordinate) | ||
Next | ||
' Process exterior ring | ||
Dim extRing = inp.ExteriorRing | ||
Rings.Add(RingToCoordinateList(extRing)) | ||
|
||
' Process interior rings (ie. holes) | ||
If inp.InteriorRingCount > 0 Then | ||
For i = 1 To inp.InteriorRingCount | ||
Dim intRing = inp.InteriorRingAt(i) | ||
Rings.Add(RingToCoordinateList(intRing)) | ||
Next | ||
End If | ||
End Sub | ||
|
||
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.