I'm trying to learn how to use NetTopologySuite (for .NET) but creating a simple circle which is going to be my search area. When I do this using the .Buffer()
method, the shape created covers the entire planet Earth.
var geographyFactory = NtsGeometryServices.Instance.CreateGeometryFactory(4326); // WGS84
var searchAreCoordinate = new NetTopologySuite.Geometries.Coordinate(coordinate.Latitude, coordinate.Longitude); // Not sure if long-lat or lat-long.
var searchArea = geographyFactory.CreatePoint(searchAreCoordinate).Buffer(1000); // To me, this is 1000 meters because the SRID is WGS84.
This is the result WKT output:
POLYGON ((1001 2, 981.78528040323044 -193.09032201612825, 924.8795325112867 -380.6834323650898, 832.46961230254522 -553.57023301960214, 708.10678118654755 -705.10678118654755, 556.57023301960226 -829.46961230254522, 383.68343236508986 -921.8795325112867, 196.09032201612834 -978.78528040323044, 1.0000000000000613 -998, -194.0903220161282 -978.78528040323044, -381.68343236508974 -921.8795325112867, -554.57023301960191 -829.46961230254533, -706.10678118654744 -705.10678118654755, -830.46961230254533 -553.57023301960214, -922.87953251128681 -380.68343236508946, -979.78528040323056 -193.09032201612771, -999 2.0000000000007656, -979.78528040323022 197.09032201612922, -922.87953251128624 384.68343236509088, -830.46961230254442 557.57023301960339, -706.1067811865463 709.10678118654869, -554.57023301960078 833.46961230254624, -381.68343236508787 925.87953251128749, -194.09032201612607 982.7852804032309, 1.0000000000024809 1002, 196.09032201613093 982.78528040322988, 383.68343236509247 925.87953251128567, 556.57023301960487 833.46961230254351, 708.10678118654994 709.10678118654516, 832.46961230254726 557.5702330195993, 924.87953251128818 384.68343236508628, 981.78528040323124 197.09032201612436, 1001 2))
and this is what it looks like, when placed over a map:
If you look at the result data, the numbers are way over -90/90 -180/180.
My guess is that I might not be setting the SRID right?