Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precision with value greater than 6 issue. #113

Closed
PrzemyslawSwiderski opened this issue May 21, 2020 · 1 comment
Closed

Precision with value greater than 6 issue. #113

PrzemyslawSwiderski opened this issue May 21, 2020 · 1 comment

Comments

@PrzemyslawSwiderski
Copy link

I have problem with encoding/decoding the following geojson:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            15.726928710,
            52.932085718
          ],
          [
            17.116699218,
            52.912214760
          ],
          [
            16.721191406,
            52.579688026
          ],
          [
            15.803833008,
            52.315195264
          ],
          [
            14.869995117,
            52.439269354
          ]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              13.716430661,
              53.156653053
            ],
            [
              16.847534179,
              53.156653053
            ],
            [
              16.847534179,
              53.943154702
            ],
            [
              13.716430664,
              53.943154702
            ],
            [
              13.716430661,
              53.156653053
            ]
          ]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [
          14.518432617,
          52.855864177
        ]
      }
    }
  ]
}

Precision found should be equal to 9, but instead it is resolved to 6.
Decoding encoded geobuf file produce the following geojson:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            15.726929,
            52.932086
          ],
          [
            17.116699,
            52.912215
          ],
          [
            16.721191,
            52.579688
          ],
          [
            15.803833,
            52.315195
          ],
          [
            14.869995,
            52.439269
          ]
        ]
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              13.716431,
              53.156653
            ],
            [
              16.847534,
              53.156653
            ],
            [
              16.847534,
              53.943155
            ],
            [
              13.716431,
              53.943155
            ],
            [
              13.716431,
              53.156653
            ]
          ]
        ]
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          14.518433,
          52.855864
        ]
      }
    }
  ]
}

So, 3 digits are missing and that is not allowed in my case.

@PrzemyslawSwiderski PrzemyslawSwiderski changed the title Wrong found precision Precision other than 6 issue. May 21, 2020
@PrzemyslawSwiderski PrzemyslawSwiderski changed the title Precision other than 6 issue. Precision other higher than 6 issue. May 21, 2020
@PrzemyslawSwiderski PrzemyslawSwiderski changed the title Precision other higher than 6 issue. Precision with value greater than 6 issue. May 21, 2020
@ghost
Copy link

ghost commented Mar 19, 2021

This is documented in issue #96 and the README:

"Nearly" lossless means coordinates are encoded with precision of 6 digits after the decimal point (about 10cm).

@PrzemyslawSwiderski PrzemyslawSwiderski closed this as not planned Won't fix, can't repro, duplicate, stale Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant