private void indexShape(ParseContext context, Object luceneShape) { if (luceneShape instanceof GeoPoint) { GeoPoint pt = (GeoPoint) luceneShape; indexFields(context, XLatLonShape.createIndexableFields(name(), pt.lat(), pt.lon())); } else if (luceneShape instanceof double[]) { double[] pt = (double[]) luceneShape; indexFields(context, XLatLonShape.createIndexableFields(name(), pt[1], pt[0])); } else if (luceneShape instanceof Line) { indexFields(context, XLatLonShape.createIndexableFields(name(), (Line)luceneShape)); } else if (luceneShape instanceof Polygon) { indexFields(context, XLatLonShape.createIndexableFields(name(), (Polygon) luceneShape)); } else if (luceneShape instanceof double[][]) { double[][] pts = (double[][])luceneShape; for (int i = 0; i < pts.length; ++i) { indexFields(context, XLatLonShape.createIndexableFields(name(), pts[i][1], pts[i][0])); indexFields(context, XLatLonShape.createIndexableFields(name(), lines[i])); indexFields(context, XLatLonShape.createIndexableFields(name(), polys[i])); Polygon p = new Polygon(new double[]{r.minLat, r.minLat, r.maxLat, r.maxLat, r.minLat}, new double[]{r.minLon, r.maxLon, r.maxLon, r.minLon, r.minLon}); indexFields(context, XLatLonShape.createIndexableFields(name(), p)); } else if (luceneShape instanceof Object[]) {