| | |
| | | |
| | | //~--- non-JDK imports -------------------------------------------------------- |
| | | |
| | | import org.apache.log4j.Logger; |
| | | |
| | | import com.vividsolutions.jts.geom.Coordinate; |
| | | import com.vividsolutions.jts.geom.Geometry; |
| | | import com.vividsolutions.jts.geom.GeometryFactory; |
| | | import com.vividsolutions.jts.geom.LinearRing; |
| | |
| | | */ |
| | | public class ShapeElement extends LineStringElement implements GeometryConverter |
| | | { |
| | | static final Logger logger = Logger.getLogger(ShapeElement.class); |
| | | |
| | | public ShapeElement(short[] raw) |
| | | { |
| | | super(raw); |
| | |
| | | |
| | | public Geometry toGeometry(GeometryFactory factory) |
| | | { |
| | | LinearRing ring = factory.createLinearRing(this.getVertices()); |
| | | return factory.createPolygon(ring, null); |
| | | |
| | | // return factory.createPolygon(ring, null); |
| | | try |
| | | { |
| | | LinearRing ring = factory.createLinearRing(this.getVertices()); |
| | | return factory.createPolygon(ring, null); |
| | | } catch (IllegalArgumentException e) |
| | | { |
| | | logger.warn(e.getMessage(), e); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static class ElementHandler extends Element.ElementHandler |