Skip to content

Commit

Permalink
Plugins/WFSClient: Feature fetching fails on systems w NumberFormatIn…
Browse files Browse the repository at this point in the history
…fo.NumberDecimalSeparator != '.' (DotSpatial#1082)
  • Loading branch information
MatthiasSchilder authored and jany-tenaj committed Oct 26, 2017
1 parent ee72378 commit ff93bfd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
- WebMap-Plugin fails fetching tiles for specific WMS (#1074)
- Plugins/WFSClient: Feature fetching fails on systems w NumberFormatInfo.NumberDecimalSeparator != '.' (#1081)
1 change: 1 addition & 0 deletions Contributors
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ Chris Wilson
Ping Yang
Trent Muhr
Joe Houghton
Matthias Schider <[email protected]>
11 changes: 9 additions & 2 deletions Source/DotSpatial.Plugins.WFSClient/Classes/WFSClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -294,7 +295,11 @@ private static Coordinate[] ExtractCoordinates(DirectPositionListType rings)
List<Coordinate> lstCoor = new List<Coordinate>();

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();
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ff93bfd

Please sign in to comment.