public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // one child, either a coord // or a coordinate sequence if(arg.children.size()<1 || arg.children.size()>2) throw new SAXException("Cannot create a box without either two coords or one coordinate sequence"); // int srid = getSrid(arg.attrs,gf.getSRID()); Envelope box = null; if(arg.children.size() == 1){ CoordinateSequence cs = (CoordinateSequence) arg.children.get(0); box = cs.expandEnvelope(new Envelope()); }else{ box = new Envelope((Coordinate)arg.children.get(0),(Coordinate)arg.children.get(1)); } return box; } });
protected Envelope computeEnvelopeInternal() { if (isEmpty()) { return new Envelope(); } return points.expandEnvelope(new Envelope()); }