| | |
| | | import com.vividsolutions.jts.geom.Geometry; |
| | | import com.vividsolutions.jts.geom.GeometryCollection; |
| | | import com.vividsolutions.jts.geom.GeometryFactory; |
| | | import com.vividsolutions.jts.geom.CoordinateList; |
| | | |
| | | /** |
| | | * ComplexShapeElement |
| | |
| | | { |
| | | private static final Logger logger = Logger.getLogger(ComplexShapeElement.class); |
| | | |
| | | ArrayList list = new ArrayList(); |
| | | ArrayList<Element> list = new ArrayList<Element>(); |
| | | |
| | | public ComplexShapeElement(byte[] raw) |
| | | { |
| | |
| | | |
| | | public boolean add(Object o) |
| | | { |
| | | return list.add(o); |
| | | return list.add((Element) o); |
| | | } |
| | | |
| | | public boolean remove(Object o) |
| | |
| | | |
| | | public Object set(int index, Object element) |
| | | { |
| | | return list.set(index, element); |
| | | return list.set(index, (Element) element); |
| | | } |
| | | |
| | | public void add(int index, Object element) |
| | | { |
| | | list.add(index, element); |
| | | list.add(index, (Element) element); |
| | | } |
| | | |
| | | public Object remove(int index) |
| | |
| | | } |
| | | } |
| | | |
| | | Geometry[] ga = list.toArray(new Geometry[list.size()]); |
| | | GeometryCollection geos = new GeometryCollection(ga, factory); |
| | | |
| | | return geos; |
| | | CoordinateList pts = new CoordinateList(); |
| | | for (Geometry geom : list) |
| | | { |
| | | pts.add(geom.getCoordinates(), true); |
| | | } |
| | | |
| | | return factory.createLinearRing(pts.toCoordinateArray()); |
| | | } |
| | | |
| | | public static class ElementHandler extends Element.ElementHandler |