The points which correspond to each polygon are not

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: t labels than smaller cities) Polygons Polygon drawing is tricky and we don't have a good solution. The points which correspond to each polygon are not presented in the type-2 record in order; you cannot necessarily draw them clockwise (for example) and expect the correct shape to come out. More problematically, they allow concave shapes, so standard "lasso" techniques to resolve the polygons do not necessarily work. Do something reasonable here, but it is okay if polygons are rendered poorly. Tile Set Divider Algorithms The Mapper and Reducer for tile rendering rely on a TileSetDivider to inform them which tile IDs are grouped together in which reducers. We have provided you with a SimpleDivider class which implements the TileSetDivider interface. This will divide the mappable range into a set of tile extents, assign them tile IDs, and assign the tile IDs to as many tile sets as there are reducers. The tile sets are created in a very naive way. Imagine a line segment (e.g., road) that spans two adjacent tiles. This road feature data must be sent to the reducers for the tile sets for both tiles. Consider SR-520 in the above diagram. Assuming a slightly simplified version where this is a single straight line segment, it can extend to 2 or more tiles. The Mapper that reads in the record for SR-520 must emit it to each Reducer for the tilesets corresponding to Tile 1 and Tile 2 (and possibly others, if the length of this line segment is very long). Your TileSetDivider can tell you the tile IDs (and thus the tile sets) for the endpoints of the line segment; from there you can determine all tile IDs and thus all tile sets that need a copy of the record. Don't forget, if a long line segment is oriented "diagonally," it may need to be emitted to a rectangle of tile IDs. The SimpleDivider is very inefficient -- tile sets do a poor job of taking into account the locality of tiles to one another. We would like you to implement a better divider, which you should call the HilbertDivider. The HilbertDivider will draw Hilbert curves over the 2D array of tile IDs. A Hilbert curve is a space-filling curve: It will...
View Full Document

Ask a homework question - tutors are online