-
Notifications
You must be signed in to change notification settings - Fork 22.8k
Description
d3.geo.path sometimes renders polygons where all points are in a straight line (so no inside) as an "infinite" area with a line shaped "hole". The polygons are created by TileStache from a postgis database and served as topojson. The polygons start out as valid RHR geometries and are turned into lines due to the shift from floating point space to integer space; see the drawing below.
If the order of the last three points in the topojson is changed the feature is drawn correctly. I've setup a page showing the difference here: http://research.geodan.nl/sites/vectortiling/test/faultytile.html
Is there a correct clockwise order for points on a line? If so it might be that TileStache is wrong here serving the points in the wrong order, but following the above drawing the points are in a valid order. I would think that if a polygon has an area of 0, the order of points doesn't matter and D3 shouldn't try to create an infinite area with a zero area hole in it.