1. A method for generating a representation of a polyline formed by a sequence of points, comprising: determining, using a processor in communication with a non-volatile computer-readable memory, an overcomplete set of geometric primitives that redundantly fit overlapping sections of the polyline, such that the overcomplete set of geometric primitives includes multiple types of geometric primitives, and geometric primitives of the multiple types are fitted to at least one section of the polyline formed by a subset of the sequence of points; determining, using the processor, a local cost of each geometric primitive in the overcomplete set of geometric primitives based on a combination of a fitting error between the geometric primitive and the section of the polyline and an encoding cost of the geometric primitive, wherein the encoding cost of the geometric primitive is a function of a number of bits required to store the geometric primitive in the non-volatile computer-readable memory, wherein at least one geometric primitive has an encoding cost that is different from an encoding cost of another geometric primitive in the overcomplete set of geometric primitives; determining, using the processor, join costs of pairs of adjacent geometric primitives in the overcomplete set of geometric primitives based on a geometric quality of a join between a pair of adjacent geometric primitives and an encoding cost of a location of the join; determining, using the processor, a combination of the geometric primitives forming a connected path along a length of the polyline such that a sum of the local costs of the geometric primitives and the join costs of the pairs of adjacent geometric primitives in the combination is optimized; and storing, using the processor, the optimized combination of the geometric primitives into the non-volatile computer-readable memory, wherein the method results in an efficiency of memory utilization of the non-volatile computer-readable memory.