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

common geometry positioning that fails [Unable to find segment...] #107

Open
CraigglesO opened this issue Oct 18, 2020 · 1 comment
Open
Labels
bug Something isn't working

Comments

@CraigglesO
Copy link

Was able to make the geometry simpler. I am using OpenStreetMaps ocean data that is broken into pieces and then tilizing them. So for every tile I have to stitch/union the ocean back together.
In other words, I get this error practically every tile.

Consider the geometry:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [
          [
            [
              [
                0.3989625786890032,
                1.009765625
              ],
              [
                0.3989625786890032,
                1.0052647693815202
              ],
              [
                0.396484375,
                1.005525034038334
              ],
              [
                0.396484375,
                1.009765625
              ],
              [
                0.3989625786890032,
                1.009765625
              ]
            ]
          ],
          [
            [
              [
                0.396484375,
                1.0055334123783004
              ],
              [
                0.3989625786890032,
                1.0052731441301153
              ],
              [
                0.3989625786890032,
                0.9831177462616355
              ],
              [
                0.3966402491889224,
                0.9823941008295243
              ],
              [
                0.396484375,
                1.0055334123783004
              ]
            ]
          ],
          [
            [
              [
                0.39895258134328715,
                0.9831211850799448
              ],
              [
                0.39895258134328704,
                1.0052740239230125
              ],
              [
                0.43091071349190757,
                1.0029868318833317
              ],
              [
                0.43091071349190746,
                0.9830924015448479
              ],
              [
                0.39895258134328715,
                0.9831211850799448
              ]
            ]
          ],
          [
            [
              [
                0.43090028201911246,
                0.9830812272092494
              ],
              [
                0.43090028201911246,
                1.0029874138408128
              ],
              [
                0.447265625,
                1.0023217069607695
              ],
              [
                0.4309719323819078,
                0.9831579787871001
              ],
              [
                0.43090028201911246,
                0.9830812272092494
              ]
            ]
          ],
          [
            [
              [
                0.39895258134328704,
                1.0052656491622696
              ],
              [
                0.39895258134328704,
                1.009765625
              ],
              [
                0.43091071349190746,
                1.009765625
              ],
              [
                0.43091071349190746,
                1.00297848871728
              ],
              [
                0.39895258134328704,
                1.0052656491622696
              ]
            ]
          ],
          [
            [
              [
                0.43090028201911235,
                1.0029790706667183
              ],
              [
                0.43090028201911246,
                1.009765625
              ],
              [
                0.447265625,
                1.009765625
              ],
              [
                0.447265625,
                1.0023133729892386
              ],
              [
                0.43090028201911235,
                1.0029790706667183
              ]
            ]
          ]
        ]
      }
    }
  ]
}

For this package, anytime a piece is surrounded on "five" sides, it will fail. The top middle in this case fails.

@CraigglesO
Copy link
Author

Found an even simpler example. Seems I was wrong? It might have to do with a line intersecting the other polygon at an end/start point of two connecting lines rather than on a line.

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [[
  [
    [
      0.333984375,
      0.9345515074448101
    ],
    [
      0.3382814280319275,
      0.9338850203871748
    ],
    [
      0.3382814280319275,
      0.933884863940738
    ],
    [
      0.33828620813379007,
      0.9338842789776549
    ],
    [
      0.36819452088818627,
      0.930224260981806
    ],
    [
      0.36819452088818627,
      0.947265625
    ],
    [
      0.333984375,
      0.947265625
    ],
    [
      0.333984375,
      0.9345515074448101
    ]
  ]
],
                        [
  [
    [
      0.333984375,
      0.9084637498721961
    ],
    [
      0.33829087072221165,
      0.9078295884995246
    ],
    [
      0.33829087072221153,
      0.9338918862375188
    ],
    [
      0.333984375,
      0.934559848622665
    ],
    [
      0.333984375,
      0.9084637498721961
    ]
  ]
]
                        ]
      }
    }
  ]
}

@mfogel mfogel added the bug Something isn't working label Nov 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants