The implementation of the packedCoordinate sequence does not do any
dimension checking on the ordinate argument. Therefore if you say have a
2D coordinate sequence and request the 3 ordinate (z) then you will
actually be returned the value for the x value of the next coordinate.

The implementation to be safe should be something like.

  public double getOrdinate(int index, int ordinate) {
    if (ordinate > dimension) {
      return Double.NaN;
    } else {
      return coords[index * dimension + ordinate];
    }
  }

Paul
_______________________________________________
jts-devel mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jts-devel

Reply via email to