| | |
| | | private FeatureTypeBuilder typeBuilderRect = null; |
| | | private FeatureType featureType = null; |
| | | private FeatureType featureType2 = null; |
| | | private FeatureType featureType3 = null; |
| | | |
| | | public IndexDgnConvertMySQLJobContext(String dataPath, DataStore targetDataStore) |
| | | { |
| | |
| | | return null; |
| | | } |
| | | |
| | | public Feature[] createFeature3(FeatureType featureType, Element element) throws IllegalAttributeException |
| | | { |
| | | DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); |
| | | if (element instanceof TextElement) |
| | | { |
| | | TextElement textElement = (TextElement) element; |
| | | String tpclid = textElement.getText(); |
| | | Feature[] result = new Feature[4]; |
| | | |
| | | Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); |
| | | |
| | | for (int i = 0; i < 4; i++) |
| | | { |
| | | char mapSubId = TPCLIDConverter.intToAscii(65 + i); |
| | | int dx = (i % 2) * TPCLIDConverter.SX600; |
| | | int dy = (i / 2) * TPCLIDConverter.SY600; |
| | | |
| | | Geometry geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] |
| | | { |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + dx, extent.getMaxY() - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), |
| | | }), null); |
| | | |
| | | result[i] = featureType.create(new Object[]{ |
| | | geom, |
| | | extent.getMinX(), |
| | | extent.getMinY(), |
| | | extent.getMaxX(), |
| | | extent.getMaxY(), |
| | | tpclid + mapSubId, |
| | | colorTable.getColorCode(textElement.getColorIndex()), |
| | | textElement.getWeight(), |
| | | textElement.getLineStyle() |
| | | }); |
| | | |
| | | } |
| | | return result; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private Feature createFeature(TextElement element) throws SchemaException, IllegalAttributeException |
| | | { |
| | | if (featureType == null) |
| | |
| | | return createFeature2(featureType2, element); |
| | | } |
| | | |
| | | private Feature[] createFeature3(TextElement element) throws SchemaException, IllegalAttributeException |
| | | { |
| | | if (featureType3 == null) |
| | | { |
| | | String dgnname = getFilename().toLowerCase(); |
| | | int i = dgnname.lastIndexOf("."); |
| | | if (i != -1) |
| | | { |
| | | dgnname = dgnname.substring(0, i); |
| | | } |
| | | dgnname = dgnname + "_s"; |
| | | featureType3 = createFeatureElement(dgnname.toLowerCase()); |
| | | } |
| | | return createFeature3(featureType3, element); |
| | | } |
| | | |
| | | protected FrammeAttributeData getFeatureLinkage(Element element) |
| | | { |
| | | if (!element.hasUserAttributeData()) |
| | |
| | | private FeatureTypeBuilder typeBuilderRect = null; |
| | | private FeatureType featureType = null; |
| | | private FeatureType featureType2 = null; |
| | | private FeatureType featureType3 = null; |
| | | |
| | | public IndexDgnConvertOraSDOJobContext(String dataPath, DataStore targetDataStore) |
| | | { |
| | |
| | | return null; |
| | | } |
| | | |
| | | public Feature[] createFeature3(FeatureType featureType, Element element) throws IllegalAttributeException |
| | | { |
| | | DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); |
| | | if (element instanceof TextElement) |
| | | { |
| | | TextElement textElement = (TextElement) element; |
| | | String tpclid = textElement.getText(); |
| | | Feature[] result = new Feature[4]; |
| | | |
| | | Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); |
| | | |
| | | for (int i = 0; i < 4; i++) |
| | | { |
| | | char mapSubId = TPCLIDConverter.intToAscii(65 + i); |
| | | int dx = (i % 2) * TPCLIDConverter.SX600; |
| | | int dy = (i / 2) * TPCLIDConverter.SY600; |
| | | |
| | | Geometry geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] |
| | | { |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + dx, extent.getMaxY() - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), |
| | | }), null); |
| | | |
| | | result[i] = featureType.create(new Object[]{ |
| | | geom, |
| | | extent.getMinX(), |
| | | extent.getMinY(), |
| | | extent.getMaxX(), |
| | | extent.getMaxY(), |
| | | tpclid + mapSubId, |
| | | colorTable.getColorCode(textElement.getColorIndex()), |
| | | textElement.getWeight(), |
| | | textElement.getLineStyle() |
| | | }); |
| | | |
| | | } |
| | | return result; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private Feature createFeature(TextElement element) throws SchemaException, IllegalAttributeException |
| | | { |
| | | if (featureType == null) |
| | |
| | | return createFeature2(featureType2, element); |
| | | } |
| | | |
| | | private Feature[] createFeature3(TextElement element) throws SchemaException, IllegalAttributeException |
| | | { |
| | | if (featureType3 == null) |
| | | { |
| | | String dgnname = getFilename().toLowerCase(); |
| | | int i = dgnname.lastIndexOf("."); |
| | | if (i != -1) |
| | | { |
| | | dgnname = dgnname.substring(0, i); |
| | | } |
| | | dgnname = dgnname + "_s"; |
| | | featureType3 = createFeatureElement(dgnname.toLowerCase()); |
| | | } |
| | | return createFeature3(featureType3, element); |
| | | } |
| | | |
| | | protected FrammeAttributeData getFeatureLinkage(Element element) |
| | | { |
| | | if (!element.hasUserAttributeData()) |
| | |
| | | import java.util.HashMap; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Arrays; |
| | | |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | |
| | | |
| | | private FeatureTypeBuilder typeBuilderPnt = null; |
| | | private FeatureTypeBuilder typeBuilderRect = null; |
| | | |
| | | private FeatureType featureType = null; |
| | | private FeatureType featureType2 = null; |
| | | private FeatureType featureType3 = null; |
| | | |
| | | private boolean dropTableMode = true; |
| | | private int accumulate = 0; |
| | |
| | | } |
| | | arrayList = txFeaturesContext.get(feature.getFeatureType()); |
| | | arrayList.add(feature); |
| | | |
| | | Feature[] features = createFeature3((TextElement) element); |
| | | if (features == null) |
| | | { |
| | | logger.info("cannot craete feature3." + element.toString() + "'" + |
| | | ((TextElement) element).getText() + "'"); |
| | | return; |
| | | } |
| | | if (!txFeaturesContext.containsKey(features[0].getFeatureType())) |
| | | { |
| | | txFeaturesContext.put(features[0].getFeatureType(), new ArrayList<Feature>()); |
| | | } |
| | | arrayList = txFeaturesContext.get(features[0].getFeatureType()); |
| | | arrayList.addAll(Arrays.asList(features)); |
| | | |
| | | accumulate++; |
| | | |
| | | if (accumulate > BATCHSIZE) |
| | |
| | | return null; |
| | | } |
| | | |
| | | public Feature[] createFeature3(FeatureType featureType, Element element) throws IllegalAttributeException |
| | | { |
| | | DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); |
| | | if (element instanceof TextElement) |
| | | { |
| | | TextElement textElement = (TextElement) element; |
| | | String tpclid = textElement.getText(); |
| | | Feature[] result = new Feature[4]; |
| | | |
| | | Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); |
| | | |
| | | for (int i = 0; i < 4; i++) |
| | | { |
| | | char mapSubId = TPCLIDConverter.intToAscii(65 + i); |
| | | int dx = (i % 2) * TPCLIDConverter.SX600; |
| | | int dy = (i / 2) * TPCLIDConverter.SY600; |
| | | |
| | | Geometry geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] |
| | | { |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + dx, extent.getMaxY() - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), |
| | | }), null); |
| | | |
| | | result[i] = featureType.create(new Object[]{ |
| | | geom, |
| | | extent.getMinX(), |
| | | extent.getMinY(), |
| | | extent.getMaxX(), |
| | | extent.getMaxY(), |
| | | tpclid + mapSubId, |
| | | colorTable.getColorCode(textElement.getColorIndex()), |
| | | textElement.getWeight(), |
| | | textElement.getLineStyle() |
| | | }); |
| | | |
| | | } |
| | | return result; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private Feature createFeature(TextElement element) throws SchemaException, IllegalAttributeException |
| | | { |
| | | if (featureType == null) |
| | |
| | | return createFeature2(featureType2, element); |
| | | } |
| | | |
| | | private Feature[] createFeature3(TextElement element) throws SchemaException, IllegalAttributeException |
| | | { |
| | | if (featureType3 == null) |
| | | { |
| | | String dgnname = getFilename().toLowerCase(); |
| | | int i = dgnname.lastIndexOf("."); |
| | | if (i != -1) |
| | | { |
| | | dgnname = dgnname.substring(0, i); |
| | | } |
| | | dgnname = dgnname + "_s"; |
| | | featureType3 = createFeatureElement(dgnname.toLowerCase()); |
| | | } |
| | | return createFeature3(featureType3, element); |
| | | } |
| | | |
| | | protected FrammeAttributeData getFeatureLinkage(Element element) |
| | | { |
| | | if (!element.hasUserAttributeData()) |
| | |
| | | import java.util.HashMap; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Arrays; |
| | | |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | |
| | | private FeatureTypeBuilder typeBuilderRect = null; |
| | | private FeatureType featureType = null; |
| | | private FeatureType featureType2 = null; |
| | | private FeatureType featureType3 = null; |
| | | |
| | | private int accumulate = 0; |
| | | |
| | | public IndexDgnConvertShpJobContext(String dataPath) |
| | | { |
| | |
| | | } |
| | | arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); |
| | | arrayList.add(feature); |
| | | |
| | | Feature[] features = createFeature3((TextElement) element); |
| | | if (features == null) |
| | | { |
| | | logger.info("cannot craete feature3." + element.toString() + "'" + |
| | | ((TextElement) element).getText() + "'"); |
| | | return; |
| | | } |
| | | if (!txFeaturesContext.containsKey(features[0].getFeatureType())) |
| | | { |
| | | txFeaturesContext.put(features[0].getFeatureType(), new ArrayList<Feature>()); |
| | | } |
| | | arrayList = (ArrayList) txFeaturesContext.get(features[0].getFeatureType()); |
| | | arrayList.addAll(Arrays.asList(features)); |
| | | |
| | | accumulate++; |
| | | } |
| | | |
| | | public void startTransaction() |
| | |
| | | return null; |
| | | } |
| | | |
| | | public Feature[] createFeature3(FeatureType featureType, Element element) throws IllegalAttributeException |
| | | { |
| | | DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); |
| | | if (element instanceof TextElement) |
| | | { |
| | | TextElement textElement = (TextElement) element; |
| | | String tpclid = textElement.getText(); |
| | | Feature[] result = new Feature[4]; |
| | | |
| | | Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); |
| | | |
| | | for (int i = 0; i < 4; i++) |
| | | { |
| | | char mapSubId = TPCLIDConverter.intToAscii(65 + i); |
| | | int dx = (i % 2) * TPCLIDConverter.SX600; |
| | | int dy = (i / 2) * TPCLIDConverter.SY600; |
| | | |
| | | Geometry geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] |
| | | { |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + dx, extent.getMaxY() - dy)), |
| | | TWDDatumConverter.fromTM2ToTWD97(new Coordinate( |
| | | extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), |
| | | }), null); |
| | | |
| | | result[i] = featureType.create(new Object[]{ |
| | | geom, |
| | | extent.getMinX(), |
| | | extent.getMinY(), |
| | | extent.getMaxX(), |
| | | extent.getMaxY(), |
| | | tpclid + mapSubId, |
| | | colorTable.getColorCode(textElement.getColorIndex()), |
| | | textElement.getWeight(), |
| | | textElement.getLineStyle() |
| | | }); |
| | | |
| | | } |
| | | return result; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private Feature createFeature(TextElement element) throws SchemaException, IllegalAttributeException |
| | | { |
| | | if (featureType == null) |
| | |
| | | return createFeature2(featureType2, element); |
| | | } |
| | | |
| | | private Feature[] createFeature3(TextElement element) throws SchemaException, IllegalAttributeException |
| | | { |
| | | if (featureType3 == null) |
| | | { |
| | | String dgnname = getFilename().toLowerCase(); |
| | | int i = dgnname.lastIndexOf("."); |
| | | if (i != -1) |
| | | { |
| | | dgnname = dgnname.substring(0, i); |
| | | } |
| | | dgnname = dgnname + "_s"; |
| | | featureType3 = createFeatureElement(dgnname.toLowerCase()); |
| | | } |
| | | return createFeature3(featureType3, element); |
| | | } |
| | | |
| | | protected FrammeAttributeData getFeatureLinkage(Element element) |
| | | { |
| | | if (!element.hasUserAttributeData()) |