xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexChainElement.java
@@ -1,7 +1,5 @@ package com.ximple.io.dgn7; //~--- JDK imports ------------------------------------------------------------ import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; @@ -10,8 +8,8 @@ import org.apache.log4j.Logger; import com.vividsolutions.jts.geom.CoordinateList; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryCollection; import com.vividsolutions.jts.geom.GeometryFactory; /** @@ -25,7 +23,7 @@ { private static final Logger logger = Logger.getLogger(ComplexChainElement.class); protected ArrayList list = new ArrayList(); protected ArrayList<Element> list = new ArrayList<Element>(); public ComplexChainElement(byte[] raw) { @@ -60,7 +58,7 @@ public boolean add(Object o) { return list.add(o); return list.add((Element) o); } public boolean remove(Object o) @@ -90,12 +88,12 @@ 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) @@ -150,8 +148,6 @@ public Geometry toGeometry(GeometryFactory factory) { ArrayList<Geometry> list = new ArrayList<Geometry>(); if (size() == 1) { Element element = (Element) get(0); @@ -181,6 +177,7 @@ } } CoordinateList pts = new CoordinateList(); for (ListIterator it = listIterator(); it.hasNext();) { Element element = (Element) it.next(); @@ -189,7 +186,7 @@ { if (((LineStringElement) element).getVerticeSize() == 0 || ((LineStringElement) element).getVerticeSize() > 1) { list.add(((LineStringElement) element).toGeometry(factory)); pts.add(((LineStringElement) element).toGeometry(factory).getCoordinates(), true); } } else if (element instanceof LineElement) @@ -197,19 +194,15 @@ if (((LineElement) element).getVertices().length == 0 || ((LineElement) element).getVertices().length > 1) { list.add(((LineElement) element).toGeometry(factory)); pts.add(((LineElement) element).toGeometry(factory).getCoordinates(), true); } /* } else if (element instanceof ArcElement) { list.add(((ArcElement) element).toGeometry(factory)); */ pts.add(((ArcElement) element).toGeometry(factory).getCoordinates(), true); } } Geometry[] ga = list.toArray(new Geometry[list.size()]); return new GeometryCollection(ga, factory); return factory.createLineString(pts.toCoordinateArray()); } public double getElementSize() xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexShapeElement.java
@@ -13,6 +13,7 @@ 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 @@ -25,7 +26,7 @@ { private static final Logger logger = Logger.getLogger(ComplexShapeElement.class); ArrayList list = new ArrayList(); ArrayList<Element> list = new ArrayList<Element>(); public ComplexShapeElement(byte[] raw) { @@ -59,7 +60,7 @@ public boolean add(Object o) { return list.add(o); return list.add((Element) o); } public boolean remove(Object o) @@ -89,12 +90,12 @@ 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) @@ -177,10 +178,14 @@ } } 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 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/LineStringElement.java
@@ -108,9 +108,9 @@ return -1; } int x = (int) ((raw[19 + (4 * index)] << 16) & 0xffff0000); int x = ((raw[19 + (4 * index)] << 16) & 0xffff0000); x += (int) (raw[20 + (4 * index)] & 0x0000ffff); x += (raw[20 + (4 * index)] & 0x0000ffff); return DgnUtility.converUnitToCoord(x); } @@ -130,9 +130,8 @@ return -1; } int y = (int) ((raw[21 + (4 * index)] << 16) & 0xffff0000); y = y + (int) (raw[22 + (4 * index)] & 0x0000ffff); int y = ((raw[21 + (4 * index)] << 16) & 0xffff0000); y = y + (raw[22 + (4 * index)] & 0x0000ffff); return DgnUtility.converUnitToCoord(y); } xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateSymbolStrategy.java
@@ -85,6 +85,12 @@ angle = ((angle < 0.0) ? (angle + 360.0) : angle); angle = ((angle > 360.0) ? (angle - 360.0) : (angle)); if (txtElement.getText().length() == 0) { logger.info("CreateSymbolStrategy cannot conver " + element.toString() + "to Feature - getText() is empty."); return null; } StringBuilder sb = new StringBuilder(); sb.append("OCT"); char id = txtElement.getText().toCharArray()[0];