forked from geodmms/xdgnjobs

?? ?
2008-05-07 10445847ed1bfa5755127e828b603a3cdd49c5e3
xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ShapeElement.java
@@ -2,6 +2,9 @@
//~--- 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;
@@ -15,6 +18,8 @@
 */
public class ShapeElement extends LineStringElement implements GeometryConverter
{
    static final Logger logger = Logger.getLogger(ShapeElement.class);
    public ShapeElement(short[] raw)
    {
        super(raw);
@@ -22,10 +27,15 @@
    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