Quantcast
Channel: MsSqlSpatial Work Item Rss Feed
Viewing all articles
Browse latest Browse all 20

COMMENTED ISSUE: When decimal seperator is no dot, geometry construction crashes

$
0
0
In the latest version of msSQLSpatial, locales where instead of a dot a comma is used as decimal seperator cause geometry construction to fail

The trick is to enhance the geometry construction functions with a temporary change of the culture in use: (Here is an example)

'First, store the CurrentCulture so it can be reset after the routine is done
Dim originalCulture As System.Globalization.CultureInfo
originalCulture = CultureInfo.CurrentCulture

'msSQLSpatial needs the locale to be set to US so the . and , are interpreted correctly
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US", True)

'Do the things you have to do here..................................

'Reset the CurrentCulture
Thread.CurrentThread.CurrentCulture = originalCulture
Comments: ** Comment from web user: milovanderlinden **

This sounds good. If this is implemented correct it is ok. I found out my issue had nothing to do with culture, but with a wrong sample in the wiki on constructing geometry from X and Y columns. I added comment on the solution on the wiki.


Viewing all articles
Browse latest Browse all 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>