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

should linestrings which fold back on themselves be cut? #13

Open
andrewharvey opened this issue Jul 2, 2018 · 1 comment
Open

should linestrings which fold back on themselves be cut? #13

andrewharvey opened this issue Jul 2, 2018 · 1 comment

Comments

@andrewharvey
Copy link

In this sample GeoJSON a LineString goes from A to B to C to B to A.

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "LineString",
        "coordinates": [[0, 0], [1, 0], [2, 0], [1, 0], [0, 0]]
      }
    }
  ]
}

I was expecting that encoded as TopoJSON the arc A to B to C would be saved as the arc A-B-C and the LineString saved as that arc + reverse of the arc, but instead it's just one arc.

{"type":"Topology","objects":{"abcba":{"type":"GeometryCollection","geometries":[{"type":"LineString","arcs":[0]}]}},"arcs":[[[0,0],[1,0],[2,0],[1,0],[0,0]]],"bbox":[0,0,2,0]}

Is this the intended output or is it a bug?

@mbostock
Copy link
Member

mbostock commented Jul 2, 2018

Related topojson/topojson#121.

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

2 participants