[PATCH] NumberFormat in Splitter

OK, my previous patch has been tested and worked. But to minimize further risk of locale problems I would prefer the following patch: Index: src/uk/me/parabola/splitter/SubArea.java =================================================================== --- src/uk/me/parabola/splitter/SubArea.java (Revision 21) +++ src/uk/me/parabola/splitter/SubArea.java (Arbeitskopie) @@ -25,6 +25,7 @@ import java.util.Formatter; import java.util.Iterator; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.zip.GZIPOutputStream; @@ -105,13 +106,11 @@ writer.append("<?xml version='1.0' encoding='UTF-8'?>\n"); writer.append("<osm version='0.5' generator='splitter'>\n"); - Formatter fmt = new Formatter(writer); - fmt.format("<bounds minlat='%f' minlon='%f' maxlat='%f' maxlon='%f'/>\n", - Utils.toDegrees(bounds.getMinLat()), - Utils.toDegrees(bounds.getMinLong()), - Utils.toDegrees(bounds.getMaxLat()), - Utils.toDegrees(bounds.getMaxLong())); - fmt.flush(); + writer.append("<bounds minlat="+Utils.toDegrees(bounds.getMinLat())); + writer.append(" minlon="+Utils.toDegrees(bounds.getMinLong())); + writer.append(" maxlat="+Utils.toDegrees(bounds.getMaxLat())); + writer.append(" maxlon="+Utils.toDegrees(bounds.getMaxLon())); + writer.append("/>\n"); } public void finishWrite() {

Hi Johann On Tue, Feb 17, 2009 at 11:07:48PM +0100, Johann Gail wrote:
But to minimize further risk of locale problems I would prefer the following patch:
How annoying... I would never have spotted that as I'm in the UK ;) I've applied the patch, but kept in the single quote characters around the attribute values. Thanks, ..Steve

On Tue, Feb 17, 2009 at 11:27 PM, Steve Ratcliffe <steve@parabola.demon.co.uk> wrote:
Hi Johann
On Tue, Feb 17, 2009 at 11:07:48PM +0100, Johann Gail wrote:
But to minimize further risk of locale problems I would prefer the following patch:
How annoying... I would never have spotted that as I'm in the UK ;)
That's right! I forgot about this: I specially changed the local settings on my computer so splitter would work properly. This also applied to the "areas.list" file. With a German local, commas were used as a decimal separator. I don't know if this is still a problem with areas.list. Cheers.

But to minimize further risk of locale problems I would prefer the following patch:
How annoying... I would never have spotted that as I'm in the UK ;)
That's right! I forgot about this: I specially changed the local settings on my computer so splitter would work properly. This also applied to the "areas.list" file. With a German local, commas were used as a decimal separator. I don't know if this is still a problem with areas.list.
Yes, its the same problem with the areas.list
participants (3)
-
Clinton Gladstone
-
Johann Gail
-
Steve Ratcliffe