protected ArrayList<float[]> forwardRhumbPoly(float[] rawllpts,int nsegs,boolean isFilled){
  if (this instanceof Mercator) {
    return _forwardPoly(rawllpts,LineType.Straight,nsegs,isFilled);
  }
  int i, n, xp, flag=0, xadj=0, totalpts=0;
  Point from=new Point(0,0);
  Point to=new Point(0,0);
  int len=rawllpts.length;
  float[][] augllpts=new float[len >>> 1][0];
  mercator.forward(rawllpts[0],rawllpts[1],from,true);
  xp=from.x;
  for (i=0, n=2; n < len; i++, n+=2) {
    mercator.forward(rawllpts[n],rawllpts[n + 1],to,true);
    if (Math.abs(xp - to.x) >= mercator.half_world) {
      flag+=(xp < to.x) ? -1 : 1;
      xadj=flag * mercator.world.x;
    }
    xp=to.x;
    if (flag != 0) {
      to.x+=xadj;
    }
    augllpts[i]=mercator.rhumbProject(from,to,false,nsegs);
    totalpts+=augllpts[i].length;
    from.x=to.x;
    from.y=to.y;
  }
  LatLonPoint llp=new LatLonPoint.Double();
  mercator.inverse(from.x,from.y,llp);
  augllpts[i]=new float[2];
  augllpts[i][0]=(float)llp.getRadLat();
  augllpts[i][1]=(float)llp.getRadLon();
  totalpts+=2;
  float[] newllpts=new float[totalpts];
  int pos=0;
  for (i=0; i < augllpts.length; i++) {
    System.arraycopy(augllpts[i],0,newllpts,pos,augllpts[i].length);
    pos+=augllpts[i].length;
  }
  augllpts=null;
  return _forwardPoly(newllpts,LineType.Straight,-1,isFilled);
}

protected ArrayList < float [ ] > forwardRhumbPoly ( float [ ] rawllpts , int nsegs , boolean isFilled ) { if ( this instanceof Mercator ) { return _forwardPoly ( rawllpts , LineType . Straight , nsegs , isFilled ) ; } int i , n , xp , flag = 0 , xadj = 0 , totalpts = 0 ; Point from = new Point ( 0 , 0 ) ; Point to = new Point ( 0 , 0 ) ; int len = rawllpts . length ; float [ ] [ ] augllpts = new float [ len > > > 1 ] [ 0 ] ; mercator . forward ( rawllpts [ 0 ] , rawllpts [ 1 ] , from , true ) ; xp = from . x ; for ( i = 0 , n = 2 ; n < len ; i ++ , n += 2 ) { mercator . forward ( rawllpts [ n ] , rawllpts [ n + 1 ] , to , true ) ; if ( Math . abs ( xp - to . x ) >= mercator . half_world ) { flag += ( xp < to . x ) ? - 1 : 1 ; xadj = flag * mercator . world . x ; } xp = to . x ; if ( flag != 0 ) { to . x += xadj ; } augllpts [ i ] = mercator . rhumbProject ( from , to , false , nsegs ) ; totalpts += augllpts [ i ] . length ; from . x = to . x ; from . y = to . y ; } LatLonPoint llp = new LatLonPoint . Double ( ) ; mercator . inverse ( from . x , from . y , llp ) ; augllpts [ i ] = new float [ 2 ] ; augllpts [ i ] [ 0 ] = ( float ) llp . getRadLat ( ) ; augllpts [ i ] [ 1 ] = ( float ) llp . getRadLon ( ) ; totalpts += 2 ; float [ ] newllpts = new float [ totalpts ] ; int pos = 0 ; for ( i = 0 ; i < augllpts . length ; i ++ ) { System . arraycopy ( augllpts [ i ] , 0 , newllpts , pos , augllpts [ i ] . length ) ; pos += augllpts [ i ] . length ; } augllpts = null ; return _forwardPoly ( newllpts , LineType . Straight , - 1 , isFilled ) ; }
forward project a rhumbline poly . < p > draws rhumb lines between vertices of poly . remember to specify vertices in radians ! check in - code comments for details about the algorithm .
