Skip to content

Commit ef877af

Browse files
committed
2.2.0
-some cleanup -web site update
1 parent 1f54705 commit ef877af

File tree

6 files changed

+688
-4
lines changed

6 files changed

+688
-4
lines changed

GeoJSON4EntityFramework/GeoJSON4EntityFramework.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<authors>Sukru Alatas</authors>
88
<owners>Sukru Alatas</owners>
99
<licenseUrl>https://raw.githubusercontent.com/alatas/GeoJSON4EntityFramework/master/LICENSE</licenseUrl>
10-
<projectUrl>https://github.com/alatas/GeoJSON4EntityFramework</projectUrl>
10+
<projectUrl>https://alatas.github.io/GeoJSON4EntityFramework/</projectUrl>
1111
<iconUrl>https://raw.githubusercontent.com/alatas/GeoJSON4EntityFramework/master/geojson.png</iconUrl>
1212
<requireLicenseAcceptance>true</requireLicenseAcceptance>
1313
<description>
@@ -28,7 +28,7 @@
2828
2.2.0
2929
-added WKT support
3030
-added geometry transform (thanks to @jumpinjackie)
31-
-added quick start example projects to source
31+
-added quick start and example projects
3232
-reorganized whole code base and unit tests (this means lots of deletions)
3333
-fixed some minor bugs
3434
</releaseNotes>

GeoJSON4EntityFramework5/GeoJSON4EntityFramework5.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<authors>Sukru Alatas</authors>
88
<owners>Sukru Alatas</owners>
99
<licenseUrl>https://raw.githubusercontent.com/alatas/GeoJSON4EntityFramework/master/LICENSE</licenseUrl>
10-
<projectUrl>https://github.com/alatas/GeoJSON4EntityFramework</projectUrl>
10+
<projectUrl>https://alatas.github.io/GeoJSON4EntityFramework/</projectUrl>
1111
<iconUrl>https://raw.githubusercontent.com/alatas/GeoJSON4EntityFramework/master/geojson.png</iconUrl>
1212
<requireLicenseAcceptance>true</requireLicenseAcceptance>
1313
<description>
@@ -28,7 +28,7 @@
2828
2.2.0
2929
-added WKT support
3030
-added geometry transform (thanks to @jumpinjackie)
31-
-added quick start example projects to source
31+
-added quick start and example projects
3232
-reorganized whole code base and unit tests (this means lots of deletions)
3333
-fixed some minor bugs
3434
</releaseNotes>

docs/_config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
title: GeoJSON4EntityFramework
2+
description: Create GeoJSON from Entity Framework Spatial Data
3+
google_analytics:
4+
show_downloads: true
5+
theme: jekyll-theme-slate
6+
7+
gems:
8+
- jekyll-mentions

docs/index.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# GeoJSON4EntityFramework ![Logo](https://raw.githubusercontent.com/alatas/GeoJSON4EntityFramework/master/geojson.png) ![BuildStatus](https://sukru.visualstudio.com/_apis/public/build/definitions/ef35124c-d2ad-4375-9c78-8862c095207b/1/badge)
2+
___
3+
4+
### What is GeoJSON?
5+
[GeoJSON](http://geojson.org/) is a format for encoding a variety of geographic data structures. A GeoJSON object may represent a geometry, a feature, or a collection of features.
6+
7+
In 2015, the Internet Engineering Task Force (IETF), in conjunction with the original specification authors, formed a GeoJSON WG to standardize GeoJSON. [RFC 7946](https://tools.ietf.org/html/rfc7946) was published in August 2016 and is the new standard specification of the GeoJSON format, replacing the 2008 GeoJSON specification.
8+
9+
GeoJSON supports _Point_, _LineString_, _Polygon_, _MultiPoint_, _MultiLineString_, _MultiPolygon_, and _GeometryCollection_ geometry types.
10+
11+
_Feature_ contain a geometry object and additional properties, and a _FeatureCollection_ represents a list of features.
12+
13+
For example, A house, a road and a bus stop represents three different _Feature_. All of them might have different type of geometries. House could be a _polygon_, road could be a _linestring_ and bus stop could be a _point_. All of them represents a neighbourhood and this called _FeatureCollection_ in GeoJSON.
14+
15+
### What is EntityFramework?
16+
EntityFramework (EF) is an open source object-relational mapping [(ORM)](https://en.wikipedia.org/wiki/Object-relational_mapping) framework for Microsoft .net. It allows us to use database rows as class instances.
17+
18+
### What is Well-known Text (WKT)?
19+
[Well-known Text (WKT)](https://en.wikipedia.org/wiki/Well-known_text) is a text markup language for representing vector geometry objects on a map, spatial reference systems of spatial objects and transformations between spatial reference systems. In summary, It's a text representations of geometrical objects.
20+
21+
### So, What is GeoJSON4EntityFramework ??
22+
_GeoJSON for EntityFramework_ is a .net library that allows you to create GeoJSON output from EntityFramework Spatial Data or WKT inputs. In other words, It serializes different type of geometry objects to GeoJSON. It's not limited to only EF entities but It can serialize WKT inputs as well.
23+
24+
### Features
25+
- [x] Supports Entity Framework v6 (System.Data.Entity.Spatial namespace) and Entity Framework v5 (System.Data.Spatial namespace) objects
26+
- [x] Supports Well-known Text inputs
27+
- [x] Supports DbGeometry (*planar*) and DbGeography (*geodetic "round earth"*) objects
28+
- [x] Supports all types of features defined in geojson specs ([RFC 7946](https://tools.ietf.org/html/rfc7946))
29+
- [x] Supports boundingbox property defined in geojson specs ([RFC 7946](https://tools.ietf.org/html/rfc7946))
30+
- [x] Supports geometry transform
31+
32+
---
33+
34+
### Quick Start
35+
36+
#### EntityFramework Example
37+
38+
**Visual Basic**
39+
40+
```vbnet
41+
Imports alatas.GeoJSON4EntityFramework
42+
43+
Function GetGeoJSONFromDB() As String
44+
Using db As New SpatialExampleEntities
45+
Dim data = From row In db.SampleTables Select row.SpatialData
46+
47+
Dim features as New FeatureCollection(data.ToArray)
48+
Return features.Serialize(prettyPrint:=True)
49+
End Using
50+
End Function
51+
```
52+
53+
**C#**
54+
55+
```csharp
56+
using alatas.GeoJSON4EntityFramework;
57+
58+
public string GetGeoJSONFromDB()
59+
{
60+
using (Entities db = new Entities())
61+
{
62+
63+
DbGeometry[] data = (from row in db.SampleTables select row.SpatialData).ToArray();
64+
65+
FeatureCollection features = new FeatureCollection(data);
66+
return features.Serialize(prettyPrint: true);
67+
}
68+
}
69+
```
70+
71+
#### Well-Known Text (WKT) Example
72+
73+
**Visual Basic**
74+
75+
```vbnet
76+
Imports alatas.GeoJSON4EntityFramework
77+
78+
Function GetGeoJSONFromWKT() As String
79+
Dim WKTs = {"POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))",
80+
"MULTIPOINT ((10 40), (40 30), (20 20), (30 10))",
81+
"LINESTRING (1 1, 2 2)"}
82+
83+
Dim features as New FeatureCollection(WKTs)
84+
Return features.Serialize(prettyPrint:=True)
85+
End Function
86+
```
87+
88+
**C#**
89+
90+
```csharp
91+
using alatas.GeoJSON4EntityFramework;
92+
93+
public string GetGeoJSONFromWKT()
94+
{
95+
string[] WKTs = {
96+
"POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))",
97+
"MULTIPOINT ((10 40), (40 30), (20 20), (30 10))",
98+
"LINESTRING (1 1, 2 2)"
99+
};
100+
101+
FeatureCollection features = new FeatureCollection(WKTs);
102+
return features.Serialize(prettyPrint: true);
103+
}
104+
```
105+
106+
---
107+
108+
### Install
109+
110+
#### Install with Package Manager Console - Nuget
111+
112+
To install GeoJSON for Entity Framework, run the following command in the Package Manager Console
113+
114+
**Entity Framework 6**
115+
116+
```powershell
117+
Install-Package GeoJSON4EntityFramework
118+
```
119+
120+
**Entity Framework 5**
121+
122+
```powershell
123+
Install-Package GeoJSON4EntityFramework5
124+
```
125+
126+
#### Manual Install
127+
Download the latest [release](https://github.com/alatas/GeoJSON4EntityFramework/releases) and add to your project references manually
128+
129+
### Prerequisites
130+
* Microsoft® System CLR Types for Microsoft® SQL Server® (x86/x64) [(SQLSysClrTypes.msi)](https://www.microsoft.com/en-us/download/details.aspx?id=49999)
131+
132+
### Tests and Validation
133+
You may validate outputs with http://geojson.io and http://geojsonlint.com
134+
___
135+
Test data extracted from OpenStreetMap®. OpenStreetMap® is open data, licensed under the [Open Data Commons Open Database License](http://opendatacommons.org/licenses/odbl/) (ODbL) by the OpenStreetMap Foundation (OSMF)

docs/stylesheets/github-light.css

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
/*
2+
Copyright 2014 GitHub Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
*/
17+
18+
.pl-c /* comment */ {
19+
color: #969896;
20+
}
21+
22+
.pl-c1 /* constant, markup.raw, meta.diff.header, meta.module-reference, meta.property-name, support, support.constant, support.variable, variable.other.constant */,
23+
.pl-s .pl-v /* string variable */ {
24+
color: #0086b3;
25+
}
26+
27+
.pl-e /* entity */,
28+
.pl-en /* entity.name */ {
29+
color: #795da3;
30+
}
31+
32+
.pl-s .pl-s1 /* string source */,
33+
.pl-smi /* storage.modifier.import, storage.modifier.package, storage.type.java, variable.other, variable.parameter.function */ {
34+
color: #333;
35+
}
36+
37+
.pl-ent /* entity.name.tag */ {
38+
color: #63a35c;
39+
}
40+
41+
.pl-k /* keyword, storage, storage.type */ {
42+
color: #a71d5d;
43+
}
44+
45+
.pl-pds /* punctuation.definition.string, string.regexp.character-class */,
46+
.pl-s /* string */,
47+
.pl-s .pl-pse .pl-s1 /* string punctuation.section.embedded source */,
48+
.pl-sr /* string.regexp */,
49+
.pl-sr .pl-cce /* string.regexp constant.character.escape */,
50+
.pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */,
51+
.pl-sr .pl-sre /* string.regexp source.ruby.embedded */ {
52+
color: #183691;
53+
}
54+
55+
.pl-v /* variable */ {
56+
color: #ed6a43;
57+
}
58+
59+
.pl-id /* invalid.deprecated */ {
60+
color: #b52a1d;
61+
}
62+
63+
.pl-ii /* invalid.illegal */ {
64+
background-color: #b52a1d;
65+
color: #f8f8f8;
66+
}
67+
68+
.pl-sr .pl-cce /* string.regexp constant.character.escape */ {
69+
color: #63a35c;
70+
font-weight: bold;
71+
}
72+
73+
.pl-ml /* markup.list */ {
74+
color: #693a17;
75+
}
76+
77+
.pl-mh /* markup.heading */,
78+
.pl-mh .pl-en /* markup.heading entity.name */,
79+
.pl-ms /* meta.separator */ {
80+
color: #1d3e81;
81+
font-weight: bold;
82+
}
83+
84+
.pl-mq /* markup.quote */ {
85+
color: #008080;
86+
}
87+
88+
.pl-mi /* markup.italic */ {
89+
color: #333;
90+
font-style: italic;
91+
}
92+
93+
.pl-mb /* markup.bold */ {
94+
color: #333;
95+
font-weight: bold;
96+
}
97+
98+
.pl-md /* markup.deleted, meta.diff.header.from-file */ {
99+
background-color: #ffecec;
100+
color: #bd2c00;
101+
}
102+
103+
.pl-mi1 /* markup.inserted, meta.diff.header.to-file */ {
104+
background-color: #eaffea;
105+
color: #55a532;
106+
}
107+
108+
.pl-mdr /* meta.diff.range */ {
109+
color: #795da3;
110+
font-weight: bold;
111+
}
112+
113+
.pl-mo /* meta.output */ {
114+
color: #1d3e81;
115+
}
116+

0 commit comments

Comments
 (0)