I'm making a WFS call to a geoServer hosted by the City of Stockholm that shows where it's forbidden to park on certain days.
The original data is shown in XML, but since you can request other data formats in the WFS call - i'm making the call &outputFormat=application/json
. Then strange stuff is starting to happen:
if you don't ask for any formatting of the coordinates - the result is presented in the format SWEREF99
and XML format.
If you keep XML
as the output, but change to the WGS84
format, the values has a resolution of 6 decimals
<gml:posList>59.297013 18.019718 59.296889 18.019697</gml:posList>
when you ask the geoserver to convert the data to JSON the result being delivered looks like this:
[[18.0474,59.2943],[18.0476,59.2942]]
as you can see the JSON format cuts the all decimals except for the first 4 ones.
On spatialreference.org this can be read about the bounds of WGS84: WGS84 Bounds: -180.0000, -90.0000, 180.0000, 90.0000
Does this mean that i can't get a higher resolution on my coordinates if i'm asking for the coordinates in WGS84? Is there any other WFS request i can make to get the full resolution? Or is it the city of Stockholm that needs to change their settings for the data output?
GeoServer allows the owner of the server to set the number of decimal digits of in JSON & GML outputs. So I would expect you to see the same output from both formats unless they are doing some sort of post-processing on the JSON data.
Depending on what you want to do with the data 4 decimal places should be fine, as discussed in this question it will be accurate to ~10m which is as good as your GPS. If you need better accuracy then you should probably get your data projected into SWEREF99 which should give you sub-meter accuracy (assuming, of course, it was measured that well).