From ff93bfd885ed16c04264c99b602bfbeebe667ce0 Mon Sep 17 00:00:00 2001 From: Matthias Schilder Date: Thu, 26 Oct 2017 09:45:58 +0200 Subject: [PATCH] Plugins/WFSClient: Feature fetching fails on systems w NumberFormatInfo.NumberDecimalSeparator != '.' (#1082) --- Changelog.md | 3 ++- Contributors | 1 + .../DotSpatial.Plugins.WFSClient/Classes/WFSClient.cs | 11 +++++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 4f416c238..f4858081e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -135,4 +135,5 @@ Be aware that code written for 1.9 will not work out of the box because DotSpati - In InRamImageData.Open don't draw the image unscaled because this can cause the image not to be drawn - FeatureTypeFromGeometryType Method updated to work with GeometryCollection (#1044) - The SpatiaLite plugin to be able to load SpatiaLite databases of version 4 and higher (#1061) -- WebMap-Plugin fails fetching tiles for specific WMS (#1074) \ No newline at end of file +- WebMap-Plugin fails fetching tiles for specific WMS (#1074) +- Plugins/WFSClient: Feature fetching fails on systems w NumberFormatInfo.NumberDecimalSeparator != '.' (#1081) \ No newline at end of file diff --git a/Contributors b/Contributors index 7b03c1bcb..23642d37b 100644 --- a/Contributors +++ b/Contributors @@ -51,3 +51,4 @@ Chris Wilson Ping Yang Trent Muhr Joe Houghton +Matthias Schider \ No newline at end of file diff --git a/Source/DotSpatial.Plugins.WFSClient/Classes/WFSClient.cs b/Source/DotSpatial.Plugins.WFSClient/Classes/WFSClient.cs index 312efa021..2793b6ae4 100644 --- a/Source/DotSpatial.Plugins.WFSClient/Classes/WFSClient.cs +++ b/Source/DotSpatial.Plugins.WFSClient/Classes/WFSClient.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Data; +using System.Globalization; using System.IO; using System.Linq; using System.Net; @@ -294,7 +295,11 @@ private static Coordinate[] ExtractCoordinates(DirectPositionListType rings) List lstCoor = new List(); for (int i = 0; i < listpoints.Length; i = i + 2) - lstCoor.Add(new Coordinate(Convert.ToDouble(listpoints[i]), Convert.ToDouble(listpoints[i + 1]))); + { + lstCoor.Add(new Coordinate( + Convert.ToDouble(listpoints[i], CultureInfo.InvariantCulture), + Convert.ToDouble(listpoints[i + 1], CultureInfo.InvariantCulture))); + } return lstCoor.ToArray(); } @@ -451,7 +456,9 @@ private IFeature ExtractGeographicData(XmlNode c) string point = Convert.ToString(geoData); var pointValue = point.Split(' '); - geo = new Point(Convert.ToDouble(pointValue[0]), Convert.ToDouble(pointValue[1])); + geo = new Point( + Convert.ToDouble(pointValue[0], CultureInfo.InvariantCulture), + Convert.ToDouble(pointValue[1], CultureInfo.InvariantCulture)); } if (_typeGeometry == FeatureType.Polygon)