title: Ease data in array to smooth a curve in PHP
body: <p>I'm using an API to get elevation data for GPX points, and try to create a graphic representation of it. My problem is that each point in the API is separated by 90meters, and my GPX points are separated by 5meters, causing several points in a row to have the same altitude before changing abruptly to a new altitude.</p>
  
  <p>Basically, I obtain an array like this one:</p>
  
  <p>[0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15...]</p>
  
  <p>How would you draw it as a PNG image representation of the altitudes while easing the curves? I need to be able to change the size of the output picture.</p>
  
  <p>I'm trying to change my array to something like that but I'm not sure how to do it and if this is the best solution:</p>
  
  <p>[0, 0, 0, 0, 5, 5, 10, 10, 10, 12, 13, 15, 15, 15, 15...]</p>
  
  <p>Thanks for any hints, I'm not used to work on pictures and data easing.</p>