15 files modified
3 files added
| | |
| | | xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractFLinkageDispatchableFilter.java svneol=native#text/plain |
| | | xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateFeatureTypeStrategy.java svneol=native#text/plain |
| | | xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineStringStrategy.java svneol=native#text/plain |
| | | xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateShapeStrategy.java svneol=native#text/plain |
| | | xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateTextStrategy.java svneol=native#text/plain |
| | | xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementDispatchableFilter.java svneol=native#text/plain |
| | | xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementDispatcher.java svneol=native#text/plain |
| | |
| | | xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/BinConverter.java svneol=native#text/plain |
| | | xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/Bits.java svneol=native#text/plain |
| | | xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ByteArrayCompressor.java svneol=native#text/plain |
| | | xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ColorTableMapping.java svneol=native#text/plain |
| | | xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/DefaultColorTable.java svneol=native#text/plain |
| | | xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/GeomUtil.java svneol=native#text/plain |
| | | xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/LangUtil.java svneol=native#text/plain |
| | | xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/PrintfFormat.java svneol=native#text/plain |
| | |
| | | <test.maxHeapSize>512M</test.maxHeapSize> |
| | | <src.output>${basedir}/target</src.output> |
| | | <java5>1.5</java5> |
| | | <xdgnio.version>0.0.2</xdgnio.version> |
| | | <gt.version>2.4.1</gt.version> |
| | | <xdgnio.version>0.3.0</xdgnio.version> |
| | | <gt.version>2.4.2</gt.version> |
| | | <failIfNoTests>false</failIfNoTests> |
| | | </properties> |
| | | |
| | |
| | | <groupId>com.ximple.eofms</groupId> |
| | | <artifactId>ximple-dgnjobs</artifactId> |
| | | <packaging>pom</packaging> |
| | | <version>0.0.2</version> |
| | | <version>0.3.0</version> |
| | | <name>ximple-dgnjobs</name> |
| | | <url>http://www.ximple.com.tw</url> |
| | | |
| | |
| | | <parent> |
| | | <groupId>com.ximple.eofms</groupId> |
| | | <artifactId>ximple-dgnjobs</artifactId> |
| | | <version>0.0.2</version> |
| | | <version>0.3.0</version> |
| | | </parent> |
| | | |
| | | <!-- =========================================================== --> |
| | |
| | | <!-- =========================================================== --> |
| | | <groupId>com.ximple.eofms</groupId> |
| | | <artifactId>ximple-dgnio</artifactId> |
| | | <version>0.0.2</version> |
| | | <version>0.3.0</version> |
| | | <packaging>jar</packaging> |
| | | <name>ximple-dgnio-1.0.x</name> |
| | | <url>http://www.ximple.com.tw</url> |
| | |
| | | |
| | | public Geometry toGeometry(GeometryFactory factory) |
| | | { |
| | | ArrayList list = new ArrayList(); |
| | | ArrayList<Geometry> list = new ArrayList<Geometry>(); |
| | | |
| | | for (ListIterator it = listIterator(); it.hasNext(); ) |
| | | { |
| | | Element element = (Element) it.next(); |
| | | |
| | | if (element instanceof LineStringElement) |
| | | if (element instanceof ShapeElement) |
| | | { |
| | | if( ((ShapeElement) element).getVerticeSize() == 0 || ((ShapeElement) element).getVerticeSize() > 1) |
| | | { |
| | | list.add(((ShapeElement) element).toGeometry(factory)); |
| | | } |
| | | } |
| | | else if (element instanceof LineStringElement) |
| | | { |
| | | if( ((LineStringElement) element).getVerticeSize() == 0 || ((LineStringElement) element).getVerticeSize() > 1) |
| | | { |
| | | list.add(((LineStringElement) element).toGeometry(factory)); |
| | | } |
| | | |
| | | |
| | | } else if (element instanceof LineElement) |
| | | { |
| | | |
| | | if( ((LineElement) element).getVertices().length == 0 || ((LineElement) element).getVertices().length > 1 ) |
| | | { |
| | | list.add(((LineElement) element).toGeometry(factory)); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | Geometry[] ga = (Geometry[]) list.toArray(new Geometry[list.size()]); |
| | | Geometry[] ga = list.toArray(new Geometry[list.size()]); |
| | | GeometryCollection geos = new GeometryCollection(ga, factory); |
| | | |
| | | return geos; |
| | |
| | | public Geometry toGeometry(GeometryFactory factory) |
| | | { |
| | | LinearRing ring = factory.createLinearRing(this.getVertices()); |
| | | |
| | | return ring; |
| | | return factory.createPolygon(ring, null); |
| | | |
| | | // return factory.createPolygon(ring, null); |
| | | } |
| | |
| | | <parent> |
| | | <groupId>com.ximple.eofms</groupId> |
| | | <artifactId>ximple-dgnjobs</artifactId> |
| | | <version>0.0.2</version> |
| | | <version>0.3.0</version> |
| | | </parent> |
| | | |
| | | |
| | | <groupId>com.ximple.eofms</groupId> |
| | | <artifactId>ximple-jobcarrier</artifactId> |
| | | <version>0.0.2</version> |
| | | <version>0.3.0</version> |
| | | <packaging>jar</packaging> |
| | | <name>ximple-jobcarrier</name> |
| | | <url>http://maven.apache.org</url> |
| | | |
| | | <properties> |
| | | <xdgnio.version>0.3.0</xdgnio.version> |
| | | </properties> |
| | | |
| | | <scm> |
| | | <connection> |
| | | scm:svn:http://www.ximple.com.tw/svn/xeofms/xspatialjob/truck/ |
| | |
| | | <parent> |
| | | <groupId>com.ximple.eofms</groupId> |
| | | <artifactId>ximple-dgnjobs</artifactId> |
| | | <version>0.0.2</version> |
| | | <version>0.3.0</version> |
| | | </parent> |
| | | |
| | | <groupId>com.ximple.eofms</groupId> |
| | | <artifactId>ximple-spatialjob</artifactId> |
| | | <version>0.0.2</version> |
| | | <version>0.3.0</version> |
| | | <packaging>jar</packaging> |
| | | <name>ximple-spatialjob</name> |
| | | <url>http://www.ximple.com.tw</url> |
| | | |
| | | <properties> |
| | | <xdgnio.version>0.3.0</xdgnio.version> |
| | | </properties> |
| | | |
| | | <description> |
| | | Ximple Spatial Data Job for Quartz |
| | | </description> |
| | |
| | | |
| | | import com.ximple.io.dgn7.*; |
| | | import com.ximple.eofms.jobs.TWD97GeometryConverterDecorator; |
| | | import com.ximple.eofms.util.DefaultColorTable; |
| | | |
| | | public class CreateLineStringStrategy implements CreateFeatureTypeStrategy |
| | | { |
| | |
| | | |
| | | public Feature createFeature(FeatureType featureType, Element element) throws IllegalAttributeException |
| | | { |
| | | DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); |
| | | FrammeAttributeData fLinkage = getFeatureLinkage(element); |
| | | if (fLinkage == null) return null; |
| | | if (element instanceof LineStringElement) |
| | |
| | | (int) fLinkage.getComponentID(), |
| | | 0, |
| | | lineStringElement.getLevelIndex(), |
| | | lineStringElement.getColorIndex(), |
| | | colorTable.getColor(lineStringElement.getColorIndex()).getRGB(), |
| | | lineStringElement.getWeight(), |
| | | lineStringElement.getLineStyle(), |
| | | }); |
| | |
| | | (int) fLinkage.getComponentID(), |
| | | 0, |
| | | complexChain.getLevelIndex(), |
| | | complexChain.getColorIndex(), |
| | | colorTable.getColor(complexChain.getColorIndex()).getRGB(), |
| | | complexChain.getWeight(), |
| | | complexChain.getLineStyle(), |
| | | }); |
New file |
| | |
| | | package com.ximple.eofms.filter; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.geotools.feature.FeatureTypeBuilder; |
| | | import org.geotools.feature.FeatureType; |
| | | import org.geotools.feature.SchemaException; |
| | | import org.geotools.feature.AttributeTypeFactory; |
| | | import org.geotools.feature.Feature; |
| | | import org.geotools.feature.IllegalAttributeException; |
| | | |
| | | import com.vividsolutions.jts.geom.GeometryFactory; |
| | | import com.vividsolutions.jts.geom.Geometry; |
| | | |
| | | import com.ximple.eofms.jobs.TWD97GeometryConverterDecorator; |
| | | import com.ximple.eofms.util.DefaultColorTable; |
| | | import com.ximple.io.dgn7.FrammeAttributeData; |
| | | import com.ximple.io.dgn7.Element; |
| | | import com.ximple.io.dgn7.UserAttributeData; |
| | | import com.ximple.io.dgn7.LineStringElement; |
| | | import com.ximple.io.dgn7.ComplexChainElement; |
| | | import com.ximple.io.dgn7.ShapeElement; |
| | | import com.ximple.io.dgn7.ComplexShapeElement; |
| | | |
| | | public class CreateShapeStrategy implements CreateFeatureTypeStrategy |
| | | { |
| | | GeometryFactory geometryFactory = new GeometryFactory(); |
| | | FeatureTypeBuilder typeBuilder = null; |
| | | TWD97GeometryConverterDecorator convertDecordator = new TWD97GeometryConverterDecorator(); |
| | | |
| | | public CreateShapeStrategy() |
| | | { |
| | | } |
| | | |
| | | protected FrammeAttributeData getFeatureLinkage(Element element) |
| | | { |
| | | if (!element.hasUserAttributeData()) |
| | | return null; |
| | | |
| | | List<UserAttributeData> usrDatas = element.getUserAttributeData(); |
| | | for (UserAttributeData anUsrData : usrDatas) |
| | | { |
| | | if (anUsrData instanceof FrammeAttributeData) |
| | | { |
| | | return (FrammeAttributeData) anUsrData; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public FeatureType createFeatureElement(String featureName) throws SchemaException |
| | | { |
| | | if (typeBuilder == null) |
| | | { |
| | | typeBuilder = FeatureTypeBuilder.newInstance(featureName); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("GEOM", Geometry.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("TID", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("OID", Long.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("CID", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("LID", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("LEVEL", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMCOLOR", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMWEIGHT", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMSTYLE", Integer.class)); |
| | | } |
| | | return typeBuilder.getFeatureType(); |
| | | } |
| | | |
| | | public Feature createFeature(FeatureType featureType, Element element) throws IllegalAttributeException |
| | | { |
| | | DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); |
| | | FrammeAttributeData fLinkage = getFeatureLinkage(element); |
| | | if (fLinkage == null) return null; |
| | | if (element instanceof ShapeElement) |
| | | { |
| | | ShapeElement shapeElement = (ShapeElement) element; |
| | | convertDecordator.setConverter(shapeElement); |
| | | Feature feature = featureType.create(new Object[]{ |
| | | convertDecordator.toGeometry(geometryFactory), |
| | | (int) fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (int) fLinkage.getComponentID(), |
| | | 0, |
| | | shapeElement.getLevelIndex(), |
| | | colorTable.getColor(shapeElement.getColorIndex()).getRGB(), |
| | | shapeElement.getWeight(), |
| | | shapeElement.getLineStyle(), |
| | | }); |
| | | return feature; |
| | | } else if (element instanceof ComplexShapeElement) |
| | | { |
| | | ComplexShapeElement complexShape = (ComplexShapeElement) element; |
| | | convertDecordator.setConverter(complexShape); |
| | | Feature feature = featureType.create(new Object[]{ |
| | | convertDecordator.toGeometry(geometryFactory), |
| | | (int) fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (int) fLinkage.getComponentID(), |
| | | 0, |
| | | complexShape.getLevelIndex(), |
| | | colorTable.getColor(complexShape.getColorIndex()).getRGB(), |
| | | complexShape.getWeight(), |
| | | complexShape.getLineStyle(), |
| | | }); |
| | | return feature; |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | | |
| | |
| | | import com.ximple.io.dgn7.UserAttributeData; |
| | | import com.ximple.io.dgn7.TextNodeElement; |
| | | import com.ximple.eofms.jobs.TWD97GeometryConverterDecorator; |
| | | import com.ximple.eofms.util.DefaultColorTable; |
| | | |
| | | public class CreateTextStrategy implements CreateFeatureTypeStrategy |
| | | { |
| | |
| | | |
| | | public Feature createFeature(FeatureType featureType, Element element) throws IllegalAttributeException |
| | | { |
| | | DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); |
| | | FrammeAttributeData fLinkage = getFeatureLinkage(element); |
| | | if (fLinkage == null) return null; |
| | | if (element instanceof TextElement) |
| | |
| | | (int) fLinkage.getComponentID(), |
| | | 0, |
| | | txtElement.getLevelIndex(), |
| | | txtElement.getColorIndex(), |
| | | colorTable.getColor(txtElement.getColorIndex()).getRGB(), |
| | | txtElement.getWeight(), |
| | | txtElement.getLineStyle(), |
| | | txtElement.getFontIndex(), |
| | |
| | | package com.ximple.eofms.filter; |
| | | |
| | | import com.ximple.io.dgn7.Element; |
| | | |
| | | import java.util.ArrayList; |
| | | |
| | | import com.ximple.io.dgn7.Element; |
| | | |
| | | public class ElementLevelCriterion implements Comparable |
| | | { |
| | | private int elementLevel; |
| | |
| | | public void filter(CoordinateSequence coordinateSequence, int i) |
| | | { |
| | | Coordinate pt = coordinateSequence.getCoordinateCopy(i); |
| | | Coordinate pt97 = TWDDatumConverter.toTWD97(pt); |
| | | Coordinate pt97 = TWDDatumConverter.fromTM2ToTWD97(pt); |
| | | pt.x = pt97.x; |
| | | pt.y = pt97.y; |
| | | pt.z = pt97.z; |
New file |
| | |
| | | package com.ximple.eofms.util; |
| | | |
| | | import java.awt.Color; |
| | | import java.util.List; |
| | | |
| | | public interface ColorTableMapping |
| | | { |
| | | List getCode(Color color); |
| | | Color getColor(int value); |
| | | boolean contain(Color color); |
| | | } |
New file |
| | |
| | | package com.ximple.eofms.util; |
| | | |
| | | import java.awt.Color; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Iterator; |
| | | |
| | | public class DefaultColorTable implements ColorTableMapping |
| | | { |
| | | private static DefaultColorTable _instance = null; |
| | | |
| | | public static ColorTableMapping getInstance() |
| | | { |
| | | if (_instance == null) |
| | | { |
| | | _instance = new DefaultColorTable(); |
| | | } |
| | | |
| | | return _instance; |
| | | } |
| | | |
| | | private ArrayList<Color> colortable = null; |
| | | private DefaultColorTable() |
| | | { |
| | | initializeColorTable(); |
| | | } |
| | | |
| | | private void initializeColorTable() |
| | | { |
| | | if (colortable != null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | colortable = new ArrayList<Color>(255); |
| | | colortable.add(0, new Color(255, 255, 255)); |
| | | colortable.add(1, new Color(0, 0, 255)); |
| | | colortable.add(2, new Color(0, 255, 0)); |
| | | colortable.add(3, new Color(255, 0, 0)); |
| | | colortable.add(4, new Color(255, 255, 0)); |
| | | colortable.add(5, new Color(255, 0, 255)); |
| | | colortable.add(6, new Color(255, 127, 0)); |
| | | colortable.add(7, new Color(0, 255, 255)); |
| | | colortable.add(8, new Color(64, 64, 64)); |
| | | colortable.add(9, new Color(192, 192, 192)); |
| | | colortable.add(10, new Color(254, 0, 96)); |
| | | colortable.add(11, new Color(160, 224, 0)); |
| | | colortable.add(12, new Color(0, 254, 160)); |
| | | colortable.add(13, new Color(128, 0, 160)); |
| | | colortable.add(14, new Color(176, 176, 176)); |
| | | colortable.add(15, new Color(0, 240, 240)); |
| | | colortable.add(16, new Color(240, 240, 240)); |
| | | colortable.add(17, new Color(0, 0, 240)); |
| | | colortable.add(18, new Color(0, 240, 0)); |
| | | colortable.add(19, new Color(240, 0, 0)); |
| | | colortable.add(20, new Color(240, 240, 0)); |
| | | colortable.add(21, new Color(240, 0, 240)); |
| | | colortable.add(22, new Color(240, 122, 0)); |
| | | colortable.add(23, new Color(0, 240, 240)); |
| | | colortable.add(24, new Color(240, 240, 240)); |
| | | colortable.add(25, new Color(0, 0, 240)); |
| | | colortable.add(26, new Color(0, 240, 0)); |
| | | colortable.add(27, new Color(240, 0, 0)); |
| | | colortable.add(28, new Color(240, 240, 0)); |
| | | colortable.add(29, new Color(240, 0, 240)); |
| | | colortable.add(30, new Color(240, 122, 0)); |
| | | colortable.add(31, new Color(0, 225, 225)); |
| | | colortable.add(32, new Color(225, 225, 225)); |
| | | colortable.add(33, new Color(0, 0, 225)); |
| | | colortable.add(34, new Color(0, 225, 0)); |
| | | colortable.add(35, new Color(225, 0, 0)); |
| | | colortable.add(36, new Color(225, 225, 0)); |
| | | colortable.add(37, new Color(225, 0, 225)); |
| | | colortable.add(38, new Color(225, 117, 0)); |
| | | colortable.add(39, new Color(0, 225, 225)); |
| | | colortable.add(40, new Color(225, 225, 225)); |
| | | colortable.add(41, new Color(0, 0, 225)); |
| | | colortable.add(42, new Color(0, 225, 0)); |
| | | colortable.add(43, new Color(225, 0, 0)); |
| | | colortable.add(44, new Color(225, 225, 0)); |
| | | colortable.add(45, new Color(225, 0, 225)); |
| | | colortable.add(46, new Color(225, 117, 0)); |
| | | colortable.add(47, new Color(0, 210, 210)); |
| | | colortable.add(48, new Color(210, 210, 210)); |
| | | colortable.add(49, new Color(0, 0, 210)); |
| | | colortable.add(50, new Color(0, 210, 0)); |
| | | colortable.add(51, new Color(210, 0, 0)); |
| | | colortable.add(52, new Color(210, 210, 0)); |
| | | colortable.add(53, new Color(210, 0, 210)); |
| | | colortable.add(54, new Color(210, 112, 0)); |
| | | colortable.add(55, new Color(0, 210, 210)); |
| | | colortable.add(56, new Color(210, 210, 210)); |
| | | colortable.add(57, new Color(0, 0, 210)); |
| | | colortable.add(58, new Color(0, 210, 0)); |
| | | colortable.add(59, new Color(210, 0, 0)); |
| | | colortable.add(60, new Color(210, 210, 0)); |
| | | colortable.add(61, new Color(210, 0, 210)); |
| | | colortable.add(62, new Color(210, 112, 0)); |
| | | colortable.add(63, new Color(0, 195, 195)); |
| | | colortable.add(64, new Color(195, 195, 195)); |
| | | colortable.add(65, new Color(0, 0, 195)); |
| | | colortable.add(66, new Color(0, 195, 0)); |
| | | colortable.add(67, new Color(195, 0, 0)); |
| | | colortable.add(68, new Color(195, 195, 0)); |
| | | colortable.add(69, new Color(195, 0, 195)); |
| | | colortable.add(70, new Color(195, 107, 0)); |
| | | colortable.add(71, new Color(0, 195, 195)); |
| | | colortable.add(72, new Color(195, 195, 195)); |
| | | colortable.add(73, new Color(0, 0, 195)); |
| | | colortable.add(74, new Color(0, 195, 0)); |
| | | colortable.add(75, new Color(195, 0, 0)); |
| | | colortable.add(76, new Color(195, 195, 0)); |
| | | colortable.add(77, new Color(195, 0, 195)); |
| | | colortable.add(78, new Color(195, 107, 0)); |
| | | colortable.add(79, new Color(0, 180, 180)); |
| | | colortable.add(80, new Color(180, 180, 180)); |
| | | colortable.add(81, new Color(0, 0, 180)); |
| | | colortable.add(82, new Color(0, 180, 0)); |
| | | colortable.add(83, new Color(180, 0, 0)); |
| | | colortable.add(84, new Color(180, 180, 0)); |
| | | colortable.add(85, new Color(180, 0, 180)); |
| | | colortable.add(86, new Color(180, 102, 0)); |
| | | colortable.add(87, new Color(0, 180, 180)); |
| | | colortable.add(88, new Color(180, 180, 180)); |
| | | colortable.add(89, new Color(0, 0, 180)); |
| | | colortable.add(90, new Color(0, 180, 0)); |
| | | colortable.add(91, new Color(180, 0, 0)); |
| | | colortable.add(92, new Color(180, 180, 0)); |
| | | colortable.add(93, new Color(180, 0, 180)); |
| | | colortable.add(94, new Color(180, 102, 0)); |
| | | colortable.add(95, new Color(0, 165, 165)); |
| | | colortable.add(96, new Color(165, 165, 165)); |
| | | colortable.add(97, new Color(0, 0, 165)); |
| | | colortable.add(98, new Color(0, 165, 0)); |
| | | colortable.add(99, new Color(165, 0, 0)); |
| | | colortable.add(100, new Color(165, 165, 0)); |
| | | colortable.add(101, new Color(165, 0, 165)); |
| | | colortable.add(102, new Color(165, 97, 0)); |
| | | colortable.add(103, new Color(0, 165, 165)); |
| | | colortable.add(104, new Color(165, 165, 165)); |
| | | colortable.add(105, new Color(0, 0, 165)); |
| | | colortable.add(106, new Color(0, 165, 0)); |
| | | colortable.add(107, new Color(165, 0, 0)); |
| | | colortable.add(108, new Color(165, 165, 0)); |
| | | colortable.add(109, new Color(165, 0, 165)); |
| | | colortable.add(110, new Color(165, 97, 0)); |
| | | colortable.add(111, new Color(0, 150, 150)); |
| | | colortable.add(112, new Color(150, 150, 150)); |
| | | colortable.add(113, new Color(0, 0, 150)); |
| | | colortable.add(114, new Color(0, 150, 0)); |
| | | colortable.add(115, new Color(150, 0, 0)); |
| | | colortable.add(116, new Color(150, 150, 0)); |
| | | colortable.add(117, new Color(150, 0, 150)); |
| | | colortable.add(118, new Color(150, 92, 0)); |
| | | colortable.add(119, new Color(0, 150, 150)); |
| | | colortable.add(120, new Color(150, 150, 150)); |
| | | colortable.add(121, new Color(0, 0, 150)); |
| | | colortable.add(122, new Color(0, 150, 0)); |
| | | colortable.add(123, new Color(150, 0, 0)); |
| | | colortable.add(124, new Color(150, 150, 0)); |
| | | colortable.add(125, new Color(150, 0, 150)); |
| | | colortable.add(126, new Color(150, 92, 0)); |
| | | colortable.add(127, new Color(0, 135, 135)); |
| | | colortable.add(128, new Color(135, 135, 135)); |
| | | colortable.add(129, new Color(0, 0, 135)); |
| | | colortable.add(130, new Color(0, 135, 0)); |
| | | colortable.add(131, new Color(135, 0, 0)); |
| | | colortable.add(132, new Color(135, 135, 0)); |
| | | colortable.add(133, new Color(135, 0, 135)); |
| | | colortable.add(134, new Color(135, 87, 0)); |
| | | colortable.add(135, new Color(0, 135, 135)); |
| | | colortable.add(136, new Color(135, 135, 135)); |
| | | colortable.add(137, new Color(0, 0, 135)); |
| | | colortable.add(138, new Color(0, 135, 0)); |
| | | colortable.add(139, new Color(135, 0, 0)); |
| | | colortable.add(140, new Color(135, 135, 0)); |
| | | colortable.add(141, new Color(135, 0, 135)); |
| | | colortable.add(142, new Color(135, 87, 0)); |
| | | colortable.add(143, new Color(0, 120, 120)); |
| | | colortable.add(144, new Color(120, 120, 120)); |
| | | colortable.add(145, new Color(0, 0, 120)); |
| | | colortable.add(146, new Color(0, 120, 0)); |
| | | colortable.add(147, new Color(120, 0, 0)); |
| | | colortable.add(148, new Color(120, 120, 0)); |
| | | colortable.add(149, new Color(120, 0, 120)); |
| | | colortable.add(150, new Color(120, 82, 0)); |
| | | colortable.add(151, new Color(0, 120, 120)); |
| | | colortable.add(152, new Color(120, 120, 120)); |
| | | colortable.add(153, new Color(0, 0, 120)); |
| | | colortable.add(154, new Color(0, 120, 0)); |
| | | colortable.add(155, new Color(120, 0, 0)); |
| | | colortable.add(156, new Color(120, 120, 0)); |
| | | colortable.add(157, new Color(120, 0, 120)); |
| | | colortable.add(158, new Color(120, 82, 0)); |
| | | colortable.add(159, new Color(0, 105, 105)); |
| | | colortable.add(160, new Color(105, 105, 105)); |
| | | colortable.add(161, new Color(0, 0, 105)); |
| | | colortable.add(162, new Color(0, 105, 0)); |
| | | colortable.add(163, new Color(105, 0, 0)); |
| | | colortable.add(164, new Color(105, 105, 0)); |
| | | colortable.add(165, new Color(105, 0, 105)); |
| | | colortable.add(166, new Color(105, 77, 0)); |
| | | colortable.add(167, new Color(0, 105, 105)); |
| | | colortable.add(168, new Color(105, 105, 105)); |
| | | colortable.add(169, new Color(0, 0, 105)); |
| | | colortable.add(170, new Color(0, 105, 0)); |
| | | colortable.add(171, new Color(105, 0, 0)); |
| | | colortable.add(172, new Color(105, 105, 0)); |
| | | colortable.add(173, new Color(105, 0, 105)); |
| | | colortable.add(174, new Color(105, 77, 0)); |
| | | colortable.add(175, new Color(0, 90, 90)); |
| | | colortable.add(176, new Color(90, 90, 90)); |
| | | colortable.add(177, new Color(0, 0, 90)); |
| | | colortable.add(178, new Color(0, 90, 0)); |
| | | colortable.add(179, new Color(90, 0, 0)); |
| | | colortable.add(180, new Color(90, 90, 0)); |
| | | colortable.add(181, new Color(90, 0, 90)); |
| | | colortable.add(182, new Color(90, 72, 0)); |
| | | colortable.add(183, new Color(0, 90, 90)); |
| | | colortable.add(184, new Color(90, 90, 90)); |
| | | colortable.add(185, new Color(0, 0, 90)); |
| | | colortable.add(186, new Color(0, 90, 0)); |
| | | colortable.add(187, new Color(90, 0, 0)); |
| | | colortable.add(188, new Color(90, 90, 0)); |
| | | colortable.add(189, new Color(90, 0, 90)); |
| | | colortable.add(190, new Color(90, 72, 0)); |
| | | colortable.add(191, new Color(0, 75, 75)); |
| | | colortable.add(192, new Color(75, 75, 75)); |
| | | colortable.add(193, new Color(0, 0, 75)); |
| | | colortable.add(194, new Color(0, 75, 0)); |
| | | colortable.add(195, new Color(75, 0, 0)); |
| | | colortable.add(196, new Color(75, 75, 0)); |
| | | colortable.add(197, new Color(75, 0, 75)); |
| | | colortable.add(198, new Color(75, 67, 0)); |
| | | colortable.add(199, new Color(0, 75, 75)); |
| | | colortable.add(200, new Color(75, 75, 75)); |
| | | colortable.add(201, new Color(0, 0, 75)); |
| | | colortable.add(202, new Color(0, 75, 0)); |
| | | colortable.add(203, new Color(75, 0, 0)); |
| | | colortable.add(204, new Color(75, 75, 0)); |
| | | colortable.add(205, new Color(75, 0, 75)); |
| | | colortable.add(206, new Color(75, 67, 0)); |
| | | colortable.add(207, new Color(0, 60, 60)); |
| | | colortable.add(208, new Color(60, 60, 60)); |
| | | colortable.add(209, new Color(0, 0, 60)); |
| | | colortable.add(210, new Color(0, 60, 0)); |
| | | colortable.add(211, new Color(60, 0, 0)); |
| | | colortable.add(212, new Color(60, 60, 0)); |
| | | colortable.add(213, new Color(60, 0, 60)); |
| | | colortable.add(214, new Color(60, 62, 0)); |
| | | colortable.add(215, new Color(0, 60, 60)); |
| | | colortable.add(216, new Color(60, 60, 60)); |
| | | colortable.add(217, new Color(0, 0, 60)); |
| | | colortable.add(218, new Color(0, 60, 0)); |
| | | colortable.add(219, new Color(60, 0, 0)); |
| | | colortable.add(220, new Color(60, 60, 0)); |
| | | colortable.add(221, new Color(60, 0, 60)); |
| | | colortable.add(222, new Color(60, 62, 0)); |
| | | colortable.add(223, new Color(0, 45, 45)); |
| | | colortable.add(224, new Color(45, 45, 45)); |
| | | colortable.add(225, new Color(0, 0, 45)); |
| | | colortable.add(226, new Color(0, 45, 0)); |
| | | colortable.add(227, new Color(45, 0, 0)); |
| | | colortable.add(228, new Color(45, 45, 0)); |
| | | colortable.add(229, new Color(45, 0, 45)); |
| | | colortable.add(230, new Color(45, 57, 0)); |
| | | colortable.add(231, new Color(0, 45, 45)); |
| | | colortable.add(232, new Color(45, 45, 45)); |
| | | colortable.add(233, new Color(0, 0, 45)); |
| | | colortable.add(234, new Color(0, 45, 0)); |
| | | colortable.add(235, new Color(45, 0, 0)); |
| | | colortable.add(236, new Color(45, 45, 0)); |
| | | colortable.add(237, new Color(45, 0, 45)); |
| | | colortable.add(238, new Color(45, 57, 0)); |
| | | colortable.add(239, new Color(0, 30, 30)); |
| | | colortable.add(240, new Color(30, 30, 30)); |
| | | colortable.add(241, new Color(0, 0, 30)); |
| | | colortable.add(242, new Color(0, 30, 0)); |
| | | colortable.add(243, new Color(30, 0, 0)); |
| | | colortable.add(244, new Color(30, 30, 0)); |
| | | colortable.add(245, new Color(30, 0, 30)); |
| | | colortable.add(246, new Color(30, 52, 0)); |
| | | colortable.add(247, new Color(0, 30, 30)); |
| | | colortable.add(248, new Color(30, 30, 30)); |
| | | colortable.add(249, new Color(0, 0, 30)); |
| | | colortable.add(250, new Color(0, 30, 0)); |
| | | colortable.add(251, new Color(30, 0, 0)); |
| | | colortable.add(252, new Color(30, 30, 0)); |
| | | colortable.add(253, new Color(30, 0, 30)); |
| | | colortable.add(254, new Color(30, 52, 0)); |
| | | } |
| | | |
| | | public List getCode(Color color) |
| | | { |
| | | ArrayList<Integer> codelist = new ArrayList<Integer>(); |
| | | for (int i = 0; i < colortable.size(); i++) |
| | | { |
| | | Color colorDef = colortable.get(i); |
| | | if (colorDef.equals(color)) |
| | | { |
| | | codelist.add(i); |
| | | } |
| | | } |
| | | return codelist; |
| | | } |
| | | |
| | | public Color getColor(int i) |
| | | { |
| | | return colortable.get(i); |
| | | } |
| | | |
| | | public boolean contain(Color color) |
| | | { |
| | | for (Color colorDef : colortable) |
| | | { |
| | | if (colorDef.equals(color)) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | |
| | | return new Coordinate(newX, newY, newZ); |
| | | } |
| | | |
| | | public static void toTM2(double a, double ecc, double ecc2, double lat, double lon, double scale, double x, double y) |
| | | public static Coordinate toTM2(double a, double ecc, double ecc2, double lat, double lon, double scale, double x, double y) |
| | | { |
| | | double x0, y0, x1, y1, m0, m1; |
| | | double n, t, c, A; |
| | |
| | | + n * Math.tan(y0) |
| | | * (A * A / 2.0 + (5.0 - t + 9.0 * c + 4 * c * c) * Math.pow(A, 4.0) / 24.0 |
| | | + (61.0 - 58.0 * t + t * t + 600.0 * c - 330.0 * ecc2) * Math.pow(A, 6.0) / 720.0)); |
| | | return new Coordinate(newX, newY); |
| | | } |
| | | |
| | | public static void fromTM2(double a, double ecc, double ecc2, double lat, double lon, double scale, double x, double y) |
| | | public static Coordinate fromTM2(double a, double ecc, double ecc2, double lat, double lon, double scale, double x, double y) |
| | | { |
| | | double newX, newY; |
| | | double x0, y0, x1, y1, phi, m, m0, mu, e1; |
| | |
| | | * (d * d / 2.0 - (5.0 + 3.0 * t1 + 10.0 * c1 - 4.0 * c1 * c1 - 9.0 * ecc2) * Math.pow(d, 4.0) / 24.0 |
| | | + (61.0 + 90.0 * t1 + 298.0 * c1 + 45.0 * t1 * t1 - 252.0 * ecc2 - 3.0 * c1 * c1) * Math.pow(d, 6.0) |
| | | / 72.0)) * RAD_DEG; |
| | | return new Coordinate(newX, newY); |
| | | } |
| | | |
| | | private static double mercator(double y, double a, double ecc) |
| | |
| | | * printf("Acuuracy (%.4f, X:%.4f, Y:%.4f)nn", sqrt((dx1-tx1)*(dx1-tx1)+(dy1-ty1)*(dy1-ty1)), (dx1-tx1), (dy1-ty1)); |
| | | * } |
| | | */ |
| | | |
| | | public static Coordinate fromTM2ToTWD97(Coordinate pt) |
| | | { |
| | | return fromTM2(TWD97_A,TWD97_ECC,TWD97_ECC2, 0, 121, TWD97_TM2, pt.x, pt.y); |
| | | } |
| | | } |
| | |
| | | <elementType>17</elementType> |
| | | </elementCriterion> |
| | | <TextCreateStrategy/> |
| | | </TypeCompFilter><!-- Low Voltage Features --> |
| | | </TypeCompFilter> |
| | | <!-- Low Voltage Features --> |
| | | <TypeCompFilter name="FSC-200.C-0"> |
| | | <tid>200</tid> |
| | | <cid>0</cid> |