code: func (p *Path) Encode(factor ...int) string {
  	f := 1.0e5
  	if len(factor) != 0 {
  		f = float64(factor[0])
  	}
  
  	var pLat int
  	var pLng int
  
  	var result bytes.Buffer
  	scratch1 := make([]byte, 0, 50)
  	scratch2 := make([]byte, 0, 50)
  
  	for _, p := range p.PointSet {
  		lat5 := int(math.Floor(p.Lat()*f + 0.5))
  		lng5 := int(math.Floor(p.Lng()*f + 0.5))
  
  		deltaLat := lat5 - pLat
  		deltaLng := lng5 - pLng
  
  		pLat = lat5
  		pLng = lng5
  
  		result.Write(append(encodeSignedNumber(deltaLat, scratch1), encodeSignedNumber(deltaLng, scratch2)...))
  
  		scratch1 = scratch1[:0]
  		scratch2 = scratch2[:0]
  	}
  
  	return result.String()
  }
docs: // Encode converts the path to a string using the Google Maps Polyline Encoding method.
  // Factor defaults to 1.0e5, the same used by Google for polyline encoding.