* @deprecated not used.
*/
public EsriGraphicList getPolyGeometry(int[][] indexData, int shapeType)
throws Exception {
EsriGraphicList list = null;
if (shapeType == SHAPE_TYPE_POLYLINE) {
list = new EsriPolylineList();
} else if (shapeType == SHAPE_TYPE_POLYGON) {
list = new EsriPolygonList();
}
int numVertices;
int numShapes = indexData[1].length;
for (int t = 0; t < numShapes; t++) {
Integer shpRecordIndex = new Integer(_leis.readInt());
/* int shpContentLength = */_leis.readInt();
int shpType = _leis.readLEInt();
if (shpType != SHAPE_TYPE_NULL) {
/* double xLeft = */_leis.readLEDouble();
/* double xBottom = */_leis.readLEDouble();
/* double xRight = */_leis.readLEDouble();
/* double xTop = */_leis.readLEDouble();
int numParts = _leis.readLEInt();
int numPoints = _leis.readLEInt();
int[] offsets = new int[numParts];
// OK, we don't want to create a sublist unless the poly
// has multiple parts. Remember that. sublist will only
// be created if there is more than one part.
for (int n = 0; n < numParts; n++) {
offsets[n] = _leis.readLEInt();
}
float[] points;
OMGraphic poly = null;
EsriGraphicList sublist = null;
if (numParts > 1) {
if (shapeType == SHAPE_TYPE_POLYLINE) {
sublist = new EsriPolylineList();
} else if (shapeType == SHAPE_TYPE_POLYGON) {
sublist = new EsriPolygonList();
}
sublist.setVague(true); // Treat sublist as one
// OMGraphic.
sublist.putAttribute(SHAPE_INDEX_ATTRIBUTE,
shpRecordIndex);
}
for (int j = 0; j < numParts; j++) {
int i = 0;
if (j != numParts - 1) {
numVertices = (offsets[j + 1]) - offsets[j];
points = new float[numVertices * 2];
} else {
numVertices = (numPoints - offsets[j]);
points = new float[numVertices * 2];
}
for (int n = 0; n < numVertices; n++) {
double lambda = _leis.readLEDouble();
double phi = _leis.readLEDouble();
points[i++] = (float) Math.toRadians(phi);
points[i++] = (float) Math.toRadians(lambda);
}
if (shapeType == SHAPE_TYPE_POLYLINE) {
poly = new EsriPolyline(points, OMGraphic.RADIANS, OMGraphic.LINETYPE_GREATCIRCLE);
} else if (shapeType == SHAPE_TYPE_POLYGON) {
poly = new EsriPolygon(points, OMGraphic.RADIANS, OMGraphic.LINETYPE_GREATCIRCLE);
}
if (drawingAttributes != null) {
drawingAttributes.setTo(poly);
} else {
DrawingAttributes.DEFAULT.setTo(poly);
}
if (poly instanceof EsriPolyline) {
// Just to make sure it gets rendered as a
// polyline. The OMPoly code will render it as a
// polygon if the fill color is not clear.
poly.setFillPaint(OMColor.clear);
}
// sublist is null for non multi-part geometries.
if (sublist != null) {
sublist.addOMGraphic(poly);
} else {
poly.putAttribute(SHAPE_INDEX_ATTRIBUTE,
shpRecordIndex);
}
}