Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The WKT specification allows both period and comma to be the decimal separator in floating-point numbers (section 7.2.1):

<decimal point> ::= <period> | <comma>

However, a comma could result in ambiguous WKT representations. In this example, the polygon is specified with five points, but the WKT could also be parsed as having three points:

POLYGON((0 0,0 1,1 1,1 0,0 0))

I'm assuming that nobody deliberately uses , as decimal separator, but is that really true?

Is there any reason to try to parse numbers in WKT with ,? Or shouly I assume that the specification is just buggy?

share|improve this question
in some locales it is perfectly normal to use , as decimal separator. – iant May 17 '13 at 13:58
But why should WKT representations be locale sensitive? – CL. May 17 '13 at 13:59
but why should they not? – iant May 17 '13 at 14:01
Because you'd get ambiguities, as shown in the question. – CL. May 17 '13 at 14:03
I think the interpretation of white space removes those ambiguities, from a parsing perspective. – L_Holcombe May 17 '13 at 14:15
up vote 0 down vote accepted

Because the coordinate pairs must be separated with a comma, and whitespace is treated as a separator between numbers in a coordinate pair, such ambiguities can be easily worked out by the parser.

(I personally think this is an example of something that could and should be internationally standardized - but then again, I'm also an American who has trouble with the metric system.)

share|improve this answer
POLYGON((0 0,0 1,1 1,1 0,0 0)) 

is not ambiguous, because the number of values for a point cannot be 3 (that would be POLYGON M or POLYGON Z).

That said, at least SpatiaLite doesn't support comma as a decimal separator. I didn't try other applications.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.