[Featureserver] Json: unrounding of coordinates

Peter Robins fs at peterrobins.co.uk
Wed Jan 20 06:01:57 EST 2010


This is a bit OT as it seems to be a problem with simplejson and not
FS, but I'm having trouble tracking down why it's happening. On
GeoJson output, coordinates are being 'unrounded', such as 43.12 being
output as 43.119999999999997. This is adding hugely to the size of the
output. If I go into python and do:
>>> import simplejson
>>> simplejson.dumps(43.12)
I get 43.119999999999997, which makes it look like a simplejson issue.
However, it doesn't occur on every server; on some, it outputs 43.12,
even though this is the same version of simplejson. This makes me
think it might be some issue with some control file being defined
differently or something.

Can anyone out there tell me what is causing this, and what I can do
to prevent it?



More information about the Featureserver mailing list