Last active
August 26, 2017 15:54
-
-
Save airbreather/6d7421c95896d821e32f6c7aa46ef484 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| using System; | |
| using NetTopologySuite.Features; | |
| using NetTopologySuite.IO; | |
| using Newtonsoft.Json.Linq; | |
| namespace Sample | |
| { | |
| internal static class Program | |
| { | |
| private static void Main(string[] args) | |
| { | |
| const string geojsonFeature = @" | |
| { | |
| ""type"": ""Feature"", | |
| ""geometry"": { | |
| ""type"": ""Point"", | |
| ""coordinates"": [125.6, 10.1] | |
| }, | |
| ""properties"": { | |
| ""name"": ""Dinagat Islands"" | |
| } | |
| }"; | |
| var f = new GeoJsonReader().Read<Feature>(geojsonFeature); | |
| Console.WriteLine(f.Geometry); | |
| const string arbitraryJson = @" | |
| { | |
| ""someArbitraryString"": ""foo"" | |
| }"; | |
| var x = JObject.Parse(arbitraryJson); | |
| Console.WriteLine(x.GetValue("someArbitraryString")); | |
| } | |
| } | |
| } |
This file contains hidden or 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
| <Project Sdk="Microsoft.NET.Sdk"> | |
| <PropertyGroup> | |
| <OutputType>Exe</OutputType> | |
| <TargetFramework>netcoreapp1.1</TargetFramework> | |
| </PropertyGroup> | |
| <ItemGroup> | |
| <PackageReference Include="NetTopologySuite.IO.GeoJSON" Version="1.15.0-pre015" /> | |
| <PackageReference Include="Newtonsoft.Json" Version="10.0.3" /> | |
| </ItemGroup> | |
| </Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment