Code Monkey home page Code Monkey logo

nettopologysuite's Introduction

NetTopologySuite

Gitter

A .NET GIS solution that is fast and reliable for the .NET platform. NetTopologySuite is a direct-port of all the functionalities offered by JTS Topology Suite: NTS expose JTS in a '.NET way', as example using Properties, Indexers etc...

An excerpt from JTS website explains the capabilities of NTS too: "The JTS Topology Suite is an API for modelling and manipulating 2-dimensional linear geometry. It provides numerous geometric predicates and functions. JTS conforms to the Simple Features Specification for SQL published by the Open GIS Consortium."

Enjoy using them!

Documentation

A documentation of the NetTopologySuite API based on code xml comments is accessible on github-pages.
To get you started, we have set up an introductory Getting Started page. A list of known issues is available, too.

Upgrading to 2.x from 1.x

A wiki page has been started to try to document the breaking changes in 2.0 when coming from 1.x.

Install with NuGet package manager

Stable NuGet Status Build Status

Stable releases are hosted on the default NuGet feed. You can install them using the following command on the package manager command line

PM> Install-Package NetTopologySuite

Pre release MyGet PreRelease Status Build Status

Pre-Release versions of NetTopologySuite are hosted on MyGet. The sources for the NetTopologySuite feed are as follows:

Version URL
NuGet v3 https://www.myget.org/F/nettopologysuite/api/v3/index.json
NuGet v2 https://www.myget.org/F/nettopologysuite/api/v2

You can install the latest pre-release package using the following command on the package manager command line

PM> Install-Package NetTopologySuite -pre -source "<Nuget v3 or NuGet v2 source>"

nettopologysuite's People

Contributors

airbreather avatar alex2512 avatar alison-97 avatar amit909singh avatar asgerpetersen avatar bjornharrtell avatar bradh avatar bricelam avatar daniellivesey90 avatar dguidi avatar falooc avatar fobermaier avatar giovani-luigi avatar inforithmics avatar jaundice avatar kellybnd avatar kristofdegrave avatar literacyfanatic avatar m1dst avatar mehrandvd avatar peetw avatar petlof avatar roji avatar skibisky avatar stoolrossa avatar thompson-tomo avatar waffle-iron avatar xivk avatar yaevh avatar zgabi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nettopologysuite's Issues

NetTopologySuite.IO.GeoJSON nuget package broken

Hi, there is an error in NTS.IO.GeoJSON.nuspec file for this package as it requires Newtonsoft.Json version 6.03 rather than 6.0.3 . As a result this package cannot be installed. Could that be fixed please?

<dependency id="Newtonsoft.Json" version="[6.03]" />

Thanks,
Pavel

GMLWriter output not valid??

Hi, I'm trying to create a really simple GML file using NTS and it is failing to open in QGIS.

I'm using this code:

        var gmlOut = new NetTopologySuite.IO.GML2.GMLWriter();        
        var stream = new FileStream(@"D:\temp\test.gml", FileMode.CreateNew);
        var geom = new NetTopologySuite.Geometries.Point(52, -0.9);
        gmlOut.Write(geom, stream);

and I get this output:

<gml:GML xmlns:gml="http://www.opengis.net/gml">gml:Pointgml:coordgml:X52/gml:Xgml:Y-0.9/gml:Y/gml:coord/gml:Point/gml:GML

Looks simple enough, but its not opening in QGIS, and if I try the OGC validator I get this message.

cvc-elt.1: Cannot find the declaration of element 'gml:GML'.

do I need to create a schema or something to go with the file? How do I do that?

Thanks

STRtree Remove issue.

Personally I found a problem removing element from STRtree.
With this simple code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GeoAPI.Geometries;
using NetTopologySuite.Index.Strtree;

namespace TestNTSTree
{
class Program
{
static void Main(string[] args)
{
STRtree tree = new STRtree();
tree.Insert(new Envelope(0, 10, 0, 10), "1");
tree.Insert(new Envelope(5, 15, 5, 15), "2");
tree.Insert(new Envelope(10, 20, 10, 20), "3");
tree.Insert(new Envelope(15, 25, 15, 25), "4");
tree.Remove(new Envelope(10, 20, 10, 20), "4");
}
}
}

I've an "{"Object reference not set to an instance of an object."}" exception on this stacktrace:

at NetTopologySuite.Index.Strtree.AbstractSTRtree2.Remove(T searchBounds, TItem item) at NetTopologySuite.Index.Strtree.STRtree1.Remove(Envelope itemEnv, TItem item)
at TestNTSTree.Program.Main(String[] args) in >c:_tfs\AIS\Incubator\TerstDotSpatialTree\TestNTSTree\Program.cs:line 20
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, >ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, >ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, >ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

I found a really boring issue too: meanwhie you are debugging the code, check the tree imply that the tree is built, hence you cannot insert or remove any item more.

Use latest ProjNet4 version

I was trying to create a coordinate system from a WKT string like that (in Resources as CS_4362_WGS84):

GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.01745329251994328,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]]

Using that code:
ICoordinateSystem cs = new CoordinateSystemFactory().CreateFromWkt(Resources.CS_4362_WGS84);

It fails with this error:

Error: 'G' is not recognized.
System.ArgumentException: 'G' is not recognized.
   bei ProjNet.Converters.WellKnownText.CoordinateSystemWktReader.Parse(String wkt)
   bei ProjNet.CoordinateSystems.CoordinateSystemFactory.CreateFromWkt(String WKT)

Then I used the latest version of ProjNet4GeoAPI @https://github.com/NetTopologySuite/ProjNet4GeoAPI and GeoAPI.
The result was no error - as expected.

So could you please use the latest ProjNet4 version in the main NetTopologySuite project?

Polygonizer

The newly added functionality to extract only polygons forming a valid polygonal geometry using the Polygonizer does not work.

See NetTopologySuite.Tests.NUnit.Operation.Polygonize

  • TestPolygonal1
  • TestPolygonal2

NTS-DotSpatial GeometryConverter build problem

Hello,

Thank you for providing conversation utility classes. This is very useful.

Actually there is a build problem which probably occurs due to DotSpatial.Data recent changes.

Error 1 Property or indexer 'DotSpatial.Data.ShapeRange.Parts' cannot be assigned to -- it is read only => GeometryConverterToDotSpatial.cs 422 13 NTS2DotSpatial

It seems setter of Parts property in DSShapeRange class is private.

/// <summary>
/// If this is null, then there is only one part for this ShapeIndex.
/// 
/// </summary>
public List<PartRange> Parts { get; private set; }

Thank you

GetPointCoordinate is dropping the Z value

In \NetTopologySuite.IO\NetTopologySuite.IO.GeoJSON\Converters\GeometryConverter.cs
private static Coordinate GetPointCoordinate(IList list)
{
var c = new Coordinate();
c.X = Convert.ToDouble(list[0]);
c.Y = Convert.ToDouble(list[1]);
return c;
}

Should be?
private static Coordinate GetPointCoordinate(IList list)
{
var c = new Coordinate();
c.X = Convert.ToDouble(list[0]);
c.Y = Convert.ToDouble(list[1]);
if (list.Count > 2)
{
c.Z = Convert.ToDouble(list[2]);
}
return c;
}

GeometryFactory.CreateGeometry does not process coordinates

GeometryFactory.CreateGeometry(IGeometry g) doc says:
"This is a convenient way to change the CoordinateSequence used to represent a geometry, or to change the factory used for a geometry."

I tried this code:

var g = // some sample polygon
var gf = new GeometryFactory(new PrecisionModel(1000));
var gscaled = gf.CreateGeometry(g); // issue: does not process coordinates

gscaled has the PrecisionModel attached but its coordinates are not changed. Debugging showed that PrecisionModel.MakePrecise() is never called.

Problem with create a new DBF-file with DBaseFileWriter

When using DBaseFileWrite to create a new DBF-file with NTS 1.13.4 some problems have occured that did not exist in earlier versions of NTS.

One problem is that I'm not able at all to create a DBF-file at all since the ValidateDataPath is set to true and the file that I'm trying to create of course does not exist.

Is it something wrong here:
https://github.com/NetTopologySuite/NetTopologySuite/blob/master/NetTopologySuite.IO/NetTopologySuite.IO.GeoTools/Dbase/DbaseFileWriter.cs#L38

Shouldn't third parameter be false since the file does not exist when trying to create it?

Moved from GeoAPI
NetTopologySuite/GeoAPI#10

UnitTests PCL failures

I see two kind of problems

  1. There are some unit tests that fails in PCL but look ok in default builds
  2. UnitTestsPCL msbuild command doesn't compile

Error in difference between two polygons

copied from GoogleCode Issue 193
What steps will reproduce the problem?

var precisionModel = new GeometryFactory(new PrecisionModel(100));
var reader = new WKTReader(precisionModel);
var p1 = reader.Read(@"POLYGON ((504927.9 6228865.64, 504969.88 6228833.89, 504980.82 6228861.76, 504927.9 6228865.64))");
var p2 = reader.Read(@"POLYGON ((504927.9 6228865.64, 504951.14 6228848.06, 504957.42 6228863.47, 504927.9 6228865.64))");
var test = p1.Difference(p2);

What is the expected output? What do you see instead?
The two polygons share a vertex (504927.9 6228865.64) at the left tip of the triangle, and when creating the difference this point does not get removed, leaving a strange "tail" on the resulting polygon. Expected to get only the blue(ish) colored polygon as a result
See the image atached.

What version of the product are you using? On what operating system?
It seems to be the same problem with verison 13.1 and 13.2
Its tested on Windows 7 x64 and .NET framework 4.5.1

Add support for CircularString (GeoAPI.Geometries.OgcGeometryType.CircularString)

Hi!

Currently NTS does not currently have support for the CircularString geometry, and I do not know if this is planned. This geometry is available in SQL Server 2012 and 2014. To be able to implement support for this in NHibernate.Spatial (which I contribute to) it is necessary that this geometry is supported in NetTopologySuite/GeoAPI.

I would be happy to help out, however I am not very familiar with the NTS/GeoAPI code yet so I will need some time to fork and poke around.

NTS.IO.GeoJSON.nuspec limits Newtonsoft.Json to the major release number of latest release

https://github.com/NetTopologySuite/NetTopologySuite/blob/master/NTS.IO.GeoJSON.nuspec includes the line <dependency id="Newtonsoft.Json" version="[6.0,7.0)" /> ...which itself has a type on the array.

The latest version of Newtonsoft.Json is 7.0.1 so this package won't work with it. I assume that the author didn't intend to limit the upper version, could it be changed to <dependency id="Newtonsoft.Json" version="6.0" /> i.e. greater than or equal to 6.0, please ?

WpfGeometryReader Creates Self-Intersecting Polygons

Not sure how high a priority NetTopologySuite.Windows.Media is to you guys, or even how complete it's supposed to be at this point considering that it doesn't go out to NuGet, but I was browsing the code and was interested to see how NTS handled the problem of creating topologically valid geometries when PathFigure.FillRule is EvenOdd.

Turns out it doesn't, and so WpfGeometryReader can easily create self-intersecting polygons which are not topologically valid.

When working on something similar for our application (JTS using J#, not NTS, sorry), I stumbled upon this post (gist) that happened to solve the fundamental problem on the JTS side. Porting the Java to C# and optimizing it a little, this seemed to work as expected (at least on this sample, where the LINESTRING is the screen coordinates of a particularly complex figure I drew with a prototype version of our lasso tool).

Obviously, if FillRule was NonZero, then the solution would be much simpler: just combine all the polygons from the Polygonizer.

Hope this helps. Feel free to close this if that assembly isn't something anyone's supposed to bother looking at right now.

Update: realized I didn't post a link to this, which was what started me on "how do I apply the Even/Odd rule to the output of Polygonizer?".

Intersection bug (found non-noded intersection between LINESTRING(..) and LINESTRING(..))

I'm doing intersection between two polygons, and in some instances I get the follwing error:
found non-noded intersection between LINESTRING...

An example of two polygons where intersection fails:

    static void Main(string[] args)
    {
        const string poly1Wkt = @"POLYGON ((447659.00088514 6232828.85568136, 447661.310889315 6232661.0118306, 447663.82381757 6232509.2309641, 447665.32016632 6232369.69959036, 447666.70195289 6232269.29960783, 447666.690152371 6232241.95127252, 447667.52798224 6232163.8253994, 447667.52798224 6232118.3170907, 447800.87791023 6232122.0212554, 447968.701300134 6232125.715481, 447968.63178764 6232132.83738432, 447962.290733373 6232134.33707906, 447957.64007719 6232141.30566063, 447959.97365113 6232150.62376395, 447968.37098475 6232156.30237139, 447968.345104083 6232160.45717706, 447967.56532022 6232193.9878832, 447967.550605288 6232195.33279361, 447966.94138956 6232218.80988487, 447963.840952101 6232227.33814896, 447966.94138956 6232234.30673053, 447966.941389556 6232251.01368731, 447966.179482514 6232320.65020981, 447961.523869854 6232327.30780043, 447966.049959616 6232332.48829994, 447963.998814869 6232519.95813469, 447961.523869854 6232524.9275755, 447961.523869854 6232528.79678793, 447963.87887844 6232530.92004396, 447962.832244316 6232626.57995612, 447960.311730742 6232628.08657778, 447958.761512014 6232637.42467704, 447961.870195314 6232645.17309987, 447961.870195314 6232714.50898591, 447961.74449003 6232725.998155, 447961.74449003 6232728.1148205, 447961.870195314 6232732.28578422, 447961.870195314 6232738.17416977, 447958.761512014 6232744.37290803, 447957.21129329 6232751.35148756, 447959.55311307 6232756.00054126, 447962.52161701 6232759.55981678, 447962.480387792 6232764.70876873, 447962.480387792 6232764.75875855, 447962.480387792 6232764.81874634, 447962.474320096 6232767.11412815, 447962.47214195 6232767.65816838, 447962.43915857 6232769.02788958, 447962.43091273 6232770.94749885, 447962.404854601 6232773.89637429, 447960.181600783 6232833.47957667, 447880.43723736 6232832.74052964, 447659.00088514 6232828.85568136), (447793.6459701 6232302.2387078, 447794.35152527 6232308.2359268, 447797.87930115 6232318.4664768, 447800.70152185 6232328.3442493, 447801.40707702 6232338.9275769, 447804.93485289 6232344.9247959, 447810.2265167 6232345.9831286, 447816.92929086 6232345.2775735, 447818.34040121 6232338.2220217, 447817.63484603 6232335.399801, 447818.6931788 6232327.2859165, 447814.81262534 6232313.5275906, 447813.40151499 6232309.9998147, 447810.2265167 6232302.2387078, 447808.10985118 6232294.4776009, 447802.11263219 6232290.949825, 447796.11541321 6232293.4192681, 447793.6459701 6232302.2387078), (447811.637626875 6232500.8524926, 447811.284849291 6232518.49137189, 447817.63484586 6232530.8385875, 447827.51261831 6232528.0163668, 447827.86539589 6232514.2580409, 447829.27650624 6232500.499715, 447829.100117447 6232492.38583046, 447826.80706313 6232485.68305626, 447817.28206827 6232483.5663908, 447811.63762688 6232490.2691649, 447811.99040447 6232491.3274977, 447811.637626875 6232500.8524926), (447840.91816652 6232640.9051964, 447842.32927687 6232647.9607481, 447849.03205103 6232658.1912981, 447852.5598269 6232673.713512, 447857.85149071 6232678.6523982, 447866.3181528 6232676.1829551, 447868.08204074 6232666.6579602, 447865.61259763 6232653.6051895, 447857.49871312 6232643.0218619, 447850.79593896 6232637.3774205, 447844.09316481 6232637.3774205, 447840.91816652 6232640.9051964))";

        const string poly2Wkt = @"POLYGON ((447961.82530680706 6232833.4948004484, 448204.281525929 6232835.23441344, 448204.57013048 6232775.91648743, 448204.941193473 6232595.93312252, 448206.903704415 6232553.43177355, 448208.940427957 6232208.61196062, 448207.43143845 6232131.64762649, 448207.151079744 6232127.09855244, 448200.570895996 6232127.09855244, 448072.32327966 6232124.77902458, 447968.969867253 6232125.72883125, 447968.63178764074 6232132.8373842416, 447968.76372115 6232119.32013572, 447968.49160828 6232114.25116749, 447701.12010698 6232110.07201814, 447668.35112175 6232109.56212193, 447380.24956789 6232105.06303771, 447288.81964634 6232103.63332872, 447125.30264852 6232100.09980099, 447113.48001323 6232100.09404913, 447102.356369275 6232097.76092161, 447091.23272532 6232092.60557339, 447090.92762908 6232096.15485094, 447088.61879267 6232193.83496844, 447093.075671513 6232288.55415544, 447097.532550355 6232374.80668035, 447105.51720507 6232525.97028132, 447106.44630804 6232553.66172674, 447106.444782067 6232576.42223989, 447105.73770092 6232602.71052892, 447102.912428275 6232651.7593311, 447102.906324384 6232658.84031794, 447127.881994617 6232662.53951074, 447240.346506496 6232681.76091738, 447312.562513589 6232699.76918549, 447323.747998083 6232738.59133125, 447328.24808055 6232761.29641657, 447313.345395715 6232783.64872429, 447287.773357094 6232832.58667079, 447287.429252421 6232838.7403911, 447341.014874881 6232839.19923826, 447387.106122124 6232836.75807906, 447477.148010195 6232835.54733156, 447582.712112107 6232835.04213924, 447687.92343643 6232834.36055812, 447701.01800881 6232837.90032102, 447751.48610462 6232836.49520419, 447790.31254005 6232832.97342183, 447962.34988663 6232835.08226668, 447962.3493503 6232833.49856044, 447961.82530680706 6232833.4948004484), (447964.739749129 6232531.69619776, 447964.640798997 6232541.6941627, 447964.640798997 6232541.74415253, 447964.640798997 6232541.82413625, 447964.59956982225 6232545.5433750348, 447964.739749129 6232531.69619776), (447964.739749129 6232531.69619776, 447961.52386985 6232528.79678793, 447961.52386985 6232524.9275755, 447964.87992848 6232518.18894712, 447964.9211577 6232514.59967771, 447966.67752254 6232333.20659975, 447961.52386985 6232327.30780043, 447966.80945605 6232319.74933893, 447966.94138956 6232306.28208015, 447966.94138956 6232234.30673053, 447963.8409521 6232227.33814896, 447966.94138956 6232218.80988487, 447968.310199709 6232166.0606218679, 447968.310199709 6232223.21898741, 447971.410637165 6232225.54851324, 447971.410637165 6232229.8076463, 447969.860418437 6232232.90701544, 447967.642286321 6232235.12656365, 447967.634040477 6232235.81642323, 447967.634040477 6232235.85641509, 447967.551582034 6232243.58484199, 447965.861183953 6232518.31892067, 447969.340930246 6232519.4786846, 447972.820676539 6232524.90757957, 447970.091302077 6232529.55663326, 447964.113064963 6232530.32647656, 447964.154294184 6232531.16630562, 447964.739749129 6232531.69619776), (447962.480387792 6232764.81874634, 447962.472141948 6232767.9381114, 447962.463896103 6232768.64796691, 447962.340208439 6232781.45536001, 447962.340208439 6232781.53534373, 447962.33547563286 6232781.7476666747, 447962.43091273 6232770.94749885, 447962.43915857 6232769.02788958, 447962.47214195 6232767.65816838, 447962.480387792 6232764.81874634), (447964.162540028 6232591.7239794973, 447964.162540028 6232592.05391212, 447963.840952101 6232626.596881, 447968.920392187 6232633.57546053, 447968.161774512 6232642.21370224, 447962.900925851 6232646.97273355, 447962.752500654 6232738.90402121, 447969.29145518 6232744.51287954, 447966.990864622 6232752.65122301, 447962.950400917 6232757.84016681, 447962.480387792 6232764.70876873, 447962.52161701 6232759.55981678, 447959.55311307 6232756.00054126, 447957.21129329 6232751.35148756, 447958.76151201 6232744.37290803, 447961.87019531 6232738.17416977, 447961.87019531 6232645.17309987, 447958.76151201 6232637.42467704, 447960.31173074 6232628.08657778, 447963.8409521 6232625.97700718, 447964.162540028 6232591.7239794973), (447968.37098474993 6232156.3023713976, 447968.400903996 6232156.33260194, 447968.310199712 6232166.06062151, 447968.37098474993 6232156.3023713976), (447968.631787637 6232132.8373843208, 447968.631787637 6232132.85738025, 447968.631787637 6232132.87737618, 447973.34016473 6232133.31728664, 447978.741192744 6232143.00531467, 447975.673738666 6232150.87371308, 447968.359674775 6232153.07326536, 447968.351428931 6232156.28261211, 447968.37098472653 6232156.3023713743, 447959.97365113 6232150.62376395, 447957.64007719 6232141.30566063, 447962.29073337 6232134.33707906, 447968.631787637 6232132.8373843208), (447407.00173461 6232812.0023283, 447414.93923033 6232807.2398309, 447428.16838985 6232807.2398309, 447431.34338814 6232817.2939922, 447427.992001057 6232819.41065768, 447410.882288075 6232819.76343526, 447407.00173461 6232812.0023283))";

        IGeometryFactory factory = GeometryFactory.Default;
        WKTReader reader = new WKTReader(factory);

        IGeometry poly1 = reader.Read(poly1Wkt);
        Assert.IsTrue(poly1.IsValid);
        Assert.IsTrue(poly1 is IPolygon);

        IGeometry poly2 = reader.Read(poly2Wkt);
        Assert.IsTrue(poly2.IsValid);
        Assert.IsTrue(poly2 is IPolygon);

        var intersection = poly1.Intersection(poly2);

        var intersectionWKT = intersection.AsText();

    }

The full error:

found non-noded intersection between LINESTRING(447968.351428931 6232156.28261211, 447968.37098472641 6232156.3023713743) and LINESTRING(447968.37098472653 6232156.3023713743, 447959.97365113 6232150.62376395) [ (447968.37098472618, 6232156.3023713743, NaN) ]
at NetTopologySuite.Operation.Overlay.Snap.SnapIfNeededOverlayOp.GetResultGeometry(SpatialFunction opCode)
at NetTopologySuite.Operation.Overlay.Snap.SnapIfNeededOverlayOp.Overlay(IGeometry g0, IGeometry g1, SpatialFunction opCode)
at NetTopologySuite.Geometries.Geometry.Intersection(IGeometry other)
at NtsTestProjekt.Program.Main(String[] args)

Image of the polygons (red circle marks where the linestrings are):
poly1

Linestrings:
linestrings1

I've tried the same instersection example with GeoServer WPS and Qgis, which uses JTS and a port of JTS, and in both instances the intersection did not fail.

Versions:
.NET framework v4.5
NetTopologySuite v1.13.3.0
GeoAPI v1.7.3.0

WriteDummyDBF in WriteGeometryCollection Method

Having some problems with my DBF-file is getting it's header overwritten when writing the collection of shapes to disk.
Found that it's actually a line in the WriteGeometryCollection-method that overwrites my DBF-file that I already have created.

I don't like this design since it's not clear for the one using NTS that the DBF-file needs to be written after the shape-file.
Shouldn't we add a check here and not create the DummyDbf (if it should be there at all) if the DBF-header of DbfWriter already have been written. Of if the DBF-file already exists.

https://github.com/NetTopologySuite/NetTopologySuite/blob/master/NetTopologySuite.IO/NetTopologySuite.IO.GeoTools/ShapefileWriter.cs#L188

https://github.com/NetTopologySuite/NetTopologySuite/blob/master/NetTopologySuite.IO/NetTopologySuite.IO.GeoTools/ShapefileWriter.cs#L204

ShapefileDataReader - default character encoding

I personally found that not all shapes files are well organized from point of view of the character encoding. Are so much different types of shape created by different tools and from different environments. In cases which I investigated I found that if no information about encoding then usually this is relayed to the environment where was created.

Some my examples shows that shape (dbf) files was related to the current language locale. So to read this files I would like to specify the default encoding for that file.

First I tried to change myself the "shapeFileDataReader.DbaseHeader.Encoding" but looks that value was always overwritten. Then I start to analyze the library code and I found that always Encoding is overwritten.

I would to specify for each file which default encoding to use in case of no encoding data found into descriptions.

I tried to modify myself the code and to see how it will work. I did some changes and looks Ok for my cases. Please looks at these changes and decide to include or not on GitHub repository and NuGet gallery.

So, my changes are:

        /// <summary>
        /// Initializes a new instance of the ShapefileDataReader class.
        /// </summary>
        /// <param name="filename">The shapefile to read (minus the .shp extension)</param>
        ///<param name="geometryFactory">The GeometryFactory to use.</param>
        ///<param name="defaultEncoding">Use specified encoding in case that no encoding found into dbf header or not attached .cpg file.</param>
        public ShapefileDataReader(string filename, IGeometryFactory geometryFactory, Encoding defaultEncoding = null)
        {
            if (String.IsNullOrEmpty(filename))
                throw new ArgumentNullException("filename");
            if (geometryFactory == null)
                throw new ArgumentNullException("geometryFactory");
            _open = true;

            string dbfFile = Path.ChangeExtension(filename, "dbf");
            _dbfReader = new DbaseFileReader(dbfFile, defaultEncoding);
            string shpFile = Path.ChangeExtension(filename, "shp");
...
    public partial class DbaseFileReader
    {
        private readonly Encoding _DEFAULT_ENCODING;
...
        public DbaseFileReader(string filename, Encoding defaultEncoding = null)
        {
            _DEFAULT_ENCODING = defaultEncoding;
...
        public DbaseFileHeader GetHeader()
        {
            if (_header == null)
            {
                FileStream stream = new FileStream(_filename, FileMode.Open, FileAccess.Read);
                BinaryReader dbfStream = new BinaryReader(stream);

                _header = (_DEFAULT_ENCODING != null) ? new DbaseFileHeader(_DEFAULT_ENCODING) : new DbaseFileHeader();
                // read the header
                _header.ReadHeader(dbfStream, _filename);

        private partial class DbaseFileEnumerator : IEnumerator, IDisposable
        {
...
            protected void ReadHeader()
            {
                _header = (_parent._DEFAULT_ENCODING != null) ? new DbaseFileHeader(_parent._DEFAULT_ENCODING) : null;
                // read the header
                _header.ReadHeader(_dbfStream, _parent._filename);
...
    public class DbaseFileHeader
    {
...
        private Encoding _encoding;
        private readonly Encoding _DEFAULT_ENCODING;
...
        public DbaseFileHeader(Encoding enc)
        {
            if (enc == null)
                throw new ArgumentNullException("enc");
            _encoding = enc;
            _DEFAULT_ENCODING = enc;
            _fieldDescriptions = new DbaseFieldDescriptor[0];
        }
...
        private Encoding DetectEncodingFromMark(byte lcid, string cpgFileName)
        {
            Encoding enc;
            if (lcid == 0 && _DEFAULT_ENCODING != null)
                return _DEFAULT_ENCODING;
...

I can pool these changes myself, but at this time I don't have any git client installed and because are relatively few changes I decide to describe the required changes here.

Regards,
Victor Scorpan.

GeoJSON Reader and FeatureCollection json

Hello,

I am having problem when I try to deserialize below FeatureCollection.

{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-2.537841796875,53.50111704294316],[-2.537841796875,54.226707764386695],[-1.0986328125,54.226707764386695],[-1.0986328125,53.50111704294316],[-2.537841796875,53.50111704294316]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-2.724609375,52.34205163638784],[-2.724609375,53.08082737207479],[-0.9667968749999999,53.08082737207479],[-0.9667968749999999,52.34205163638784],[-2.724609375,52.34205163638784]]]}}]}

According to http://geojsonlint.com/ the geoJSON is valid.

Here is the unit test:

    [Test]
    public void NtsFeatureCollectionDeserializeBug()
    {
        string geoJson = "{'type':'FeatureCollection','features':[{'type':'Feature','properties':{},'geometry':{'type':'Polygon','coordinates':[[[-2.537841796875,53.50111704294316],[-2.537841796875,54.226707764386695],[-1.0986328125,54.226707764386695],[-1.0986328125,53.50111704294316],[-2.537841796875,53.50111704294316]]]}},{'type':'Feature','properties':{},'geometry':{'type':'Polygon','coordinates':[[[-2.724609375,52.34205163638784],[-2.724609375,53.08082737207479],[-0.9667968749999999,53.08082737207479],[-0.9667968749999999,52.34205163638784],[-2.724609375,52.34205163638784]]]}}]}".Replace("'", "\"");
        var geoJsonReader = new GeoJsonReader();
        var featureCollection =  geoJsonReader.Read<FeatureCollection>(geoJson);
        Assert.IsNotNull(featureCollection);
    }

I get this exception:

System.ArgumentException : Expected token 'geometry' not found.
at NetTopologySuite.IO.Converters.FeatureConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader)
at NetTopologySuite.IO.Converters.FeatureCollectionConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader)
at NetTopologySuite.IO.GeoJsonReader.Read(String json)
at WebCoreMap.Test.Basemap.Geo.GeoJSONTest.NtsFeatureCollectionDeserializeBug() in GeoJSONTest.cs: line 26

Thank you

NTS 2.0+3.5 builds broken

As a part of moving to github, we have used nuget packages for GeoAPI and ProjNET. as you can see in packages.config.
Referenced libraries are for 4.0 client profile now

<package id="GeoAPI" version="1.7.3" targetFramework="net40-Client" />
<package id="ProjNET4GeoAPI" version="1.3.2" targetFramework="net40-Client" />

so msbuild code that compiles NTS for 2.0 and 3.5 aren't working now.
msbuild /t:rebuildrelease teamcity.targets
NOTE: I've manually commented now the XML section that launch this code

Why does a rectangle not overlap another rectangle inside it?

The JTS docs say this about the Overlaps predicate:

"Overlaps: The Geometries share some but not all points in common, and the intersection has the same dimension as the Geometries themselves"

The 2 rectangles below share some points, the intersection is the smaller rectangle, so why on earth does JTS (and NTS) say that these 2 rectangles do NOT overlap?

NTS behaves like JTS.

overlaps

Replacing obsolete DoubleDouble functions by operators

I replaced the obsolete DoubleDouble functions by operators. As I have no idea how to upload the changes I'll leave them here for someone to integrate.

NetTopologySuite\Algorithm\CGAlgorithmsDD.cs
In line 58 (inside public static int SignOfDet2x2(DoubleDouble x1, DoubleDouble y1, DoubleDouble x2, DoubleDouble y2))
replace
DoubleDouble det = x1.Multiply(y2).Subtract(y1.Multiply(x2));
by
DoubleDouble det = x1 * y2 - y1 * x2;

NetTopologySuite\Mathematics\DD.cs
In line 1174 (inside public static DoubleDouble Parse(String str))
replace
val2 = val.Multiply(scale);
by
val2 = val*scale;

NetTopologySuite\Triangulate\QuadEdge\TrianglePredicate.cs
In line 142 - 147 (inside public static bool IsInCircleDDSlow(Coordinate a, Coordinate b, Coordinate c, Coordinate p))
replace

 DoubleDouble aTerm = (ax.Multiply(ax).Add(ay.Multiply(ay))).Multiply(TriAreaDDSlow(bx, by, cx, cy, px, py));
 DoubleDouble bTerm = (bx.Multiply(bx).Add(by.Multiply(by))).Multiply(TriAreaDDSlow(ax, ay, cx, cy, px, py));
 DoubleDouble cTerm = (cx.Multiply(cx).Add(cy.Multiply(cy))).Multiply(TriAreaDDSlow(ax, ay, bx, by, px, py));
 DoubleDouble pTerm = (px.Multiply(px).Add(py.Multiply(py))).Multiply(TriAreaDDSlow(ax, ay, bx, by, cx, cy));

 DoubleDouble sum = aTerm.Subtract(bTerm).Add(cTerm).Subtract(pTerm);

by

 DoubleDouble aTerm = (ax * ax + ay * ay) * TriAreaDDSlow(bx, by, cx, cy, px, py);
 DoubleDouble bTerm = (bx * bx + by * by) * TriAreaDDSlow(ax, ay, cx, cy, px, py);
 DoubleDouble cTerm = (cx * cx + cy * cy) * TriAreaDDSlow(ax, ay, bx, by, px, py);
 DoubleDouble pTerm = (px * px + py * py) * TriAreaDDSlow(ax, ay, bx, by, cx, cy);

 DoubleDouble sum = aTerm - bTerm + cTerm - pTerm;

In line 170 inside (private static DoubleDouble TriAreaDDSlow(DoubleDouble ax, DoubleDouble ay, DoubleDouble bx, DoubleDouble by, DoubleDouble cx, DoubleDouble cy))
replace
return (bx.Subtract(ax).Multiply(cy.Subtract(ay)).Subtract(by.Subtract(ay).Multiply(cx.Subtract(ax))));
by
return (bx - ax) * (cy - ay) - (by - ay) * (cx - ax);

Documentation?

Is there a website where this library is documented?

  • If so a link should be added to the README.md file.
  • If not, some documentation should be created. (Though it looks like there is a Sandcastle configuration, so I suspect there is documentation and I'm just not finding it.)

When using NuGet to get the packages, the XML that provides "Intellisense" in Visual Studio doesn't seem to be present.

Submodule: branch detached

After made some changes in PowerCollections repo, I see that the submodule inside NetTopologySuite points to a branch and not to the master.
Looks an error to me, or I'm wrong?

Projection sample code

Hello,

Is there any sample provided for projection?
For example is it possible to project an IGeometry from a coordination system to another?

Thank you,
Shahin

Can't write a shapefile with no features

NTS 1.13.3.2 - I'm not sure if this is to spec or not but I am getting a NullReferenceException when writing a shape file with no features. If you uncomment the below line so that there is one feature, this works.

    public void NullReferenceWhenWriteingShapeFileWithNoFeatures()
    {
        var header = new DbaseFileHeader();
        header.AddColumn("X", 'C', 10, 0);

        var attributesTable = new AttributesTable();
        attributesTable.AddAttribute("X", "y");
        var feature = new Feature(new Point(1, 2), attributesTable);

        var writer = new ShapefileDataWriter(@"C:\temp\output") { Header = header };
        var features = new List<IFeature>();

// features.Add(feature);
writer.Write(features);
}

GeoJsonSerializer cannot serialize properties that are objects

given a geojson property that is an object then the serializer attempts to add the 'properties' attribute more than once.

I have a very quick fix and will submit a pull request with some accompanying tests

the following won't work....

const string geojsonString = @"
{
  ""type"": ""FeatureCollection"",
  ""features"": [
    {
      ""type"": ""Feature"",
      ""geometry"": {
        ""type"": ""Point"",
        ""coordinates"": [
          1.0,
          2.0
        ]
      },
      ""properties"": {
        ""foo"": {
          ""bar"": ""xyz""
        }
      }
    }
  ]
}
";
var reader = new GeoJsonReader();
var resultCollection = reader.Read<FeatureCollection>(geojsonString);
var gjs = new GeoJsonWriter();
gjs.Write(resultCollection);

KML Reader

I see a KML writer and I THOUGHT there was a KML reader but it seems to have disappeared. Did it ever exist or am I going crazy?

`DbaseFileWriter.Write(IList)` issues

  • it does not check if the number of columns provided does match the number of fields defined in the header
  • it does not check if the number of bytes written matches the record length
  • it does not check if all data types could be handled.

[Request] Add IPointOnGeometryLocator.Intersects similar to PointLocator.Intersects

(JTS doesn't have this either)

Problem: NetTopologySuite.Algorithm.PointLocator has a convenience method called "Intersects" that just returns whether Locate returns a value other than Exterior. There's nothing similar for IPointOnGeometryLocator, which makes it quite a bit awkward to change code that was using PointLocator (the class) to instead use the PointLocator (property) of a PreparedPolygon for performance reasons.

My guess as to why this might be in JTS is because PointLocator doesn't implement an interface. So whereas it's easy to create this in PointLocator (just add a method, done), doing a similar thing on the IPointOnGeometryLocator interface affects all implementers of that interface, not just the internal ones. Further, adding it later would be a breaking change because anyone else who implements this interface would have to implement that method.

Proposed solution: extension method. This is something Java doesn't have, and it importantly doesn't suffer from the "is technically a breaking change" problem that adding Intersects to the interface does.

public static bool Intersects(this IPointOnGeometryLocator locator, Coordinate p)
{
    return locator.Locate(p) != Location.Exterior;
}

Above version is consistent with the PointLocator class, though the below version would be how I would write it, being much more defensive:

public static bool Intersects(this IPointOnGeometryLocator locator, Coordinate p)
{
    if (locator == null)
    {
        throw new ArgumentNullException("locator");
    }

    if (p == null)
    {
        throw new ArgumentNullException("p");
    }

    switch (locator.Locate(p))
    {
        case Location.Boundary:
        case Location.Interior:
            return true;

        case Location.Exterior:
            return false;

        default:
            throw new InvalidOperationException("IPointOnGeometryLocator.Locate should never return anything other than Boundary, Interior, or Exterior.");
    }
}

VWLineSimplifier Optimization

Not exactly sure where I should be putting this, as I don't think it's worthy of a pull request just yet, but I've got a heavily optimized version of VWLineSimplifier that I'm tentatively calling "FastVWLineSimplifier". The TODO caught my eye and I couldn't resist.

airbreather/NetTopologySuite@ee14fc9

That commit includes a test case that produces output similar to this on my machine:
Time (slow): 11.9271277033042 seconds
Time (fast): 0.0595896480771026 seconds

Notably, FastVWLineSimplifier appears to return perfectly identical results to what VWLineSimplifier would produce (doing a full replacement passed all the NUnit tests), though the implementation is obviously completely different.

I think all it should really need is some surface-level cleanup and general direction from you guys about what to do about it.

Thoughts?

CoordinateArraySequence and Ordinate.M

If CoordinateArraySequenceFactory.Create(int size, int dimension) (which is the Default factory) is used with dimension = 4, the returning CoordinateArray will claim it has Ordinates XY.

Reason is this peace of Code in NetTopologySuite.Geometries.Implementation.CoordinateArray.cs

public Ordinates Ordinates
        {
            get
            {
                return _dimension == 3 
                    ? Ordinates.XYZ 
                    : Ordinates.XY;
            }
        }

I had this Problem, because customers data contains XYZM geometries with was read with GaiaGeoReader and he only received XY geometries. This was a problem, because he was especially interested in Z values.

My suggestion is to change the statement from

return _dimension == 3 

to

return _dimension >= 3 

Even if a CoordinateArray can not hold M values, it should not throw away Z values, e.g. when geometries are read with GaiaGeoReader.

As you can see, I'm new to github. Is this a major change, which needs an extensive discussion or did I just find a bug?

Please, any of you github NetTopologySuite pros, can you leave any comment in this?

ShapefileDataReader creating PolygonZ instead of Polygon for XY Wkt

We are using WktReader to create geometries from Wkt that are XY coordinates and using ShapefileDataWriter to create a shapefile with these geometries. When reading the shapefile in something like QGIS v2.10.1, the polygons are read as PolygonZ with a 'nan' Z coordinate. What we want is just a XY Polygon.

Here are the steps I used for debugging this

  1. Convert Wkt to Geometry
// Wkt in 4326 SRID (WGS84)
var wkt = "POLYGON ((-86.7605020509258 41.5101338613656, -86.7604972038273 41.5100611525915, -86.7604971708084 41.5100606308085, -86.7604611720717 41.5094596307695, -86.7604611426546 41.5094591103497, -86.7604291439208 41.5088571103154, -86.760429130715 41.508856853856, -86.7603991319814 41.5082548538241, -86.7603991259966 41.5082547317887, -86.7603701303631 41.5076537960468, -86.7603401446338 41.5070530565908, -86.7603071566895 41.5064532528163, -86.7603071500912 41.506453131098, -86.7602814240795 41.5059715533315, -86.7605549835241 41.5059607024218, -86.7605808466407 41.5064448078787, -86.760613844555 41.5070447469854, -86.7606138651484 41.5070451395365, -86.7606438664126 41.5076461395046, -86.7606438727239 41.5076462680791, -86.7606728710439 41.5082472070294, -86.7607028628788 41.5088490177453, -86.7607348434949 41.5094506292495, -86.7607708135428 41.5100511081057, -86.760776407335 41.5101350123382, -86.7605020509258 41.5101338613656))";

var geomFactory = new GeometryFactory(new PrecisionModel(), 4326);
var wktReader = new WKTReader(geomFactory);

Debug.WriteLine($"Geometry Type: {geometry.GeometryType}");
Debug.WriteLine($"Shapefile Type: {Shapefile.GetShapeType(geometry)}");

Output:
Geometry Type: Polygon
Shapefile Type: PolygonZM

  1. Cast geometry to IPolygon to get the CoordindateSequence Ordinates
IPolygon geomPolygon = geometry as IPolygon;
Debug.WriteLine($"IPolygon Geometry Type: {geomPolygon.GeometryType}");
Debug.WriteLine($"IPolygon Shell CoordindateSequence Ordinates: {geomPolygon.Shell.CoordinateSequence.Ordinates}");

Output:
IPolygon Geometry Type: Polygon
IPolygon Shell CoordindateSequence Ordinates: XYZ

What I need is for the Ordindates to be XY. Not sure if this is as intended or we are not using the corect GeometryFactory settings or a bug. We have a temp fix in by creating our own instance of ICoordinateSequenceFactory and passing an instance into GeometryFactory.

Here's a gist of the full sample to recreate: https://gist.github.com/billpratt/6bf4ab8e4435dc39db92

KdTree Matching Bug

The kd-tree does not correctly find existing nodes. It ignores branches that may contain matches within the tree’s threshold.

To demonstrate this, create a kd-tree with a threshold of 1.0. Then add the following points (0.0, 0.0), (0.1, 1.0), and (-0.1, 1.0). The third point should be matched to the second point. However, the code ignores the right child of the root node and does not find the match.

I also posted this to the JTS mailing list.

Need for new version of NetTopologySuite.IO.GeoTools on NuGet

NTS.IO.GEOTOOLS on Nuget currently references GeoAPI 1.7.2, but when adding ProjNet4GeoAPI that requires GeoAPI >= 1.7.3 ShapeFileDataReader does not work any more.

It looks like the .ctor of ShapeFileDataReader requires a IGeometryFactory as argument, which was removed from GeoApi 1.7.3?

We need to update the GeoTools assembly published on NuGet

Prevent geometries being created with z

Hi

When I create and save a geometry like this:

List coordinates = new List();
coordinates.Add(new Coordinate(0, 0));
coordinates.Add(new Coordinate(1, 0));
coordinates.Add(new Coordinate(1, 1));
coordinates.Add(new Coordinate(0, 1));
coordinates.Add(new Coordinate(0, 0));

AttributesTable attributesTable = new AttributesTable();
Polygon polygon = new Polygon(new LinearRing(coordinates.ToArray()));
IList features = new List();
features.Add(new Feature(polygon, attributesTable));

string shapefilePath = @"C:\test";
ShapefileDataWriter writer = new ShapefileDataWriter(shapefilePath) { Header = ShapefileDataWriter.GetHeader(features[0], features.Count) };
writer.Write((System.Collections.IList)features);

The resulting shape file has polygons with Z values, although they are null. In ArcMAP the polygons show as "Polygon ZM". This is not very good for my further processing of the data. How can get it to save it as just normal xy based polygons?

GeoJSON Reader and Feature "id" attribute

I'm using GeoServer, and the Feature objects retrieved from it's WFS contains an id member. This cannot be deserialized using the GeoJsonSerializer since it throws an ArgumentException when a property name is not "bbox", "geometry" or "properties".

It's valid GeoJSON according to http://geojsonlint.com/ and when reading the specs, the "id" should be allowed: http://geojson.org/geojson-spec.html#feature-objects

Example (I've excluded geometry for readability...):

{"type":"FeatureCollection","totalFeatures":5,"features":[{"type":"Feature","id":"vfs_kommun.256","geometry":null,"properties":{"kommunnamn":"Karlskrona"}}],"crs":null}

Running into exception trying to load Oracle Spatial Object

Right now I'm not sure what the root cause of this exception is; all I know is that I'm running into an exception when I attempt to access an Oracle Spatial Object. I'm using devart's dotConnect as my EntityFramework connector. If you have any ideas what might cause this exception to occur so I can address the right people, that would be awesome. Note that I'm using NetTopologySuite 1.13. I'm also using Postgis in this project, so I have a reference to NetTopologySuite.IO.PostGis

"ExceptionMessage": "premature end of enumerator",
"ExceptionType": "System.InvalidOperationException",
"StackTrace": " at NetTopologySuite.IO.WKTReader.GetNextWord(IEnumerator1 tokens)\\\r\\\n at NetTopologySuite.IO.WKTReader.ReadGeometryTaggedText(IEnumerator1 tokens)\r\n at NetTopologySuite.IO.WKTReader.Read(TextReader reader)\r\n at NetTopologySuite.IO.WKTReader.Read(String wellKnownText)\r\n at Devart.Common.Entity.bi.a(Int32 A_0, Boolean A_1)\r\n at Devart.Common.Entity.bi.b(Int32 A_0)\r\n at System.Data.Entity.Core.Common.Internal.Materialization.Shaper.b__1c[TProperty](DbDataReader reader, Int32 column)\r\n at System.Data.Entity.Core.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader1.GetValue(DbDataReader reader, Int32 ordinal)\\\r\\\n at System.Data.Entity.Core.Common.Internal.Materialization.Shaper.GetSpatialPropertyValueWithErrorHandling[TProperty](Int32 ordinal, String propertyName, String typeName, PrimitiveTypeKind spatialTypeKind)\\\r\\\n at lambda_method(Closure , Shaper )\\\r\\\n at System.Data.Entity.Core.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly[TEntity](Func2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet)\r\n at lambda_method(Closure , Shaper )\r\n at System.Data.Entity.Core.Common.Internal.Materialization.Coordinator1.ReadNextElement(Shaper shaper)\\\r\\\n at System.Data.Entity.Core.Common.Internal.Materialization.Shaper1.SimpleEnumerator.MoveNext()\r\n at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.Serialize(JsonWriter jsonWriter, Object value)\r\n at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding)\r\n at System.Net.Http.Formatting.JsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding)\r\n at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, HttpContent content)\r\n at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at System.Web.Http.WebHost.HttpControllerHandler.d__1b.MoveNext()"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.