From 94ae08701bbd7585a0b7e5a92d1975965a503c03 Mon Sep 17 00:00:00 2001 From: Dennis Kao <ulysseskao@gmail.com> Date: Wed, 15 Jan 2014 11:28:52 +0800 Subject: [PATCH] Merge branch 'origin/2.1.x' --- xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementDispatcher.java | 61 .gitattributes | 25 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateShapeStrategy.java | 156 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/XGeosConfigDigesterUtils.java | 27 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/OracleConvertMySQLJobContext.java | 186 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleConvertPostGISJobContext.java | 340 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/Bits.java | 138 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/TWDDatumConverter.java | 174 xdgnjobs/ximple-spatialjob/pom.xml | 68 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/AbstractOracleToPostGISJobContext.java | 602 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateEllipseShapeStrategy.java | 117 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ColorTableMapping.java | 3 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/geoserver/config/XGeosDataConfigMapping.java | 20 xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs_edb.xml | 148 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/BinConverter.java | 131 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateArcLineStringStrategy.java | 101 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/FileUtils.java | 63 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/AbstractOracleToOraSDOJobContext.java | 58 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2MySQLJob.java | 563 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateTextStrategy.java | 181 xdgnjobs/ximple-build/maven/jar-collector/src/main/java/com/ximple/eofms/maven/JarCollector.java | 62 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/EPSG3825GeometryConverterDecorator.java | 66 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsBinaryWriter.java | 207 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileException.java | 15 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleTransformColorOwnerJob.java | 580 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TextElement.java | 159 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractFLinkageDispatchableFilter.java | 28 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/FeatureDgnConvertOraSDOJobContext.java | 186 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineStringStrategy.java | 230 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/AbstractDgnToShapefileJobContext.java | 9 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/IndexDgnConvertEdbGeoJobContext.java | 829 xdgnjobs/ximple-elmparser/src/main/java/com/ximple/eofms/XElementParser.java | 3 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractDgnFileJobContext.java | 132 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/FeatureTypeBuilderUtil.java | 927 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/AbstractOracleToMySQLJobContext.java | 57 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/OracleConvertShapefilesJobContext.java | 260 xdgnjobs/ximple-dgnio/.gitignore | 1 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/FeatureDgnConvertMySQLJobContext.java | 209 xdgnjobs/ximple-jobcarrier/pom.xml | 138 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TextNodeElement.java | 197 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleTransformColorOwner2CSVJob.java | 488 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/UserAttributeData.java | 17 xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/digester-rules-3.0.dtd | 244 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/FrammeAttributeData.java | 34 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/AbstractDgnToEdbGeoJobContext.java | 672 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/GeneralDgnConvertMySQLJobContext.java | 492 xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7TextElementReaderTest.java | 88 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ConnectivityDirectionEnum.java | 275 xdgnjobs/ximple-build/maven/pom.xml | 8 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/GeometryConverter.java | 5 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/TPCLIDConverter.java | 282 xdgnjobs/ximple-jobcarrier/quartz.properties | 33 xdgnjobs/ximple-jobcarrier/src/main/java/com/ximple/eofms/XQuartzJobWizard.java | 166 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementLevelCriterion.java | 30 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7OracleReader.java | 126 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/geoserver/config/XGeosDataConfig.java | 72 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileHeader.java | 23 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/GeneralDgnConvertPostGISJobContext.java | 619 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/OracleUpgradeJobContext.java | 19 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/GeomUtil.java | 15 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexElement.java | 5 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/LineElement.java | 57 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineTextStrategy.java | 207 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/DummyFeatureConvertJobContext.java | 231 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsGeometry.java | 72 xdgnjobs/ximple-jobcarrier/src/main/resources/quartz.properties | 14 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateFeatureTypeStrategy.java | 19 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/FeatureTypeEvent.java | 17 xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/digester-rules-3.0.dtd | 244 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/DummyFeatureConvertEdbGeoJobContext.java | 234 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeIdDispatchableFilter.java | 77 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/GeometryConverterDecorator.java | 9 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompLevelIdDispatchableFilter.java | 91 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementTypeCriterion.java | 28 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/DummyFeatureConvertPostGISJobContext.java | 207 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/AbstractDgnToOraSDOJobContext.java | 51 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/PrintfFormat.java | 1784 - xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/util/FeatureTypeBuilderUtilTest.java | 20 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/util/DgnUtility.java | 90 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsGisWrapper.java | 55 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleIncrementDgn2PostGISJob.java | 552 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ByteArrayCompressor.java | 34 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/StringUtils.java | 1060 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/AbstractOracleDatabaseJob.java | 411 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsWrapper.java | 57 xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/filter/ElementDispatcherTest.java | 19 xdgnjobs/ximple-jobcarrier/.gitignore | 1 xdgnjobs/ximple-build/maven/jar-collector/pom.xml | 3 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/GeneralDgnConvertShpJobContext.java | 507 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Element.java | 289 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/GeoserverIntegrateConfigJob.java | 1192 + xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/NIOUtilities.java | 47 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/GeneralDgnConvertOraSDOJobContext.java | 454 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/FeatureDgnConvertShpJobContext.java | 221 xdgnjobs/ximple-jobcarrier/src/main/java/com/ximple/eofms/XQuartzJobCarrier.java | 110 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ShapeElement.java | 49 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateComplexChainStrategy.java | 233 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/LangUtil.java | 46 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/OracleConvertOraSDOJobContext.java | 214 xdgnjobs/ximple-jobcarrier/src/test/java/com/ximple/eofms/XQuartzJobCarrierTest.java | 6 xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/OracleTarget.java | 86 xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/xgeosdataconfig.xml | 16563 +++++++++++++++ xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ElementType.java | 97 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/EllipseElement.java | 96 xdgnjobs/ximple-dgnio/src/test/resources/com/ximple/io/dgn7/test-data/dgnseed2d.dgn | 0 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/IndexDgnConvertShpJobContext.java | 403 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2OraSDOJob.java | 568 xdgnjobs/ximple-spatialjob/src/main/resources/conf/DefaultConvertShpFilter.xml | 39 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2ShpJob.java | 498 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/FeatureDgnConvertPostGISJobContext.java | 199 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/DefaultColorTable.java | 63 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/DummyFeatureConvertOraSDOJobContext.java | 215 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2PostGISJob.java | 1548 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/IndexDgnConvertMySQLJobContext.java | 363 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2EdbGeoJob.java | 1352 + xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/IndexDgnConvertOraSDOJobContext.java | 339 xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/util/FileUtilsTest.java | 35 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/GeneralDgnConvertEdbGeoJobContext.java | 575 xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/FeatureClassificationRules.xml | 2 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/OracleConvertEdbGeoJobContext.java | 383 xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/DefaultXGeosDataConfigRules.xml | 19 xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/rest/GeoManagerEncoderTest.java | 47 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ArcElement.java | 130 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementDispatchableFilter.java | 8 xdgnjobs/ximple-jobcarrier/quartz_jobs.xml | 165 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/AbstractDgnToPostGISJobContext.java | 607 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Lock.java | 113 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/util/PrintfFormat.java | 1784 - xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/AbstractDgnToMySQLJobContext.java | 51 xdgnjobs/ximple-jobcarrier/src/main/resources/log4j.properties | 4 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractOracleJobContext.java | 445 xdgnjobs/ximple-build/maven/jar-collector/.gitignore | 1 xdgnjobs/ximple-dgnio/pom.xml | 10 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/IElementHandler.java | 7 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/collector/FeatureTypeCollector.java | 24 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/DataReposVersionManager.java | 22 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleIncrementPostGISJobContext.java | 420 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/Base64.java | 105 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/IndexDgnConvertPostGISJobContext.java | 930 xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/ElementDispatcherRules.xml | 2 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ElementFactory.java | 124 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractDispatchableFilter.java | 61 xdgnjobs/pom.xml | 421 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileWriter.java | 362 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TagElement.java | 24 xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7fileReaderTest.java | 63 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/EPSG3826GeometryConverterDecorator.java | 66 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/StreamLogging.java | 14 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ElementDigesterUtils.java | 25 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/DummyFeatureConvertMySQlJobContext.java | 228 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileReader.java | 330 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsBinaryParser.java | 99 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7Exception.java | 15 xdgnjobs/ximple-jobcarrier/log4j.properties | 29 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateMultiSymbolStrategy.java | 308 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/DummyFeatureConvertShpJobContext.java | 245 xdgnjobs/ximple-build/pom.xml | 4 xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7OracleReaderTest.java | 53 xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7fileWriterTest.java | 100 xdgnjobs/ximple-dgnio/src/test/resources/com/ximple/io/dgn7/test-data/demo.dgn | 0 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleUpgradeBlob2UDTJob.java | 39 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleElementLogger.java | 265 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TcbElement.java | 41 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexChainElement.java | 150 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JTSShape.java | 177 xdgnjobs/ximple-jobcarrier/src/main/resources/com/ximple/eofms/XQuartzJobWizard_zh_TW.properties | 12 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateSymbolStrategy.java | 240 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleConvertGeoServerContext.java | 10 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/AbstractOracleToEdbGeoJobContext.java | 699 xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs.xml | 105 xdgnjobs/ximple-elmparser/src/main/java/com/ximple/eofms/XElementFetcher.java | 9 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateFeatureTypeEventListener.java | 3 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/LineStringElement.java | 88 xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/xgeosdataconfig-1.xml | 11546 ++++++++++ xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/FeatureDgnConvertEdbGeoJobContext.java | 224 xdgnjobs/ximple-elmparser/pom.xml | 43 xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexShapeElement.java | 122 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/collector/FeatureClassification.java | 15 xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/ElementFactoryTest.java | 177 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompIdDispatchableFilter.java | 90 180 files changed, 50,458 insertions(+), 14,668 deletions(-) diff --git a/.gitattributes b/.gitattributes index 0ad992e..bf21934 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,7 +14,9 @@ xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileException.java svneol=native#text/plain xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileHeader.java svneol=native#text/plain xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileReader.java svneol=native#text/plain +xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileWriter.java -text svneol=unset#text/plain xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Element.java svneol=native#text/plain +xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ElementFactory.java -text svneol=unset#text/plain xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ElementType.java svneol=native#text/plain xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/EllipseElement.java svneol=native#text/plain xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/FrammeAttributeData.java svneol=native#text/plain @@ -36,11 +38,14 @@ xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7OracleReaderTest.java svneol=native#text/plain xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7TextElementReaderTest.java svneol=native#text/plain xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7fileReaderTest.java svneol=native#text/plain +xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7fileWriterTest.java -text svneol=unset#text/plain +xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/ElementFactoryTest.java -text svneol=unset#text/plain xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/OracleTarget.java svneol=native#text/plain xdgnjobs/ximple-dgnio/src/test/resources/com/ximple/io/dgn7/test-data/Demo.dgn -text xdgnjobs/ximple-dgnio/src/test/resources/com/ximple/io/dgn7/test-data/HV88491-1.dgn -text xdgnjobs/ximple-dgnio/src/test/resources/com/ximple/io/dgn7/test-data/HV88491_0888888.dgn -text xdgnjobs/ximple-dgnio/src/test/resources/com/ximple/io/dgn7/test-data/HV88494_0.dgn -text +xdgnjobs/ximple-dgnio/src/test/resources/com/ximple/io/dgn7/test-data/dgnseed2d.dgn -text xdgnjobs/ximple-dgnio/src/test/resources/com/ximple/io/dgn7/test-data/testHV.dgn -text xdgnjobs/ximple-elmparser/pom.xml svneol=native#text/xml xdgnjobs/ximple-elmparser/src/main/java/com/ximple/eofms/XElementFetcher.java svneol=native#text/plain @@ -48,7 +53,10 @@ xdgnjobs/ximple-elmparser/src/main/resources/com/ximple/eofms/XElementParser.properties svneol=native#text/plain xdgnjobs/ximple-elmparser/src/main/resources/com/ximple/eofms/XElementParser_zh_TW.properties svneol=native#text/plain xdgnjobs/ximple-elmparser/src/main/resources/log4j.properties svneol=native#text/plain +xdgnjobs/ximple-jobcarrier/log4j.properties -text xdgnjobs/ximple-jobcarrier/pom.xml svneol=native#text/xml +xdgnjobs/ximple-jobcarrier/quartz.properties -text +xdgnjobs/ximple-jobcarrier/quartz_jobs.xml -text xdgnjobs/ximple-jobcarrier/src/main/java/com/ximple/eofms/XQuartzJobCarrier.java svneol=native#text/plain xdgnjobs/ximple-jobcarrier/src/main/java/com/ximple/eofms/XQuartzJobWizard.java svneol=native#text/plain xdgnjobs/ximple-jobcarrier/src/main/resources/com/ximple/eofms/XQuartzJobWizard.properties svneol=native#text/plain @@ -56,6 +64,7 @@ xdgnjobs/ximple-jobcarrier/src/main/resources/log4j.properties svneol=native#text/plain xdgnjobs/ximple-jobcarrier/src/main/resources/quartz.properties svneol=native#text/plain xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs.xml svneol=native#text/xml +xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs_edb.xml -text svneol=unset#text/xml xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs_shapefiles.xml svneol=native#text/xml xdgnjobs/ximple-jobcarrier/src/test/java/com/ximple/eofms/XQuartzJobCarrierTest.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/pom.xml svneol=native#text/xml @@ -85,6 +94,7 @@ xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/AbstractOracleDatabaseJob.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/DataReposVersionManager.java -text xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/DummyFeatureConvertJobContext.java svneol=native#text/plain +xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2EdbGeoJob.java -text svneol=unset#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2MySQLJob.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2OraSDOJob.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2PostGISJob.java svneol=native#text/plain @@ -94,6 +104,13 @@ xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractDgnFileJobContext.java -text xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractOracleJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/OracleUpgradeJobContext.java svneol=native#text/plain +xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/AbstractDgnToEdbGeoJobContext.java -text svneol=unset#text/plain +xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/AbstractOracleToEdbGeoJobContext.java -text svneol=unset#text/plain +xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/DummyFeatureConvertEdbGeoJobContext.java -text svneol=unset#text/plain +xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/FeatureDgnConvertEdbGeoJobContext.java -text svneol=unset#text/plain +xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/GeneralDgnConvertEdbGeoJobContext.java -text svneol=unset#text/plain +xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/IndexDgnConvertEdbGeoJobContext.java -text svneol=unset#text/plain +xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/OracleConvertEdbGeoJobContext.java -text svneol=unset#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/AbstractDgnToMySQLJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/AbstractOracleToMySQLJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/DummyFeatureConvertMySQlJobContext.java svneol=native#text/plain @@ -127,13 +144,17 @@ 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/DigesterUtils.java -text +xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/EPSG3825GeometryConverterDecorator.java -text svneol=unset#text/plain +xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/EPSG3826GeometryConverterDecorator.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/FeatureTypeBuilderUtil.java svneol=native#text/plain +xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/FileUtils.java -text svneol=unset#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/GeometryConverterDecorator.java -text svneol=unset#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 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/StringUtils.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/TPCLIDConverter.java svneol=native#text/plain -xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/TWD97GeometryConverterDecorator.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/TWDDatumConverter.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JTSShape.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsBinaryParser.java svneol=native#text/plain @@ -147,5 +168,7 @@ xdgnjobs/ximple-spatialjob/src/main/resources/conf/DefaultConvertShpFilter.xml svneol=native#text/xml xdgnjobs/ximple-spatialjob/src/main/resources/conf/DefaultMapGroups.xml svneol=native#text/xml xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/filter/ElementDispatcherTest.java svneol=native#text/plain +xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/util/FeatureTypeBuilderUtilTest.java -text svneol=unset#text/plain +xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/util/FileUtilsTest.java -text svneol=unset#text/plain xdgnjobs/ximple-spatialjob/src/test/resources/com/ximple/eofms/filter/test-data/testElementFilter.xml svneol=native#text/xml xdgnjobs/ximple-spatialjob/src/test/resources/com/ximple/eofms/filter/test-data/testRules.xml svneol=native#text/xml diff --git a/xdgnjobs/pom.xml b/xdgnjobs/pom.xml index dfff2ad..632f5e6 100644 --- a/xdgnjobs/pom.xml +++ b/xdgnjobs/pom.xml @@ -17,10 +17,14 @@ <oracle.jdbc>true</oracle.jdbc> <test.maxHeapSize>512M</test.maxHeapSize> <src.output>${basedir}/target</src.output> - <java5>1.5</java5> - <xdgnio.version>0.9.0</xdgnio.version> - <gt.version>2.4.4</gt.version> + <java5>1.6</java5> + <xdgnio.version>2.1.1</xdgnio.version> + <gt.version>10.3.x</gt.version> <failIfNoTests>false</failIfNoTests> + <stress.skip.pattern></stress.skip.pattern> + <online.skip.pattern></online.skip.pattern> + <java.awt.headless>false</java.awt.headless> + <allow.test.failure.ignore>false</allow.test.failure.ignore> </properties> <profiles> @@ -31,6 +35,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> + <version>2.6.1</version> <configuration> <source>1.5</source> </configuration> @@ -48,6 +53,30 @@ </site> </distributionManagement> </profile> + + <!-- =========================================================== --> + <!-- Build Configuration --> + <!-- copies all JARs in a single directory. --> + <!-- =========================================================== --> + <profile> + <id>collect</id> + <build> + <plugins> + <plugin> + <groupId>com.ximple.eofms.maven</groupId> + <artifactId>ximple-jar-collector</artifactId> + <version>${project.version}</version> + <executions> + <execution> + <goals> + <goal>collect</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> </profiles> <scm> @@ -60,7 +89,7 @@ <groupId>com.ximple.eofms</groupId> <artifactId>ximple-dgnjobs</artifactId> <packaging>pom</packaging> - <version>0.9.0</version> + <version>2.1.1</version> <name>ximple-dgnjobs</name> <url>http://www.ximple.com.tw</url> @@ -71,7 +100,7 @@ <url>http://www.ximple.com.tw</url> </organization> - <inceptionYear>2008</inceptionYear> + <inceptionYear>2012</inceptionYear> <!-- =========================================================== --> <!-- Issue managements and mailing lists. --> @@ -109,22 +138,10 @@ <!-- =========================================================== --> <dependencyManagement> <dependencies> - <!-- GeoAPI and its dependencies --> - <dependency> - <groupId>org.opengis</groupId> - <artifactId>geoapi-nogenerics</artifactId> - <version>2.1.1</version> - </dependency> - <dependency> - <groupId>javax.units</groupId> - <artifactId>jsr108</artifactId> - <version>0.01</version> - </dependency> - <dependency> <groupId>com.vividsolutions</groupId> <artifactId>jts</artifactId> - <version>1.9</version> + <version>1.13</version> </dependency> <!-- Apache --> @@ -132,7 +149,7 @@ <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> - <version>1.7</version> + <version>1.8.2</version> </dependency> --> <dependency> @@ -141,14 +158,15 @@ <version>3.2.1</version> </dependency> <dependency> - <groupId>commons-digester</groupId> - <artifactId>commons-digester</artifactId> - <version>1.8</version> + <groupId>org.apache.commons</groupId> + <artifactId>commons-digester3</artifactId> + <version>3.2</version> + <!--classifier>with-deps</classifier--> </dependency> <dependency> <groupId>commons-pool</groupId> <artifactId>commons-pool</artifactId> - <version>1.4</version> + <version>1.6</version> </dependency> <dependency> <groupId>commons-logging</groupId> @@ -163,98 +181,122 @@ <dependency> <groupId>commons-cli</groupId> <artifactId>commons-cli</artifactId> - <version>1.1</version> + <version>1.2</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>2.4</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> - <version>1.2.15</version> + <version>1.2.17</version> <!-- Same as the dependency in commons-logging --> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> - <version>3.1-FINAL</version> + <version>3.9</version> </dependency> <!-- geotools --> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2</artifactId> + <artifactId>gt-api</artifactId> <version>${gt.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-api</artifactId> + <artifactId>gt-main</artifactId> <version>${gt.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-main</artifactId> + <artifactId>gt-shapefile</artifactId> <version>${gt.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-shapefile</artifactId> - <version>${gt.version}</version> - </dependency> - <dependency> - <groupId>org.geotools</groupId> - <artifactId>gt2-sample-data</artifactId> + <artifactId>gt-sample-data</artifactId> <version>${gt.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-data</artifactId> + <artifactId>gt-data</artifactId> <version>${gt.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-jdbc</artifactId> + <artifactId>gt-opengis</artifactId> <version>${gt.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-oracle-spatial</artifactId> + <artifactId>gt-metadata</artifactId> <version>${gt.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-postgis</artifactId> + <artifactId>gt-jdbc</artifactId> <version>${gt.version}</version> </dependency> <dependency> - <groupId>org.geotools</groupId> - <artifactId>gt2-mysql</artifactId> + <groupId>org.geotools.jdbc</groupId> + <artifactId>gt-jdbc-oracle</artifactId> + <version>${gt.version}</version> + </dependency> + <dependency> + <groupId>org.geotools.jdbc</groupId> + <artifactId>gt-jdbc-postgis</artifactId> + <version>${gt.version}</version> + <!--exclusions> + <exclusion> + <groupId>org.postgis</groupId> + <artifactId>postgis-driver</artifactId> + </exclusion> + </exclusions--> + </dependency> + <dependency> + <groupId>org.geotools.jdbc</groupId> + <artifactId>gt-jdbc-mysql</artifactId> <version>${gt.version}</version> </dependency> <!-- because main and sample-data depend on referencing we need a tie breaker --> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-referencing</artifactId> + <artifactId>gt-referencing</artifactId> + <version>${gt.version}</version> + </dependency> + <dependency> + <groupId>org.geotools</groupId> + <artifactId>gt-epsg-hsql</artifactId> + <version>${gt.version}</version> + <!--exclusions> + <exclusion> + <groupId>com.h2database</groupId> + <artifactId>h2</artifactId> + </exclusion> + </exclusions--> + </dependency> + <dependency> + <groupId>org.geotools</groupId> + <artifactId>gt-epsg-wkt</artifactId> <version>${gt.version}</version> </dependency> <dependency> - <groupId>jdom</groupId> + <groupId>org.jdom</groupId> <artifactId>jdom</artifactId> - <version>1.0</version> + <version>1.1.3</version> </dependency> <dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity</artifactId> - <version>1.5</version> - </dependency> - - <!-- We need this to make the referencing module useful --> - <dependency> - <groupId>org.geotools</groupId> - <artifactId>gt2-epsg-hsql</artifactId> - <version>${gt.version}</version> - <scope>test</scope> + <version>1.7</version> </dependency> <!-- ORACLE --> @@ -262,7 +304,7 @@ <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc5</artifactId> - <version>11.1.0</version> + <version>11.1.0.7.0</version> </dependency> <dependency> <groupId>com.oracle</groupId> @@ -280,42 +322,91 @@ <version>11.1.0</version> </dependency> - <dependency> + <!--dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> - <version>8.3-603.jdbc3</version> - </dependency> + <version>8.4-702.jdbc3</version> + </dependency--> <dependency> <groupId>org.postgis</groupId> <artifactId>postgis-driver</artifactId> - <version>1.3.3</version> + <version>2.0.2</version> </dependency> - <dependency> + <!--dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> - <version>5.1.6</version> - </dependency> + <version>5.1.18</version> + </dependency--> - <!-- opensymphony --> + <!--dependency> + <groupId>com.h2database</groupId> + <artifactId>h2</artifactId> + <version>1.3.163</version> + </dependency--> + + <!-- EnterpriseDB --> <dependency> - <groupId>opensymphony</groupId> - <artifactId>quartz</artifactId> - <version>1.6.0</version> + <groupId>com.ximple.eofms</groupId> + <artifactId>xedb-gt-geospatial</artifactId> + <version>0.1.1</version> </dependency> - + + <!-- quartz-scheduler--> + <dependency> + <groupId>org.quartz-scheduler</groupId> + <artifactId>quartz</artifactId> + <version>2.2.1</version> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.quartz-scheduler</groupId> + <artifactId>quartz-jobs</artifactId> + <version>2.2.1</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.7.5</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.7.5</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + <version>1.7.5</version> + </dependency> <dependency> <groupId>org.awl</groupId> <artifactId>awl</artifactId> <version>1.1.0-rc</version> </dependency> + <dependency> + <groupId>it.geosolutions</groupId> + <artifactId>geoserver-manager</artifactId> + <!--version>1.5.2</version--> + <version>1.6-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>xerces</groupId> + <artifactId>xercesImpl</artifactId> + <version>2.11.0</version> + </dependency> <!-- Tests or legacy --> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> - <version>5.8</version> - <classifier>jdk15</classifier> + <version>6.8.7</version> <scope>test</scope> </dependency> </dependencies> @@ -325,16 +416,6 @@ <!-- Dependencies to be inherited by all modules. --> <!-- =========================================================== --> <dependencies> - <dependency> - <artifactId>geoapi-nogenerics</artifactId> - <groupId>org.opengis</groupId> - </dependency> - - <dependency> - <artifactId>jsr108</artifactId> - <groupId>javax.units</groupId> - </dependency> - <dependency> <groupId>com.vividsolutions</groupId> <artifactId>jts</artifactId> @@ -346,8 +427,9 @@ <groupId>commons-collections</groupId> </dependency> <dependency> - <groupId>commons-digester</groupId> - <artifactId>commons-digester</artifactId> + <groupId>org.apache.commons</groupId> + <artifactId>commons-digester3</artifactId> + <!--classifier>with-deps</classifier--> </dependency> <dependency> <groupId>commons-pool</groupId> @@ -367,18 +449,42 @@ </dependency> <dependency> - <artifactId>gt2-api</artifactId> <groupId>org.geotools</groupId> + <artifactId>gt-api</artifactId> </dependency> <dependency> - <artifactId>gt2-main</artifactId> <groupId>org.geotools</groupId> + <artifactId>gt-main</artifactId> + </dependency> + <dependency> + <groupId>org.geotools</groupId> + <artifactId>gt-epsg-hsql</artifactId> + </dependency> + + <!--dependency> + <groupId>com.h2database</groupId> + <artifactId>h2</artifactId> + </dependency--> + + <dependency> + <groupId>xerces</groupId> + <artifactId>xercesImpl</artifactId> </dependency> <dependency> - <artifactId>testng</artifactId> + <groupId>it.geosolutions</groupId> + <artifactId>geoserver-manager</artifactId> + <exclusions> + <exclusion> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> <groupId>org.testng</groupId> - <classifier>jdk15</classifier> + <artifactId>testng</artifactId> <scope>test</scope> </dependency> </dependencies> @@ -402,125 +508,18 @@ <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-assembly-plugin</artifactId> - <version>2.1</version> - <configuration> - <descriptors> - <descriptor>build/maven/assembly/binaryDist.xml</descriptor> - <descriptor>build/maven/assembly/sourceDist.xml</descriptor> - </descriptors> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-clean-plugin</artifactId> - <version>2.1.1</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-clover-plugin</artifactId> - <version>2.3</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.0.2</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-install-plugin</artifactId> - <version>2.1</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <version>2.1</version> + <artifactId>maven-eclipse-plugin</artifactId> + <version>2.5</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> - <version>2.4</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-plugin-plugin</artifactId> - <version>2.3</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-pmd-plugin</artifactId> - <version>2.4</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-project-info-reports-plugin</artifactId> - <version>2.0.1</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-resources-plugin</artifactId> - <version>2.2</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-site-plugin</artifactId> - <version>2.0-beta-5</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.4.2</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-report-plugin</artifactId> - <version>2.4.2</version> - </plugin> - - <!-- http://www.ibiblio.org/maven2/org/codehaus/mojo/ --> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>changelog-maven-plugin</artifactId> - <version>2.0-beta-1</version> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>changes-maven-plugin</artifactId> - <version>2.0-beta-1</version> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>jxr-maven-plugin</artifactId> - <version>2.0-beta-1</version> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>taglist-maven-plugin</artifactId> - <version>2.2</version> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>jalopy-maven-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-source-plugin</artifactId> - <configuration> - <outputDirectory>${src.output}</outputDirectory> - <attach>false</attach> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-eclipse-plugin</artifactId> - <version>2.4</version> + <version>2.6.1</version> </plugin> </plugins> </pluginManagement> <!-- http://www.ibiblio.org/maven2/org/apache/maven/wagon/ --> - <!-- <extensions> <extension> <groupId>org.apache.maven.wagon</groupId> @@ -528,7 +527,6 @@ <version>1.0-beta-2</version> </extension> </extensions> - --> <plugins> <!-- ======================================================= --> @@ -543,6 +541,7 @@ <convention>gt2/jalopygeotools.xml</convention> <failOnError>false</failOnError> </configuration> + <!-- <dependencies> <dependency> <groupId>org.geotools.maven</groupId> @@ -550,6 +549,7 @@ <version>${gt.version}</version> </dependency> </dependencies> + --> </plugin> @@ -560,13 +560,13 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> - <source>1.5</source> + <source>1.6</source> <!-- The -source argument for the Java compiler. --> - <target>1.5</target> + <target>1.6</target> <!-- The -target argument for the Java compiler. --> <debug>true</debug> <!-- Whether to include debugging information. --> - <encoding>ISO-8859-1</encoding> + <encoding>UTF-8</encoding> <!-- The -encoding argument for the Java compiler. --> </configuration> </plugin> @@ -578,6 +578,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> + <version>2.14.1</version> <configuration> <includes> <include>**/*Test.java</include> @@ -606,13 +607,15 @@ <!-- ======================================================= --> <!-- Code coverage --> <!-- ======================================================= --> + <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-clover-plugin</artifactId> + <version>2.4</version> <configuration> <jdk>1.5</jdk> <licenseLocation> - http://svn.geotools.org/geotools/branches/2.4.x/build/maven/build-configs/src/main/resources/gt2/clover.license + http://svn.geotools.org/geotools/branches/2.6.x/build/maven/build-configs/src/main/resources/gt2/clover.license </licenseLocation> <flushPolicy>directed</flushPolicy> </configuration> @@ -621,8 +624,8 @@ <phase>pre-site</phase> <goals> <goal>instrument</goal> - <!-- aggregation is disabled due to the bug: --> - <!-- http://jira.codehaus.org/browse/MCLOVER-34 --> + < - aggregation is disabled due to the bug: - !> + < - http://jira.codehaus.org/browse/MCLOVER-34 - !> </goals> </execution> </executions> @@ -634,7 +637,7 @@ </dependency> </dependencies> </plugin> - + --> <!-- ======================================================= --> <!-- JAR packaging. --> @@ -649,6 +652,14 @@ </manifest> </archive> </configuration> + </plugin> + + <!-- ======================================================= --> + <!-- JavaDoc packaging. --> + <!-- ======================================================= --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> </plugin> <!-- ======================================================= --> @@ -693,13 +704,13 @@ <uniqueVersion>false</uniqueVersion> <id>ximple</id> <name>Ximple - Artifactory lib repo</name> - <url>dav:http://www.ximple.com.tw/artifactory/libs-releases</url> + <url>dav:http://www.ximple.com.tw/artifactory/libs-releases-local</url> </repository> <snapshotRepository> <uniqueVersion>false</uniqueVersion> <id>ximple-snapshots</id> <name>Ximple - Artifactory lib-snapshots repo</name> - <url>dav:http://www.ximple.com.tw/artifactory/libs-snapshots</url> + <url>dav:http://www.ximple.com.tw/artifactory/libs-snapshots-local</url> </snapshotRepository> </distributionManagement> @@ -765,6 +776,6 @@ <module>ximple-dgnio</module> <module>ximple-spatialjob</module> <module>ximple-jobcarrier</module> - <module>ximple-elmparser</module> + <!-- <module>ximple-elmparser</module> --> </modules> </project> \ No newline at end of file diff --git a/xdgnjobs/ximple-build/maven/jar-collector/.gitignore b/xdgnjobs/ximple-build/maven/jar-collector/.gitignore new file mode 100644 index 0000000..b83d222 --- /dev/null +++ b/xdgnjobs/ximple-build/maven/jar-collector/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/xdgnjobs/ximple-build/maven/jar-collector/pom.xml b/xdgnjobs/ximple-build/maven/jar-collector/pom.xml index 1285949..3939f8a 100644 --- a/xdgnjobs/ximple-build/maven/jar-collector/pom.xml +++ b/xdgnjobs/ximple-build/maven/jar-collector/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>com.ximple.eofms.maven</groupId> <artifactId>ximple-maven</artifactId> - <version>0.9.0</version> + <version>2.1.1</version> </parent> @@ -16,6 +16,7 @@ <!-- =========================================================== --> <groupId>com.ximple.eofms.maven</groupId> <artifactId>ximple-jar-collector</artifactId> + <version>2.1.1</version> <packaging>maven-plugin</packaging> <name>JAR files collector</name> diff --git a/xdgnjobs/ximple-build/maven/jar-collector/src/main/java/com/ximple/eofms/maven/JarCollector.java b/xdgnjobs/ximple-build/maven/jar-collector/src/main/java/com/ximple/eofms/maven/JarCollector.java index ecd6b30..978a987 100644 --- a/xdgnjobs/ximple-build/maven/jar-collector/src/main/java/com/ximple/eofms/maven/JarCollector.java +++ b/xdgnjobs/ximple-build/maven/jar-collector/src/main/java/com/ximple/eofms/maven/JarCollector.java @@ -55,14 +55,6 @@ private String jarName; /** - * Project dependencies. - * - * @parameter expression="${project.artifacts}" - * @required - */ - private Set /*<Artifact>*/ dependencies; - - /** * The Maven project running this plugin. * * @parameter expression="${project}" @@ -80,13 +72,10 @@ * Gets the parent "target" directory. */ MavenProject parent = project; - while (parent.hasParent()) { parent = parent.getParent(); } - collectDirectory = parent.getBuild().getDirectory(); - /* * Now collects the JARs. */ @@ -106,22 +95,18 @@ * such file. Some modules use pom packaging, which do not produce any JAR file. */ final File jarFile = new File(outputDirectory, jarName + ".jar"); - if (!jarFile.isFile()) { return; } - /* * Get the "target" directory of the parent pom.xml and make sure it exists. */ File collect = new File(collectDirectory); - if (!collect.exists()) { if (!collect.mkdir()) { - throw new MojoExecutionException("Failed to create target directory."); + throw new MojoExecutionException("Failed to create target directory: " + collect.getAbsolutePath()); } } - if (collect.getCanonicalFile().equals(jarFile.getParentFile().getCanonicalFile())) { /* * The parent's directory is the same one than this module's directory. @@ -131,47 +116,42 @@ */ return; } - /* * Creates a "binaries" subdirectory inside the "target" directory. */ collect = new File(collect, SUB_DIRECTORY); - if (!collect.exists()) { if (!collect.mkdir()) { throw new MojoExecutionException("Failed to create binaries directory."); } } - - int count = 1; FileUtils.copyFileToDirectory(jarFile, collect); - + Set<Artifact> dependencies = project.getDependencyArtifacts(); if (dependencies != null) { - for (final Iterator it = dependencies.iterator(); it.hasNext();) { - final Artifact artifact = (Artifact) it.next(); + for (final Artifact artifact : dependencies) { + System.out.println("+++++++++++++++++++++++ DEP: " + artifact.getDependencyTrail()); final String scope = artifact.getScope(); - - if ((scope != null) // Maven 2.0.6 bug? - && (scope.equalsIgnoreCase(Artifact.SCOPE_COMPILE) - || scope.equalsIgnoreCase(Artifact.SCOPE_RUNTIME))) { + if (scope != null && // Maven 2.0.6 bug? + (scope.equalsIgnoreCase(Artifact.SCOPE_COMPILE) || + scope.equalsIgnoreCase(Artifact.SCOPE_RUNTIME))) + { final File file = artifact.getFile(); - final File copy = new File(collect, file.getName()); - - if (!copy.exists()) { - /* - * Copies the dependency only if it was not already copied. Note that - * the module's JAR was copied inconditionnaly above (because it may - * be the result of a new compilation). If a Geotools JAR from the - * dependencies list changed, it will be copied inconditionnaly when - * the module for this JAR will be processed by Maven. - */ - FileUtils.copyFileToDirectory(file, collect); - count++; + if (!artifact.getGroupId().startsWith("com.ximple.eofms")) { + final File copy = new File(collect, file.getName()); + if (copy.exists()) { + /* + * Copies the dependency only if it was not already copied. Note that + * the module's JAR was copied inconditionnaly above (because it may + * be the result of a new compilation). If a Geotools JAR from the + * dependencies list changed, it will be copied inconditionnaly when + * the module for this JAR will be processed by Maven. + */ + continue; + } } + FileUtils.copyFileToDirectory(file, collect); } } } - - getLog().info("Copied " + count + " JAR to parent directory."); } } diff --git a/xdgnjobs/ximple-build/maven/pom.xml b/xdgnjobs/ximple-build/maven/pom.xml index 1db68d6..95f08e2 100644 --- a/xdgnjobs/ximple-build/maven/pom.xml +++ b/xdgnjobs/ximple-build/maven/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>com.ximple.eofms.maven</groupId> <artifactId>ximple-build</artifactId> - <version>0.9.0</version> + <version>2.1.1</version> </parent> @@ -46,17 +46,17 @@ <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> - <version>2.0.4</version> + <version>2.2.1</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-project</artifactId> - <version>2.0.4</version> + <version>2.2.1</version> </dependency> <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId> - <version>1.2</version> + <version>2.1</version> </dependency> </dependencies> diff --git a/xdgnjobs/ximple-build/pom.xml b/xdgnjobs/ximple-build/pom.xml index 2feb035..d1af094 100644 --- a/xdgnjobs/ximple-build/pom.xml +++ b/xdgnjobs/ximple-build/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>com.ximple.eofms</groupId> <artifactId>ximple-dgnjobs</artifactId> - <version>0.9.0</version> + <version>2.1.1</version> </parent> @@ -16,7 +16,7 @@ <!-- =========================================================== --> <groupId>com.ximple.eofms.maven</groupId> <artifactId>ximple-build</artifactId> - <version>0.9.0</version> + <version>2.1.1</version> <packaging>pom</packaging> <name>Build tools for Ximple DgnJobs</name> diff --git a/xdgnjobs/ximple-dgnio/.gitignore b/xdgnjobs/ximple-dgnio/.gitignore new file mode 100644 index 0000000..b83d222 --- /dev/null +++ b/xdgnjobs/ximple-dgnio/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/xdgnjobs/ximple-dgnio/pom.xml b/xdgnjobs/ximple-dgnio/pom.xml index f29cf9e..16ab7f6 100644 --- a/xdgnjobs/ximple-dgnio/pom.xml +++ b/xdgnjobs/ximple-dgnio/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>com.ximple.eofms</groupId> <artifactId>ximple-dgnjobs</artifactId> - <version>0.9.0</version> + <version>2.1.1</version> </parent> <!-- =========================================================== --> @@ -15,7 +15,7 @@ <!-- =========================================================== --> <groupId>com.ximple.eofms</groupId> <artifactId>ximple-dgnio</artifactId> - <version>0.9.0</version> + <version>2.1.1</version> <packaging>jar</packaging> <name>ximple-dgnio</name> <url>http://www.ximple.com.tw</url> @@ -60,7 +60,7 @@ <dependencies> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-sample-data</artifactId> + <artifactId>gt-sample-data</artifactId> <scope>test</scope> </dependency> <dependency> @@ -71,6 +71,10 @@ <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + </dependency> </dependencies> <!-- =========================================================== --> diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ArcElement.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ArcElement.java index bd452df..b9fc904 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ArcElement.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ArcElement.java @@ -5,6 +5,7 @@ import org.apache.log4j.Logger; +import com.vividsolutions.jts.algorithm.Angle; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; @@ -16,33 +17,28 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/26 �U�� 06:41:45 + * @since 2006/5/26 �U�� 06:41:45 */ -public class ArcElement extends Element implements GeometryConverter -{ +public class ArcElement extends Element implements GeometryConverter { private static final Logger logger = Logger.getLogger(ArcElement.class); - public ArcElement(byte[] raw) - { + ArcElement(byte[] raw) { super(raw); } - public double getStartAngle() - { + public double getStartAngle() { int angle = (raw[18] & 0x0000ffff) << 16 | (raw[19] & 0x0000ffff); return DgnUtility.converIntToRotation(angle); } - public void setStartAngle(double value) - { + public void setStartAngle(double value) { int angle = DgnUtility.converRotatioToInt(value); raw[18] = (short) (angle >>> 16 & 0x0000ffff); raw[19] = (short) (angle & 0x0000ffff); } - public double getSweepAngle() - { + public double getSweepAngle() { int angle = (raw[20] & 0x0000ffff) << 16 | (raw[21] & 0x0000ffff); if (angle < 0) angle = -1 * (angle & 0x7fffffff); @@ -50,11 +46,9 @@ return DgnUtility.converIntToRotation(angle); } - public void setSweepAngle(double value) - { + public void setSweepAngle(double value) { int angle = DgnUtility.converRotatioToInt(value); - if (angle < 0) - { + if (angle < 0) { angle &= 0x7fffffff; angle |= 0x80000000; } @@ -63,8 +57,7 @@ raw[21] = (short) (angle & 0x0000ffff); } - public double getPrimary() - { + public double getPrimary() { rawBuffer.position(22 * 2); ByteOrder bo = rawBuffer.order(); rawBuffer.order(ByteOrder.BIG_ENDIAN); @@ -74,16 +67,14 @@ return DgnUtility.convertDGNToIEEEDouble(primary) / 1000.0; } - public void setPrimary(double value) - { + public void setPrimary(double value) { double temp = value * 1000.0; short[] primary = DgnUtility.convertIEEEDoubleToDGN(temp); System.arraycopy(primary, 0, raw, 22, 4); } - public double getSecondary() - { + public double getSecondary() { rawBuffer.position(26 * 2); ByteOrder bo = rawBuffer.order(); rawBuffer.order(ByteOrder.BIG_ENDIAN); @@ -93,32 +84,28 @@ return DgnUtility.convertDGNToIEEEDouble(secondary) / 1000.0; } - public void setSecondary(double value) - { + public void setSecondary(double value) { double temp = value * 1000.0; short[] secondary = DgnUtility.convertIEEEDoubleToDGN(temp); System.arraycopy(secondary, 0, raw, 26, 4); } - public double getRotationAngle() - { + public double getRotationAngle() { int rotation = (raw[30] << 16 & 0xffff0000); rotation |= raw[31] & 0x0000ffff; return DgnUtility.converIntToRotation(rotation); } - public void setRotationAngle(double value) - { + public void setRotationAngle(double value) { int angle = DgnUtility.converRotatioToInt(value); raw[30] = (short) (angle >> 16 & 0x0000ffff); raw[31] = (short) (angle & 0x0000ffff); } - public Coordinate getOrigin() - { + public Coordinate getOrigin() { rawBuffer.position(32 * 2); ByteOrder bo = rawBuffer.order(); rawBuffer.order(ByteOrder.BIG_ENDIAN); @@ -135,8 +122,7 @@ return new Coordinate(dx, dy); } - public void setOrigin(Coordinate value) - { + public void setOrigin(Coordinate value) { double temp = DgnUtility.converCoordToUnit(value.x); short[] x = DgnUtility.convertIEEEDoubleToDGN(temp); @@ -148,8 +134,7 @@ System.arraycopy(y, 0, raw, 36, 4); } - public Geometry toGeometry(GeometryFactory factory) - { + public Geometry toGeometry(GeometryFactory factory) { double sweep = getSweepAngle(); double temp = Math.abs(sweep); temp /= 4; @@ -157,74 +142,73 @@ return factory.createLineString(convertToLineString(pts)); } - private Coordinate[] convertToLineString(int pts) - { - ArrayList<Coordinate> result = new ArrayList<Coordinate>(); - double beta = DgnUtility.converRotationToRadian(-getRotationAngle()); - double startAngle = getStartAngle(); - double sweepAngle = getSweepAngle(); - double endAngle = startAngle + sweepAngle; - double steps = sweepAngle / pts; - double current; - if (sweepAngle < 0) - { - for (current = startAngle; current > endAngle; current += steps) - { - Coordinate pt = computePointOnArcByAngle(beta, current); - result.add(pt); - } + private double validAngle(double value) { + if (value < 0.0) value += 360.0; + else if (value > 360.0) value -= 360.0; - } else - { - for (current = startAngle; current < endAngle; current += steps) - { - Coordinate pt = computePointOnArcByAngle(beta, current); - result.add(pt); - } + return value; + } + + private Coordinate[] convertToLineString(int pts) { + ArrayList<Coordinate> result = new ArrayList<Coordinate>(); + double rotation = validAngle(360 - getRotationAngle()); + double beta = Angle.toRadians(-rotation); + double startAngle = validAngle(getStartAngle()); + double sweepAngle = Math.abs(getSweepAngle()); + boolean clockwise = (getSweepAngle() < 0.0); + double endAngle = validAngle(startAngle + getSweepAngle()); + double steps = sweepAngle / pts; + + double current; + for (int i = 0; i < pts; i++) { + if (clockwise) + current = startAngle - i * steps; + else + current = startAngle + i * steps; + + current = validAngle(current); + Coordinate pt = computePointOnArcByAngle(beta, current); + result.add(pt); } - Coordinate pt = computePointOnArcByAngle(beta, endAngle); + current = validAngle(endAngle); + Coordinate pt = computePointOnArcByAngle(beta, current); result.add(pt); return result.toArray(new Coordinate[result.size()]); } - private Coordinate computePointOnArcByAngle(double beta, double current) - { + private Coordinate computePointOnArcByAngle(double beta, double angle) { double sinbeta = Math.sin(beta); double cosbeta = Math.cos(beta); - Coordinate pt = new Coordinate(); - double alpha = DgnUtility.converRotationToRadian(current); + double alpha = Angle.toRadians(angle); double sinalpha = Math.sin(alpha); double cosalpha = Math.cos(alpha); + + Coordinate pt = new Coordinate(); pt.x = getOrigin().x + (getPrimary() * cosalpha * cosbeta - - getSecondary() * sinalpha * sinbeta); + getSecondary() * sinalpha * sinbeta); pt.y = getOrigin().y + (getPrimary() * cosalpha * sinbeta + - getSecondary() * sinalpha * cosbeta); + getSecondary() * sinalpha * cosbeta); return pt; } - public static class ElementHandler extends Element.ElementHandler - { + public static class ElementHandler extends Element.ElementHandler { private static ElementHandler instance = null; - public ElementHandler() - { + public ElementHandler() { super(ElementType.ARC); } - public static IElementHandler getInstance() - { - if (instance == null) - { + public static IElementHandler getInstance() { + if (instance == null) { instance = new ElementHandler(); } return instance; } - protected Element createElement(byte[] raw) - { + protected Element createElement(byte[] raw) { return new ArcElement(raw); } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexChainElement.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexChainElement.java index 95a0758..ef07d30 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexChainElement.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexChainElement.java @@ -1,6 +1,7 @@ package com.ximple.io.dgn7; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.List; @@ -11,165 +12,138 @@ import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.LineString; +import com.vividsolutions.jts.geom.LinearRing; /** * ComplexChainElement * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �U�� 03:44:56 + * @since 2006/5/18 */ -public class ComplexChainElement extends Element implements ComplexElement, GeometryConverter -{ +public class ComplexChainElement extends Element implements ComplexElement, GeometryConverter { private static final Logger logger = Logger.getLogger(ComplexChainElement.class); protected ArrayList<Element> list = new ArrayList<Element>(); - public ComplexChainElement(byte[] raw) - { + ComplexChainElement(byte[] raw) { super(raw); attrOffset = 4; } - public int size() - { + public int size() { return list.size(); } - public boolean isEmpty() - { + public boolean isEmpty() { return list.isEmpty(); } - public boolean contains(Object o) - { + public boolean contains(Object o) { return list.contains(o); } - public Iterator iterator() - { + public Iterator iterator() { return list.iterator(); } - public Object[] toArray() - { + public Object[] toArray() { return list.toArray(); } - public <T> T[] toArray(T[] ts) - { + public <T> T[] toArray(T[] ts) { return list.toArray(ts); } - public boolean add(Element element) - { + public boolean add(Element element) { return list.add(element); } - public boolean remove(Object o) - { + public boolean remove(Object o) { return list.remove(o); } - public boolean containsAll(Collection<?> objects) - { + public boolean containsAll(Collection<?> objects) { return list.containsAll(objects); } - public boolean addAll(Collection<? extends Element> elements) - { + public boolean addAll(Collection<? extends Element> elements) { return list.addAll(elements); } - public boolean addAll(int i, Collection<? extends Element> elements) - { + public boolean addAll(int i, Collection<? extends Element> elements) { return list.addAll(i, elements); } - public boolean removeAll(Collection<?> objects) - { + public boolean removeAll(Collection<?> objects) { return list.removeAll(objects); } - public boolean retainAll(Collection<?> objects) - { + public boolean retainAll(Collection<?> objects) { return list.retainAll(objects); } - public void clear() - { + public void clear() { list.clear(); } - public Element get(int index) - { + public Element get(int index) { return list.get(index); } - public Element set(int i, Element element) - { + public Element set(int i, Element element) { return list.set(i, element); } - public void add(int i, Element element) - { + public void add(int i, Element element) { list.add(i, element); } - public Element remove(int index) - { + public Element remove(int index) { return list.remove(index); } - public int indexOf(Object o) - { + public int indexOf(Object o) { return list.indexOf(o); } - public int lastIndexOf(Object o) - { + public int lastIndexOf(Object o) { return list.lastIndexOf(o); } - public ListIterator listIterator() - { + public ListIterator listIterator() { return list.listIterator(); } - public ListIterator listIterator(int index) - { + public ListIterator listIterator(int index) { return list.listIterator(index); } - public List subList(int fromIndex, int toIndex) - { + public List subList(int fromIndex, int toIndex) { return list.subList(fromIndex, toIndex); } - public Geometry toGeometry(GeometryFactory factory) - { + public Geometry toGeometry(GeometryFactory factory) { ArrayList<LineString> lineStrings = new ArrayList<LineString>(); - for (ListIterator it = listIterator(); it.hasNext();) - { + for (ListIterator it = listIterator(); it.hasNext();) { Element element = (Element) it.next(); - if (element instanceof LineStringElement) - { - if (((LineStringElement) element).getVerticeSize() == 0 || ((LineStringElement) element).getVerticeSize() > 1) - { + if (element instanceof ShapeElement) { + if (((ShapeElement) element).getVerticeSize() == 0 || ((ShapeElement) element).getVerticeSize() > 1) { + lineStrings.add((LinearRing) ((ShapeElement) element).toGeometry(factory)); + } + } else if (element instanceof LineStringElement) { + if (((LineStringElement) element).getVerticeSize() == 0 || ((LineStringElement) element).getVerticeSize() > 1) { lineStrings.add((LineString) ((LineStringElement) element).toGeometry(factory)); } - } else if (element instanceof LineElement) - { + } else if (element instanceof LineElement) { - if (((LineElement) element).getVertices().length == 0 || ((LineElement) element).getVertices().length > 1) - { + if (((LineElement) element).getVertices().length == 0 || ((LineElement) element).getVertices().length > 1) { lineStrings.add((LineString) ((LineElement) element).toGeometry(factory)); } - } else if (element instanceof ArcElement) - { + } else if (element instanceof ArcElement) { lineStrings.add((LineString) ((ArcElement) element).toGeometry(factory)); } else { logger.warn("Unknown sub-element in ComplexChain Element-" + element.getElementType()); @@ -182,42 +156,56 @@ return factory.createMultiLineString(lines); } - public double getElementSize() - { + public short getTotalLength() { return raw[18]; } - public boolean isClosed() - { - if (isEmpty()) - { + protected void setTotalLength(short value) { + raw[18] = value; + } + + public short getNumOfElement() { + return raw[19]; + } + + protected void setNumOfElement(short value) { + raw[19] = value; + } + + + public short[] getAttributes() { + return Arrays.copyOfRange(raw, 20, 23); + } + + protected void setAttributes(short[] values) { + if (values.length < 4) return; + System.arraycopy(values, 0, raw, 20, 24 - 20); + } + + public boolean isClosed() { + if (isEmpty()) { return false; } return false; } - public static class ElementHandler extends Element.ElementHandler - { + public static class ElementHandler extends Element.ElementHandler { private static ElementHandler instance = null; - public ElementHandler() - { + public ElementHandler() { super(ElementType.COMPLEXCHAIN); } - public static IElementHandler getInstance() - { - if (instance == null) - { + public static IElementHandler getInstance() { + if (instance == null) { instance = new ElementHandler(); } return instance; } - protected Element createElement(byte[] raw) - { + protected Element createElement(byte[] raw) { return new ComplexChainElement(raw); } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexElement.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexElement.java index 299bb04..42dc018 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexElement.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexElement.java @@ -9,8 +9,7 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �U�� 04:17:37 + * @since 2006/5/18 */ -public interface ComplexElement extends List<Element> -{ +public interface ComplexElement extends List<Element> { } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexShapeElement.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexShapeElement.java index a4389e4..2250e6a 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexShapeElement.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ComplexShapeElement.java @@ -19,196 +19,156 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �U�� 03:45:15 + * @since 2006/5/18 �U�� 03:45:15 */ -public class ComplexShapeElement extends Element implements ComplexElement, GeometryConverter -{ +public class ComplexShapeElement extends Element implements ComplexElement, GeometryConverter { private static final Logger logger = Logger.getLogger(ComplexShapeElement.class); ArrayList<Element> list = new ArrayList<Element>(); - public ComplexShapeElement(byte[] raw) - { + ComplexShapeElement(byte[] raw) { super(raw); } - public int size() - { + public int size() { return list.size(); } - public boolean isEmpty() - { + public boolean isEmpty() { return list.isEmpty(); } - public boolean contains(Object o) - { + public boolean contains(Object o) { return list.contains(o); } - public Iterator iterator() - { + public Iterator iterator() { return list.iterator(); } - public Object[] toArray() - { + public Object[] toArray() { return list.toArray(); } - public <T> T[] toArray(T[] ts) - { + public <T> T[] toArray(T[] ts) { return list.toArray(ts); } - public boolean add(Element element) - { + public boolean add(Element element) { return list.add(element); } - public boolean remove(Object o) - { + public boolean remove(Object o) { return list.remove(o); } - public boolean containsAll(Collection<?> objects) - { + public boolean containsAll(Collection<?> objects) { return list.containsAll(objects); } - public boolean addAll(Collection<? extends Element> elements) - { + public boolean addAll(Collection<? extends Element> elements) { return list.addAll(elements); } - public boolean addAll(int i, Collection<? extends Element> elements) - { + public boolean addAll(int i, Collection<? extends Element> elements) { return list.addAll(i, elements); } - public boolean removeAll(Collection<?> objects) - { + public boolean removeAll(Collection<?> objects) { return list.removeAll(objects); } - public boolean retainAll(Collection<?> objects) - { + public boolean retainAll(Collection<?> objects) { return list.retainAll(objects); } - public void clear() - { + public void clear() { list.clear(); } - public Element get(int index) - { + public Element get(int index) { return list.get(index); } - public Element set(int i, Element element) - { + public Element set(int i, Element element) { return list.set(i, element); } - public void add(int i, Element element) - { + public void add(int i, Element element) { list.add(i, element); } - public Element remove(int index) - { + public Element remove(int index) { return list.remove(index); } - public int indexOf(Object o) - { + public int indexOf(Object o) { return list.indexOf(o); } - public int lastIndexOf(Object o) - { + public int lastIndexOf(Object o) { return list.lastIndexOf(o); } - public ListIterator listIterator() - { + public ListIterator listIterator() { return list.listIterator(); } - public ListIterator listIterator(int index) - { + public ListIterator listIterator(int index) { return list.listIterator(index); } - public List subList(int fromIndex, int toIndex) - { + public List subList(int fromIndex, int toIndex) { return list.subList(fromIndex, toIndex); } - public Geometry toGeometry(GeometryFactory factory) - { + public Geometry toGeometry(GeometryFactory factory) { ArrayList<Geometry> list = new ArrayList<Geometry>(); - for (ListIterator it = listIterator(); it.hasNext();) - { + for (ListIterator it = listIterator(); it.hasNext();) { Element element = (Element) it.next(); - if (element instanceof ShapeElement) - { - if (((ShapeElement) element).getVerticeSize() == 0 || ((ShapeElement) element).getVerticeSize() > 1) - { + 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) - { + } 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) - { + } else if (element instanceof LineElement) { + if (((LineElement) element).getVertices().length == 0 || ((LineElement) element).getVertices().length > 1) { list.add(((LineElement) element).toGeometry(factory)); } - } else if (element instanceof ArcElement) - { + } else if (element instanceof ArcElement) { } } CoordinateList pts = new CoordinateList(); - for (Geometry geom : list) - { + for (Geometry geom : list) { pts.add(geom.getCoordinates(), true); } return factory.createLinearRing(pts.toCoordinateArray()); } - public static class ElementHandler extends Element.ElementHandler - { + public static class ElementHandler extends Element.ElementHandler { private static ElementHandler instance = null; - public ElementHandler() - { + public ElementHandler() { super(ElementType.COMPLEXSHAPE); } - public static IElementHandler getInstance() - { - if (instance == null) - { + public static IElementHandler getInstance() { + if (instance == null) { instance = new ElementHandler(); } return instance; } - protected Element createElement(byte[] raw) - { + protected Element createElement(byte[] raw) { return new ComplexShapeElement(raw); } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7Exception.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7Exception.java index 0f2cd91..ef9387b 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7Exception.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7Exception.java @@ -1,24 +1,19 @@ package com.ximple.io.dgn7; -public class Dgn7Exception extends Exception -{ - public Dgn7Exception() - { +public class Dgn7Exception extends Exception { + public Dgn7Exception() { } - public Dgn7Exception(String s) - { + public Dgn7Exception(String s) { super(s); } - public Dgn7Exception(String s, Throwable throwable) - { + public Dgn7Exception(String s, Throwable throwable) { super(s, throwable); } - public Dgn7Exception(Throwable throwable) - { + public Dgn7Exception(Throwable throwable) { super(throwable); } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7OracleReader.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7OracleReader.java index b8908cf..189c289 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7OracleReader.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7OracleReader.java @@ -19,10 +19,9 @@ * Dgn7OracleReader * User: Ulysses * Date: 2007/10/24 - * Time: �U�� 01:01:08 + * Time: */ -public class Dgn7OracleReader implements Iterator<Element> -{ +public class Dgn7OracleReader implements Iterator<Element> { private final static Logger logger = Logger.getLogger(Dgn7OracleReader.class); private String _sql; @@ -32,76 +31,60 @@ private static final int FETCHSIZE = 20; private Element _element; - public Dgn7OracleReader(String sql, String fieldName, OracleConnection connection) - { + public Dgn7OracleReader(String sql, String fieldName, OracleConnection connection) { this._sql = sql; this._fieldName = fieldName; this._connection = connection; } - public String getSql() - { + public String getSql() { return _sql; } - public void setSql(String sql) - { + public void setSql(String sql) { this._sql = sql; } - public String getFieldName() - { + public String getFieldName() { return _fieldName; } - public void setFieldName(String fieldName) - { + public void setFieldName(String fieldName) { this._fieldName = fieldName; } - public boolean hasNext() - { - if (_resultSet == null) - { - try - { + public boolean hasNext() { + if (_resultSet == null) { + try { initializeReader(); - } catch (SQLException e) - { + } catch (SQLException e) { throw new RuntimeException("initialize oralce error.", e); - } catch (Dgn7Exception e) - { + } catch (Dgn7Exception e) { throw new RuntimeException("initialize oralce error.", e); } } return _element != null; } - public Element next() - { + public Element next() { Element result = _element; - try - { + try { fetchElement(); - } catch (SQLException e) - { + } catch (SQLException e) { throw new RuntimeException("Error:" + e.getMessage(), e); - } catch (Dgn7Exception e) - { + } catch (Dgn7Exception e) { throw new RuntimeException("Error:" + e.getMessage(), e); } return result; } - public void remove() - { + public void remove() { throw new RuntimeException("Not Support this method."); } - private boolean initializeReader() throws SQLException, Dgn7Exception - { + private boolean initializeReader() throws SQLException, Dgn7Exception { if (_resultSet != null) return true; Statement stmtSrc = _connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); @@ -113,31 +96,24 @@ return true; } - private boolean fetchElement() throws SQLException, Dgn7Exception - { - if (_resultSet.next()) - { + private boolean fetchElement() throws SQLException, Dgn7Exception { + if (_resultSet.next()) { byte[] raw = null; Object value = _resultSet.getObject(this._fieldName); - if (value instanceof BLOB) - { + if (value instanceof BLOB) { BLOB blob = (BLOB) value; - try - { + try { raw = getBytesFromBLOB(blob); - } catch (IOException e) - { + } catch (IOException e) { throw new Dgn7Exception("IOError", e); } - blob.close(); - } else if (value instanceof byte[]) - { + // blob.close(); + } else if (value instanceof byte[]) { raw = (byte[]) value; } - if (raw == null) - { + if (raw == null) { _element = null; return false; } @@ -156,35 +132,28 @@ ElementType recordType = ElementType.forID(type); IElementHandler handler = recordType.getElementHandler(); _element = (Element) handler.read(buffer, signature, elementLength); - if (recordType.isComplexElement() && (elementLength < raw.length)) - { + if (recordType.isComplexElement() && (elementLength < raw.length)) { int offset = elementLength; - while (offset < (raw.length - 4)) - { + while (offset < (raw.length - 4)) { buffer.position(offset); signature = buffer.getShort(); type = (byte) ((signature >>> 8) & 0x007f); elementLength = (buffer.getShort() * 2) + 4; - if (raw.length < (offset + elementLength)) - { + if (raw.length < (offset + elementLength)) { System.out.println("Length not match:" + offset + ":" + buffer.position() + ":" + buffer.limit()); break; } recordType = ElementType.forID(type); handler = recordType.getElementHandler(); - if (handler != null) - { + if (handler != null) { Element subElement = (Element) handler.read(buffer, signature, elementLength); ((ComplexElement) _element).add(subElement); offset += elementLength; - } else - { + } else { byte[] remain = new byte[buffer.remaining()]; System.arraycopy(raw, offset, remain, 0, buffer.remaining()); - for (int i = 0; i < remain.length; i++) - { - if (remain[i] != 0) - { + for (int i = 0; i < remain.length; i++) { + if (remain[i] != 0) { logger.info("fetch element has some error. index=" + (offset + i) + ":value=" + remain[i]); System.out.println("fetch element has some error. index=" + (offset + i) + ":value=" + remain[i]); } @@ -194,16 +163,14 @@ } } - } else - { + } else { _element = null; return false; } return true; } - protected static byte[] getBytesFromBLOB(BLOB blob) throws SQLException, IOException - { + protected byte[] getBytesFromBLOB(BLOB blob) throws SQLException, IOException { byte[] raw; // BLOB blob = (BLOB) rs.getBlob(1); @@ -213,29 +180,30 @@ ByteBuffer buffer = null; // ByteBuffer.allocate(optimalSize); int len; - try - { - while ((len = (is.read(chunk))) != -1) - { - if (buffer != null) - { + try { + while ((len = (is.read(chunk))) != -1) { + if (buffer != null) { buffer.limit(buffer.limit() + len); - } else - { + } else { buffer = ByteBuffer.allocate(len); } buffer.put(chunk); } - is.close(); assert buffer != null; buffer.position(0); raw = buffer.array(); - } catch (IOException e) - { + } catch (IOException e) { e.printStackTrace(); throw e; + } finally { + try { + is.close(); + } catch (IOException e) { + logger.warn("InputStream cannot close", e); + } + ; } return raw; diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileException.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileException.java index 54741e5..00e0772 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileException.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileException.java @@ -1,24 +1,19 @@ package com.ximple.io.dgn7; -public class Dgn7fileException extends Dgn7Exception -{ +public class Dgn7fileException extends Dgn7Exception { - public Dgn7fileException() - { + public Dgn7fileException() { } - public Dgn7fileException(String message) - { + public Dgn7fileException(String message) { super(message); } - public Dgn7fileException(String message, Throwable cause) - { + public Dgn7fileException(String message, Throwable cause) { super(message, cause); } - public Dgn7fileException(Throwable cause) - { + public Dgn7fileException(Throwable cause) { super(cause); } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileHeader.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileHeader.java index 33f3a1c..ca59edf 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileHeader.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileHeader.java @@ -13,27 +13,23 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/17 �U�� 01:21:00 + * @since 2006/5/17 */ -public class Dgn7fileHeader -{ +public class Dgn7fileHeader { private short elmtype; private byte[] raw; - public Dgn7fileHeader() - { + public Dgn7fileHeader() { } - public void read(ByteBuffer file, boolean strict) throws IOException - { + public void read(ByteBuffer file, boolean strict) throws IOException { file.order(ByteOrder.LITTLE_ENDIAN); elmtype = file.getShort(); short wtf = file.getShort(); int length = (wtf * 2); - if (file.remaining() != (length)) - { + if (file.remaining() != (length)) { Assert.shouldNeverReachHere(); } @@ -41,15 +37,12 @@ file.get(raw, 0, file.remaining()); } - public String toString() - { + public String toString() { return "Dgn7fileHeader{" + "raw=" + ((raw == null) ? "null" : raw.length) + '}'; } - public int size() - { - if (raw == null) - { + public int size() { + if (raw == null) { return 0; } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileReader.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileReader.java index 35a3156..4dabae4 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileReader.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileReader.java @@ -2,6 +2,8 @@ //~--- JDK imports ------------------------------------------------------------ +import javax.swing.JFileChooser; +import javax.swing.JFrame; import java.io.EOFException; import java.io.File; import java.io.FileInputStream; @@ -11,8 +13,6 @@ import java.nio.MappedByteBuffer; import java.nio.channels.FileChannel; import java.nio.channels.ReadableByteChannel; -import javax.swing.JFileChooser; -import javax.swing.JFrame; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; @@ -27,10 +27,9 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/17 �U�� 01:24:10 + * @since 2006/5/17 */ -public class Dgn7fileReader -{ +public class Dgn7fileReader { private static final Logger logger = LogManager.getLogger(Dgn7fileReader.class); private Dgn7fileHeader header; @@ -38,17 +37,16 @@ ByteBuffer buffer; private ElementType fileElementType = ElementType.UNDEFINED; private ByteBuffer headerTransfer; - private final Record record = new Record(); + private final Element.FileRecord record = new Element.FileRecord(); private final boolean randomAccessEnabled; private Lock lock; private boolean useMemoryMappedBuffer; private long currentOffset = 0L; - private StreamLogging streamLogger = new StreamLogging("Shapefile Reader"); + private StreamLogging streamLogger = new StreamLogging("Dgn7 Reader"); private int maxElementId = 0; - public Dgn7fileReader(ReadableByteChannel channel, boolean strict, boolean useMemoryMapped, Lock lock) - throws IOException, Dgn7fileException - { + public Dgn7fileReader(FileChannel channel, boolean strict, boolean useMemoryMapped, Lock lock) + throws IOException, Dgn7fileException { this.channel = channel; this.useMemoryMappedBuffer = useMemoryMapped; streamLogger.open(); @@ -58,34 +56,29 @@ init(strict); } - public Dgn7fileReader(ReadableByteChannel channel, Lock lock) throws IOException, Dgn7fileException - { + public Dgn7fileReader(FileChannel channel, Lock lock) throws IOException, Dgn7fileException { this(channel, true, true, lock); } // ensure the capacity of the buffer is of size by doubling the original // capacity until it is big enough // this may be naiive and result in out of MemoryError as implemented... - public static ByteBuffer ensureCapacity(ByteBuffer buffer, int size, boolean useMemoryMappedBuffer) - { + public static ByteBuffer ensureCapacity(ByteBuffer buffer, int size, boolean useMemoryMappedBuffer) { // This sucks if you accidentally pass is a MemoryMappedBuffer of size // 80M // like I did while messing around, within moments I had 1 gig of // swap... - if (buffer.isReadOnly() || useMemoryMappedBuffer) - { + if (buffer.isReadOnly() || useMemoryMappedBuffer) { return buffer; } int limit = buffer.limit(); - while (limit < size) - { + while (limit < size) { limit *= 2; } - if (limit != buffer.limit()) - { + if (limit != buffer.limit()) { // if (record.ready) { buffer = ByteBuffer.allocateDirect(limit); @@ -99,31 +92,26 @@ } // for filling a ReadableByteChannel - public static int fill(ByteBuffer buffer, ReadableByteChannel channel) throws IOException - { + public static int fill(ByteBuffer buffer, ReadableByteChannel channel) throws IOException { int r = buffer.remaining(); // channel reads return -1 when EOF or other error // because they a non-blocking reads, 0 is a valid return value!! - while ((buffer.remaining() > 0) && (r != -1)) - { + while ((buffer.remaining() > 0) && (r != -1)) { r = channel.read(buffer); } - if (r == -1) - { + if (r == -1) { buffer.limit(buffer.position()); } return r; } - public static Dgn7fileHeader readHeader(ReadableByteChannel channel, boolean strict) throws IOException - { + public static Dgn7fileHeader readHeader(ReadableByteChannel channel, boolean strict) throws IOException { ByteBuffer buffer = ByteBuffer.allocateDirect(4); - if (fill(buffer, channel) == -1) - { + if (fill(buffer, channel) == -1) { throw new EOFException("Premature end of header"); } @@ -138,8 +126,7 @@ buffer = ByteBuffer.allocateDirect(length + 4); buffer.put(old); - if (fill(buffer, channel) == -1) - { + if (fill(buffer, channel) == -1) { throw new EOFException("Premature end of header"); } @@ -152,23 +139,19 @@ return header; } - public Dgn7fileHeader getHeader() - { + public Dgn7fileHeader getHeader() { return header; } - public void close() throws IOException - { + public void close() throws IOException { lock.unlockRead(); - if (channel.isOpen()) - { + if (channel.isOpen()) { channel.close(); streamLogger.close(); } - if (buffer instanceof MappedByteBuffer) - { + if (buffer instanceof MappedByteBuffer) { NIOUtilities.clean(buffer); } @@ -176,13 +159,11 @@ header = null; } - public boolean supportsRandomAccess() - { + public boolean supportsRandomAccess() { return randomAccessEnabled; } - public Record nextElement() throws IOException, Dgn7fileException - { + public Element.FileRecord nextElement() throws IOException, Dgn7fileException { // need to update position buffer.position(this.toBufferOffset(record.end)); @@ -201,12 +182,10 @@ // track the record location int elementLength = (buffer.getShort() * 2) + 4; - if (!buffer.isReadOnly() && !useMemoryMappedBuffer) - { + if (!buffer.isReadOnly() && !useMemoryMappedBuffer) { // capacity is less than required for the record // copy the old into the newly allocated - if (buffer.capacity() < elementLength) - { + if (buffer.capacity() < elementLength) { this.currentOffset += buffer.position(); ByteBuffer old = buffer; @@ -221,8 +200,7 @@ // remaining is less than record length // compact the remaining data and read again, // allowing enough room for one more record header - if (buffer.remaining() < elementLength) - { + if (buffer.remaining() < elementLength) { this.currentOffset += buffer.position(); buffer.compact(); fill(buffer, channel); @@ -252,8 +230,7 @@ // second guess them... buffer.mark(); - if (recordType.isMultiPoint()) - { + if (recordType.isMultiPoint()) { int lowCoorX = buffer.getInt(); lowCoorX = DgnUtility.convertFromDGN(lowCoorX); @@ -292,6 +269,7 @@ record.length = elementLength; record.signature = signature; record.number = recordNumber; + record.buffer = buffer; // remember, we read one int already... record.end = this.toFileOffset(buffer.position()) + elementLength - 4; @@ -307,24 +285,18 @@ return record; } - public void goTo(int offset) throws IOException, UnsupportedOperationException - { - if (randomAccessEnabled) - { - if (this.useMemoryMappedBuffer) - { + public void goTo(int offset) throws IOException, UnsupportedOperationException { + if (randomAccessEnabled) { + if (this.useMemoryMappedBuffer) { buffer.position(offset); - } else - { + } else { /* * Check to see if requested offset is already loaded; ensure * that record header is in the buffer */ - if ((this.currentOffset <= offset) && (this.currentOffset + buffer.limit() >= offset + 4)) - { + if ((this.currentOffset <= offset) && (this.currentOffset + buffer.limit() >= offset + 4)) { buffer.position(this.toBufferOffset(offset)); - } else - { + } else { FileChannel fc = (FileChannel) this.channel; fc.position(offset); @@ -339,25 +311,20 @@ record.end = offset; - try - { + try { hasNext(); - } catch (IOException ioe) - { + } catch (IOException ioe) { record.end = oldRecordOffset; throw ioe; } - } else - { + } else { throw new UnsupportedOperationException("Random Access not enabled"); } } - public Record elementAt(int offset) throws IOException, UnsupportedOperationException, Dgn7fileException - { - if (randomAccessEnabled) - { + public Element.FileRecord elementAt(int offset) throws IOException, UnsupportedOperationException, Dgn7fileException { + if (randomAccessEnabled) { this.goTo(offset); return nextElement(); @@ -366,25 +333,21 @@ throw new UnsupportedOperationException("Random Access not enabled"); } - public boolean hasNext() throws IOException - { + public boolean hasNext() throws IOException { // mark current position int position = buffer.position(); // ensure the proper position, regardless of read or handler behavior - try - { + try { buffer.position(this.toBufferOffset(record.end)); - } catch (IllegalArgumentException e) - { + } catch (IllegalArgumentException e) { logger.warn("position=" + this.toBufferOffset(record.end), e); return false; } // no more data left - if (buffer.remaining() < 4) - { + if (buffer.remaining() < 4) { return false; } @@ -392,8 +355,7 @@ boolean hasNext = true; short type = buffer.getShort(); - if (type == -1) - { + if (type == -1) { hasNext = false; } @@ -403,8 +365,7 @@ return hasNext; } - private void init(boolean strict) throws IOException, Dgn7fileException - { + private void init(boolean strict) throws IOException, Dgn7fileException { header = readHeader(channel, strict); // fileElementType = header.getElementType(); @@ -416,8 +377,7 @@ // { // throw new IOException("Unsuported shape type:" + fileElementType); // } - if ((channel instanceof FileChannel) && useMemoryMappedBuffer) - { + if ((channel instanceof FileChannel) && useMemoryMappedBuffer) { FileChannel fc = (FileChannel) channel; buffer = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); @@ -425,8 +385,7 @@ // buffer.position(100); buffer.position(header.size()); this.currentOffset = 0; - } else - { + } else { // force useMemoryMappedBuffer to false this.useMemoryMappedBuffer = false; @@ -444,33 +403,26 @@ record.end = toFileOffset(buffer.position()); } - private int toBufferOffset(int offset) - { + private int toBufferOffset(int offset) { return (int) (offset - currentOffset); } - private int toFileOffset(int offset) - { + private int toFileOffset(int offset) { return (int) (currentOffset + offset); } - public int getCount(int count) throws Dgn7fileException - { - try - { - if (channel == null) - { + public int getCount(int count) throws Dgn7fileException { + try { + if (channel == null) { return -1; } count = 0; - for (int tmp = readElement(); tmp != -1; tmp = readElement()) - { + for (int tmp = readElement(); tmp != -1; tmp = readElement()) { count += tmp; } - } catch (IOException ioe) - { + } catch (IOException ioe) { count = -1; // What now? This seems arbitrarily appropriate ! @@ -480,23 +432,19 @@ return count; } - public int getCount() throws Dgn7fileException - { + public int getCount() throws Dgn7fileException { return getCount(0); } - private int readElement() throws IOException - { - if (!fillBuffer()) - { + private int readElement() throws IOException { + if (!fillBuffer()) { return -1; } // burn the record number buffer.getInt(); - if (!fillBuffer()) - { + if (!fillBuffer()) { return -1; } @@ -506,8 +454,7 @@ // subtract that from the record length recordlength -= 4; - if (!fillBuffer()) - { + if (!fillBuffer()) { return -1; } @@ -515,13 +462,11 @@ int type = buffer.getInt(); // go to end of record - while (buffer.limit() < buffer.position() + recordlength) - { + while (buffer.limit() < buffer.position() + recordlength) { recordlength -= buffer.limit() - buffer.position(); buffer.clear(); - if (channel.read(buffer) < 1) - { + if (channel.read(buffer) < 1) { return -1; } } @@ -529,8 +474,7 @@ buffer.position(buffer.position() + recordlength); // return 0 if record is null. Null records should be counted. - if (type == 0) - { + if (type == 0) { // this is a null feature return 0; } @@ -538,28 +482,23 @@ return 1; } - private boolean fillBuffer() throws IOException - { + private boolean fillBuffer() throws IOException { int result = 1; - if (buffer.limit() <= buffer.position() + 4) - { + if (buffer.limit() <= buffer.position() + 4) { result = fill(buffer, channel); } return result > 0; } - public static void main(String[] args) - { + public static void main(String[] args) { JFileChooser jfc = new JFileChooser("D:/TEMP"); File f = null; int r = jfc.showOpenDialog(new JFrame()); - if (r == JFileChooser.APPROVE_OPTION) - { - try - { + if (r == JFileChooser.APPROVE_OPTION) { + try { f = jfc.getSelectedFile(); FileChannel channel = new FileInputStream(f).getChannel(); @@ -573,25 +512,20 @@ count = 0; size = 0; - try - { + try { Element lastComplex = null; - while (reader.hasNext()) - { + while (reader.hasNext()) { size++; - Dgn7fileReader.Record record = reader.nextElement(); + Element.FileRecord record = reader.nextElement(); - if (record.element() != null) - { + if (record.element() != null) { Element element = (Element) record.element(); ElementType type = element.getElementType(); - if ((!type.isComplexElement()) && (!element.isComponentElement())) - { - if (lastComplex != null) - { + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { // @todo add process in here count++; lastComplex = null; @@ -599,19 +533,14 @@ // @todo add process in here count++; - } else if (element.isComponentElement()) - { - if (lastComplex != null) - { + } else if (element.isComponentElement()) { + if (lastComplex != null) { ((ComplexElement) lastComplex).add(element); } - } else if (type.isComplexElement()) - { - if (lastComplex == null) - { + } else if (type.isComplexElement()) { + if (lastComplex == null) { lastComplex = element; - } else - { + } else { // @todo add process in here count++; lastComplex = element; @@ -619,104 +548,23 @@ } } } - } catch (IOException e) - { + } catch (IOException e) { logger.warn("Stop read dgn file", e); - } catch (Dgn7fileException e) - { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. - } finally - { + } catch (Dgn7fileException e) { + logger.warn(e.getMessage(), e); + } finally { reader.close(); } - System.out.println("count=" + count + " size=" + size); + logger.debug("count=" + count + " size=" + size); // reader.close(); - } catch (IOException ioe) - { - System.out.println(ioe); - ioe.printStackTrace(); - } catch (Dgn7fileException e) - { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. + } catch (IOException ioe) { + logger.warn(ioe.getMessage(), ioe); + } catch (Dgn7fileException e) { + logger.warn(e.getMessage(), e); } } System.exit(0); - } - - public final class Record - { - int length; - int number = 0; - int offset; // Relative to the whole file - int start = 0; // Relative to the current loaded buffer - short signature = 0; - - /** - * The minimum X value. - */ - public double minX; - - /** - * The minimum Y value. - */ - public double minY; - - /** - * The minimum Z value. - */ - public double minZ; - - /** - * The maximum X value. - */ - public double maxX; - - /** - * The maximum Y value. - */ - public double maxY; - - /** - * The maximum Z value. - */ - public double maxZ; - - // ElementType type; - int end = 0; // Relative to the whole file - Object element = null; - IElementHandler handler; - - public Object element() - { - if (element == null) - { - buffer.position(start); - buffer.order(ByteOrder.LITTLE_ENDIAN); - - if (handler == null) - { - return null; - } - - element = handler.read(buffer, signature, length); - } - - return element; - } - - public int offset() - { - return offset; - } - - /** - * A summary of the record. - */ - public String toString() - { - return "Record " + number + " length " + length + " bounds " + minX + "," + minY + " " + maxX + "," + maxY; - } } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileWriter.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileWriter.java new file mode 100644 index 0000000..6e475cd --- /dev/null +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Dgn7fileWriter.java @@ -0,0 +1,362 @@ +package com.ximple.io.dgn7; + +import com.ximple.util.DgnUtility; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; + +import java.io.EOFException; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.MappedByteBuffer; +import java.nio.ShortBuffer; +import java.nio.channels.FileChannel; +import java.nio.channels.ReadableByteChannel; +import java.nio.channels.WritableByteChannel; + +public class Dgn7fileWriter { + private static final Logger logger = LogManager.getLogger(Dgn7fileWriter.class); + + private Dgn7fileHeader header; + private FileChannel channel; + ByteBuffer buffer; + private ElementType fileElementType = ElementType.UNDEFINED; + private ByteBuffer headerTransfer; + private final Element.FileRecord record = new Element.FileRecord(); + private final boolean randomAccessEnabled; + private Lock lock; + private boolean useMemoryMappedBuffer; + private long currentOffset = 0L; + private StreamLogging streamLogger = new StreamLogging("Dgn7 Writer"); + private int maxElementId = 0; + + public Dgn7fileWriter(FileChannel channel, boolean strict, boolean useMemoryMapped, Lock lock) + throws IOException, Dgn7fileException { + this.channel = channel; + this.useMemoryMappedBuffer = useMemoryMapped; + streamLogger.open(); + randomAccessEnabled = channel instanceof FileChannel; + this.lock = lock; + lock.lockRead(); + lock.lockWrite(); + // init(strict); + } + + public Dgn7fileWriter(FileChannel channel, Lock lock) throws IOException, Dgn7fileException { + this(channel, true, true, lock); + } + + protected boolean hasNext() throws IOException { + // mark current position + int position = buffer.position(); + + // ensure the proper position, regardless of read or handler behavior + try { + buffer.position(this.toBufferOffset(record.end)); + } catch (IllegalArgumentException e) { + logger.warn("position=" + this.toBufferOffset(record.end), e); + + return false; + } + + // no more data left + if (buffer.remaining() < 4) { + return false; + } + + // looks good + boolean hasNext = true; + short type = buffer.getShort(); + + if (type == -1) { + hasNext = false; + } + + // reset things to as they were + buffer.position(position); + + return hasNext; + } + + protected Element.FileRecord nextElement() throws IOException, Dgn7fileException { + // need to update position + buffer.position(this.toBufferOffset(record.end)); + + // record header is big endian + buffer.order(ByteOrder.LITTLE_ENDIAN); + + // read shape record header + int recordNumber = ++maxElementId; + short signature = buffer.getShort(); + + // byte type = (byte) (buffer.get() & 0x7f); + byte type = (byte) ((signature >>> 8) & 0x007f); + + // silly Bentley say contentLength is in 2-byte words + // and ByteByffer uses bytes. + // track the record location + int elementLength = (buffer.getShort() * 2) + 4; + + if (!buffer.isReadOnly() && !useMemoryMappedBuffer) { + // capacity is less than required for the record + // copy the old into the newly allocated + if (buffer.capacity() < elementLength) { + this.currentOffset += buffer.position(); + + ByteBuffer old = buffer; + + // ensure enough capacity for one more record header + buffer = Dgn7fileReader.ensureCapacity(buffer, elementLength, useMemoryMappedBuffer); + buffer.put(old); + fill(buffer, channel); + buffer.position(0); + } else + + // remaining is less than record length + // compact the remaining data and read again, + // allowing enough room for one more record header + if (buffer.remaining() < elementLength) { + this.currentOffset += buffer.position(); + buffer.compact(); + fill(buffer, channel); + buffer.position(0); + } + } + + // shape record is all little endian + // buffer.order(ByteOrder.LITTLE_ENDIAN); + // read the type, handlers don't need it + ElementType recordType = ElementType.forID(type); + + logger.debug("nextElement at " + this.toBufferOffset(record.end) + ":type=" + type); + + // this usually happens if the handler logic is bunk, + // but bad files could exist as well... + + /* + * if (recordType != ElementType.NULL && recordType != fileElementType) + * { + * throw new IllegalStateException("ShapeType changed illegally from " + fileElementType + " to " + recordType); + * } + */ + + // peek at bounds, then reset for handler + // many handler's may ignore bounds reading, but we don't want to + // second guess them... + buffer.mark(); + + if (recordType.isMultiPoint()) { + int lowCoorX = buffer.getInt(); + + lowCoorX = DgnUtility.convertFromDGN(lowCoorX); + record.minX = DgnUtility.converUnitToCoord(lowCoorX); + + int lowCoorY = buffer.getInt(); + + lowCoorY = DgnUtility.convertFromDGN(lowCoorY); + record.minY = DgnUtility.converUnitToCoord(lowCoorY); + + int lowCoorZ = buffer.getInt(); + + lowCoorZ = DgnUtility.convertFromDGN(lowCoorZ); + record.minZ = DgnUtility.converUnitToCoord(lowCoorZ); + + int highCoorX = buffer.getInt(); + + highCoorX = DgnUtility.convertFromDGN(highCoorX); + record.maxX = DgnUtility.converUnitToCoord(highCoorX); + + int highCoorY = buffer.getInt(); + + highCoorY = DgnUtility.convertFromDGN(highCoorY); + record.maxY = DgnUtility.converUnitToCoord(highCoorY); + + int highCoorZ = buffer.getInt(); + + highCoorZ = DgnUtility.convertFromDGN(highCoorZ); + record.maxZ = DgnUtility.converUnitToCoord(highCoorZ); + } + + buffer.reset(); + record.offset = record.end; + + // update all the record info. + record.length = elementLength; + record.signature = signature; + record.number = recordNumber; + record.buffer = buffer; + + // remember, we read one int already... + record.end = this.toFileOffset(buffer.position()) + elementLength - 4; + // record.end = this.toFileOffset(buffer.position()) + elementLength; + + // mark this position for the reader + record.start = buffer.position(); + + // clear any cached record + record.handler = recordType.getElementHandler(); + record.element = null; + + return record; + } + + private void init(boolean strict) throws IOException, Dgn7fileException { + header = readHeader(channel, strict); + + if (useMemoryMappedBuffer) { + FileChannel fc = channel; + + buffer = fc.map(FileChannel.MapMode.READ_WRITE, 0, fc.size()); + + // buffer.position(100); + buffer.position(header.size()); + this.currentOffset = 0; + } else { + // force useMemoryMappedBuffer to false + this.useMemoryMappedBuffer = false; + + // start with 8K buffer + buffer = ByteBuffer.allocateDirect(8 * 1024); + fill(buffer, channel); + buffer.flip(); + this.currentOffset = header.size(); + } + + headerTransfer = ByteBuffer.allocate(4); + headerTransfer.order(ByteOrder.LITTLE_ENDIAN); + + // make sure the record end is set now... + record.end = toFileOffset(buffer.position()); + } + + public static Dgn7fileHeader readHeader(FileChannel channel, boolean strict) throws IOException { + ByteBuffer buffer = ByteBuffer.allocateDirect(4); + + if (fill(buffer, channel) == -1) { + throw new EOFException("Premature end of header"); + } + + buffer.order(ByteOrder.LITTLE_ENDIAN); + + int length = buffer.getShort(2) * 2; + ByteBuffer old = buffer; + + old.position(0); + + // ensure enough capacity for one more record header + buffer = ByteBuffer.allocateDirect(length + 4); + buffer.put(old); + + if (fill(buffer, channel) == -1) { + throw new EOFException("Premature end of header"); + } + + buffer.position(0); + + Dgn7fileHeader header = new Dgn7fileHeader(); + + header.read(buffer, strict); + + return header; + } + + protected static int fill(ByteBuffer buffer, FileChannel channel) throws IOException { + int r = buffer.remaining(); + + // channel reads return -1 when EOF or other error + // because they a non-blocking reads, 0 is a valid return value!! + while ((buffer.remaining() > 0) && (r != -1)) { + r = channel.read(buffer); + } + + if (r == -1) { + buffer.limit(buffer.position()); + } + + return r; + } + + private void allocateBuffers() { + buffer = ByteBuffer.allocateDirect(16 * 1024); + } + + private void checkShapeBuffer(int size) { + if (buffer.capacity() < size) { + if (buffer != null) + NIOUtilities.clean(buffer); + buffer = ByteBuffer.allocateDirect(size); + } + } + + private void drain() throws IOException { + buffer.flip(); + while (buffer.remaining() > 0) + channel.write(buffer); + buffer.flip().limit(buffer.capacity()); + } + + private int toBufferOffset(int offset) { + return (int) (offset - currentOffset); + } + + private int toFileOffset(int offset) { + return (int) (currentOffset + offset); + } + + public void writeElement(Element element) throws IOException { + if (element == null) return; + if (element.getElementType().isComplexElement()) { + writeTo(element); + ComplexElement complexElement = (ComplexElement) element; + for (Element component : complexElement) { + writeTo(component); + } + } else { + writeTo(element); + } + } + + private void writeTo(Element element) throws IOException { + ByteBuffer writeBuffer = ByteBuffer.allocateDirect(element.raw.length * 2); + writeBuffer.order(ByteOrder.LITTLE_ENDIAN); + for (short word : element.raw) { + writeBuffer.putShort(word); + } + writeBuffer.rewind(); + + channel.write(writeBuffer); + } + + + + public void toEnd() throws IOException, Dgn7fileException { + while (hasNext()) { + nextElement(); + } + } + + public void close() throws IOException { + lock.unlockWrite(); + lock.unlockRead(); + + if (channel.isOpen()) { + channel.close(); + streamLogger.close(); + } + + if (buffer instanceof MappedByteBuffer) { + NIOUtilities.clean(buffer); + } + + channel = null; + header = null; + } + + public void writeEOF() throws IOException { + ByteBuffer writeBuffer = ByteBuffer.allocateDirect(2); + writeBuffer.order(ByteOrder.LITTLE_ENDIAN); + writeBuffer.putShort((short) -1); + channel.write(writeBuffer); + + } +} diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Element.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Element.java index abe63f6..5c44664 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Element.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Element.java @@ -5,7 +5,6 @@ import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; import java.nio.ByteOrder; -import java.nio.ShortBuffer; import java.util.ArrayList; import java.util.List; @@ -14,14 +13,12 @@ import com.ximple.util.DgnUtility; /** - * Record + * FileRecord * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �W�� 11:14:50 */ -public class Element -{ +public class Element { public static final int CONSTRUCTION_CLASS = 0; public static final int CONSTRUCTION_RULE_CLASS = 0; public static final int DIMENSION_CLASS = 0; @@ -38,9 +35,9 @@ protected short[] raw; protected byte attrOffset = 0; protected ByteBuffer rawBuffer; + protected boolean newElement = false; - public Element(byte[] raw) - { + Element(byte[] raw) { // this.raw = raw; this.raw = new short[raw.length / 2]; rawBuffer = ByteBuffer.wrap(raw); @@ -48,13 +45,18 @@ rawBuffer.asShortBuffer().get(this.raw); } - public int getLineStyle() - { + public int getLineStyle() { return (raw[17] & 0x0007); } - public Envelope getRange() - { + protected void setLineStyle(int value) { + if (value > -1 && value < 8) + raw[17] = (short) ((raw[17] & 0xfff8) | (value & 0x0007)); + else + new IllegalArgumentException("Out of Range!"); + } + + public Envelope getRange() { int lowCoorX = ((raw[3] << 16) & 0xffff0000) + (raw[2] & 0x0000ffff); lowCoorX = DgnUtility.convertFromDGN(lowCoorX); @@ -68,11 +70,10 @@ highCoorY = DgnUtility.convertFromDGN(highCoorY); return new Envelope(DgnUtility.converUnitToCoord(lowCoorX), DgnUtility.converUnitToCoord(highCoorX), - DgnUtility.converUnitToCoord(lowCoorY), DgnUtility.converUnitToCoord(highCoorY)); + DgnUtility.converUnitToCoord(lowCoorY), DgnUtility.converUnitToCoord(highCoorY)); } - public void setRange(Envelope bbox) - { + public void setRange(Envelope bbox) { int lowCoordX = DgnUtility.converCoordToUnit(bbox.getMinX()); int temp = DgnUtility.converToDGN(lowCoordX); raw[3] = (short) (temp >> 16 & 0x0000ffff); @@ -83,6 +84,10 @@ raw[5] = (short) (temp >> 16 & 0x0000ffff); raw[4] = (short) (temp & 0x0000ffff); + // lowZ + raw[7] = 0; + raw[8] = 0; + int highCoorX = DgnUtility.converCoordToUnit(bbox.getMaxX()); temp = DgnUtility.converToDGN(highCoorX); raw[9] = (short) (temp >> 16 & 0x0000ffff); @@ -92,132 +97,157 @@ temp = DgnUtility.converToDGN(highCoorY); raw[11] = (short) (temp >> 16 & 0x0000ffff); raw[10] = (short) (temp & 0x0000ffff); + + // highZ + raw[13] = (short) 0xffff; + raw[12] = (short) 0xffff; + } - public boolean isComponentElement() - { + public boolean isComponentElement() { return (short) ((raw[0] >>> 7) & 0x0001) == 1; } - public boolean removeUserAttributeData(int iLinkageId) - { + protected void setComponentElement(boolean value) { + raw[0] = (short) ((raw[0] & 0xff7f) | (value ? 0x0080 : 0x0)); + } + + public boolean removeUserAttributeData(int iLinkageId) { return true; } - public boolean removeUserAttributeData(int iLinkageId, int iLinkageIndex) - { + public boolean removeUserAttributeData(int iLinkageId, int iLinkageIndex) { return true; } - public boolean isDeleted() - { + public boolean isDeleted() { return (short) ((raw[0] >>> 15) & 0x0001) == 1; } - public int getColorIndex() - { + protected void setDeleted(boolean value) { + raw[0] = (short) ((raw[0] & 0x7fff) | ((((value) ? 1 : 0) << 15) & 0x8000)); + } + + public int getColorIndex() { return ((raw[17] >>> 8) & 0x00ff); } - public int getType() - { + protected void setColorIndex(int value) { + if (value > -1 && value < 256) + { + raw[17] = (short) ((raw[17] & 0x00ff) | (value << 8 & 0xff00)); + } else new IllegalArgumentException("Out of Range!"); + } + + public int getType() { return ((raw[0] >>> 8) & 0x007f); } - public ElementType getElementType() - { + protected void setType(int value) { + raw[0] = (short) ((raw[0] & 0x80ff) | (value << 8) & 0x3f00); + } + + public ElementType getElementType() { return ElementType.forID(getType()); } - public int getLevelIndex() - { + public int getLevelIndex() { return (raw[0] & 0x003f); } - public void setLevelIndex(int value) - { + public void setLevelIndex(int value) { raw[0] = (short) ((raw[0] & 0xffc0) | (value & 0x003f)); } - public int getWeight() - { + public int getWeight() { return ((raw[17] >>> 3) & 0x001f); } - public void setWeight(int value) - { - if (value > -1 && value < 31) - { + public void setWeight(int value) { + if (value > -1 && value < 31) { raw[17] = (short) ((raw[17] & 0xff07) | (value << 3 & 0x00f8)); - } - else - { + } else { throw new RuntimeException("Out of Range!"); } } - public void addUserAttributeData(byte[] pDataBlock, Class dataClass, int iLinkageId) throws Element.Exception - { + public short getFollowLength() { + return raw[1]; } - public void addUserAttributeData(byte[] pDataBlock, int iLinkageId, Object oDataDef) throws Element.Exception - { + protected void setFollowLength(short value) { + assert (raw.length >= value + 2); + raw[1] = value; } - public boolean hasUserAttributeData() - { - if (raw[15] <= 0) - { + public void addUserAttributeData(byte[] pDataBlock, Class dataClass, int iLinkageId) throws Element.Exception { + } + + public void addUserAttributeData(byte[] pDataBlock, int iLinkageId, Object oDataDef) throws Element.Exception { + } + + public boolean hasUserAttributeData() { + if (raw[15] <= 0) { return false; } short index = (short) (raw[15] + 16); - if (index == -1) - { + if (index == -1) { return false; } return true; } - public List<UserAttributeData> getUserAttributeData() - { + public int getUserAttributeDataOffset() { + return (raw[15] + 16); + } + + public List<UserAttributeData> getUserAttributeData() { short[] data; short length, nextAttribute; - if (raw[15] <= 0) - { + if (raw[15] <= 0) { return new ArrayList<UserAttributeData>(); } short index = (short) (raw[15] + 16 + attrOffset); - if (index == -1) - { + if (index == -1) { return null; } ArrayList<UserAttributeData> aLinkageSet = new ArrayList<UserAttributeData>(); - while (index < raw.length) - { + while (index < raw.length) { + + + if (raw[index] == 0 || ((short) raw[index]) == 0x8000) + { + index += 4; + aLinkageSet.add(null); + continue; + } + length = (short) (raw[index] & (short) 0x00ff); - if (length == 0) - { + if (length == 0) { break; + } + + if (length > raw.length - index - 1) + { + return null; } nextAttribute = (short) (index + length + 1); data = new short[length]; System.arraycopy(raw, index + 1, data, 0, length); - if (data[0] == (short) 0x0020) - { + if (data[0] == (short) 0x0020) { aLinkageSet.add(new FrammeAttributeData(data)); - } else - { + } else { aLinkageSet.add(new UserAttributeData(data)); } @@ -227,48 +257,39 @@ return aLinkageSet; } - public void getUserAttributeData(byte[] pDataBlock, Class dataClass, int iLinkageId, int iLinkageIndex) - { + public void getUserAttributeData(byte[] pDataBlock, Class dataClass, int iLinkageId, int iLinkageIndex) { } - public void getUserAttributeData(byte[] pDataBlock, int iLinkageId, Object oDataDef) - { + public void getUserAttributeData(byte[] pDataBlock, int iLinkageId, Object oDataDef) { } - public ByteBuffer getRawBuffer() - { + public ByteBuffer getRawBuffer() { return rawBuffer.asReadOnlyBuffer(); } - public short[] getRawArray() - { + public short[] getRawArray() { if (raw == null) return null; short[] result = new short[raw.length]; System.arraycopy(raw, 0, result, 0, raw.length); return result; } - public static class Exception extends java.lang.Exception - { - public Exception() - { + public static class Exception extends java.lang.Exception { + public Exception() { } - // Constructs an Record.Exception with no detail message. - public Exception(String oStrMessage) - { + // Constructs an ElementRecord.Exception with no detail message. + public Exception(String oStrMessage) { super(oStrMessage); } } - protected static int getOffsetPosition(int offset) - { + protected static int getOffsetPosition(int offset) { return offset * 2; } - public void resyncBuffer() - { + public void resyncBuffer() { byte[] tempRaw = new byte[this.raw.length * 2]; ByteBuffer tempBuffer = ByteBuffer.wrap(tempRaw); tempBuffer.order(ByteOrder.LITTLE_ENDIAN); @@ -279,28 +300,22 @@ rawBuffer.position(pos); } - public static class ElementHandler implements IElementHandler - { + public static class ElementHandler implements IElementHandler { ElementType elementType; - public ElementHandler(ElementType elementType) - { + public ElementHandler(ElementType elementType) { this.elementType = elementType; } - public ElementType getElementType() - { + public ElementType getElementType() { return elementType; } - public Object read(ByteBuffer buffer, short signature, int length) - { + public Element read(ByteBuffer buffer, short signature, int length) { byte[] dst = new byte[length]; - try - { + try { buffer.get(dst, 4, dst.length - 4); - } catch (BufferUnderflowException exception) - { + } catch (BufferUnderflowException exception) { throw exception; } @@ -323,24 +338,90 @@ return elm; } - public void write(ByteBuffer buffer, Object element) - { + public void write(ByteBuffer buffer, Object element) { buffer.put(((Element) element).rawBuffer); } - public int getLength(Object element) - { + public int getLength(Object element) { return ((Element) element).raw.length; } - public int getBufferLength(Object element) - { + public int getBufferLength(Object element) { return ((Element) element).rawBuffer.limit(); } - protected Element createElement(byte[] raw) - { + protected Element createElement(byte[] raw) { return new Element(raw); } } + + public static final class FileRecord { + int length; + int number = 0; + int offset; // Relative to the whole file + int start = 0; // Relative to the current loaded buffer + short signature = 0; + + /** + * The minimum X value. + */ + public double minX; + + /** + * The minimum Y value. + */ + public double minY; + + /** + * The minimum Z value. + */ + public double minZ; + + /** + * The maximum X value. + */ + public double maxX; + + /** + * The maximum Y value. + */ + public double maxY; + + /** + * The maximum Z value. + */ + public double maxZ; + + // ElementType type; + int end = 0; // Relative to the whole file + Object element = null; + IElementHandler handler; + ByteBuffer buffer; + + public Object element() { + if (element == null) { + buffer.position(start); + buffer.order(ByteOrder.LITTLE_ENDIAN); + + if (handler == null) { + return null; + } + + element = handler.read(buffer, signature, length); + } + + return element; + } + + public int offset() { + return offset; + } + + /** + * A summary of the record. + */ + public String toString() { + return "FileRecord " + number + " length " + length + " bounds " + minX + "," + minY + " " + maxX + "," + maxY; + } + } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ElementFactory.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ElementFactory.java new file mode 100644 index 0000000..34dda57 --- /dev/null +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ElementFactory.java @@ -0,0 +1,124 @@ +package com.ximple.io.dgn7; + +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.GeometryFactory; +import com.vividsolutions.jts.geom.LineString; +import com.vividsolutions.jts.geom.LinearRing; + +import java.util.Arrays; +import java.util.LinkedList; + +public class ElementFactory { + static final int DEFAULT_ELMHEAD_LENGTH = 28; + static final int DEFAULT_DISPHEAD_LENGTH = 8; + static final int MINIMAL_ELEMLENGTH = 18 * 2; + + static final int MAXINUM_LINESTRING_PTLEN = 100; + + private static ElementFactory elementFactory = new ElementFactory(); + private static GeometryFactory factory = new GeometryFactory(); + + public static Element createLineString(LineString linestring) { + Coordinate[] pts = linestring.getCoordinates(); + LineStringElement element = elementFactory.createLineStringElement(pts); + element.setRange(linestring.getEnvelopeInternal()); + return element; + } + + public static Element createShape(LinearRing ring) { + Coordinate[] pts = ring.getCoordinates(); + int elmsize = MINIMAL_ELEMLENGTH + 2 + pts.length * 8; + ShapeElement element = new ShapeElement(new byte[elmsize]); + for (int i = 0; i < pts.length; i++) { + element.setX(i, pts[i].x); + element.setY(i, pts[i].y); + } + element.setVerticeSize(pts.length); + element.setType(ElementType.SHAPE.id); + element.setFollowLength((short) ((elmsize / 2) - 2)); + element.setRange(ring.getEnvelopeInternal()); + element.setLevelIndex(0); + element.setColorIndex(0); + element.setWeight(0); + element.setLineStyle(0); + return element; + } + + private LineStringElement createLineStringElement(Coordinate[] pts) { + int elmsize = MINIMAL_ELEMLENGTH + 2 + pts.length * 8; + LineStringElement element = new LineStringElement(new byte[elmsize]); + for (int i = 0; i < pts.length; i++) { + element.setX(i, pts[i].x); + element.setY(i, pts[i].y); + } + element.setVerticeSize(pts.length); + element.setType(ElementType.LINESTRING.id); + element.setFollowLength((short) ((elmsize / 2) - 2)); + element.setLevelIndex(0); + element.setColorIndex(0); + element.setWeight(0); + element.setLineStyle(0); + return element; + } + + private ShapeElement createShapeElement(Coordinate[] pts) { + int elmsize = MINIMAL_ELEMLENGTH + 2 + pts.length * 8; + ShapeElement element = new ShapeElement(new byte[elmsize]); + for (int i = 0; i < pts.length; i++) { + element.setX(i, pts[i].x); + element.setY(i, pts[i].y); + } + element.setVerticeSize(pts.length); + element.setType(ElementType.SHAPE.id); + element.setFollowLength((short) ((elmsize / 2) - 2)); + element.setLevelIndex(0); + element.setColorIndex(0); + element.setWeight(0); + element.setLineStyle(0); + return element; + } + + public static Element createComplexChain(LineString linestring) { + LinkedList<LineStringElement> elms = new LinkedList<LineStringElement>(); + Coordinate[] allpts = linestring.getCoordinates(); + int segsize = allpts.length / MAXINUM_LINESTRING_PTLEN; + int currentpos = 0; + int totalLength = 0; + for (int seg = 0; seg < segsize; seg++) { + Coordinate[] pts = Arrays.copyOfRange(allpts, + currentpos, currentpos + MAXINUM_LINESTRING_PTLEN + 1, Coordinate[].class); + LineStringElement element = elementFactory.createLineStringElement(pts); + currentpos += MAXINUM_LINESTRING_PTLEN; + element.setRange(element.toGeometry(factory).getEnvelopeInternal()); + element.setComponentElement(true); + element.setLevelIndex(0); + totalLength += element.raw.length; + elms.add(element); + } + int remain = allpts.length % MAXINUM_LINESTRING_PTLEN; + Coordinate[] pts = Arrays.copyOfRange(allpts, + currentpos, currentpos + remain, Coordinate[].class); + LineStringElement element = elementFactory.createLineStringElement(pts); + element.setRange(element.toGeometry(factory).getEnvelopeInternal()); + element.setComponentElement(true); + element.setLevelIndex(0); + elms.add(element); + totalLength += element.raw.length; + + ComplexChainElement result = new ComplexChainElement(new byte[MINIMAL_ELEMLENGTH + 12]); + result.addAll(elms); + result.setRange(linestring.getEnvelopeInternal()); + result.setType(ElementType.COMPLEXCHAIN.id); + result.setFollowLength((short) (((MINIMAL_ELEMLENGTH + 12) / 2) - 2)); + result.setNumOfElement((short) elms.size()); + totalLength += result.raw.length; + totalLength -= 19; + result.setTotalLength((short) totalLength); + result.setLevelIndex(0); + result.setColorIndex(0); + result.setWeight(0); + result.setLineStyle(0); + + return result; + } +} diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ElementType.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ElementType.java index 8541156..1a5166f 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ElementType.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ElementType.java @@ -30,14 +30,14 @@ | 23 Circular Truncated Cone | | 24 B-Spline Surface (complex) | | 25 B-Spline Surface boundary | -| 26 B-Spline Knot Record | +| 26 B-Spline Knot ElementRecord | | 27 B-Spline Curve (complex) | | 28 B-Spline Weight Factor | -| 33 Dimension Record | -| 34 Shared Cell Definition Record | -| 35 Shared Cell Record | -| 36 Multiline Record | -| 37 Attribute Record | +| 33 Dimension ElementRecord | +| 34 Shared Cell Definition ElementRecord | +| 35 Shared Cell ElementRecord | +| 36 Multiline ElementRecord | +| 37 Attribute ElementRecord | | 38 DgnStore Component | | 39 DgnStore Header | | 66 MicroStation Application | @@ -45,22 +45,22 @@ | 88 Raster Component | | 90 Raster Reference Attachment | | 91 Raster Reference Component | -| 92 Raster Hierarchy Record | +| 92 Raster Hierarchy ElementRecord | | 93 Raster Hierarchy Component | -| 94 Raster Frame Record | -| 95 Table Entry Record | -| 96 Table Header Record | -| 97 View Group Record | -| 98 View Record | -| 99 Level Mask Record | -| 100 Reference Attach Record | +| 94 Raster Frame ElementRecord | +| 95 Table Entry ElementRecord | +| 96 Table Header ElementRecord | +| 97 View Group ElementRecord | +| 98 View ElementRecord | +| 99 Level Mask ElementRecord | +| 100 Reference Attach ElementRecord | | 101 Matrix Header | | 102 Matrix Int Data | | 103 Matrix Double Data | | 105 Mesh Header | -| 106 Extended Record (graphic) (complex) | -| 107 Extended Record (non-graphic) (complex) | -| 108 Reference Override Record | +| 106 Extended ElementRecord (graphic) (complex) | +| 107 Extended ElementRecord (non-graphic) (complex) | +| 108 Reference Override ElementRecord | | 110 Named Group Header | | 111 Named Group Component | | | @@ -71,10 +71,9 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/17 �U�� 01:26:49 + * @since 2006/5/17 �U�� 01:26:49 */ -public final class ElementType -{ +public final class ElementType { /** * Represents a Null shape (id = 0). */ @@ -172,8 +171,7 @@ * @param id The id. * @param name The name. */ - protected ElementType(int id, String name) - { + protected ElementType(int id, String name) { this.id = id; this.name = name; } @@ -183,8 +181,7 @@ * * @return The name. */ - public String toString() - { + public String toString() { return name; } @@ -194,64 +191,52 @@ * * @return true if multipoint, false otherwise. */ - public boolean isMultiPoint() - { + public boolean isMultiPoint() { boolean mp = true; - if (this == UNDEFINED) - { + if (this == UNDEFINED) { mp = false; - } else if (this == NULL) - { + } else if (this == NULL) { mp = false; - } else if (this == IGDSDIGITIZER) - { + } else if (this == IGDSDIGITIZER) { mp = false; - } else if (this == TCB) - { + } else if (this == TCB) { mp = false; - } else if (this == LEVELSYMBOLOGY) - { + } else if (this == LEVELSYMBOLOGY) { mp = false; } return mp; } - public boolean isComplexElement() - { + public boolean isComplexElement() { return id == 2 || id == 7 || id == 12 || id == 14 || id == 18 || - id == 19 || id == 106 || id == 107; + id == 19 || id == 106 || id == 107; } - public boolean isPointType() - { + public boolean isPointType() { return id == 7 || id == 17; } - public boolean isLineType() - { + public boolean isLineType() { return id == 3 || id == 4 || id == 11 || id == 12 || id == 16; } - public boolean isPolygonType() - { + public boolean isPolygonType() { return id == 6 || id == 14; } - public boolean isMultiPointType() - { + public boolean isMultiPointType() { return id == 3 || id == 4 || id == 6 || id == 11 || id == 12 || - id == 13 || id == 14 || id == 15 || id == 16 || id == 22; + id == 13 || id == 14 || id == 15 || id == 16 || id == 22; } - public boolean isArcType() - { + public boolean isArcType() { return id == 15 || (id == 16); } @@ -261,12 +246,10 @@ * @param id The id to search for. * @return The ElementType for the id. */ - public static ElementType forID(int id) - { + public static ElementType forID(int id) { ElementType t; - switch (id) - { + switch (id) { case 0: t = NULL; break; @@ -330,12 +313,10 @@ return t; } - public IElementHandler getElementHandler() throws Dgn7fileException - { + public IElementHandler getElementHandler() throws Dgn7fileException { IElementHandler handler; - switch (id) - { + switch (id) { case 3: handler = LineElement.ElementHandler.getInstance(); break; diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/EllipseElement.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/EllipseElement.java index 044d57a..fbe715c 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/EllipseElement.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/EllipseElement.java @@ -11,35 +11,28 @@ import com.ximple.util.DgnUtility; -public class EllipseElement extends Element implements GeometryConverter -{ +public class EllipseElement extends Element implements GeometryConverter { private static final Logger logger = Logger.getLogger(EllipseElement.class); - public EllipseElement(byte[] raw) - { + EllipseElement(byte[] raw) { super(raw); } - public double getStartAngle() - { + public double getStartAngle() { return 0.0; } - public void setStartAngle(double value) - { + public void setStartAngle(double value) { } - public double getSweepAngle() - { + public double getSweepAngle() { return 360.0; } - public void setSweepAngle(double value) - { + public void setSweepAngle(double value) { } - public double getPrimary() - { + public double getPrimary() { rawBuffer.position(18 * 2); ByteOrder bo = rawBuffer.order(); rawBuffer.order(ByteOrder.BIG_ENDIAN); @@ -49,16 +42,14 @@ return DgnUtility.convertDGNToIEEEDouble(primary) / 1000.0; } - public void setPrimary(double value) - { + public void setPrimary(double value) { double temp = value * 1000.0; short[] primary = DgnUtility.convertIEEEDoubleToDGN(temp); System.arraycopy(primary, 0, raw, 18, 4); } - public double getSecondary() - { + public double getSecondary() { rawBuffer.position(22 * 2); ByteOrder bo = rawBuffer.order(); rawBuffer.order(ByteOrder.BIG_ENDIAN); @@ -68,32 +59,28 @@ return DgnUtility.convertDGNToIEEEDouble(secondary) / 1000.0; } - public void setSecondary(double value) - { + public void setSecondary(double value) { double temp = value * 1000.0; short[] secondary = DgnUtility.convertIEEEDoubleToDGN(temp); System.arraycopy(secondary, 0, raw, 22, 4); } - public double getRotationAngle() - { + public double getRotationAngle() { int rotation = (raw[26] << 16 & 0xffff0000); rotation |= raw[27] & 0x0000ffff; return DgnUtility.converIntToRotation(rotation); } - public void setRotationAngle(double value) - { + public void setRotationAngle(double value) { int angle = DgnUtility.converRotatioToInt(value); raw[26] = (short) (angle >> 16 & 0x0000ffff); raw[27] = (short) (angle & 0x0000ffff); } - public Coordinate getOrigin() - { + public Coordinate getOrigin() { rawBuffer.position(28 * 2); ByteOrder bo = rawBuffer.order(); rawBuffer.order(ByteOrder.BIG_ENDIAN); @@ -110,8 +97,7 @@ return new Coordinate(dx, dy); } - public void setOrigin(Coordinate value) - { + public void setOrigin(Coordinate value) { double temp = DgnUtility.converCoordToUnit(value.x); short[] x = DgnUtility.convertIEEEDoubleToDGN(temp); @@ -123,16 +109,14 @@ System.arraycopy(y, 0, raw, 32, 4); } - public Geometry toGeometry(GeometryFactory factory) - { + public Geometry toGeometry(GeometryFactory factory) { double temp = Math.abs(getStartAngle() - getSweepAngle()); temp /= 4; int pts = (temp < 3) ? 3 : (int) temp; - return factory.createPolygon(factory.createLinearRing(convertToLineString(pts)), null); + return factory.createPolygon(factory.createLinearRing(convertToPolygon(pts)), null); } - private Coordinate[] convertToLineString(int pts) - { + private Coordinate[] convertToPolygon(int pts) { ArrayList<Coordinate> result = new ArrayList<Coordinate>(); double beta = DgnUtility.converRotationToRadian(-getRotationAngle()); double startAngle = getStartAngle(); @@ -140,28 +124,16 @@ double endAngle = startAngle + sweepAngle; double steps = sweepAngle / pts; double current; - if (sweepAngle < 0) - { - for (current = startAngle; current > endAngle; current += steps) - { - Coordinate pt = computePointOnArcByAngle(beta, current); - result.add(pt); - } - - } else - { - for (current = startAngle; current < endAngle; current += steps) - { - Coordinate pt = computePointOnArcByAngle(beta, current); - result.add(pt); - } + //sweepAngle always 360 degree + for (current = startAngle; current < endAngle; current += steps) { + Coordinate pt = computePointOnEllipseByAngle(beta, current); + result.add(pt); } - Coordinate pt = computePointOnArcByAngle(beta, endAngle); + Coordinate pt = computePointOnEllipseByAngle(beta, endAngle); result.add(pt); - if (!result.get(0).equals(result.get(result.size() - 1))) - { + if (!result.get(0).equals(result.get(result.size() - 1))) { result.add(result.get(0)); } @@ -169,8 +141,7 @@ } - private Coordinate computePointOnArcByAngle(double beta, double current) - { + private Coordinate computePointOnEllipseByAngle(double beta, double current) { double sinbeta = Math.sin(beta); double cosbeta = Math.cos(beta); Coordinate pt = new Coordinate(); @@ -178,33 +149,28 @@ double sinalpha = Math.sin(alpha); double cosalpha = Math.cos(alpha); pt.x = getOrigin().x + (getPrimary() * cosalpha * cosbeta - - getSecondary() * sinalpha * sinbeta); + getSecondary() * sinalpha * sinbeta); pt.y = getOrigin().y + (getPrimary() * cosalpha * sinbeta + - getSecondary() * sinalpha * cosbeta); + getSecondary() * sinalpha * cosbeta); return pt; } - public static class ElementHandler extends Element.ElementHandler - { + public static class ElementHandler extends Element.ElementHandler { private static ElementHandler instance = null; - public ElementHandler() - { + public ElementHandler() { super(ElementType.ELLIPSE); } - public static IElementHandler getInstance() - { - if (instance == null) - { + public static IElementHandler getInstance() { + if (instance == null) { instance = new ElementHandler(); } return instance; } - protected Element createElement(byte[] raw) - { + protected Element createElement(byte[] raw) { return new EllipseElement(raw); } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/FrammeAttributeData.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/FrammeAttributeData.java index 2a9840e..b7ea2bb 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/FrammeAttributeData.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/FrammeAttributeData.java @@ -5,29 +5,24 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �U�� 06:36:55 + * @since 2006/5/18 */ -public class FrammeAttributeData extends UserAttributeData -{ - public FrammeAttributeData(short id) - { +public class FrammeAttributeData extends UserAttributeData { + public FrammeAttributeData(short id) { super(id, 7); } - public FrammeAttributeData(short[] src) - { + public FrammeAttributeData(short[] src) { super(src); } - public short getFsc() - { + public short getFsc() { int fsc = _src[3] & 0x0000ffff; return (short) fsc; } - public int getUfid() - { + public int getUfid() { int ufid = (int) (_src[2] << 16 & 0xffff0000); ufid += _src[1] & 0x0000ffff; @@ -35,37 +30,32 @@ return ufid; } - public byte getComponentID() - { + public byte getComponentID() { int cmpid = (int) (_src[5] & 0x000000ff); return (byte) cmpid; } - public byte getRuleNo() - { + public byte getRuleNo() { int no = (int) ((_src[5] >> 8) & 0x000000ff); return (byte) no; } - public short getStatus() - { + public short getStatus() { int status = (int) (_src[4] & 0x0000ffff); return (short) status; } - public short getOccID() - { + public short getOccID() { int occid = (int) (_src[6] & 0x0000ffff); return (short) occid; } - public String toString() - { + public String toString() { return "FrammeData{" + getFsc() + "," + getUfid() + "," + getComponentID() + "," + getRuleNo() + "," + getStatus() + "," - + getOccID() + "}"; + + getOccID() + "}"; } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/GeometryConverter.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/GeometryConverter.java index 2ac6fdc..5f82888 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/GeometryConverter.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/GeometryConverter.java @@ -10,9 +10,8 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �W�� 11:38:57 + * @since 2006/5/18 */ -public interface GeometryConverter -{ +public interface GeometryConverter { public Geometry toGeometry(GeometryFactory factory); } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/IElementHandler.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/IElementHandler.java index 37af5e9..e7e3b2d 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/IElementHandler.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/IElementHandler.java @@ -9,13 +9,12 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/17 �U�� 01:50:26 + * @since 2006/5/17 �U�� 01:50:26 */ -public interface IElementHandler -{ +public interface IElementHandler { public ElementType getElementType(); - public Object read(ByteBuffer buffer, short signature, int length); + public Element read(ByteBuffer buffer, short signature, int length); public void write(ByteBuffer buffer, Object element); diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/LineElement.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/LineElement.java index 2996936..09694ab 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/LineElement.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/LineElement.java @@ -15,24 +15,20 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �W�� 11:34:59 + * @since 2006/5/18 �W�� 11:34:59 */ -public class LineElement extends Element implements GeometryConverter -{ +public class LineElement extends Element implements GeometryConverter { private static final Logger logger = Logger.getLogger(LineElement.class); - public LineElement(byte[] raw) - { + LineElement(byte[] raw) { super(raw); } - public Coordinate getCentroid(double dTolerance) - { + public Coordinate getCentroid(double dTolerance) { return null; } - public Coordinate getEndPoint() - { + public Coordinate getEndPoint() { int endX = ((raw[22] << 16) & 0xffff0000) | (raw[23] & 0x0000ffff); int endY = ((raw[24] << 16) & 0xffff0000) | (raw[25] & 0x0000ffff); @@ -43,18 +39,15 @@ return new Coordinate(x, y); } - public Coordinate getNormal() - { + public Coordinate getNormal() { return null; } - public Coordinate getOrigin() - { + public Coordinate getOrigin() { return null; } - public Coordinate getStartPoint() - { + public Coordinate getStartPoint() { int startX = ((raw[18] << 16) & 0xffff0000); startX = startX + (raw[19] & 0x0000ffff); @@ -68,28 +61,24 @@ return new Coordinate(x, y); } - public Coordinate getVertex(int index) - { + public Coordinate getVertex(int index) { return (index == 0) - ? getStartPoint() - : getEndPoint(); + ? getStartPoint() + : getEndPoint(); } - public double getLength() - { + public double getLength() { Coordinate p1 = getStartPoint(); Coordinate p2 = getEndPoint(); return DgnUtility.getLength(p1.x, p1.y, p2.x, p2.y); } - public Coordinate pointAtDistance(double dDistance, double dTolerance) - { + public Coordinate pointAtDistance(double dDistance, double dTolerance) { return null; } - public Coordinate[] getVertices() - { + public Coordinate[] getVertices() { Coordinate[] result = new Coordinate[2]; result[0] = getStartPoint(); @@ -98,32 +87,26 @@ return result; } - public Geometry toGeometry(GeometryFactory factory) - { + public Geometry toGeometry(GeometryFactory factory) { return factory.createLineString(getVertices()); } - public static class ElementHandler extends Element.ElementHandler - { + public static class ElementHandler extends Element.ElementHandler { private static ElementHandler instance = null; - public ElementHandler() - { + public ElementHandler() { super(ElementType.LINE); } - public static IElementHandler getInstance() - { - if (instance == null) - { + public static IElementHandler getInstance() { + if (instance == null) { instance = new ElementHandler(); } return instance; } - protected Element createElement(byte[] raw) - { + protected Element createElement(byte[] raw) { return new LineElement(raw); } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/LineStringElement.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/LineStringElement.java index ce09145..7e82921 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/LineStringElement.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/LineStringElement.java @@ -15,61 +15,54 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �U�� 02:48:58 + * @since 2006/5/18 */ -public class LineStringElement extends Element implements GeometryConverter -{ +public class LineStringElement extends Element implements GeometryConverter { private static final Logger logger = Logger.getLogger(LineStringElement.class); - public LineStringElement(byte[] raw) - { + LineStringElement(byte[] raw) { super(raw); } - public Coordinate getCentroid(double dTolerance) - { + public Coordinate getCentroid(double dTolerance) { return null; } - public Coordinate getEndPoint() - { + public Coordinate getEndPoint() { return new Coordinate(getX(getVerticeSize() - 1), getY(getVerticeSize() - 1)); } - public Coordinate getNormal() - { + public Coordinate getNormal() { return null; } - public Coordinate getOrigin() - { + public Coordinate getOrigin() { return null; } - public Coordinate getStartPoint() - { + public Coordinate getStartPoint() { return new Coordinate(getX(0), getY(0)); } - public Coordinate getVertex(int index) - { + public Coordinate getVertex(int index) { return (index == 0) - ? getStartPoint() - : getEndPoint(); + ? getStartPoint() + : getEndPoint(); } - public int getVerticeSize() - { + public int getVerticeSize() { return raw[18] & 0x0000ffff; } - public double getLength() - { + public void setVerticeSize(int size) { + raw[18] = (short) (size & 0x0000ffff); + } + + public double getLength() { double result = 0.0; Coordinate[] vset = getVertices(); - for (int i = 1; i < getVerticeSize(); i++) - { + for (int i = 1; i < getVerticeSize(); i++) { Coordinate p1 = vset[i - 1]; Coordinate p2 = vset[i]; @@ -79,32 +72,26 @@ return result; } - public Coordinate pointAtDistance(double dDistance, double dTolerance) - { + public Coordinate pointAtDistance(double dDistance, double dTolerance) { return null; } - public Coordinate[] getVertices() - { + public Coordinate[] getVertices() { Coordinate[] result = new Coordinate[getVerticeSize()]; - for (int i = 0; i < getVerticeSize(); i++) - { + for (int i = 0; i < getVerticeSize(); i++) { result[i] = new Coordinate(getX(i), getY(i)); } return result; } - public Geometry toGeometry(GeometryFactory factory) - { + public Geometry toGeometry(GeometryFactory factory) { return factory.createLineString(getVertices()); } - protected double getX(int index) - { - if ((index < 0) || (index > getVerticeSize())) - { + protected double getX(int index) { + if ((index < 0) || (index > getVerticeSize())) { return -1; } @@ -115,18 +102,15 @@ return DgnUtility.converUnitToCoord(x); } - protected void setX(int index, double dx) - { + protected void setX(int index, double dx) { int newVal = DgnUtility.converCoordToUnit(dx); raw[19 + (4 * index)] = (short) (newVal >> 16 & 0x0000ffff); raw[20 + (4 * index)] = (short) (newVal & 0x0000ffff); } - protected double getY(int index) - { - if ((index < 0) || (index > getVerticeSize())) - { + protected double getY(int index) { + if ((index < 0) || (index > getVerticeSize())) { return -1; } @@ -136,35 +120,29 @@ return DgnUtility.converUnitToCoord(y); } - protected void setY(int index, double dy) - { + protected void setY(int index, double dy) { int newVal = DgnUtility.converCoordToUnit(dy); raw[21 + (4 * index)] = (short) ((newVal >> 16) & 0x0000ffff); raw[22 + (4 * index)] = (short) (newVal & 0x0000ffff); } - public static class ElementHandler extends Element.ElementHandler - { + public static class ElementHandler extends Element.ElementHandler { private static ElementHandler instance = null; - public ElementHandler() - { + public ElementHandler() { super(ElementType.LINESTRING); } - public static IElementHandler getInstance() - { - if (instance == null) - { + public static IElementHandler getInstance() { + if (instance == null) { instance = new ElementHandler(); } return instance; } - protected Element createElement(byte[] raw) - { + protected Element createElement(byte[] raw) { return new LineStringElement(raw); } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Lock.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Lock.java index 58f9f73..2bd43f6 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Lock.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/Lock.java @@ -14,10 +14,9 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �W�� 10:27:24 + * @since 2006/5/18 */ -public class Lock -{ +public class Lock { Logger logger = LogManager.getLogger("com.ximple.io.dgn7"); /** @@ -42,20 +41,16 @@ * @return * @throws java.io.IOException */ - synchronized boolean canRead() throws IOException - { - if ((writer != null) && (writer != Thread.currentThread())) - { + synchronized boolean canRead() throws IOException { + if ((writer != null) && (writer != Thread.currentThread())) { return false; } - if (writer == null) - { + if (writer == null) { return true; } - if (owners.size() > 1) - { + if (owners.size() > 1) { return false; } @@ -69,22 +64,17 @@ * @return * @throws IOException */ - synchronized boolean canWrite() throws IOException - { - if (owners.size() > 1) - { + synchronized boolean canWrite() throws IOException { + if (owners.size() > 1) { return false; } - if ((canRead()) && ((writer == Thread.currentThread()) || (writer == null))) - { - if (owners.isEmpty()) - { + if ((canRead()) && ((writer == Thread.currentThread()) || (writer == null))) { + if (owners.isEmpty()) { return true; } - if (owners.containsKey(Thread.currentThread())) - { + if (owners.containsKey(Thread.currentThread())) { return true; } } @@ -98,17 +88,12 @@ * * @throws IOException */ - public synchronized void lockRead() throws IOException - { - if (!canRead()) - { - while ((writeLocks > 0) || (writer != null)) - { - try - { + public synchronized void lockRead() throws IOException { + if (!canRead()) { + while ((writeLocks > 0) || (writer != null)) { + try { wait(); - } catch (InterruptedException e) - { + } catch (InterruptedException e) { throw (IOException) new IOException().initCause(e); } } @@ -119,11 +104,9 @@ Thread current = Thread.currentThread(); Owner owner = (Owner) owners.get(current); - if (owner != null) - { + if (owner != null) { owner.timesLocked++; - } else - { + } else { owner = new Owner(current); owners.put(current, owner); } @@ -131,10 +114,8 @@ logger.debug("Start Read Lock:" + owner); } - private void assertTrue(String message, boolean b) - { - if (!b) - { + private void assertTrue(String message, boolean b) { + if (!b) { throw new AssertionError(message); } } @@ -143,8 +124,7 @@ * Called by ShapefileReader after a read is complete and after the IOStream * is closed. */ - public synchronized void unlockRead() - { + public synchronized void unlockRead() { assertTrue("Current thread does not have a readLock", owners.containsKey(Thread.currentThread())); Owner owner = (Owner) owners.get(Thread.currentThread()); @@ -152,8 +132,7 @@ assertTrue("Current thread has " + owner.timesLocked + "negative number of locks", owner.timesLocked > 0); owner.timesLocked--; - if (owner.timesLocked == 0) - { + if (owner.timesLocked == 0) { owners.remove(Thread.currentThread()); } @@ -167,33 +146,26 @@ * * @throws IOException */ - public synchronized void lockWrite() throws IOException - { + public synchronized void lockWrite() throws IOException { Thread currentThread = Thread.currentThread(); - if (writer == null) - { + if (writer == null) { writer = currentThread; } - while (!canWrite()) - { - try - { + while (!canWrite()) { + try { wait(); - } catch (InterruptedException e) - { + } catch (InterruptedException e) { throw (IOException) new IOException().initCause(e); } - if (writer == null) - { + if (writer == null) { writer = currentThread; } } - if (writer == null) - { + if (writer == null) { writer = currentThread; } @@ -206,28 +178,23 @@ /** * default visibility for tests */ - synchronized int getReadLocks(Thread thread) - { + synchronized int getReadLocks(Thread thread) { Owner owner = (Owner) owners.get(thread); - if (owner == null) - { + if (owner == null) { return -1; } return owner.timesLocked; } - public synchronized void unlockWrite() - { - if (writeLocks > 0) - { + public synchronized void unlockWrite() { + if (writeLocks > 0) { assertTrue("current thread does not own the write lock", writer == Thread.currentThread()); assertTrue("writeLock has already been unlocked", writeLocks > 0); writeLocks--; - if (writeLocks == 0) - { + if (writeLocks == 0) { writer = null; } } @@ -239,24 +206,20 @@ /** * default visibility for tests */ - synchronized boolean ownWriteLock(Thread thread) - { + synchronized boolean ownWriteLock(Thread thread) { return (writer == thread) && (writeLocks > 0); } - private class Owner - { + private class Owner { final Thread owner; int timesLocked; - Owner(Thread owner) - { + Owner(Thread owner) { this.owner = owner; timesLocked = 1; } - public String toString() - { + public String toString() { return owner.getName() + " has " + timesLocked + " locks"; } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/NIOUtilities.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/NIOUtilities.java index 84c14af..1596ef6 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/NIOUtilities.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/NIOUtilities.java @@ -34,8 +34,7 @@ * @source $URL$ * @since 2.0 */ -public class NIOUtilities -{ +public class NIOUtilities { /** * {@code true} if a warning has already been logged. */ @@ -47,8 +46,7 @@ * @todo This constructor will become private when {@code NIOBufferUtils} * will have been removed. */ - protected NIOUtilities() - { + protected NIOUtilities() { } /** @@ -61,30 +59,23 @@ * @return true if the operation was successful, false otherwise. * @see java.nio.MappedByteBuffer */ - public static boolean clean(final ByteBuffer buffer) - { - if (buffer == null || !buffer.isDirect()) - { + public static boolean clean(final ByteBuffer buffer) { + if (buffer == null || !buffer.isDirect()) { return false; } - Boolean b = (Boolean) AccessController.doPrivileged(new PrivilegedAction() - { - public Object run() - { + Boolean b = (Boolean) AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { Boolean success = Boolean.FALSE; - try - { + try { Method getCleanerMethod = buffer.getClass().getMethod("cleaner", (Class[]) null); getCleanerMethod.setAccessible(true); Object cleaner = getCleanerMethod.invoke(buffer, (Object[]) null); Method clean = cleaner.getClass().getMethod("clean", (Class[]) null); clean.invoke(cleaner, (Object[]) null); success = Boolean.TRUE; - } catch (Exception e) - { + } catch (Exception e) { // This really is a show stopper on windows - if (isLoggable()) - { + if (isLoggable()) { log(e, buffer); } } @@ -98,15 +89,12 @@ /** * Check if a warning message should be logged. */ - private static synchronized boolean isLoggable() - { - try - { + private static synchronized boolean isLoggable() { + try { return !warned && ( - System.getProperty("org.geotools.io.debugBuffer", "false").equalsIgnoreCase("true") || - System.getProperty("os.name").indexOf("Windows") >= 0); - } catch (SecurityException exception) - { + System.getProperty("org.geotools.io.debugBuffer", "false").equalsIgnoreCase("true") || + System.getProperty("os.name").indexOf("Windows") >= 0); + } catch (SecurityException exception) { // The utilities may be running in an Applet, in which case we // can't read properties. Assumes we are not in debugging mode. return false; @@ -116,12 +104,11 @@ /** * Log a warning message. */ - private static synchronized void log(final Exception e, final ByteBuffer buffer) - { + private static synchronized void log(final Exception e, final ByteBuffer buffer) { warned = true; String message = "Error attempting to close a mapped byte buffer : " + buffer.getClass().getName() - + "\n JVM : " + System.getProperty("java.version") - + ' ' + System.getProperty("java.vendor"); + + "\n JVM : " + System.getProperty("java.version") + + ' ' + System.getProperty("java.vendor"); Logger.getLogger("org.geotools.io").log(Level.SEVERE, message, e); } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ShapeElement.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ShapeElement.java index c43458e..6fd7d89 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ShapeElement.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/ShapeElement.java @@ -2,41 +2,34 @@ 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; -import com.vividsolutions.jts.geom.Coordinate; /** * ShapeElement * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �U�� 03:08:43 + * @since 2006/5/18 �U�� 03:08:43 */ -public class ShapeElement extends LineStringElement implements GeometryConverter -{ +public class ShapeElement extends LineStringElement implements GeometryConverter { private static final Logger logger = Logger.getLogger(ShapeElement.class); - public ShapeElement(byte[] raw) - { + ShapeElement(byte[] raw) { super(raw); } - public Coordinate[] getVertices() - { + public Coordinate[] getVertices() { Coordinate[] result = super.getVertices(); - if ((result != null) && (result.length > 2)) - { + if ((result != null) && (result.length > 2)) { boolean isClosed = result[0].equals2D(result[result.length - 1]); - if (!isClosed) - { + if (!isClosed) { double distance = result[0].distance(result[result.length - 1]); - if (distance < 0.00210) - { + if (distance < 0.00210) { result[result.length - 1] = new Coordinate(result[0]); - } else - { + } else { logger.info("Shape is not closed. distance=" + distance); logger.debug("result[0]=" + result[0].toString()); logger.debug("result[length - 1]=" + result[result.length - 1]); @@ -47,40 +40,32 @@ return result; } - public Geometry toGeometry(GeometryFactory factory) - { - try - { + public Geometry toGeometry(GeometryFactory factory) { + try { LinearRing ring = factory.createLinearRing(this.getVertices()); return factory.createPolygon(ring, null); - } catch (IllegalArgumentException e) - { + } catch (IllegalArgumentException e) { logger.warn(e.getMessage(), e); return null; } } - public static class ElementHandler extends Element.ElementHandler - { + public static class ElementHandler extends Element.ElementHandler { private static ElementHandler instance = null; - public ElementHandler() - { + public ElementHandler() { super(ElementType.SHAPE); } - public static IElementHandler getInstance() - { - if (instance == null) - { + public static IElementHandler getInstance() { + if (instance == null) { instance = new ElementHandler(); } return instance; } - protected Element createElement(byte[] raw) - { + protected Element createElement(byte[] raw) { return new ShapeElement(raw); } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/StreamLogging.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/StreamLogging.java index 8000b5c..04d0673 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/StreamLogging.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/StreamLogging.java @@ -10,10 +10,9 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �W�� 10:31:08 + * @since 2006/5/18 */ -public class StreamLogging -{ +public class StreamLogging { private static final Logger LOGGER = LogManager.getLogger("com.ximple.io.dgn7"); private String name; private int open = 0; @@ -23,22 +22,19 @@ * * @param name */ - public StreamLogging(String name) - { + public StreamLogging(String name) { this.name = name; } /** * Call when reader or writer is opened */ - public synchronized void open() - { + public synchronized void open() { open++; LOGGER.debug(name + " has been opened. Number open: " + open); } - public synchronized void close() - { + public synchronized void close() { open--; LOGGER.debug(name + " has been closed. Number open: " + open); } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TagElement.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TagElement.java index 13a3f3a..3f2dd6b 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TagElement.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TagElement.java @@ -5,41 +5,33 @@ import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; -public class TagElement extends Element implements GeometryConverter -{ +public class TagElement extends Element implements GeometryConverter { private static final Logger logger = Logger.getLogger(TagElement.class); - public TagElement(byte[] raw) - { + TagElement(byte[] raw) { super(raw); } - public Geometry toGeometry(GeometryFactory factory) - { + public Geometry toGeometry(GeometryFactory factory) { return null; } - public static class ElementHandler extends Element.ElementHandler - { + public static class ElementHandler extends Element.ElementHandler { private static ElementHandler instance = null; - public ElementHandler() - { + public ElementHandler() { super(ElementType.TAG); } - public static IElementHandler getInstance() - { - if (instance == null) - { + public static IElementHandler getInstance() { + if (instance == null) { instance = new ElementHandler(); } return instance; } - protected Element createElement(byte[] raw) - { + protected Element createElement(byte[] raw) { return new TagElement(raw); } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TcbElement.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TcbElement.java index 58519ae..e5bb065 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TcbElement.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TcbElement.java @@ -7,32 +7,26 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �U�� 05:03:46 + * @since 2006/5/18 �U�� 05:03:46 */ -public class TcbElement extends Element -{ +public class TcbElement extends Element { private static final Logger logger = Logger.getLogger(TcbElement.class); - public TcbElement(byte[] raw) - { + TcbElement(byte[] raw) { super(raw); } - public boolean is2D() - { + public boolean is2D() { int dimension = (int) (raw[607] & 0x00000004); - if (dimension == 0) - { + if (dimension == 0) { return true; - } else - { + } else { return false; } } - public String getMasterUnitName() - { + public String getMasterUnitName() { byte[] master = new byte[1]; master[0] = (byte) (raw[560] & 0x00ff); @@ -47,8 +41,7 @@ return sb.toString(); } - public String getSubUnitName() - { + public String getSubUnitName() { byte[] sub = new byte[2]; sub[0] = (byte) (raw[561] & 0x00ff); @@ -62,32 +55,26 @@ return sb.toString(); } - public int getGraphicGroup() - { + public int getGraphicGroup() { return (int) (raw[594] & 0x0000ffff); } - public static class ElementHandler extends Element.ElementHandler - { + public static class ElementHandler extends Element.ElementHandler { private static ElementHandler instance = null; - public ElementHandler() - { + public ElementHandler() { super(ElementType.TCB); } - public static IElementHandler getInstance() - { - if (instance == null) - { + public static IElementHandler getInstance() { + if (instance == null) { instance = new ElementHandler(); } return instance; } - protected Element createElement(byte[] raw) - { + protected Element createElement(byte[] raw) { return new TcbElement(raw); } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TextElement.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TextElement.java index 6cf8570..08afe39 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TextElement.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TextElement.java @@ -1,5 +1,12 @@ package com.ximple.io.dgn7; +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.CoordinateList; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.GeometryFactory; +import com.ximple.util.DgnUtility; +import org.apache.log4j.Logger; + import java.awt.geom.AffineTransform; import java.nio.ByteBuffer; import java.nio.CharBuffer; @@ -7,24 +14,14 @@ import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; -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.CoordinateList; - -import com.ximple.util.DgnUtility; - /** * TextElement * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �W�� 11:45:29 + * @since 2006/5/18 */ -public class TextElement extends Element implements GeometryConverter -{ +public class TextElement extends Element implements GeometryConverter { private static final Logger logger = Logger.getLogger(TextElement.class); public static final int ED_CENTERJUSTIFICATION = 0; @@ -63,13 +60,11 @@ public static final int TXTJUST_RD = 24; /* Right Descender */ public static final int TXTJUST_NONE = 127;/* no justfication */ - public TextElement(byte[] raw) - { + TextElement(byte[] raw) { super(raw); } - public Coordinate getOrigin() - { + public Coordinate getOrigin() { int x = (raw[25] << 16 & 0xffff0000); x += raw[26] & 0x0000ffff; @@ -84,38 +79,31 @@ return new Coordinate(dx, dy); } - public int getFontIndex() - { + public int getFontIndex() { return (int) raw[18] & 0x00000000ff; } - public boolean hasSlant() - { + public boolean hasSlant() { return true; } - public boolean hasUnderline() - { + public boolean hasUnderline() { return true; } - public boolean isFixedWidthSpacing() - { + public boolean isFixedWidthSpacing() { return true; } - public boolean isPlanar() - { + public boolean isPlanar() { return true; } - public boolean isVertical() - { + public boolean isVertical() { return true; } - public double getTextHeight() - { + public double getTextHeight() { int height = ((raw[21] << 16) & 0xffff0000); height += raw[22] & 0x0000ffff; @@ -123,8 +111,7 @@ return DgnUtility.converIntToDouble(height); } - public double getTextWidth() - { + public double getTextWidth() { int length = (raw[19] << 16 & 0xffff0000); length += raw[20] & 0x0000ffff; @@ -132,63 +119,61 @@ return DgnUtility.converIntToDouble(length); } - public int getJustification() - { + public int getJustification() { return ((raw[18] >>> 8) & 0x00000000ff); } - public double getRotationAngle() - { + public double getRotationAngle() { int totation = ((raw[23] & 0x0000ffff) << 16) | (raw[24] & 0x0000ffff); return DgnUtility.converIntToRotation(totation); } - public boolean isChinese() - { + public boolean isChinese() { + if (raw.length < 31) return false; int isChinese = raw[30] & 0x0000ffff; return (isChinese == 0xfdff); } - public int getTextLength() - { + public int getTextLength() { int num = raw[29]; - if (isChinese()) - { + if (isChinese()) { num = (num / 2) - 1; } return num; } - public String getText() - { + public String getText() { StringBuilder val = new StringBuilder(); char[] temp; int num = getTextLength(); + if (num < 0) { + logger.warn("getTextLength() return Negative Value."); + return ""; + } - if (!isChinese()) - { + if (30 + num / 2 > raw.length) { + logger.warn("getTextLength() too long."); + return ""; + } + + if (!isChinese()) { temp = new char[num]; - for (int i = 0; i < temp.length; i++) - { - if ((i % 2) == 0) - { + for (int i = 0; i < temp.length; i++) { + if ((i % 2) == 0) { temp[i] = (char) (raw[30 + (int) (i / 2)] & (short) 0x00ff); - } else - { + } else { temp[i] = (char) ((raw[30 + (int) (i / 2)] >> 8) & (short) 0x00ff); } val.append(temp[i]); } - } else - { + } else { byte[] strRaw = new byte[num * 2]; - for (int i = 0; i < num; i++) - { + for (int i = 0; i < num; i++) { short charValue = raw[i + 31]; byte hi = (byte) (charValue >>> 8); byte lo = (byte) charValue; @@ -196,18 +181,15 @@ strRaw[i * 2 + 1] = lo; } - try - { + try { Charset charsetBig5 = Charset.forName("Big5"); CharsetDecoder decoder = charsetBig5.newDecoder(); CharBuffer cb = decoder.decode(ByteBuffer.wrap(strRaw)); val.append(cb); - } catch (CharacterCodingException e) - { + } catch (CharacterCodingException e) { logger.warn(e.getMessage(), e); return val.toString(); - } finally - { + } finally { // rawBuffer.position(pos); // rawBuffer.order(order); } @@ -216,8 +198,7 @@ return val.toString(); } - protected byte[] convertDBCSToUnicode(byte[] buffer) - { + protected byte[] convertDBCSToUnicode(byte[] buffer) { byte[] charBuffer = new byte[4]; charBuffer[0] = (byte) ((byte) ((buffer[1] & 0xc0) >>> 6) | 0xc0); charBuffer[1] = (byte) (buffer[1] & 0x3f | 0x80); @@ -226,23 +207,19 @@ return charBuffer; } - public Geometry toGeometry(GeometryFactory factory) - { + public Geometry toGeometry(GeometryFactory factory) { return factory.createPoint(getUserOrigin()); } - public Geometry toAnchorGeometry(GeometryFactory factory) - { - if (getText() == null) - { - return factory.createMultiPoint(new Coordinate[] {}); + public Geometry toAnchorGeometry(GeometryFactory factory) { + if (getText() == null) { + return factory.createMultiPoint(new Coordinate[]{}); } return factory.createMultiPoint(toAnchorCoordinates()); } - public Coordinate[] toAnchorCoordinates() - { + public Coordinate[] toAnchorCoordinates() { CoordinateList result = new CoordinateList(); int len = getText().trim().length(); if (len == 0) return result.toCoordinateArray(); @@ -257,8 +234,7 @@ at.setToRotation(angle, p.x, p.y); at.scale(1, 1); - for (int i = 0; i < len; i++) - { + for (int i = 0; i < len; i++) { double[] srcPt = new double[2]; double[] dstPt = new double[2]; @@ -272,16 +248,14 @@ return result.toCoordinateArray(); } - private double getUserWidth() - { + private double getUserWidth() { int just = getJustification(); // Envelope range = getRange(); // case -1 // double width = (range.getWidth()); // case -1 // double width = this.getTextWidth() * this.getTextLength() * 1000.0; // case -2 double width = (this.getTextWidth() * this.getTextLength()); - switch (just) - { + switch (just) { case TXTJUST_LT: case TXTJUST_LC: case TXTJUST_LB: @@ -303,13 +277,11 @@ return width; } - private double getUserHeight() - { + private double getUserHeight() { int just = getJustification(); double height = getTextHeight(); - switch (just) - { + switch (just) { case TXTJUST_LB: case TXTJUST_CB: case TXTJUST_RB: // bottom @@ -331,8 +303,7 @@ return height; } - public Coordinate getUserOrigin() - { + public Coordinate getUserOrigin() { double width = getUserWidth(); double height = getUserHeight(); double angle = Math.toRadians(getRotationAngle()); @@ -354,8 +325,7 @@ return new Coordinate(dstPt[0], dstPt[1]); } - public Object clone() throws CloneNotSupportedException - { + public Object clone() throws CloneNotSupportedException { int pos = this.rawBuffer.position(); this.rawBuffer.position(0); byte[] rawBytes = this.rawBuffer.array(); @@ -367,27 +337,22 @@ return other; } - public static class ElementHandler extends Element.ElementHandler - { + public static class ElementHandler extends Element.ElementHandler { private static ElementHandler instance = null; - public ElementHandler() - { + public ElementHandler() { super(ElementType.TEXT); } - public static IElementHandler getInstance() - { - if (instance == null) - { + public static IElementHandler getInstance() { + if (instance == null) { instance = new ElementHandler(); } return instance; } - protected Element createElement(byte[] raw) - { + protected Element createElement(byte[] raw) { return new TextElement(raw); } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TextNodeElement.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TextNodeElement.java index f82e526..bfcb788 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TextNodeElement.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/TextNodeElement.java @@ -11,9 +11,9 @@ import org.apache.log4j.Logger; import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.CoordinateList; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; -import com.vividsolutions.jts.geom.CoordinateList; import com.ximple.util.DgnUtility; @@ -22,149 +22,120 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �U�� 04:02:58 + * @since 2006/5/18 �U�� 04:02:58 */ -public class TextNodeElement extends Element implements ComplexElement, GeometryConverter -{ +public class TextNodeElement extends Element implements ComplexElement, GeometryConverter { private static final Logger logger = Logger.getLogger(TextElement.class); private ArrayList<Element> list = new ArrayList<Element>(); - public TextNodeElement(byte[] raw) - { + TextNodeElement(byte[] raw) { super(raw); } - public int size() - { + public int size() { return list.size(); } - public boolean isEmpty() - { + public boolean isEmpty() { return list.isEmpty(); } - public boolean contains(Object o) - { + public boolean contains(Object o) { return list.contains(o); } - public Iterator<Element> iterator() - { + public Iterator<Element> iterator() { return list.iterator(); } - public Object[] toArray() - { + public Object[] toArray() { return list.toArray(); } - public <T> T[] toArray(T[] ts) - { + public <T> T[] toArray(T[] ts) { return list.toArray(ts); } - public boolean add(Element element) - { + public boolean add(Element element) { return list.add(element); } - public boolean remove(Object o) - { + public boolean remove(Object o) { return list.remove(o); } - public boolean containsAll(Collection<?> objects) - { + public boolean containsAll(Collection<?> objects) { return list.containsAll(objects); } - public boolean addAll(Collection<? extends Element> elements) - { + public boolean addAll(Collection<? extends Element> elements) { return list.addAll(elements); } - public boolean addAll(int i, Collection<? extends Element> elements) - { + public boolean addAll(int i, Collection<? extends Element> elements) { return list.addAll(i, elements); } - public boolean removeAll(Collection<?> objects) - { + public boolean removeAll(Collection<?> objects) { return list.removeAll(objects); } - public boolean retainAll(Collection<?> objects) - { + public boolean retainAll(Collection<?> objects) { return list.retainAll(objects); } - public void clear() - { + public void clear() { list.clear(); } - public Element get(int index) - { + public Element get(int index) { return list.get(index); } - public Element set(int index, Element element) - { + public Element set(int index, Element element) { return list.set(index, element); } - public void add(int index, Element element) - { + public void add(int index, Element element) { list.add(index, element); } - public Element remove(int index) - { + public Element remove(int index) { return list.remove(index); } - public int indexOf(Object o) - { + public int indexOf(Object o) { return list.indexOf(o); } - public int lastIndexOf(Object o) - { + public int lastIndexOf(Object o) { return list.lastIndexOf(o); } - public ListIterator<Element> listIterator() - { + public ListIterator<Element> listIterator() { return list.listIterator(); } - public ListIterator<Element> listIterator(int index) - { + public ListIterator<Element> listIterator(int index) { return list.listIterator(index); } - public List<Element> subList(int fromIndex, int toIndex) - { + public List<Element> subList(int fromIndex, int toIndex) { return list.subList(fromIndex, toIndex); } - public Element[] toArray(Element[] a) - { + public Element[] toArray(Element[] a) { return list.toArray(a); } - public String[] getTextArray() - { + public String[] getTextArray() { ArrayList<String> list = new ArrayList<String>(); - for (ListIterator it = listIterator(); it.hasNext();) - { + for (ListIterator it = listIterator(); it.hasNext();) { Element element = (Element) it.next(); - if (element instanceof TextElement) - { + if (element instanceof TextElement) { list.add(((TextElement) element).getText()); } } @@ -172,8 +143,7 @@ return list.toArray(new String[list.size()]); } - public Geometry toGeometry(GeometryFactory factory) - { + public Geometry toGeometry(GeometryFactory factory) { /* * CoordinateList coords = new CoordinateList(); * for (ListIterator it = listIterator(); it.hasNext(); ) @@ -190,104 +160,85 @@ // return factory.createMultiPoint(coords.toCoordinateArray()); } - public Geometry toAnchorGeometry(GeometryFactory factory) - { + public Geometry toAnchorGeometry(GeometryFactory factory) { CoordinateList coords = new CoordinateList(); - for (int i = 0; i < size(); i++) - { + for (int i = 0; i < size(); i++) { TextElement txtElm = (TextElement) get(i); coords.add(txtElm.toAnchorCoordinates(), false); } return factory.createMultiPoint(coords.toCoordinateArray()); } - public int getTotalWords() - { + public int getTotalWords() { return (raw[18] & 0x0000ffff); } - public void setTotalWords(int value) - { + public void setTotalWords(int value) { raw[18] = (short) (value & 0x0000ffff); } - public int getNumString() - { + public int getNumString() { return (raw[19] & 0x0000ffff); } - public void setNumString(int value) - { + public void setNumString(int value) { raw[19] = (short) (value & 0x0000ffff); } - public int getNodeNumber() - { + public int getNodeNumber() { return (raw[20] & 0x0000ffff); } - public void setNodeNumber(int value) - { + public void setNodeNumber(int value) { raw[20] = (short) (value & 0x0000ffff); } - public int getMaxLength() - { + public int getMaxLength() { return (raw[21] & 0x00ff); } - public void setMaxLength(int value) - { + public void setMaxLength(int value) { raw[21] = (short) ((value & 0x00ff) | (raw[21] & 0xff00)); } - public int getMaxUsed() - { + public int getMaxUsed() { return ((raw[21] >> 8) & 0x00ff); } - public void setMaxUsed(int value) - { + public void setMaxUsed(int value) { raw[21] = (short) (((value << 8) & 0xff00) | (raw[21] & 0x00ff)); } - public int getJustification() - { + public int getJustification() { return ((raw[22] >> 8) & 0x00ff); } - public void setJustification(int value) - { + public void setJustification(int value) { raw[22] = (short) (((value << 8) & 0xff00) | (raw[22] & 0x00ff)); } - - public int getFontIndex() - { + + public int getFontIndex() { return (raw[22] & 0x00ff); } - public void setFontIndex(int value) - { + public void setFontIndex(int value) { raw[22] = (short) ((value & 0x00ff) | (raw[22] & 0xff00)); } - public double getLineSpacing() - { + public double getLineSpacing() { int lineSpace; lineSpace = ((raw[23] & 0x0000ffff) << 16) | (raw[24] & 0x0000ffff); return lineSpace; } - public void setLineSpacing(double value) - { - int temp = (int) (value*1000.0); + public void setLineSpacing(double value) { + int temp = (int) (value * 1000.0); raw[23] = (short) ((temp >> 16) & 0x0000ffff); raw[24] = (short) (temp & 0x0000ffff); } - public double getTextNodeLength() - { + public double getTextNodeLength() { int lengthMult; lengthMult = ((raw[25] << 16) & 0xffff0000); @@ -296,15 +247,13 @@ return DgnUtility.converIntToDouble(lengthMult); } - public void setTextNodeLength(double value) - { + public void setTextNodeLength(double value) { int temp = DgnUtility.converDoubleToInt(value); raw[25] = (short) ((temp >> 16) & 0x0000ffff); raw[26] = (short) (temp & 0x0000ffff); } - public double getTextNodeHeight() - { + public double getTextNodeHeight() { int heightMult; heightMult = ((raw[27] << 16) & 0xffff0000); @@ -313,30 +262,26 @@ return DgnUtility.converIntToDouble(heightMult); } - public void setTextNodeHeight(double value) - { + public void setTextNodeHeight(double value) { int temp = DgnUtility.converDoubleToInt(value); raw[27] = (short) ((temp >> 16) & 0x0000ffff); raw[28] = (short) (temp & 0x0000ffff); } - public double getRotationAngle() - { + public double getRotationAngle() { int rotation = (raw[29] << 16 & 0xffff0000); rotation += raw[30]; return DgnUtility.converIntToRotation(rotation); } - public void setRotationAngle(double value) - { + public void setRotationAngle(double value) { int temp = DgnUtility.converRotatioToInt(value); raw[29] = (short) (temp >> 16 & 0x0000ffff); raw[30] = (short) (temp & 0x0000ffff); } - public Coordinate getOrigin() - { + public Coordinate getOrigin() { int x = ((raw[31] << 16) & 0xffff0000) | (raw[32] & 0x0000ffff); double dx = DgnUtility.converUnitToCoord(x); // return DgnUtility.convertFromDGN(x); @@ -347,8 +292,7 @@ return new Coordinate(dx, dy); } - public void setOrigin(Coordinate value) - { + public void setOrigin(Coordinate value) { int x = DgnUtility.converCoordToUnit(value.x); raw[31] = (short) (x >> 16 & 0x0000ffff); raw[32] = (short) (x & 0x0000ffff); @@ -358,8 +302,7 @@ raw[34] = (short) (y & 0x0000ffff); } - public Object clone() throws CloneNotSupportedException - { + public Object clone() throws CloneNotSupportedException { int pos = this.rawBuffer.position(); this.rawBuffer.position(0); byte[] rawBytes = this.rawBuffer.array(); @@ -368,8 +311,7 @@ this.rawBuffer.position(pos); TextNodeElement other = new TextNodeElement(otherRaw); - for (Object o : this) - { + for (Object o : this) { TextElement textElm = (TextElement) o; other.add((Element) textElm.clone()); } @@ -377,27 +319,22 @@ return other; } - public static class ElementHandler extends Element.ElementHandler - { + public static class ElementHandler extends Element.ElementHandler { private static ElementHandler instance = null; - public ElementHandler() - { + public ElementHandler() { super(ElementType.TEXTNODE); } - public static IElementHandler getInstance() - { - if (instance == null) - { + public static IElementHandler getInstance() { + if (instance == null) { instance = new ElementHandler(); } return instance; } - protected Element createElement(byte[] raw) - { + protected Element createElement(byte[] raw) { return new TextNodeElement(raw); } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/UserAttributeData.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/UserAttributeData.java index 2b87fe1..c14aa67 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/UserAttributeData.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/UserAttributeData.java @@ -5,30 +5,25 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �U�� 02:29:29 + * @since 2006/5/18 */ -public class UserAttributeData -{ +public class UserAttributeData { protected short[] _src; - public UserAttributeData(short id, int attributeCount) - { + public UserAttributeData(short id, int attributeCount) { _src = new short[attributeCount]; _src[0] = id; } - public UserAttributeData(short[] src) - { + public UserAttributeData(short[] src) { _src = src; } - public short getID() - { + public short getID() { return _src[0]; } - public void setID(short value) - { + public void setID(short value) { _src[0] = value; } } diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/util/DgnUtility.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/util/DgnUtility.java index 0009270..2ed1f27 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/util/DgnUtility.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/util/DgnUtility.java @@ -12,25 +12,21 @@ * * @author Ulysses * @version 0.1 - * @since 2006/5/18 �U�� 01:33:00 + * @since 2006/5/18 */ -public final class DgnUtility -{ +public final class DgnUtility { private static final Logger logger = Logger.getLogger(DgnUtility.class); - public static double converIntToDouble(int src) - { + public static double converIntToDouble(int src) { return (double) ((long) ((src * 6) / 1000.0 + 0.5)) / 1000.0; } - public static int converDoubleToInt(double src) - { + public static int converDoubleToInt(double src) { return (int) (src / 6 * 1000000.0); } - public static int convertFromDGN(int aValue) - { + public static int convertFromDGN(int aValue) { int newVal; newVal = (((aValue ^ 0x00008000) << 16) & 0xffff0000); @@ -39,8 +35,7 @@ return newVal; } - public static int converToDGN(int aValue) - { + public static int converToDGN(int aValue) { int newVal; newVal = (aValue << 16 & 0xffff0000); @@ -49,26 +44,22 @@ return newVal; } - public static double converIntToRotation(int aValue) - { + public static double converIntToRotation(int aValue) { return aValue / 360000.0; } - public static int converRotatioToInt(double aValue) - { + public static int converRotatioToInt(double aValue) { return (int) (aValue * 360000.0); } - public static double converRotationToRadian(double aValue) - { + public static double converRotationToRadian(double aValue) { return aValue * Math.PI / 180; } - public static double converUnitToCoord(int aValue) - { + public static double converUnitToCoord(int aValue) { double newVal; newVal = aValue / 1000.0; @@ -77,8 +68,7 @@ return newVal; } - public static double converUnitToCoord(double aValue) - { + public static double converUnitToCoord(double aValue) { double newVal; newVal = aValue / 1000.0; @@ -87,8 +77,7 @@ return newVal; } - public static int converCoordToUnit(double aValue) - { + public static int converCoordToUnit(double aValue) { double newVal = aValue; newVal -= 2147483.648; @@ -97,30 +86,25 @@ return (int) newVal; } - public static Envelope converUnitToCoord(Envelope range) - { - if (range == null) - { + public static Envelope converUnitToCoord(Envelope range) { + if (range == null) { return null; } return new Envelope(converUnitToCoord((int) range.getMinX()), converUnitToCoord((int) range.getMaxX()), - converUnitToCoord((int) range.getMinY()), converUnitToCoord((int) range.getMaxY())); + converUnitToCoord((int) range.getMinY()), converUnitToCoord((int) range.getMaxY())); } - public static Envelope converCoordToUnit(Envelope range) - { - if (range == null) - { + public static Envelope converCoordToUnit(Envelope range) { + if (range == null) { return null; } return new Envelope(converCoordToUnit(range.getMinX()), converCoordToUnit(range.getMaxX()), - converCoordToUnit(range.getMinY()), converCoordToUnit(range.getMaxY())); + converCoordToUnit(range.getMinY()), converCoordToUnit(range.getMaxY())); } - public static long convertDGNToRAWIEEEDouble(byte[] org) - { + public static long convertDGNToRAWIEEEDouble(byte[] org) { ByteBuffer buf = ByteBuffer.allocate(8); buf.order(ByteOrder.LITTLE_ENDIAN); buf.mark(); @@ -144,8 +128,7 @@ int sign = (tmp[0] & 0x80000000); exponent = (tmp[0] >>> 23) & 0x000000ff; - if (exponent != 0) - { + if (exponent != 0) { exponent = exponent - 129 + 1023; } @@ -153,8 +136,7 @@ tmp[1] = tmp[1] >>> 3; tmp[1] = (tmp[1] & 0x1fffffff) | (tmp[0] << 29); - if (rndbits != 0) - { + if (rndbits != 0) { tmp[1] = tmp[1] | 0x00000001; } @@ -170,8 +152,7 @@ buf.get(tmpRaw); buf.position(0); buf.order(ByteOrder.LITTLE_ENDIAN); - for (int i = tmpRaw.length; i > 0; i--) - { + for (int i = tmpRaw.length; i > 0; i--) { buf.put(tmpRaw[i - 1]); } buf.position(0); @@ -179,13 +160,11 @@ return result; } - public static double convertDGNToIEEEDouble(byte[] src) - { + public static double convertDGNToIEEEDouble(byte[] src) { return Double.longBitsToDouble(convertDGNToRAWIEEEDouble(src)); } - public static short[] convertIEEEDoubleToDGN(double src) - { + public static short[] convertIEEEDoubleToDGN(double src) { long newVal = Double.doubleToLongBits(src); // uint[] tmp = new int[ 2 ]; @@ -202,18 +181,14 @@ sign = tmp[0] & 0x80000000; exponent = (tmp[0] >>> 20) & 0x07ff; - if (exponent != 0) - { + if (exponent != 0) { exponent = exponent - 1023 + 129; } - if (exponent > 255) - { - if (sign != 0) - { + if (exponent > 255) { + if (sign != 0) { des[0] = -1; - } else - { + } else { des[0] = 0x7fff; } @@ -222,16 +197,14 @@ des[3] = -1; return des; - } else if ((exponent < 0) || ((exponent == 0) && (sign == 0))) - { + } else if ((exponent < 0) || ((exponent == 0) && (sign == 0))) { des[0] = 0x0; des[1] = 0x0; des[2] = 0x0; des[3] = 0x0; return des; - } else - { + } else { tmp[0] = (tmp[0] << 3) | (tmp[1] >> 29); tmp[0] = tmp[0] & 0x007fffff; tmp[0] = tmp[0] | (exponent << 23) | sign; @@ -249,8 +222,7 @@ return des; } - public static double getLength(double x1, double y1, double x2, double y2) - { + public static double getLength(double x1, double y1, double x2, double y2) { double dx = x1 - x2; double dy = y1 - y2; diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/util/PrintfFormat.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/util/PrintfFormat.java index 8e2bf6b..88af493 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/util/PrintfFormat.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/util/PrintfFormat.java @@ -441,8 +441,7 @@ * formatting of -0.0f * round up/down when last digits are 50000... */ -public final class PrintfFormat -{ +public final class PrintfFormat { /** * Vector of control strings and format literals. */ @@ -471,8 +470,7 @@ * string is null, zero length, or otherwise * malformed. */ - public PrintfFormat(String fmtArg) throws IllegalArgumentException - { + public PrintfFormat(String fmtArg) throws IllegalArgumentException { this(Locale.getDefault(), fmtArg); } @@ -489,91 +487,74 @@ * string is null, zero length, or otherwise * malformed. */ - public PrintfFormat(Locale locale, String fmtArg) throws IllegalArgumentException - { + public PrintfFormat(Locale locale, String fmtArg) throws IllegalArgumentException { dfs = new DecimalFormatSymbols(locale); int ePos = 0; ConversionSpecification sFmt = null; String unCS = this.nonControl(fmtArg, 0); - if (unCS != null) - { + if (unCS != null) { sFmt = new ConversionSpecification(); sFmt.setLiteral(unCS); vFmt.addElement(sFmt); } - while ((cPos != -1) && (cPos < fmtArg.length())) - { - for (ePos = cPos + 1; ePos < fmtArg.length(); ePos++) - { + while ((cPos != -1) && (cPos < fmtArg.length())) { + for (ePos = cPos + 1; ePos < fmtArg.length(); ePos++) { char c = 0; c = fmtArg.charAt(ePos); - if (c == 'i') - { + if (c == 'i') { break; } - if (c == 'd') - { + if (c == 'd') { break; } - if (c == 'f') - { + if (c == 'f') { break; } - if (c == 'g') - { + if (c == 'g') { break; } - if (c == 'G') - { + if (c == 'G') { break; } - if (c == 'o') - { + if (c == 'o') { break; } - if (c == 'x') - { + if (c == 'x') { break; } - if (c == 'X') - { + if (c == 'X') { break; } - if (c == 'e') - { + if (c == 'e') { break; } - if (c == 'E') - { + if (c == 'E') { break; } - if (c == 'c') - { + if (c == 'c') { break; } - if (c == 's') - { + if (c == 's') { break; } - if (c == '%') - { + if (c == '%') { break; } } @@ -583,8 +564,7 @@ vFmt.addElement(sFmt); unCS = this.nonControl(fmtArg, ePos); - if (unCS != null) - { + if (unCS != null) { sFmt = new ConversionSpecification(); sFmt.setLiteral(unCS); vFmt.addElement(sFmt); @@ -606,14 +586,12 @@ * @return the substring from the start position * to the beginning of the control string. */ - private String nonControl(String s, int start) - { + private String nonControl(String s, int start) { String ret = ""; cPos = s.indexOf("%", start); - if (cPos == -1) - { + if (cPos == -1) { cPos = s.length(); } @@ -629,90 +607,69 @@ * @param o The array of objects to format. * @return The formatted String. */ - public String sprintf(Object[] o) - { + public String sprintf(Object[] o) { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; int i = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { - if (cs.isPositionalSpecification()) - { + } else { + if (cs.isPositionalSpecification()) { i = cs.getArgumentPosition() - 1; - if (cs.isPositionalFieldWidth()) - { + if (cs.isPositionalFieldWidth()) { int ifw = cs.getArgumentPositionForFieldWidth() - 1; cs.setFieldWidthWithArg(((Integer) o[ifw]).intValue()); } - if (cs.isPositionalPrecision()) - { + if (cs.isPositionalPrecision()) { int ipr = cs.getArgumentPositionForPrecision() - 1; cs.setPrecisionWithArg(((Integer) o[ipr]).intValue()); } - } else - { - if (cs.isVariableFieldWidth()) - { + } else { + if (cs.isVariableFieldWidth()) { cs.setFieldWidthWithArg(((Integer) o[i]).intValue()); i++; } - if (cs.isVariablePrecision()) - { + if (cs.isVariablePrecision()) { cs.setPrecisionWithArg(((Integer) o[i]).intValue()); i++; } } - if (o[i] instanceof Byte) - { + if (o[i] instanceof Byte) { sb.append(cs.internalsprintf(((Byte) o[i]).byteValue())); - } else if (o[i] instanceof Short) - { + } else if (o[i] instanceof Short) { sb.append(cs.internalsprintf(((Short) o[i]).shortValue())); - } else if (o[i] instanceof Integer) - { + } else if (o[i] instanceof Integer) { sb.append(cs.internalsprintf(((Integer) o[i]).intValue())); - } else if (o[i] instanceof Long) - { + } else if (o[i] instanceof Long) { sb.append(cs.internalsprintf(((Long) o[i]).longValue())); - } else if (o[i] instanceof Float) - { + } else if (o[i] instanceof Float) { sb.append(cs.internalsprintf(((Float) o[i]).floatValue())); - } else if (o[i] instanceof Double) - { + } else if (o[i] instanceof Double) { sb.append(cs.internalsprintf(((Double) o[i]).doubleValue())); - } else if (o[i] instanceof Character) - { + } else if (o[i] instanceof Character) { sb.append(cs.internalsprintf(((Character) o[i]).charValue())); - } else if (o[i] instanceof String) - { + } else if (o[i] instanceof String) { sb.append(cs.internalsprintf((String) o[i])); - } else - { + } else { sb.append(cs.internalsprintf(o[i])); } - if (!cs.isPositionalSpecification()) - { + if (!cs.isPositionalSpecification()) { i++; } } @@ -726,23 +683,19 @@ * * @return the formatted String. */ - public String sprintf() - { + public String sprintf() { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); } } @@ -759,26 +712,21 @@ * conversion character is f, e, E, g, G, s, * or S. */ - public String sprintf(int x) throws IllegalArgumentException - { + public String sprintf(int x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { + } else { sb.append(cs.internalsprintf(x)); } } @@ -795,26 +743,21 @@ * conversion character is f, e, E, g, G, s, * or S. */ - public String sprintf(long x) throws IllegalArgumentException - { + public String sprintf(long x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { + } else { sb.append(cs.internalsprintf(x)); } } @@ -831,26 +774,21 @@ * conversion character is c, C, s, S, * d, d, x, X, or o. */ - public String sprintf(double x) throws IllegalArgumentException - { + public String sprintf(double x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { + } else { sb.append(cs.internalsprintf(x)); } } @@ -866,26 +804,21 @@ * @throws IllegalArgumentException if the * conversion character is neither s nor S. */ - public String sprintf(String x) throws IllegalArgumentException - { + public String sprintf(String x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { + } else { sb.append(cs.internalsprintf(x)); } } @@ -907,52 +840,38 @@ * conversion character is inappropriate for * formatting an unwrapped value. */ - public String sprintf(Object x) throws IllegalArgumentException - { + public String sprintf(Object x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { - if (x instanceof Byte) - { + } else { + if (x instanceof Byte) { sb.append(cs.internalsprintf(((Byte) x).byteValue())); - } else if (x instanceof Short) - { + } else if (x instanceof Short) { sb.append(cs.internalsprintf(((Short) x).shortValue())); - } else if (x instanceof Integer) - { + } else if (x instanceof Integer) { sb.append(cs.internalsprintf(((Integer) x).intValue())); - } else if (x instanceof Long) - { + } else if (x instanceof Long) { sb.append(cs.internalsprintf(((Long) x).longValue())); - } else if (x instanceof Float) - { + } else if (x instanceof Float) { sb.append(cs.internalsprintf(((Float) x).floatValue())); - } else if (x instanceof Double) - { + } else if (x instanceof Double) { sb.append(cs.internalsprintf(((Double) x).doubleValue())); - } else if (x instanceof Character) - { + } else if (x instanceof Character) { sb.append(cs.internalsprintf(((Character) x).charValue())); - } else if (x instanceof String) - { + } else if (x instanceof String) { sb.append(cs.internalsprintf((String) x)); - } else - { + } else { sb.append(cs.internalsprintf(x)); } } @@ -994,8 +913,7 @@ * optional L does not imply conversion to a long * long double. */ - private class ConversionSpecification - { + private class ConversionSpecification { /** * Default precision. */ @@ -1136,8 +1054,7 @@ * Constructor. Used to prepare an instance * to hold a literal, not a control string. */ - ConversionSpecification() - { + ConversionSpecification() { } /** @@ -1152,20 +1069,16 @@ * input string is null, zero length, or * otherwise malformed. */ - ConversionSpecification(String fmtArg) throws IllegalArgumentException - { - if (fmtArg == null) - { + ConversionSpecification(String fmtArg) throws IllegalArgumentException { + if (fmtArg == null) { throw new NullPointerException(); } - if (fmtArg.length() == 0) - { + if (fmtArg.length() == 0) { throw new IllegalArgumentException("Control strings must have positive" + " lengths."); } - if (fmtArg.charAt(0) == '%') - { + if (fmtArg.charAt(0) == '%') { fmt = fmtArg; pos = 1; setArgPosition(); @@ -1174,33 +1087,25 @@ setPrecision(); setOptionalHL(); - if (setConversionCharacter()) - { - if (pos == fmtArg.length()) - { - if (leadingZeros && leftJustify) - { + if (setConversionCharacter()) { + if (pos == fmtArg.length()) { + if (leadingZeros && leftJustify) { leadingZeros = false; } - if (precisionSet && leadingZeros) - { + if (precisionSet && leadingZeros) { if ((conversionCharacter == 'd') || (conversionCharacter == 'i') || (conversionCharacter == 'o') - || (conversionCharacter == 'x')) - { + || (conversionCharacter == 'x')) { leadingZeros = false; } } - } else - { + } else { throw new IllegalArgumentException("Malformed conversion specification=" + fmtArg); } - } else - { + } else { throw new IllegalArgumentException("Malformed conversion specification=" + fmtArg); } - } else - { + } else { throw new IllegalArgumentException("Control strings must begin with %."); } } @@ -1210,8 +1115,7 @@ * * @param s the String to store. */ - void setLiteral(String s) - { + void setLiteral(String s) { fmt = s; } @@ -1221,23 +1125,18 @@ * * @return s the stored String. */ - String getLiteral() - { + String getLiteral() { StringBuilder sb = new StringBuilder(); int i = 0; - while (i < fmt.length()) - { - if (fmt.charAt(i) == '\\') - { + while (i < fmt.length()) { + if (fmt.charAt(i) == '\\') { i++; - if (i < fmt.length()) - { + if (i < fmt.length()) { char c = fmt.charAt(i); - switch (c) - { + switch (c) { case 'a': sb.append((char) 0x07); @@ -1280,12 +1179,10 @@ } i++; - } else - { + } else { sb.append('\\'); } - } else - { + } else { i++; } } @@ -1299,8 +1196,7 @@ * * @return the conversion character. */ - char getConversionCharacter() - { + char getConversionCharacter() { return conversionCharacter; } @@ -1313,8 +1209,7 @@ * uses an * field width; otherwise * <code>false</code>. */ - boolean isVariableFieldWidth() - { + boolean isVariableFieldWidth() { return variableFieldWidth; } @@ -1325,10 +1220,8 @@ * * @param fw the field width. */ - void setFieldWidthWithArg(int fw) - { - if (fw < 0) - { + void setFieldWidthWithArg(int fw) { + if (fw < 0) { leftJustify = true; } @@ -1345,8 +1238,7 @@ * uses an * precision; otherwise * <code>false</code>. */ - boolean isVariablePrecision() - { + boolean isVariablePrecision() { return variablePrecision; } @@ -1356,8 +1248,7 @@ * * @param pr the precision. */ - void setPrecisionWithArg(int pr) - { + void setPrecisionWithArg(int pr) { precisionSet = true; precision = Math.max(pr, 0); } @@ -1371,22 +1262,17 @@ * @throws IllegalArgumentException if the * conversion character is f, e, E, g, or G. */ - String internalsprintf(int s) throws IllegalArgumentException - { + String internalsprintf(int s) throws IllegalArgumentException { String s2 = ""; - switch (conversionCharacter) - { + switch (conversionCharacter) { case 'd': case 'i': - if (optionalh) - { + if (optionalh) { s2 = printDFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printDFormat((long) s); - } else - { + } else { s2 = printDFormat(s); } @@ -1394,28 +1280,22 @@ case 'x': case 'X': - if (optionalh) - { + if (optionalh) { s2 = printXFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printXFormat((long) s); - } else - { + } else { s2 = printXFormat(s); } break; case 'o': - if (optionalh) - { + if (optionalh) { s2 = printOFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printOFormat((long) s); - } else - { + } else { s2 = printOFormat(s); } @@ -1429,7 +1309,7 @@ default: throw new IllegalArgumentException("Cannot format a int with a format using a " + conversionCharacter - + " conversion character."); + + " conversion character."); } return s2; @@ -1444,22 +1324,17 @@ * @throws IllegalArgumentException if the * conversion character is f, e, E, g, or G. */ - String internalsprintf(long s) throws IllegalArgumentException - { + String internalsprintf(long s) throws IllegalArgumentException { String s2 = ""; - switch (conversionCharacter) - { + switch (conversionCharacter) { case 'd': case 'i': - if (optionalh) - { + if (optionalh) { s2 = printDFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printDFormat(s); - } else - { + } else { s2 = printDFormat((int) s); } @@ -1467,28 +1342,22 @@ case 'x': case 'X': - if (optionalh) - { + if (optionalh) { s2 = printXFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printXFormat(s); - } else - { + } else { s2 = printXFormat((int) s); } break; case 'o': - if (optionalh) - { + if (optionalh) { s2 = printOFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printOFormat(s); - } else - { + } else { s2 = printOFormat((int) s); } @@ -1502,7 +1371,7 @@ default: throw new IllegalArgumentException("Cannot format a long with a format using a " + conversionCharacter - + " conversion character."); + + " conversion character."); } return s2; @@ -1518,12 +1387,10 @@ * conversion character is c, C, s, S, i, d, * x, X, or o. */ - String internalsprintf(double s) throws IllegalArgumentException - { + String internalsprintf(double s) throws IllegalArgumentException { String s2 = ""; - switch (conversionCharacter) - { + switch (conversionCharacter) { case 'f': s2 = printFFormat(s); @@ -1543,7 +1410,7 @@ default: throw new IllegalArgumentException("Cannot " + "format a double with a format using a " + conversionCharacter - + " conversion character."); + + " conversion character."); } return s2; @@ -1558,17 +1425,14 @@ * @throws IllegalArgumentException if the * conversion character is neither s nor S. */ - String internalsprintf(String s) throws IllegalArgumentException - { + String internalsprintf(String s) throws IllegalArgumentException { String s2 = ""; - if ((conversionCharacter == 's') || (conversionCharacter == 'S')) - { + if ((conversionCharacter == 's') || (conversionCharacter == 'S')) { s2 = printSFormat(s); - } else - { + } else { throw new IllegalArgumentException("Cannot " + "format a String with a format using a " + conversionCharacter - + " conversion character."); + + " conversion character."); } return s2; @@ -1583,17 +1447,14 @@ * @throws IllegalArgumentException if the * conversion character is neither s nor S. */ - String internalsprintf(Object s) - { + String internalsprintf(Object s) { String s2 = ""; - if ((conversionCharacter == 's') || (conversionCharacter == 'S')) - { + if ((conversionCharacter == 's') || (conversionCharacter == 'S')) { s2 = printSFormat(s.toString()); - } else - { + } else { throw new IllegalArgumentException("Cannot format a String with a format using" + " a " + conversionCharacter - + " conversion character."); + + " conversion character."); } return s2; @@ -1621,8 +1482,7 @@ * to appear after the radix character. Padding is * with trailing 0s. */ - private char[] fFormatDigits(double x) - { + private char[] fFormatDigits(double x) { // int defaultDigits=6; String sx, sxOut; int i, j, k; @@ -1630,19 +1490,15 @@ int expon = 0; boolean minusSign = false; - if (x > 0.0) - { + if (x > 0.0) { sx = Double.toString(x); - } else if (x < 0.0) - { + } else if (x < 0.0) { sx = Double.toString(-x); minusSign = true; - } else - { + } else { sx = Double.toString(x); - if (sx.charAt(0) == '-') - { + if (sx.charAt(0) == '-') { minusSign = true; sx = sx.substring(1); } @@ -1651,68 +1507,51 @@ int ePos = sx.indexOf('E'); int rPos = sx.indexOf('.'); - if (rPos != -1) - { + if (rPos != -1) { n1In = rPos; - } else if (ePos != -1) - { + } else if (ePos != -1) { n1In = ePos; - } else - { + } else { n1In = sx.length(); } - if (rPos != -1) - { - if (ePos != -1) - { + if (rPos != -1) { + if (ePos != -1) { n2In = ePos - rPos - 1; - } else - { + } else { n2In = sx.length() - rPos - 1; } - } else - { + } else { n2In = 0; } - if (ePos != -1) - { + if (ePos != -1) { int ie = ePos + 1; expon = 0; - if (sx.charAt(ie) == '-') - { - for (++ie; ie < sx.length(); ie++) - { - if (sx.charAt(ie) != '0') - { + if (sx.charAt(ie) == '-') { + for (++ie; ie < sx.length(); ie++) { + if (sx.charAt(ie) != '0') { break; } } - if (ie < sx.length()) - { + if (ie < sx.length()) { expon = -Integer.parseInt(sx.substring(ie)); } - } else - { - if (sx.charAt(ie) == '+') - { + } else { + if (sx.charAt(ie) == '+') { ++ie; } - for (; ie < sx.length(); ie++) - { - if (sx.charAt(ie) != '0') - { + for (; ie < sx.length(); ie++) { + if (sx.charAt(ie) != '0') { break; } } - if (ie < sx.length()) - { + if (ie < sx.length()) { expon = Integer.parseInt(sx.substring(ie)); } } @@ -1720,11 +1559,9 @@ int p; - if (precisionSet) - { + if (precisionSet) { p = precision; - } else - { + } else { p = defaultDigits - 1; } @@ -1732,102 +1569,79 @@ char[] ca2 = new char[n1In + n2In]; char[] ca3, ca4, ca5; - for (j = 0; j < n1In; j++) - { + for (j = 0; j < n1In; j++) { ca2[j] = ca1[j]; } i = j + 1; - for (k = 0; k < n2In; j++, i++, k++) - { + for (k = 0; k < n2In; j++, i++, k++) { ca2[j] = ca1[i]; } - if (n1In + expon <= 0) - { + if (n1In + expon <= 0) { ca3 = new char[-expon + n2In]; - for (j = 0, k = 0; k < (-n1In - expon); k++, j++) - { + for (j = 0, k = 0; k < (-n1In - expon); k++, j++) { ca3[j] = '0'; } - for (i = 0; i < (n1In + n2In); i++, j++) - { + for (i = 0; i < (n1In + n2In); i++, j++) { ca3[j] = ca2[i]; } - } else - { + } else { ca3 = ca2; } boolean carry = false; - if (p < -expon + n2In) - { - if (expon < 0) - { + if (p < -expon + n2In) { + if (expon < 0) { i = p; - } else - { + } else { i = p + n1In; } carry = checkForCarry(ca3, i); - if (carry) - { + if (carry) { carry = startSymbolicCarry(ca3, i - 1, 0); } } - if (n1In + expon <= 0) - { + if (n1In + expon <= 0) { ca4 = new char[2 + p]; - if (!carry) - { + if (!carry) { ca4[0] = '0'; - } else - { + } else { ca4[0] = '1'; } - if (alternateForm || !precisionSet || (precision != 0)) - { + if (alternateForm || !precisionSet || (precision != 0)) { ca4[1] = '.'; - for (i = 0, j = 2; i < Math.min(p, ca3.length); i++, j++) - { + for (i = 0, j = 2; i < Math.min(p, ca3.length); i++, j++) { ca4[j] = ca3[i]; } - for (; j < ca4.length; j++) - { + for (; j < ca4.length; j++) { ca4[j] = '0'; } } - } else - { - if (!carry) - { - if (alternateForm || !precisionSet || (precision != 0)) - { + } else { + if (!carry) { + if (alternateForm || !precisionSet || (precision != 0)) { ca4 = new char[n1In + expon + p + 1]; - } else - { + } else { ca4 = new char[n1In + expon]; } j = 0; - } else - { - if (alternateForm || !precisionSet || (precision != 0)) - { + } else { + if (alternateForm || !precisionSet || (precision != 0)) { ca4 = new char[n1In + expon + p + 2]; - } else - { + } else { ca4 = new char[n1In + expon + 1]; } @@ -1835,28 +1649,23 @@ j = 1; } - for (i = 0; i < Math.min(n1In + expon, ca3.length); i++, j++) - { + for (i = 0; i < Math.min(n1In + expon, ca3.length); i++, j++) { ca4[j] = ca3[i]; } - for (; i < n1In + expon; i++, j++) - { + for (; i < n1In + expon; i++, j++) { ca4[j] = '0'; } - if (alternateForm || !precisionSet || (precision != 0)) - { + if (alternateForm || !precisionSet || (precision != 0)) { ca4[j] = '.'; j++; - for (k = 0; (i < ca3.length) && (k < p); i++, j++, k++) - { + for (k = 0; (i < ca3.length) && (k < p); i++, j++, k++) { ca4[j] = ca3[i]; } - for (; j < ca4.length; j++) - { + for (; j < ca4.length; j++) { ca4[j] = '0'; } } @@ -1864,25 +1673,20 @@ int nZeros = 0; - if (!leftJustify && leadingZeros) - { + if (!leftJustify && leadingZeros) { int xThousands = 0; - if (thousands) - { + if (thousands) { int xlead = 0; - if ((ca4[0] == '+') || (ca4[0] == '-') || (ca4[0] == ' ')) - { + if ((ca4[0] == '+') || (ca4[0] == '-') || (ca4[0] == ' ')) { xlead = 1; } int xdp = xlead; - for (; xdp < ca4.length; xdp++) - { - if (ca4[xdp] == '.') - { + for (; xdp < ca4.length; xdp++) { + if (ca4[xdp] == '.') { break; } } @@ -1890,74 +1694,60 @@ xThousands = (xdp - xlead) / 3; } - if (fieldWidthSet) - { + if (fieldWidthSet) { nZeros = fieldWidth - ca4.length; } - if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) - { + if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) { nZeros--; } nZeros -= xThousands; - if (nZeros < 0) - { + if (nZeros < 0) { nZeros = 0; } } j = 0; - if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) - { + if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) { ca5 = new char[ca4.length + nZeros + 1]; j++; - } else - { + } else { ca5 = new char[ca4.length + nZeros]; } - if (!minusSign) - { - if (leadingSign) - { + if (!minusSign) { + if (leadingSign) { ca5[0] = '+'; } - if (leadingSpace) - { + if (leadingSpace) { ca5[0] = ' '; } - } else - { + } else { ca5[0] = '-'; } - for (i = 0; i < nZeros; i++, j++) - { + for (i = 0; i < nZeros; i++, j++) { ca5[j] = '0'; } - for (i = 0; i < ca4.length; i++, j++) - { + for (i = 0; i < ca4.length; i++, j++) { ca5[j] = ca4[i]; } int lead = 0; - if ((ca5[0] == '+') || (ca5[0] == '-') || (ca5[0] == ' ')) - { + if ((ca5[0] == '+') || (ca5[0] == '-') || (ca5[0] == ' ')) { lead = 1; } int dp = lead; - for (; dp < ca5.length; dp++) - { - if (ca5[dp] == '.') - { + for (; dp < ca5.length; dp++) { + if (ca5[dp] == '.') { break; } } @@ -1965,35 +1755,29 @@ int nThousands = (dp - lead) / 3; // Localize the decimal point. - if (dp < ca5.length) - { + if (dp < ca5.length) { ca5[dp] = dfs.getDecimalSeparator(); } char[] ca6 = ca5; - if (thousands && (nThousands > 0)) - { + if (thousands && (nThousands > 0)) { ca6 = new char[ca5.length + nThousands + lead]; ca6[0] = ca5[0]; - for (i = lead, k = lead; i < dp; i++) - { - if ((i > 0) && (dp - i) % 3 == 0) - { + for (i = lead, k = lead; i < dp; i++) { + if ((i > 0) && (dp - i) % 3 == 0) { // ca6[k]=','; ca6[k] = dfs.getGroupingSeparator(); ca6[k + 1] = ca5[i]; k += 2; - } else - { + } else { ca6[k] = ca5[i]; k++; } } - for (; i < ca5.length; i++, k++) - { + for (; i < ca5.length; i++, k++) { ca6[k] = ca5[i]; } } @@ -2011,47 +1795,35 @@ * @param x the double value to be formatted. * @return the converted double value. */ - private String fFormatString(double x) - { + private String fFormatString(double x) { boolean noDigits = false; char[] ca6, ca7; - if (Double.isInfinite(x)) - { - if (x == Double.POSITIVE_INFINITY) - { - if (leadingSign) - { + if (Double.isInfinite(x)) { + if (x == Double.POSITIVE_INFINITY) { + if (leadingSign) { ca6 = "+Inf".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca6 = " Inf".toCharArray(); - } else - { + } else { ca6 = "Inf".toCharArray(); } - } else - { + } else { ca6 = "-Inf".toCharArray(); } noDigits = true; - } else if (Double.isNaN(x)) - { - if (leadingSign) - { + } else if (Double.isNaN(x)) { + if (leadingSign) { ca6 = "+NaN".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca6 = " NaN".toCharArray(); - } else - { + } else { ca6 = "NaN".toCharArray(); } noDigits = true; - } else - { + } else { ca6 = fFormatDigits(x); } @@ -2090,8 +1862,7 @@ * L does not imply conversion to a long long * double. */ - private char[] eFormatDigits(double x, char eChar) - { + private char[] eFormatDigits(double x, char eChar) { char[] ca1, ca2, ca3; // int defaultDigits=6; @@ -2102,19 +1873,15 @@ int ePos, rPos, eSize; boolean minusSign = false; - if (x > 0.0) - { + if (x > 0.0) { sx = Double.toString(x); - } else if (x < 0.0) - { + } else if (x < 0.0) { sx = Double.toString(-x); minusSign = true; - } else - { + } else { sx = Double.toString(x); - if (sx.charAt(0) == '-') - { + if (sx.charAt(0) == '-') { minusSign = true; sx = sx.substring(1); } @@ -2122,145 +1889,111 @@ ePos = sx.indexOf('E'); - if (ePos == -1) - { + if (ePos == -1) { ePos = sx.indexOf('e'); } rPos = sx.indexOf('.'); - if (rPos != -1) - { + if (rPos != -1) { n1In = rPos; - } else if (ePos != -1) - { + } else if (ePos != -1) { n1In = ePos; - } else - { + } else { n1In = sx.length(); } - if (rPos != -1) - { - if (ePos != -1) - { + if (rPos != -1) { + if (ePos != -1) { n2In = ePos - rPos - 1; - } else - { + } else { n2In = sx.length() - rPos - 1; } - } else - { + } else { n2In = 0; } - if (ePos != -1) - { + if (ePos != -1) { int ie = ePos + 1; expon = 0; - if (sx.charAt(ie) == '-') - { - for (++ie; ie < sx.length(); ie++) - { - if (sx.charAt(ie) != '0') - { + if (sx.charAt(ie) == '-') { + for (++ie; ie < sx.length(); ie++) { + if (sx.charAt(ie) != '0') { break; } } - if (ie < sx.length()) - { + if (ie < sx.length()) { expon = -Integer.parseInt(sx.substring(ie)); } - } else - { - if (sx.charAt(ie) == '+') - { + } else { + if (sx.charAt(ie) == '+') { ++ie; } - for (; ie < sx.length(); ie++) - { - if (sx.charAt(ie) != '0') - { + for (; ie < sx.length(); ie++) { + if (sx.charAt(ie) != '0') { break; } } - if (ie < sx.length()) - { + if (ie < sx.length()) { expon = Integer.parseInt(sx.substring(ie)); } } } - if (rPos != -1) - { + if (rPos != -1) { expon += rPos - 1; } - if (precisionSet) - { + if (precisionSet) { p = precision; - } else - { + } else { p = defaultDigits - 1; } - if ((rPos != -1) && (ePos != -1)) - { + if ((rPos != -1) && (ePos != -1)) { ca1 = (sx.substring(0, rPos) + sx.substring(rPos + 1, ePos)).toCharArray(); - } else if (rPos != -1) - { + } else if (rPos != -1) { ca1 = (sx.substring(0, rPos) + sx.substring(rPos + 1)).toCharArray(); - } else if (ePos != -1) - { + } else if (ePos != -1) { ca1 = sx.substring(0, ePos).toCharArray(); - } else - { + } else { ca1 = sx.toCharArray(); } boolean carry = false; int i0 = 0; - if (ca1[0] != '0') - { + if (ca1[0] != '0') { i0 = 0; - } else - { - for (i0 = 0; i0 < ca1.length; i0++) - { - if (ca1[i0] != '0') - { + } else { + for (i0 = 0; i0 < ca1.length; i0++) { + if (ca1[i0] != '0') { break; } } } - if (i0 + p < ca1.length - 1) - { + if (i0 + p < ca1.length - 1) { carry = checkForCarry(ca1, i0 + p + 1); - if (carry) - { + if (carry) { carry = startSymbolicCarry(ca1, i0 + p, i0); } - if (carry) - { + if (carry) { ca2 = new char[i0 + p + 1]; ca2[i0] = '1'; - for (j = 0; j < i0; j++) - { + for (j = 0; j < i0; j++) { ca2[j] = '0'; } - for (i = i0, j = i0 + 1; j < p + 1; i++, j++) - { + for (i = i0, j = i0 + 1; j < p + 1; i++, j++) { ca2[j] = ca1[i]; } @@ -2269,85 +2002,67 @@ } } - if ((Math.abs(expon) < 100) && !optionalL) - { + if ((Math.abs(expon) < 100) && !optionalL) { eSize = 4; - } else - { + } else { eSize = 5; } - if (alternateForm || !precisionSet || (precision != 0)) - { + if (alternateForm || !precisionSet || (precision != 0)) { ca2 = new char[2 + p + eSize]; - } else - { + } else { ca2 = new char[1 + eSize]; } - if (ca1[0] != '0') - { + if (ca1[0] != '0') { ca2[0] = ca1[0]; j = 1; - } else - { + } else { for (j = 1; j < ((ePos == -1) - ? ca1.length - : ePos); j++) - { - if (ca1[j] != '0') - { + ? ca1.length + : ePos); j++) { + if (ca1[j] != '0') { break; } } - if (((ePos != -1) && (j < ePos)) || ((ePos == -1) && (j < ca1.length))) - { + if (((ePos != -1) && (j < ePos)) || ((ePos == -1) && (j < ca1.length))) { ca2[0] = ca1[j]; expon -= j; j++; - } else - { + } else { ca2[0] = '0'; j = 2; } } - if (alternateForm || !precisionSet || (precision != 0)) - { + if (alternateForm || !precisionSet || (precision != 0)) { ca2[1] = '.'; i = 2; - } else - { + } else { i = 1; } - for (k = 0; (k < p) && (j < ca1.length); j++, i++, k++) - { + for (k = 0; (k < p) && (j < ca1.length); j++, i++, k++) { ca2[i] = ca1[j]; } - for (; i < ca2.length - eSize; i++) - { + for (; i < ca2.length - eSize; i++) { ca2[i] = '0'; } ca2[i++] = eChar; - if (expon < 0) - { + if (expon < 0) { ca2[i++] = '-'; - } else - { + } else { ca2[i++] = '+'; } expon = Math.abs(expon); - if (expon >= 100) - { - switch (expon / 100) - { + if (expon >= 100) { + switch (expon / 100) { case 1: ca2[i] = '1'; @@ -2397,8 +2112,7 @@ i++; } - switch ((expon % 100) / 10) - { + switch ((expon % 100) / 10) { case 0: ca2[i] = '0'; @@ -2452,8 +2166,7 @@ i++; - switch (expon % 10) - { + switch (expon % 10) { case 0: ca2[i] = '0'; @@ -2507,25 +2220,20 @@ int nZeros = 0; - if (!leftJustify && leadingZeros) - { + if (!leftJustify && leadingZeros) { int xThousands = 0; - if (thousands) - { + if (thousands) { int xlead = 0; - if ((ca2[0] == '+') || (ca2[0] == '-') || (ca2[0] == ' ')) - { + if ((ca2[0] == '+') || (ca2[0] == '-') || (ca2[0] == ' ')) { xlead = 1; } int xdp = xlead; - for (; xdp < ca2.length; xdp++) - { - if (ca2[xdp] == '.') - { + for (; xdp < ca2.length; xdp++) { + if (ca2[xdp] == '.') { break; } } @@ -2533,74 +2241,60 @@ xThousands = (xdp - xlead) / 3; } - if (fieldWidthSet) - { + if (fieldWidthSet) { nZeros = fieldWidth - ca2.length; } - if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) - { + if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) { nZeros--; } nZeros -= xThousands; - if (nZeros < 0) - { + if (nZeros < 0) { nZeros = 0; } } j = 0; - if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) - { + if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) { ca3 = new char[ca2.length + nZeros + 1]; j++; - } else - { + } else { ca3 = new char[ca2.length + nZeros]; } - if (!minusSign) - { - if (leadingSign) - { + if (!minusSign) { + if (leadingSign) { ca3[0] = '+'; } - if (leadingSpace) - { + if (leadingSpace) { ca3[0] = ' '; } - } else - { + } else { ca3[0] = '-'; } - for (k = 0; k < nZeros; j++, k++) - { + for (k = 0; k < nZeros; j++, k++) { ca3[j] = '0'; } - for (i = 0; (i < ca2.length) && (j < ca3.length); i++, j++) - { + for (i = 0; (i < ca2.length) && (j < ca3.length); i++, j++) { ca3[j] = ca2[i]; } int lead = 0; - if ((ca3[0] == '+') || (ca3[0] == '-') || (ca3[0] == ' ')) - { + if ((ca3[0] == '+') || (ca3[0] == '-') || (ca3[0] == ' ')) { lead = 1; } int dp = lead; - for (; dp < ca3.length; dp++) - { - if (ca3[dp] == '.') - { + for (; dp < ca3.length; dp++) { + if (ca3[dp] == '.') { break; } } @@ -2608,35 +2302,29 @@ int nThousands = dp / 3; // Localize the decimal point. - if (dp < ca3.length) - { + if (dp < ca3.length) { ca3[dp] = dfs.getDecimalSeparator(); } char[] ca4 = ca3; - if (thousands && (nThousands > 0)) - { + if (thousands && (nThousands > 0)) { ca4 = new char[ca3.length + nThousands + lead]; ca4[0] = ca3[0]; - for (i = lead, k = lead; i < dp; i++) - { - if ((i > 0) && (dp - i) % 3 == 0) - { + for (i = lead, k = lead; i < dp; i++) { + if ((i > 0) && (dp - i) % 3 == 0) { // ca4[k]=','; ca4[k] = dfs.getGroupingSeparator(); ca4[k + 1] = ca3[i]; k += 2; - } else - { + } else { ca4[k] = ca3[i]; k++; } } - for (; i < ca3.length; i++, k++) - { + for (; i < ca3.length; i++, k++) { ca4[k] = ca3[i]; } } @@ -2655,33 +2343,26 @@ * @return <code>true</code> if the truncation forces * a round that will change the print */ - private boolean checkForCarry(char[] ca1, int icarry) - { + private boolean checkForCarry(char[] ca1, int icarry) { boolean carry = false; - if (icarry < ca1.length) - { - if ((ca1[icarry] == '6') || (ca1[icarry] == '7') || (ca1[icarry] == '8') || (ca1[icarry] == '9')) - { + if (icarry < ca1.length) { + if ((ca1[icarry] == '6') || (ca1[icarry] == '7') || (ca1[icarry] == '8') || (ca1[icarry] == '9')) { carry = true; - } else if (ca1[icarry] == '5') - { + } else if (ca1[icarry] == '5') { int ii = icarry + 1; - for (; ii < ca1.length; ii++) - { - if (ca1[ii] != '0') - { + for (; ii < ca1.length; ii++) { + if (ca1[ii] != '0') { break; } } carry = ii < ca1.length; - if (!carry && (icarry > 0)) - { + if (!carry && (icarry > 0)) { carry = ((ca1[icarry - 1] == '1') || (ca1[icarry - 1] == '3') || (ca1[icarry - 1] == '5') - || (ca1[icarry - 1] == '7') || (ca1[icarry - 1] == '9')); + || (ca1[icarry - 1] == '7') || (ca1[icarry - 1] == '9')); } } } @@ -2703,16 +2384,13 @@ * a round that will change the print still * more */ - private boolean startSymbolicCarry(char[] ca, int cLast, int cFirst) - { + private boolean startSymbolicCarry(char[] ca, int cLast, int cFirst) { boolean carry = true; - for (int i = cLast; carry && (i >= cFirst); i--) - { + for (int i = cLast; carry && (i >= cFirst); i--) { carry = false; - switch (ca[i]) - { + switch (ca[i]) { case '0': ca[i] = '1'; @@ -2781,47 +2459,35 @@ * converted double value. * @return the converted double value. */ - private String eFormatString(double x, char eChar) - { + private String eFormatString(double x, char eChar) { boolean noDigits = false; char[] ca4, ca5; - if (Double.isInfinite(x)) - { - if (x == Double.POSITIVE_INFINITY) - { - if (leadingSign) - { + if (Double.isInfinite(x)) { + if (x == Double.POSITIVE_INFINITY) { + if (leadingSign) { ca4 = "+Inf".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca4 = " Inf".toCharArray(); - } else - { + } else { ca4 = "Inf".toCharArray(); } - } else - { + } else { ca4 = "-Inf".toCharArray(); } noDigits = true; - } else if (Double.isNaN(x)) - { - if (leadingSign) - { + } else if (Double.isNaN(x)) { + if (leadingSign) { ca4 = "+NaN".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca4 = " NaN".toCharArray(); - } else - { + } else { ca4 = "NaN".toCharArray(); } noDigits = true; - } else - { + } else { ca4 = eFormatDigits(x, eChar); } @@ -2838,74 +2504,59 @@ * @param noDigits NaN or signed Inf * @return a padded array of characters */ - private char[] applyFloatPadding(char[] ca4, boolean noDigits) - { + private char[] applyFloatPadding(char[] ca4, boolean noDigits) { char[] ca5 = ca4; - if (fieldWidthSet) - { + if (fieldWidthSet) { int i, j, nBlanks; - if (leftJustify) - { + if (leftJustify) { nBlanks = fieldWidth - ca4.length; - if (nBlanks > 0) - { + if (nBlanks > 0) { ca5 = new char[ca4.length + nBlanks]; - for (i = 0; i < ca4.length; i++) - { + for (i = 0; i < ca4.length; i++) { ca5[i] = ca4[i]; } - for (j = 0; j < nBlanks; j++, i++) - { + for (j = 0; j < nBlanks; j++, i++) { ca5[i] = ' '; } } - } else if (!leadingZeros || noDigits) - { + } else if (!leadingZeros || noDigits) { nBlanks = fieldWidth - ca4.length; - if (nBlanks > 0) - { + if (nBlanks > 0) { ca5 = new char[ca4.length + nBlanks]; - for (i = 0; i < nBlanks; i++) - { + for (i = 0; i < nBlanks; i++) { ca5[i] = ' '; } - for (j = 0; j < ca4.length; i++, j++) - { + for (j = 0; j < ca4.length; i++, j++) { ca5[i] = ca4[j]; } } - } else if (leadingZeros) - { + } else if (leadingZeros) { nBlanks = fieldWidth - ca4.length; - if (nBlanks > 0) - { + if (nBlanks > 0) { ca5 = new char[ca4.length + nBlanks]; i = 0; j = 0; - if (ca4[0] == '-') - { + if (ca4[0] == '-') { ca5[0] = '-'; i++; j++; } - for (int k = 0; k < nBlanks; i++, k++) - { + for (int k = 0; k < nBlanks; i++, k++) { ca5[i] = '0'; } - for (; j < ca4.length; i++, j++) - { + for (; j < ca4.length; i++, j++) { ca5[i] = ca4[j]; } } @@ -2921,8 +2572,7 @@ * @param x the double to format. * @return the formatted String. */ - private String printFFormat(double x) - { + private String printFFormat(double x) { return fFormatString(x); } @@ -2933,13 +2583,10 @@ * @param x the double to format. * @return the formatted String. */ - private String printEFormat(double x) - { - if (conversionCharacter == 'e') - { + private String printEFormat(double x) { + if (conversionCharacter == 'e') { return eFormatString(x, 'e'); - } else - { + } else { return eFormatString(x, 'E'); } } @@ -2971,68 +2618,52 @@ * @param x the double to format. * @return the formatted String. */ - private String printGFormat(double x) - { + private String printGFormat(double x) { String sx, sy, sz, ret; int savePrecision = precision; int i; char[] ca4, ca5; boolean noDigits = false; - if (Double.isInfinite(x)) - { - if (x == Double.POSITIVE_INFINITY) - { - if (leadingSign) - { + if (Double.isInfinite(x)) { + if (x == Double.POSITIVE_INFINITY) { + if (leadingSign) { ca4 = "+Inf".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca4 = " Inf".toCharArray(); - } else - { + } else { ca4 = "Inf".toCharArray(); } - } else - { + } else { ca4 = "-Inf".toCharArray(); } noDigits = true; - } else if (Double.isNaN(x)) - { - if (leadingSign) - { + } else if (Double.isNaN(x)) { + if (leadingSign) { ca4 = "+NaN".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca4 = " NaN".toCharArray(); - } else - { + } else { ca4 = "NaN".toCharArray(); } noDigits = true; - } else - { - if (!precisionSet) - { + } else { + if (!precisionSet) { precision = defaultDigits; } - if (precision == 0) - { + if (precision == 0) { precision = 1; } int ePos = -1; - if (conversionCharacter == 'g') - { + if (conversionCharacter == 'g') { sx = eFormatString(x, 'e').trim(); ePos = sx.indexOf('e'); - } else - { + } else { sx = eFormatString(x, 'E').trim(); ePos = sx.indexOf('E'); } @@ -3041,37 +2672,28 @@ int expon = 0; - if (sx.charAt(i) == '-') - { - for (++i; i < sx.length(); i++) - { - if (sx.charAt(i) != '0') - { + if (sx.charAt(i) == '-') { + for (++i; i < sx.length(); i++) { + if (sx.charAt(i) != '0') { break; } } - if (i < sx.length()) - { + if (i < sx.length()) { expon = -Integer.parseInt(sx.substring(i)); } - } else - { - if (sx.charAt(i) == '+') - { + } else { + if (sx.charAt(i) == '+') { ++i; } - for (; i < sx.length(); i++) - { - if (sx.charAt(i) != '0') - { + for (; i < sx.length(); i++) { + if (sx.charAt(i) != '0') { break; } } - if (i < sx.length()) - { + if (i < sx.length()) { expon = Integer.parseInt(sx.substring(i)); } } @@ -3079,66 +2701,50 @@ // Trim trailing zeros. // If the radix character is not followed by // a digit, trim it, too. - if (!alternateForm) - { - if ((expon >= -4) && (expon < precision)) - { + if (!alternateForm) { + if ((expon >= -4) && (expon < precision)) { sy = fFormatString(x).trim(); - } else - { + } else { sy = sx.substring(0, ePos); } i = sy.length() - 1; - for (; i >= 0; i--) - { - if (sy.charAt(i) != '0') - { + for (; i >= 0; i--) { + if (sy.charAt(i) != '0') { break; } } - if ((i >= 0) && (sy.charAt(i) == '.')) - { + if ((i >= 0) && (sy.charAt(i) == '.')) { i--; } - if (i == -1) - { + if (i == -1) { sz = "0"; - } else if (!Character.isDigit(sy.charAt(i))) - { + } else if (!Character.isDigit(sy.charAt(i))) { sz = sy.substring(0, i + 1) + "0"; - } else - { + } else { sz = sy.substring(0, i + 1); } - if ((expon >= -4) && (expon < precision)) - { + if ((expon >= -4) && (expon < precision)) { ret = sz; - } else - { + } else { ret = sz + sx.substring(ePos); } - } else - { - if ((expon >= -4) && (expon < precision)) - { + } else { + if ((expon >= -4) && (expon < precision)) { ret = fFormatString(x).trim(); - } else - { + } else { ret = sx; } } // leading space was trimmed off during // construction - if (leadingSpace) - { - if (x >= 0) - { + if (leadingSpace) { + if (x >= 0) { ret = " " + ret; } } @@ -3180,8 +2786,7 @@ * @param x the short to format. * @return the formatted String. */ - private String printDFormat(short x) - { + private String printDFormat(short x) { return printDFormat(Short.toString(x)); } @@ -3212,8 +2817,7 @@ * @param x the long to format. * @return the formatted String. */ - private String printDFormat(long x) - { + private String printDFormat(long x) { return printDFormat(Long.toString(x)); } @@ -3244,8 +2848,7 @@ * @param x the int to format. * @return the formatted String. */ - private String printDFormat(int x) - { + private String printDFormat(int x) { return printDFormat(Integer.toString(x)); } @@ -3258,59 +2861,47 @@ * String. * @return the formatted String. */ - private String printDFormat(String sx) - { + private String printDFormat(String sx) { int nLeadingZeros = 0; int nBlanks = 0, - n = 0; + n = 0; int i = 0, - jFirst = 0; + jFirst = 0; boolean neg = sx.charAt(0) == '-'; - if (sx.equals("0") && precisionSet && (precision == 0)) - { + if (sx.equals("0") && precisionSet && (precision == 0)) { sx = ""; } - if (!neg) - { - if (precisionSet && (sx.length() < precision)) - { + if (!neg) { + if (precisionSet && (sx.length() < precision)) { nLeadingZeros = precision - sx.length(); } - } else - { - if (precisionSet && (sx.length() - 1) < precision) - { + } else { + if (precisionSet && (sx.length() - 1) < precision) { nLeadingZeros = precision - sx.length() + 1; } } - if (nLeadingZeros < 0) - { + if (nLeadingZeros < 0) { nLeadingZeros = 0; } - if (fieldWidthSet) - { + if (fieldWidthSet) { nBlanks = fieldWidth - nLeadingZeros - sx.length(); - if (!neg && (leadingSign || leadingSpace)) - { + if (!neg && (leadingSign || leadingSpace)) { nBlanks--; } } - if (nBlanks < 0) - { + if (nBlanks < 0) { nBlanks = 0; } - if (leadingSign) - { + if (leadingSign) { n++; - } else if (leadingSpace) - { + } else if (leadingSpace) { n++; } @@ -3320,90 +2911,70 @@ char[] ca = new char[n]; - if (leftJustify) - { - if (neg) - { + if (leftJustify) { + if (neg) { ca[i++] = '-'; - } else if (leadingSign) - { + } else if (leadingSign) { ca[i++] = '+'; - } else if (leadingSpace) - { + } else if (leadingSpace) { ca[i++] = ' '; } char[] csx = sx.toCharArray(); jFirst = neg - ? 1 - : 0; + ? 1 + : 0; - for (int j = 0; j < nLeadingZeros; i++, j++) - { + for (int j = 0; j < nLeadingZeros; i++, j++) { ca[i] = '0'; } - for (int j = jFirst; j < csx.length; j++, i++) - { + for (int j = jFirst; j < csx.length; j++, i++) { ca[i] = csx[j]; } - for (int j = 0; j < nBlanks; i++, j++) - { + for (int j = 0; j < nBlanks; i++, j++) { ca[i] = ' '; } - } else - { - if (!leadingZeros) - { - for (i = 0; i < nBlanks; i++) - { + } else { + if (!leadingZeros) { + for (i = 0; i < nBlanks; i++) { ca[i] = ' '; } - if (neg) - { + if (neg) { ca[i++] = '-'; - } else if (leadingSign) - { + } else if (leadingSign) { ca[i++] = '+'; - } else if (leadingSpace) - { + } else if (leadingSpace) { ca[i++] = ' '; } - } else - { - if (neg) - { + } else { + if (neg) { ca[i++] = '-'; - } else if (leadingSign) - { + } else if (leadingSign) { ca[i++] = '+'; - } else if (leadingSpace) - { + } else if (leadingSpace) { ca[i++] = ' '; } - for (int j = 0; j < nBlanks; j++, i++) - { + for (int j = 0; j < nBlanks; j++, i++) { ca[i] = '0'; } } - for (int j = 0; j < nLeadingZeros; j++, i++) - { + for (int j = 0; j < nLeadingZeros; j++, i++) { ca[i] = '0'; } char[] csx = sx.toCharArray(); jFirst = neg - ? 1 - : 0; + ? 1 + : 0; - for (int j = jFirst; j < csx.length; j++, i++) - { + for (int j = jFirst; j < csx.length; j++, i++) { ca[i] = csx[j]; } } @@ -3432,32 +3003,25 @@ * @param x the short to format. * @return the formatted String. */ - private String printXFormat(short x) - { + private String printXFormat(short x) { String sx = null; - if (x == Short.MIN_VALUE) - { + if (x == Short.MIN_VALUE) { sx = "8000"; - } else if (x < 0) - { + } else if (x < 0) { String t; - if (x == Short.MIN_VALUE) - { + if (x == Short.MIN_VALUE) { t = "0"; - } else - { + } else { t = Integer.toString((~(-x - 1)) ^ Short.MIN_VALUE, 16); - if ((t.charAt(0) == 'F') || (t.charAt(0) == 'f')) - { + if ((t.charAt(0) == 'F') || (t.charAt(0) == 'f')) { t = t.substring(16, 32); } } - switch (t.length()) - { + switch (t.length()) { case 1: sx = "800" + t; @@ -3474,8 +3038,7 @@ break; case 4: - switch (t.charAt(0)) - { + switch (t.charAt(0)) { case '1': sx = "9" + t.substring(1, 4); @@ -3514,8 +3077,7 @@ break; } - } else - { + } else { sx = Integer.toString((int) x, 16); } @@ -3543,19 +3105,15 @@ * @param x the long to format. * @return the formatted String. */ - private String printXFormat(long x) - { + private String printXFormat(long x) { String sx = null; - if (x == Long.MIN_VALUE) - { + if (x == Long.MIN_VALUE) { sx = "8000000000000000"; - } else if (x < 0) - { + } else if (x < 0) { String t = Long.toString((~(-x - 1)) ^ Long.MIN_VALUE, 16); - switch (t.length()) - { + switch (t.length()) { case 1: sx = "800000000000000" + t; @@ -3632,8 +3190,7 @@ break; case 16: - switch (t.charAt(0)) - { + switch (t.charAt(0)) { case '1': sx = "9" + t.substring(1, 16); @@ -3672,8 +3229,7 @@ break; } - } else - { + } else { sx = Long.toString(x, 16); } @@ -3701,19 +3257,15 @@ * @param x the int to format. * @return the formatted String. */ - private String printXFormat(int x) - { + private String printXFormat(int x) { String sx = null; - if (x == Integer.MIN_VALUE) - { + if (x == Integer.MIN_VALUE) { sx = "80000000"; - } else if (x < 0) - { + } else if (x < 0) { String t = Integer.toString((~(-x - 1)) ^ Integer.MIN_VALUE, 16); - switch (t.length()) - { + switch (t.length()) { case 1: sx = "8000000" + t; @@ -3750,8 +3302,7 @@ break; case 8: - switch (t.charAt(0)) - { + switch (t.charAt(0)) { case '1': sx = "9" + t.substring(1, 8); @@ -3790,8 +3341,7 @@ break; } - } else - { + } else { sx = Integer.toString(x, 16); } @@ -3807,45 +3357,37 @@ * String. * @return the formatted String. */ - private String printXFormat(String sx) - { + private String printXFormat(String sx) { int nLeadingZeros = 0; int nBlanks = 0; - if (sx.equals("0") && precisionSet && (precision == 0)) - { + if (sx.equals("0") && precisionSet && (precision == 0)) { sx = ""; } - if (precisionSet) - { + if (precisionSet) { nLeadingZeros = precision - sx.length(); } - if (nLeadingZeros < 0) - { + if (nLeadingZeros < 0) { nLeadingZeros = 0; } - if (fieldWidthSet) - { + if (fieldWidthSet) { nBlanks = fieldWidth - nLeadingZeros - sx.length(); - if (alternateForm) - { + if (alternateForm) { nBlanks = nBlanks - 2; } } - if (nBlanks < 0) - { + if (nBlanks < 0) { nBlanks = 0; } int n = 0; - if (alternateForm) - { + if (alternateForm) { n += 2; } @@ -3856,71 +3398,57 @@ char[] ca = new char[n]; int i = 0; - if (leftJustify) - { - if (alternateForm) - { + if (leftJustify) { + if (alternateForm) { ca[i++] = '0'; ca[i++] = 'x'; } - for (int j = 0; j < nLeadingZeros; j++, i++) - { + for (int j = 0; j < nLeadingZeros; j++, i++) { ca[i] = '0'; } char[] csx = sx.toCharArray(); - for (int j = 0; j < csx.length; j++, i++) - { + for (int j = 0; j < csx.length; j++, i++) { ca[i] = csx[j]; } - for (int j = 0; j < nBlanks; j++, i++) - { + for (int j = 0; j < nBlanks; j++, i++) { ca[i] = ' '; } - } else - { - if (!leadingZeros) - { - for (int j = 0; j < nBlanks; j++, i++) - { + } else { + if (!leadingZeros) { + for (int j = 0; j < nBlanks; j++, i++) { ca[i] = ' '; } } - if (alternateForm) - { + if (alternateForm) { ca[i++] = '0'; ca[i++] = 'x'; } - if (leadingZeros) - { - for (int j = 0; j < nBlanks; j++, i++) - { + if (leadingZeros) { + for (int j = 0; j < nBlanks; j++, i++) { ca[i] = '0'; } } - for (int j = 0; j < nLeadingZeros; j++, i++) - { + for (int j = 0; j < nLeadingZeros; j++, i++) { ca[i] = '0'; } char[] csx = sx.toCharArray(); - for (int j = 0; j < csx.length; j++, i++) - { + for (int j = 0; j < csx.length; j++, i++) { ca[i] = csx[j]; } } String caReturn = new String(ca); - if (conversionCharacter == 'X') - { + if (conversionCharacter == 'X') { caReturn = caReturn.toUpperCase(); } @@ -3949,19 +3477,15 @@ * @param x the short to format. * @return the formatted String. */ - private String printOFormat(short x) - { + private String printOFormat(short x) { String sx = null; - if (x == Short.MIN_VALUE) - { + if (x == Short.MIN_VALUE) { sx = "100000"; - } else if (x < 0) - { + } else if (x < 0) { String t = Integer.toString((~(-x - 1)) ^ Short.MIN_VALUE, 8); - switch (t.length()) - { + switch (t.length()) { case 1: sx = "10000" + t; @@ -3987,8 +3511,7 @@ break; } - } else - { + } else { sx = Integer.toString((int) x, 8); } @@ -4017,19 +3540,15 @@ * @param x the long to format. * @return the formatted String. */ - private String printOFormat(long x) - { + private String printOFormat(long x) { String sx = null; - if (x == Long.MIN_VALUE) - { + if (x == Long.MIN_VALUE) { sx = "1000000000000000000000"; - } else if (x < 0) - { + } else if (x < 0) { String t = Long.toString((~(-x - 1)) ^ Long.MIN_VALUE, 8); - switch (t.length()) - { + switch (t.length()) { case 1: sx = "100000000000000000000" + t; @@ -4135,8 +3654,7 @@ break; } - } else - { + } else { sx = Long.toString(x, 8); } @@ -4165,19 +3683,15 @@ * @param x the int to format. * @return the formatted String. */ - private String printOFormat(int x) - { + private String printOFormat(int x) { String sx = null; - if (x == Integer.MIN_VALUE) - { + if (x == Integer.MIN_VALUE) { sx = "20000000000"; - } else if (x < 0) - { + } else if (x < 0) { String t = Integer.toString((~(-x - 1)) ^ Integer.MIN_VALUE, 8); - switch (t.length()) - { + switch (t.length()) { case 1: sx = "2000000000" + t; @@ -4233,8 +3747,7 @@ break; } - } else - { + } else { sx = Integer.toString(x, 8); } @@ -4250,38 +3763,31 @@ * String. * @return the formatted String. */ - private String printOFormat(String sx) - { + private String printOFormat(String sx) { int nLeadingZeros = 0; int nBlanks = 0; - if (sx.equals("0") && precisionSet && (precision == 0)) - { + if (sx.equals("0") && precisionSet && (precision == 0)) { sx = ""; } - if (precisionSet) - { + if (precisionSet) { nLeadingZeros = precision - sx.length(); } - if (alternateForm) - { + if (alternateForm) { nLeadingZeros++; } - if (nLeadingZeros < 0) - { + if (nLeadingZeros < 0) { nLeadingZeros = 0; } - if (fieldWidthSet) - { + if (fieldWidthSet) { nBlanks = fieldWidth - nLeadingZeros - sx.length(); } - if (nBlanks < 0) - { + if (nBlanks < 0) { nBlanks = 0; } @@ -4289,49 +3795,38 @@ char[] ca = new char[n]; int i; - if (leftJustify) - { - for (i = 0; i < nLeadingZeros; i++) - { + if (leftJustify) { + for (i = 0; i < nLeadingZeros; i++) { ca[i] = '0'; } char[] csx = sx.toCharArray(); - for (int j = 0; j < csx.length; j++, i++) - { + for (int j = 0; j < csx.length; j++, i++) { ca[i] = csx[j]; } - for (int j = 0; j < nBlanks; j++, i++) - { + for (int j = 0; j < nBlanks; j++, i++) { ca[i] = ' '; } - } else - { - if (leadingZeros) - { - for (i = 0; i < nBlanks; i++) - { + } else { + if (leadingZeros) { + for (i = 0; i < nBlanks; i++) { ca[i] = '0'; } - } else - { - for (i = 0; i < nBlanks; i++) - { + } else { + for (i = 0; i < nBlanks; i++) { ca[i] = ' '; } } - for (int j = 0; j < nLeadingZeros; j++, i++) - { + for (int j = 0; j < nLeadingZeros; j++, i++) { ca[i] = '0'; } char[] csx = sx.toCharArray(); - for (int j = 0; j < csx.length; j++, i++) - { + for (int j = 0; j < csx.length; j++, i++) { ca[i] = csx[j]; } } @@ -4357,31 +3852,25 @@ * @param x the char to format. * @return the formatted String. */ - private String printCFormat(char x) - { + private String printCFormat(char x) { int nPrint = 1; int width = fieldWidth; - if (!fieldWidthSet) - { + if (!fieldWidthSet) { width = nPrint; } char[] ca = new char[width]; int i = 0; - if (leftJustify) - { + if (leftJustify) { ca[0] = x; - for (i = 1; i <= width - nPrint; i++) - { + for (i = 1; i <= width - nPrint; i++) { ca[i] = ' '; } - } else - { - for (i = 0; i < width - nPrint; i++) - { + } else { + for (i = 0; i < width - nPrint; i++) { ca[i] = ' '; } @@ -4415,84 +3904,66 @@ * @param x the String to format. * @return the formatted String. */ - private String printSFormat(String x) - { + private String printSFormat(String x) { int nPrint = x.length(); int width = fieldWidth; - if (precisionSet && (nPrint > precision)) - { + if (precisionSet && (nPrint > precision)) { nPrint = precision; } - if (!fieldWidthSet) - { + if (!fieldWidthSet) { width = nPrint; } int n = 0; - if (width > nPrint) - { + if (width > nPrint) { n += width - nPrint; } - if (nPrint >= x.length()) - { + if (nPrint >= x.length()) { n += x.length(); - } else - { + } else { n += nPrint; } char[] ca = new char[n]; int i = 0; - if (leftJustify) - { - if (nPrint >= x.length()) - { + if (leftJustify) { + if (nPrint >= x.length()) { char[] csx = x.toCharArray(); - for (i = 0; i < x.length(); i++) - { + for (i = 0; i < x.length(); i++) { ca[i] = csx[i]; } - } else - { + } else { char[] csx = x.substring(0, nPrint).toCharArray(); - for (i = 0; i < nPrint; i++) - { + for (i = 0; i < nPrint; i++) { ca[i] = csx[i]; } } - for (int j = 0; j < width - nPrint; j++, i++) - { + for (int j = 0; j < width - nPrint; j++, i++) { ca[i] = ' '; } - } else - { - for (i = 0; i < width - nPrint; i++) - { + } else { + for (i = 0; i < width - nPrint; i++) { ca[i] = ' '; } - if (nPrint >= x.length()) - { + if (nPrint >= x.length()) { char[] csx = x.toCharArray(); - for (int j = 0; j < x.length(); i++, j++) - { + for (int j = 0; j < x.length(); i++, j++) { ca[i] = csx[j]; } - } else - { + } else { char[] csx = x.substring(0, nPrint).toCharArray(); - for (int j = 0; j < nPrint; i++, j++) - { + for (int j = 0; j < nPrint; i++, j++) { ca[i] = csx[j]; } } @@ -4509,20 +3980,17 @@ * character is there, and * <code>false</code> otherwise. */ - private boolean setConversionCharacter() - { + private boolean setConversionCharacter() { /* idfgGoxXeEcs */ boolean ret = false; conversionCharacter = '\0'; - if (pos < fmt.length()) - { + if (pos < fmt.length()) { char c = fmt.charAt(pos); if ((c == 'i') || (c == 'd') || (c == 'f') || (c == 'g') || (c == 'G') || (c == 'o') || (c == 'x') || (c == 'X') - || (c == 'e') || (c == 'E') || (c == 'c') || (c == 's') || (c == '%')) - { + || (c == 'e') || (c == 'E') || (c == 'c') || (c == 's') || (c == '%')) { conversionCharacter = c; pos++; ret = true; @@ -4541,26 +4009,21 @@ * respectively, before formatting. If any of * these is present, store them. */ - private void setOptionalHL() - { + private void setOptionalHL() { optionalh = false; optionall = false; optionalL = false; - if (pos < fmt.length()) - { + if (pos < fmt.length()) { char c = fmt.charAt(pos); - if (c == 'h') - { + if (c == 'h') { optionalh = true; pos++; - } else if (c == 'l') - { + } else if (c == 'l') { optionall = true; pos++; - } else if (c == 'L') - { + } else if (c == 'L') { optionalL = true; pos++; } @@ -4570,44 +4033,35 @@ /** * Set the precision. */ - private void setPrecision() - { + private void setPrecision() { int firstPos = pos; precisionSet = false; - if ((pos < fmt.length()) && (fmt.charAt(pos) == '.')) - { + if ((pos < fmt.length()) && (fmt.charAt(pos) == '.')) { pos++; - if ((pos < fmt.length()) && (fmt.charAt(pos) == '*')) - { + if ((pos < fmt.length()) && (fmt.charAt(pos) == '*')) { pos++; - if (!setPrecisionArgPosition()) - { + if (!setPrecisionArgPosition()) { variablePrecision = true; precisionSet = true; } return; - } else - { - while (pos < fmt.length()) - { + } else { + while (pos < fmt.length()) { char c = fmt.charAt(pos); - if (Character.isDigit(c)) - { + if (Character.isDigit(c)) { pos++; - } else - { + } else { break; } } - if (pos > firstPos + 1) - { + if (pos > firstPos + 1) { String sz = fmt.substring(firstPos + 1, pos); precision = Integer.parseInt(sz); @@ -4620,39 +4074,31 @@ /** * Set the field width. */ - private void setFieldWidth() - { + private void setFieldWidth() { int firstPos = pos; fieldWidth = 0; fieldWidthSet = false; - if ((pos < fmt.length()) && (fmt.charAt(pos) == '*')) - { + if ((pos < fmt.length()) && (fmt.charAt(pos) == '*')) { pos++; - if (!setFieldWidthArgPosition()) - { + if (!setFieldWidthArgPosition()) { variableFieldWidth = true; fieldWidthSet = true; } - } else - { - while (pos < fmt.length()) - { + } else { + while (pos < fmt.length()) { char c = fmt.charAt(pos); - if (Character.isDigit(c)) - { + if (Character.isDigit(c)) { pos++; - } else - { + } else { break; } } - if ((firstPos < pos) && (firstPos < fmt.length())) - { + if ((firstPos < pos) && (firstPos < fmt.length())) { String sz = fmt.substring(firstPos, pos); fieldWidth = Integer.parseInt(sz); @@ -4664,22 +4110,17 @@ /** * Store the digits <code>n</code> in %n$ forms. */ - private void setArgPosition() - { + private void setArgPosition() { int xPos; - for (xPos = pos; xPos < fmt.length(); xPos++) - { - if (!Character.isDigit(fmt.charAt(xPos))) - { + for (xPos = pos; xPos < fmt.length(); xPos++) { + if (!Character.isDigit(fmt.charAt(xPos))) { break; } } - if ((xPos > pos) && (xPos < fmt.length())) - { - if (fmt.charAt(xPos) == '$') - { + if ((xPos > pos) && (xPos < fmt.length())) { + if (fmt.charAt(xPos) == '$') { positionalSpecification = true; argumentPosition = Integer.parseInt(fmt.substring(pos, xPos)); pos = xPos + 1; @@ -4690,23 +4131,18 @@ /** * Store the digits <code>n</code> in *n$ forms. */ - private boolean setFieldWidthArgPosition() - { + private boolean setFieldWidthArgPosition() { boolean ret = false; int xPos; - for (xPos = pos; xPos < fmt.length(); xPos++) - { - if (!Character.isDigit(fmt.charAt(xPos))) - { + for (xPos = pos; xPos < fmt.length(); xPos++) { + if (!Character.isDigit(fmt.charAt(xPos))) { break; } } - if ((xPos > pos) && (xPos < fmt.length())) - { - if (fmt.charAt(xPos) == '$') - { + if ((xPos > pos) && (xPos < fmt.length())) { + if (fmt.charAt(xPos) == '$') { positionalFieldWidth = true; argumentPositionForFieldWidth = Integer.parseInt(fmt.substring(pos, xPos)); pos = xPos + 1; @@ -4720,23 +4156,18 @@ /** * Store the digits <code>n</code> in *n$ forms. */ - private boolean setPrecisionArgPosition() - { + private boolean setPrecisionArgPosition() { boolean ret = false; int xPos; - for (xPos = pos; xPos < fmt.length(); xPos++) - { - if (!Character.isDigit(fmt.charAt(xPos))) - { + for (xPos = pos; xPos < fmt.length(); xPos++) { + if (!Character.isDigit(fmt.charAt(xPos))) { break; } } - if ((xPos > pos) && (xPos < fmt.length())) - { - if (fmt.charAt(xPos) == '$') - { + if ((xPos > pos) && (xPos < fmt.length())) { + if (fmt.charAt(xPos) == '$') { positionalPrecision = true; argumentPositionForPrecision = Integer.parseInt(fmt.substring(pos, xPos)); pos = xPos + 1; @@ -4747,41 +4178,34 @@ return ret; } - boolean isPositionalSpecification() - { + boolean isPositionalSpecification() { return positionalSpecification; } - int getArgumentPosition() - { + int getArgumentPosition() { return argumentPosition; } - boolean isPositionalFieldWidth() - { + boolean isPositionalFieldWidth() { return positionalFieldWidth; } - int getArgumentPositionForFieldWidth() - { + int getArgumentPositionForFieldWidth() { return argumentPositionForFieldWidth; } - boolean isPositionalPrecision() - { + boolean isPositionalPrecision() { return positionalPrecision; } - int getArgumentPositionForPrecision() - { + int getArgumentPositionForPrecision() { return argumentPositionForPrecision; } /** * Set flag characters, one of '-+#0 or a space. */ - private void setFlagCharacters() - { + private void setFlagCharacters() { /* '-+ #0 */ thousands = false; leftJustify = false; @@ -4790,38 +4214,28 @@ alternateForm = false; leadingZeros = false; - for (; pos < fmt.length(); pos++) - { + for (; pos < fmt.length(); pos++) { char c = fmt.charAt(pos); - if (c == '\'') - { + if (c == '\'') { thousands = true; - } else if (c == '-') - { + } else if (c == '-') { leftJustify = true; leadingZeros = false; - } else if (c == '+') - { + } else if (c == '+') { leadingSign = true; leadingSpace = false; - } else if (c == ' ') - { - if (!leadingSign) - { + } else if (c == ' ') { + if (!leadingSign) { leadingSpace = true; } - } else if (c == '#') - { + } else if (c == '#') { alternateForm = true; - } else if (c == '0') - { - if (!leftJustify) - { + } else if (c == '0') { + if (!leftJustify) { leadingZeros = true; } - } else - { + } else { break; } } diff --git a/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7OracleReaderTest.java b/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7OracleReaderTest.java index f01a630..b792260 100644 --- a/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7OracleReaderTest.java +++ b/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7OracleReaderTest.java @@ -17,19 +17,15 @@ * Dgn7OracleReaderTest * User: Ulysses * Date: 2007/10/24 - * Time: �W�� 10:49:54 */ -public class Dgn7OracleReaderTest -{ +public class Dgn7OracleReaderTest { @BeforeTest - public void setUp() - { + public void setUp() { } - @Test - public void testOracleReader() throws SQLException, IOException - { + // @Test + public void testOracleReader() throws SQLException, IOException { OracleConnection connection = OracleTarget.getInstance().getOracleConnection(); // String fetchSrcStmtFmt = "SELECT IGDSELM FROM \"%s\".\"%s\" ORDER BY ROWID"; String fetchSrcStmtFmt = "SELECT IGDSELM FROM \"%s\".\"%s\" WHERE TAG_SFSC=106 ORDER BY ROWID"; @@ -40,21 +36,17 @@ Dgn7OracleReader reader = new Dgn7OracleReader(fetchSrcStmt, "IGDSELM", connection); int count = 0; - while (reader.hasNext()) - { + while (reader.hasNext()) { Element element = reader.next(); - if (element instanceof ComplexChainElement) - { + if (element instanceof ComplexChainElement) { ComplexChainElement complexChain = (ComplexChainElement) element; FrammeAttributeData frammeLinkage = null; List<UserAttributeData> attrs = complexChain.getUserAttributeData(); - for (int k = 0; k < attrs.size(); k++) - { + for (int k = 0; k < attrs.size(); k++) { UserAttributeData userAttr = attrs.get(k); - if (userAttr instanceof FrammeAttributeData) - { + if (userAttr instanceof FrammeAttributeData) { frammeLinkage = (FrammeAttributeData) userAttr; break; } @@ -63,16 +55,14 @@ System.out.print("complexChain:"); if (frammeLinkage != null) System.out.print(":FSC-" + frammeLinkage.getFsc() + - ":UFID-" + frammeLinkage.getUfid() + - ":COMP-" + frammeLinkage.getComponentID()); + ":UFID-" + frammeLinkage.getUfid() + + ":COMP-" + frammeLinkage.getComponentID()); else System.out.print("Linkage is null"); - for (int i = 0; i < complexChain.size(); i++) - { + for (int i = 0; i < complexChain.size(); i++) { Element elm = (Element) complexChain.get(i); - if (elm instanceof LineStringElement) - { + if (elm instanceof LineStringElement) { LineStringElement lineStringElement = (LineStringElement) elm; int size = lineStringElement.getVerticeSize(); System.out.print("size=" + size + ":"); @@ -83,18 +73,15 @@ } System.out.println(); - } else if (element instanceof TextNodeElement) - { + } else if (element instanceof TextNodeElement) { TextNodeElement textNode = (TextNodeElement) element; FrammeAttributeData frammeLinkage = null; List<UserAttributeData> attrs = textNode.getUserAttributeData(); - for (int k = 0; k < attrs.size(); k++) - { + for (int k = 0; k < attrs.size(); k++) { UserAttributeData userAttr = attrs.get(k); - if (userAttr instanceof FrammeAttributeData) - { + if (userAttr instanceof FrammeAttributeData) { frammeLinkage = (FrammeAttributeData) userAttr; break; } @@ -104,15 +91,13 @@ System.out.print("TextNode:origin=" + coord.toString()); if (frammeLinkage != null) System.out.print(":FSC-" + frammeLinkage.getFsc() + - ":UFID-" + frammeLinkage.getUfid() + - ":COMP-" + frammeLinkage.getComponentID()); + ":UFID-" + frammeLinkage.getUfid() + + ":COMP-" + frammeLinkage.getComponentID()); else System.out.print("Linkage is null"); - for (int i = 0; i < textNode.size(); i++) - { + for (int i = 0; i < textNode.size(); i++) { Element elm = (Element) textNode.get(i); - if (elm instanceof TextElement) - { + if (elm instanceof TextElement) { TextElement textElm = (TextElement) elm; System.out.print("---"); String text = textElm.getText(); diff --git a/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7TextElementReaderTest.java b/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7TextElementReaderTest.java index 301255e..54d8808 100644 --- a/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7TextElementReaderTest.java +++ b/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7TextElementReaderTest.java @@ -17,10 +17,8 @@ * Dgn7TextElementReaderTest * User: Ulysses * Date: 2008/1/10 - * Time: �W�� 12:19:14 */ -public class Dgn7TextElementReaderTest -{ +public class Dgn7TextElementReaderTest { private final static Logger logger = Logger.getLogger(Dgn7fileReaderTest.class); private final static String testFilePathCreated = "demo.dgn"; @@ -30,16 +28,13 @@ private FileInputStream _fs; @BeforeTest - public void setUp() throws FileNotFoundException - { + public void setUp() throws FileNotFoundException { } @Test - public void testRead() throws Dgn7fileException, IOException - { + public void testRead() throws Dgn7fileException, IOException { File dataFile = TestData.file(this, testFilePathCreated); - if (dataFile.exists()) - { + if (dataFile.exists()) { System.out.println("Output--" + testFilePathCreated); _fs = new FileInputStream(dataFile); FileChannel fc = _fs.getChannel(); @@ -49,8 +44,7 @@ } dataFile = TestData.file(this, testFilePathExist); - if (dataFile.exists()) - { + if (dataFile.exists()) { System.out.println("Output--" + testFilePathExist); _fs = new FileInputStream(dataFile); FileChannel fc = _fs.getChannel(); @@ -60,8 +54,7 @@ } dataFile = TestData.file(this, testFilePathPostComplete); - if (dataFile.exists()) - { + if (dataFile.exists()) { System.out.println("Output--" + testFilePathPostComplete); _fs = new FileInputStream(dataFile); FileChannel fc = _fs.getChannel(); @@ -71,97 +64,76 @@ } } - public void dumpElements(FileChannel fc) throws Dgn7fileException, IOException - { + public void dumpElements(FileChannel fc) throws Dgn7fileException, IOException { Dgn7fileReader reader = new Dgn7fileReader(fc, new Lock()); int count = 0; Element lastComplex = null; - while (reader.hasNext()) - { - Dgn7fileReader.Record record = reader.nextElement(); - if (record.element() != null) - { + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { Element element = (Element) record.element(); ElementType type = element.getElementType(); - if ((!type.isComplexElement()) && (!element.isComponentElement())) - { - if (lastComplex != null) - { + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { // @todo add process in here lastComplex = null; } // @todo add process in here - } else if (element.isComponentElement()) - { - if (lastComplex != null) - { + } else if (element.isComponentElement()) { + if (lastComplex != null) { ((ComplexElement) lastComplex).add(element); } - } else if (type.isComplexElement()) - { - if (lastComplex == null) - { + } else if (type.isComplexElement()) { + if (lastComplex == null) { lastComplex = element; - } else - { + } else { // @todo add process in here lastComplex = element; } } - if (element.getElementType().isComplexElement()) - { - if (element instanceof ComplexChainElement) - { + if (element.getElementType().isComplexElement()) { + if (element instanceof ComplexChainElement) { ComplexChainElement complexChain = (ComplexChainElement) element; int size = complexChain.size(); - for (Object aComplexChain : complexChain) - { + for (Object aComplexChain : complexChain) { Element subElement = (Element) aComplexChain; subElement.getType(); } } - if (element instanceof ComplexShapeElement) - { + if (element instanceof ComplexShapeElement) { ComplexShapeElement complexShape = (ComplexShapeElement) element; } - if (element instanceof TextNodeElement) - { + if (element instanceof TextNodeElement) { TextNodeElement textNode = (TextNodeElement) element; int size = textNode.size(); - for (int i = 0; i < size; i++) - { + for (int i = 0; i < size; i++) { Element subElement = (Element) textNode.get(i); subElement.getElementType(); } } - } else - { + } else { boolean hasLinkage = false; - if (element instanceof TextElement) - { + if (element instanceof TextElement) { TextElement textElm = (TextElement) element; List<UserAttributeData> usrData = textElm.getUserAttributeData(); Iterator<UserAttributeData> it = usrData.iterator(); - while (it.hasNext()) - { + while (it.hasNext()) { UserAttributeData attr = it.next(); - if (attr instanceof FrammeAttributeData) - { + if (attr instanceof FrammeAttributeData) { hasLinkage = true; System.out.println("------------------------------------------"); System.out.println("FSC=" + ((FrammeAttributeData) attr).getFsc() + ":" + - ((FrammeAttributeData) attr).getUfid()); + ((FrammeAttributeData) attr).getUfid()); } } - if (hasLinkage) - { + if (hasLinkage) { System.out.println("Text.Font=" + textElm.getFontIndex()); System.out.println("Text.Just=" + textElm.getJustification()); System.out.println("usrData.len=" + usrData.size()); @@ -175,6 +147,6 @@ count++; } - logger.info("ElementRecord Count=" + count); + logger.info("FileRecord Count=" + count); } } diff --git a/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7fileReaderTest.java b/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7fileReaderTest.java index 40b6d1f..8f227ad 100644 --- a/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7fileReaderTest.java +++ b/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7fileReaderTest.java @@ -14,11 +14,10 @@ * Dgn7fileReaderTest * User: Ulysses * Date: 2007/10/24 - * Time: �W�� 01:43:41 + * Time: �W�� 01:43:41 * To change this template use File | Settings | File Templates. */ -public class Dgn7fileReaderTest -{ +public class Dgn7fileReaderTest { private final static Logger logger = Logger.getLogger(Dgn7fileReaderTest.class); // private final static String testFilePath = "test-data\\testHV.dgn"; @@ -26,11 +25,9 @@ private FileInputStream _fs; @BeforeTest - public void setUp() throws IOException - { + public void setUp() throws IOException { File dataFile = TestData.file(this, testFilePath); - if (!dataFile.exists()) - { + if (!dataFile.exists()) { return; } @@ -38,72 +35,56 @@ } @Test - public void testRead() throws Dgn7fileException, IOException - { + public void testRead() throws Dgn7fileException, IOException { if (_fs == null) return; FileChannel fc = _fs.getChannel(); Dgn7fileReader reader = new Dgn7fileReader(fc, new Lock()); int count = 0; Element lastComplex = null; - while (reader.hasNext()) - { - Dgn7fileReader.Record record = reader.nextElement(); - if (record.element() != null) - { + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { Element element = (Element) record.element(); ElementType type = element.getElementType(); - if ((!type.isComplexElement()) && (!element.isComponentElement())) - { - if (lastComplex != null) - { + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { // @todo add process in here lastComplex = null; } // @todo add process in here - } else if (element.isComponentElement()) - { - if (lastComplex != null) - { + } else if (element.isComponentElement()) { + if (lastComplex != null) { ((ComplexElement) lastComplex).add(element); } - } else if (type.isComplexElement()) - { - if (lastComplex == null) - { + } else if (type.isComplexElement()) { + if (lastComplex == null) { lastComplex = element; - } else - { + } else { // @todo add process in here lastComplex = element; } } - if (element.getElementType().isComplexElement()) - { - if (element instanceof ComplexChainElement) - { + if (element.getElementType().isComplexElement()) { + if (element instanceof ComplexChainElement) { ComplexChainElement complexChain = (ComplexChainElement) element; int size = complexChain.size(); - for (Object aComplexChain : complexChain) - { + for (Object aComplexChain : complexChain) { Element subElement = (Element) aComplexChain; subElement.getType(); } } - if (element instanceof ComplexShapeElement) - { + if (element instanceof ComplexShapeElement) { ComplexShapeElement complexShape = (ComplexShapeElement) element; } - if (element instanceof TextNodeElement) - { + if (element instanceof TextNodeElement) { TextNodeElement textNode = (TextNodeElement) element; int size = textNode.size(); - for (int i = 0; i < size; i++) - { + for (int i = 0; i < size; i++) { Element subElement = (Element) textNode.get(i); subElement.getElementType(); } @@ -113,6 +94,6 @@ count++; } - logger.info("ElementRecord Count=" + count); + logger.info("FileRecord Count=" + count); } } diff --git a/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7fileWriterTest.java b/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7fileWriterTest.java new file mode 100644 index 0000000..2d87990 --- /dev/null +++ b/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/Dgn7fileWriterTest.java @@ -0,0 +1,100 @@ +package com.ximple.io.dgn7; + +import org.apache.commons.io.FileUtils; +import org.apache.log4j.Logger; +import org.geotools.TestData; +import org.testng.Assert; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.nio.channels.FileChannel; + +public class Dgn7fileWriterTest { + private final static Logger logger = Logger.getLogger(Dgn7fileReaderTest.class); + + // private final static String testFilePath = "test-data\\testHV.dgn"; + private final static String testFilePath = "testHV.dgn"; + private FileInputStream _fs; + + @BeforeTest + public void setUp() throws IOException { + File dataFile = TestData.file(this, testFilePath); + if (!dataFile.exists()) { + return; + } + + _fs = new FileInputStream(dataFile); + } + + @Test + public void testWrite() { + } + + @Test + public void testCopy() throws Dgn7fileException, IOException { + File target = TestData.temp(this, "testdgn2d.dgn"); + FileUtils.copyFile(TestData.file(this, "dgnseed2d.dgn"), target); + RandomAccessFile targetStream = new RandomAccessFile(target, "rw"); + FileChannel fctarget = targetStream.getChannel(); + Lock lock = new Lock(); + + Dgn7fileReader targetReader = new Dgn7fileReader(fctarget, new Lock()); + while (targetReader.hasNext()) { + targetReader.nextElement(); + } + + Dgn7fileWriter writer = new Dgn7fileWriter(fctarget, lock); + + FileChannel fc = _fs.getChannel(); + Dgn7fileReader reader = new Dgn7fileReader(fc, new Lock()); + int count = 0; + Element lastComplex = null; + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { + Element element = (Element) record.element(); + ElementType type = element.getElementType(); + boolean completed = false; + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { + // @todo add process in here + processCompleteElement(lastComplex, writer); + lastComplex = null; + } + + // @todo add process in here + processCompleteElement(element, writer); + } else if (element.isComponentElement()) { + if (lastComplex != null) { + ((ComplexElement) lastComplex).add(element); + } else { + logger.warn("wong." + element.toString()); + Assert.fail("Component Element cannot found parent."); + } + } else if (type.isComplexElement()) { + if (lastComplex != null) { + // @todo add process in here + processCompleteElement(lastComplex, writer); + } + lastComplex = element; + } + // writer.writeElement(element); + } + count++; + } + writer.writeEOF(); + writer.close(); + + // FileUtils.copyFile(target, new File("G://target.dgn")); + } + + private boolean processCompleteElement(Element element, Dgn7fileWriter writer) throws IOException { + writer.writeElement(element); + return true; + } +} diff --git a/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/ElementFactoryTest.java b/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/ElementFactoryTest.java new file mode 100644 index 0000000..eaa5d73 --- /dev/null +++ b/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/ElementFactoryTest.java @@ -0,0 +1,177 @@ +package com.ximple.io.dgn7; + +import com.vividsolutions.jts.geom.CoordinateList; +import com.vividsolutions.jts.geom.GeometryFactory; +import com.vividsolutions.jts.geom.LineString; +import com.vividsolutions.jts.geom.MultiLineString; +import org.apache.commons.io.FileUtils; +import org.apache.log4j.Logger; +import org.geotools.TestData; +import org.testng.Assert; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.nio.channels.FileChannel; + +/** + * Created by IntelliJ IDEA. + * User: Ulysses + * Date: 2010/4/21 + */ +public class ElementFactoryTest { + private final static Logger logger = Logger.getLogger(Dgn7fileReaderTest.class); + + // private final static String testFilePath = "test-data\\testHV.dgn"; + private final static String testFilePath = "testHV.dgn"; + + private static GeometryFactory factory = new GeometryFactory(); + + private FileInputStream _fs; + private LineStringElement _testLineString = null; + private ComplexChainElement _testComplexChain = null; + + @BeforeTest + public void setUp() throws IOException, Dgn7fileException { + File dataFile = TestData.file(this, testFilePath); + if (!dataFile.exists()) { + return; + } + + _fs = new FileInputStream(dataFile); + + fetchTestElement(_fs); + _fs.close(); + } + + private void fetchTestElement(FileInputStream fs) throws Dgn7fileException, IOException { + FileChannel fc = _fs.getChannel(); + Dgn7fileReader reader = new Dgn7fileReader(fc, new Lock()); + int count = 0; + Element lastComplex = null; + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { + Element element = (Element) record.element(); + ElementType type = element.getElementType(); + boolean completed = false; + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { + // @todo add process in here + if (!processCompleteElement(lastComplex)) break; + lastComplex = null; + } + + // @todo add process in here + if (!processCompleteElement(element)) break; + } else if (element.isComponentElement()) { + if (lastComplex != null) { + ((ComplexElement) lastComplex).add(element); + } else { + logger.warn("wong." + element.toString()); + Assert.fail("Component Element cannot found parent."); + } + } else if (type.isComplexElement()) { + if (lastComplex != null) { + // @todo add process in here + if (!processCompleteElement(lastComplex)) break; + } + lastComplex = element; + } + } + count++; + } + } + + private boolean processCompleteElement(Element element) throws IOException { + if (element instanceof LineStringElement) { + _testLineString = (LineStringElement) element; + } + + if (element instanceof ComplexChainElement) { + _testComplexChain = (ComplexChainElement) element; + } + + if ((_testLineString != null) && (_testComplexChain != null)) return false; + return true; + } + + @Test + public void testCreateLineString() throws IOException, Dgn7fileException { + Assert.assertNotNull(_testLineString); + LineStringElement originElement = _testLineString; + + LineString geometry = (LineString) originElement.toGeometry(factory); + Element cloneElement = ElementFactory.createLineString(geometry); + Assert.assertTrue(cloneElement instanceof LineStringElement); + cloneElement.setLevelIndex(originElement.getLevelIndex()); + cloneElement.setColorIndex(originElement.getColorIndex()); + cloneElement.setWeight(originElement.getWeight()); + cloneElement.setLineStyle(originElement.getLineStyle()); + cloneElement.setRange(geometry.getEnvelopeInternal()); + + int len = originElement.raw.length; + int lenClone = cloneElement.raw.length; + // Assert.assertEquals(lenClone, len - originElement.getUserAttributeDataOffset() + 1); + if (originElement.hasUserAttributeData()) { + Assert.assertEquals(lenClone, originElement.getUserAttributeDataOffset()); + } + System.out.println("origin size=(" + len + ")-:- Clone size=(" + lenClone + ")"); + int headerSize = ElementFactory.MINIMAL_ELEMLENGTH / 2; + for (int i = 0; i <= headerSize; i++) { + if (originElement.raw[i] != cloneElement.raw[i]) { + System.out.print("different index=" + i + ":"); + System.out.println("origin[" + Integer.toHexString(originElement.raw[i]) + + "]-clone:[" + Integer.toHexString(cloneElement.raw[i]) + "]"); + } + } + } + + @Test + public void testCreateComplexChain() throws IOException, Dgn7fileException { + Assert.assertNotNull(_testComplexChain); + ComplexChainElement originElement = _testComplexChain; + + System.out.print("len=" + originElement.raw.length); + for (Element elm : originElement) { + System.out.print(":" + elm.raw.length); + } + System.out.println(); + + MultiLineString geometries = (MultiLineString) originElement.toGeometry(factory); + LineString geometry = factory.createLineString(geometries.getCoordinates()); + + ComplexChainElement cloneElement = (ComplexChainElement) ElementFactory.createComplexChain(geometry); + Assert.assertTrue(cloneElement instanceof ComplexChainElement); + cloneElement.setLevelIndex(originElement.getLevelIndex()); + cloneElement.setColorIndex(originElement.getColorIndex()); + cloneElement.setWeight(originElement.getWeight()); + cloneElement.setLineStyle(originElement.getLineStyle()); + cloneElement.setRange(geometry.getEnvelopeInternal()); + + int len = originElement.raw.length; + int lenClone = cloneElement.raw.length; + // Assert.assertEquals(lenClone, len - originElement.getUserAttributeDataOffset() + 1); + System.out.print("clonelen=" + cloneElement.raw.length); + for (Element elm : cloneElement) { + System.out.print(":" + elm.raw.length); + } + System.out.println(); + + if (originElement.hasUserAttributeData()) { + Assert.assertEquals(lenClone, originElement.getUserAttributeDataOffset() + 4); + } + System.out.println("origin size=(" + len + ")-:- Clone size=(" + lenClone + ")"); + int headerSize = ElementFactory.MINIMAL_ELEMLENGTH / 2 + 6; + for (int i = 0; i < headerSize; i++) { + if (originElement.raw[i] != cloneElement.raw[i]) { + System.out.print("different index=" + i + ":"); + System.out.println("origin[" + Integer.toHexString(originElement.raw[i]) + + "]-clone:[" + Integer.toHexString(cloneElement.raw[i]) + "]"); + } + } + } +} diff --git a/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/OracleTarget.java b/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/OracleTarget.java index 11d8fe0..49c74e2 100644 --- a/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/OracleTarget.java +++ b/xdgnjobs/ximple-dgnio/src/test/java/com/ximple/io/dgn7/OracleTarget.java @@ -19,24 +19,20 @@ * Time: ?U?? 03:12:43 * To change this template use File | Settings | File Templates. */ -public class OracleTarget -{ +public class OracleTarget { private static final Logger logger = Logger.getLogger(OracleTarget.class); private static OracleTarget _instance = null; private static final String ORACLE_URL = "jdbc:oracle:thin:@"; private static final String _propUsrKey = "user"; private static final String _propPassKey = "password"; - private static String _oracleHost = "192.168.11.200"; - private static String _oracleInstance = "NNTPC"; + private static String _oracleHost = "10.10.1.7"; + private static String _oracleInstance = "ORCL"; private static String _oraclePort = "1521"; - static - { - try - { + static { + try { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); - } catch (SQLException e) - { + } catch (SQLException e) { Assert.shouldNeverReachHere(e.getMessage()); } } @@ -44,45 +40,37 @@ private OracleConnection oracleConnection = null; private Properties properties; - private OracleTarget() - { + private OracleTarget() { properties = new Properties(); - properties.put(_propUsrKey, "SPATIALDB"); - properties.put(_propPassKey, "SPATIALDB000"); + properties.put(_propUsrKey, "system"); + properties.put(_propPassKey, "simple000"); } - public static String getOracleHost() - { + public static String getOracleHost() { return _oracleHost; } - public static void setOracleHost(String oracleHost) - { + public static void setOracleHost(String oracleHost) { OracleTarget._oracleHost = oracleHost; } - public static String getOracleInstance() - { + public static String getOracleInstance() { return _oracleInstance; } - public static void setOracleInstance(String oracleInstance) - { + public static void setOracleInstance(String oracleInstance) { OracleTarget._oracleInstance = oracleInstance; } - public static String getOraclePort() - { + public static String getOraclePort() { return _oraclePort; } - public static void setOraclePort(String oraclePort) - { + public static void setOraclePort(String oraclePort) { OracleTarget._oraclePort = oraclePort; } - public static String getCurrentURL() - { + public static String getCurrentURL() { StringBuilder builder = new StringBuilder(); builder.append(ORACLE_URL); @@ -95,48 +83,38 @@ return builder.toString(); } - public String getLoginPass() - { + public String getLoginPass() { return (String) properties.get(_propPassKey); } - public void setLoginPass(String loginPass) - { + public void setLoginPass(String loginPass) { properties.put(_propPassKey, loginPass); } - public String getLoginUsr() - { + public String getLoginUsr() { return (String) properties.get(_propUsrKey); } - public void setLoginUsr(String loginUsr) - { + public void setLoginUsr(String loginUsr) { properties.put(_propUsrKey, loginUsr); } - public static OracleTarget getInstance() - { - if (_instance == null) - { + public static OracleTarget getInstance() { + if (_instance == null) { _instance = new OracleTarget(); } return _instance; } - public OracleConnection getOracleConnection() - { - try - { - if (oracleConnection == null) - { + public OracleConnection getOracleConnection() { + try { + if (oracleConnection == null) { oracleConnection = (OracleConnection) DriverManager.getConnection(getCurrentURL(), properties); } return oracleConnection; - } catch (SQLException e) - { + } catch (SQLException e) { logger.warn(e.getMessage(), e); } @@ -145,17 +123,13 @@ return null; } - public void closeConnection() - { - try - { - if (oracleConnection != null) - { + public void closeConnection() { + try { + if (oracleConnection != null) { oracleConnection.close(); oracleConnection = null; } - } catch (SQLException e) - { + } catch (SQLException e) { logger.warn(e.getMessage(), e); } } diff --git a/xdgnjobs/ximple-dgnio/src/test/resources/com/ximple/io/dgn7/test-data/demo.dgn b/xdgnjobs/ximple-dgnio/src/test/resources/com/ximple/io/dgn7/test-data/demo.dgn new file mode 100644 index 0000000..d749f68 --- /dev/null +++ b/xdgnjobs/ximple-dgnio/src/test/resources/com/ximple/io/dgn7/test-data/demo.dgn Binary files differ diff --git a/xdgnjobs/ximple-dgnio/src/test/resources/com/ximple/io/dgn7/test-data/dgnseed2d.dgn b/xdgnjobs/ximple-dgnio/src/test/resources/com/ximple/io/dgn7/test-data/dgnseed2d.dgn new file mode 100644 index 0000000..367c782 --- /dev/null +++ b/xdgnjobs/ximple-dgnio/src/test/resources/com/ximple/io/dgn7/test-data/dgnseed2d.dgn Binary files differ diff --git a/xdgnjobs/ximple-elmparser/pom.xml b/xdgnjobs/ximple-elmparser/pom.xml index e994b75..ef560f6 100644 --- a/xdgnjobs/ximple-elmparser/pom.xml +++ b/xdgnjobs/ximple-elmparser/pom.xml @@ -2,23 +2,21 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> - <parent> <groupId>com.ximple.eofms</groupId> <artifactId>ximple-dgnjobs</artifactId> - <version>0.9.0</version> + <version>2.1.1</version> </parent> - <groupId>com.ximple.eofms</groupId> <artifactId>ximple-elmparser</artifactId> - <version>0.9.0</version> + <version>2.1.1</version> <packaging>jar</packaging> <name>ximple-elmparser</name> <url>http://maven.apache.org</url> <properties> - <xdgnio.version>0.9.0</xdgnio.version> + <xdgnio.version>1.2.2</xdgnio.version> </properties> <scm> @@ -37,7 +35,7 @@ <url>http://www.ximple.com.tw</url> </organization> - <inceptionYear>2008</inceptionYear> + <inceptionYear>2010</inceptionYear> <developers> <developer> @@ -59,8 +57,8 @@ <!-- =========================================================== --> <dependencies> <dependency> + <groupId>org.quartz-scheduler</groupId> <artifactId>quartz</artifactId> - <groupId>opensymphony</groupId> </dependency> <dependency> @@ -71,50 +69,50 @@ <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-shapefile</artifactId> + <artifactId>gt-shapefile</artifactId> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-sample-data</artifactId> + <artifactId>gt-sample-data</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-data</artifactId> + <artifactId>gt-data</artifactId> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-jdbc</artifactId> + <artifactId>gt-jdbc</artifactId> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-postgis</artifactId> + <artifactId>gt-postgis</artifactId> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-oracle-spatial</artifactId> + <artifactId>gt-oracle-spatial</artifactId> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-mysql</artifactId> + <artifactId>gt-mysql</artifactId> </dependency> <!-- because main and sample-data depend on referencing we need a tie breaker --> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-referencing</artifactId> + <artifactId>gt-referencing</artifactId> </dependency> <!-- We need this to make the referencing module useful --> <dependency> - <artifactId>gt2-epsg-hsql</artifactId> + <artifactId>gt-epsg-hsql</artifactId> <groupId>org.geotools</groupId> <scope>test</scope> </dependency> <dependency> + <groupId>org.jdom</groupId> <artifactId>jdom</artifactId> - <groupId>jdom</groupId> </dependency> <dependency> @@ -171,14 +169,14 @@ <!-- Ximple Library --> <dependency> - <artifactId>ximple-dgnio</artifactId> <groupId>com.ximple.eofms</groupId> - <version>${xdgnio.version}</version> + <artifactId>ximple-dgnio</artifactId> + <version>${project.version}</version> </dependency> <dependency> - <artifactId>ximple-spatialjob</artifactId> <groupId>com.ximple.eofms</groupId> - <version>${xdgnio.version}</version> + <artifactId>ximple-spatialjob</artifactId> + <version>${project.version}</version> </dependency> </dependencies> @@ -207,8 +205,9 @@ Use maven from the command line: mvn exec:java -Dexec.mainClass="com.ximple.eofms.XElementParser" --> - <artifactId>exec-maven-plugin</artifactId> <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>1.2.1</version> <!-- <executions> <execution> diff --git a/xdgnjobs/ximple-elmparser/src/main/java/com/ximple/eofms/XElementFetcher.java b/xdgnjobs/ximple-elmparser/src/main/java/com/ximple/eofms/XElementFetcher.java index f9f9cc7..e1024b5 100644 --- a/xdgnjobs/ximple-elmparser/src/main/java/com/ximple/eofms/XElementFetcher.java +++ b/xdgnjobs/ximple-elmparser/src/main/java/com/ximple/eofms/XElementFetcher.java @@ -337,7 +337,7 @@ elmLogger.flashLogging(); } - protected static byte[] getBytesFromBLOB(BLOB blob) throws SQLException + protected byte[] getBytesFromBLOB(BLOB blob) throws SQLException { byte[] raw = null; @@ -363,8 +363,6 @@ buffer.put(chunk); } - is.close(); - assert buffer != null; buffer.position(0); raw = buffer.array(); @@ -372,6 +370,9 @@ { e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates. Assert.shouldNeverReachHere(); + } finally + { + try { is.close(); } catch (IOException e) { logger.warn("InputStream cannot close", e); }; } return raw; @@ -457,7 +458,7 @@ BLOB blob = (BLOB) rsSrc.getBlob(1); raw = getBytesFromBLOB(blob); - blob.close(); + // blob.close(); } else { raw = rsSrc.getBytes(1); diff --git a/xdgnjobs/ximple-elmparser/src/main/java/com/ximple/eofms/XElementParser.java b/xdgnjobs/ximple-elmparser/src/main/java/com/ximple/eofms/XElementParser.java index ffecfd9..c2d6ae8 100644 --- a/xdgnjobs/ximple-elmparser/src/main/java/com/ximple/eofms/XElementParser.java +++ b/xdgnjobs/ximple-elmparser/src/main/java/com/ximple/eofms/XElementParser.java @@ -21,7 +21,6 @@ import org.geotools.feature.Feature; import org.geotools.feature.FeatureType; import org.geotools.feature.SimpleFeature; -import org.geotools.feature.IllegalAttributeException; import org.geotools.feature.FeatureCollection; import org.geotools.feature.FeatureCollections; import org.geotools.data.FeatureWriter; @@ -217,7 +216,7 @@ return; } - // �P�_�O�_�ũM���� + // �P�_�O�_�ũM��� Feature feature = elementDispatcher.execute(element, false); if (feature == null) { diff --git a/xdgnjobs/ximple-jobcarrier/.gitignore b/xdgnjobs/ximple-jobcarrier/.gitignore new file mode 100644 index 0000000..b83d222 --- /dev/null +++ b/xdgnjobs/ximple-jobcarrier/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/xdgnjobs/ximple-jobcarrier/log4j.properties b/xdgnjobs/ximple-jobcarrier/log4j.properties new file mode 100644 index 0000000..a3a40c6 --- /dev/null +++ b/xdgnjobs/ximple-jobcarrier/log4j.properties @@ -0,0 +1,29 @@ +# Create stdout appender +log4j.rootLogger=info, logfile, stdout + +# Configure the stdout appender to go to the Console +log4j.appender.stdout=org.apache.log4j.ConsoleAppender + +# Configure stdout appender to use the PatternLayout +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout + +# Pattern output the caller's filename and line # +log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n +#log4j.appender.stdout.encoding=UTF-8 + +log4j.appender.logfile=org.apache.log4j.FileAppender +log4j.appender.logfile.file=xjobcarrier.log +log4j.appender.logfile.layout=org.apache.log4j.PatternLayout +log4j.appender.logfile.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n +#log4j.appender.logfile.encoding=UTF-8 + +log4j.appender.remoteout=com.holub.log4j.RemoteAppender +log4j.appender.remoteout.Port=8011 +log4j.appender.remoteout.layout=org.apache.log4j.PatternLayout +log4j.appender.remoteout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n +#log4j.appender.remoteout.encoding=UTF-8 + +# Print messages of level INFO or above for examples +log4j.logger.org.cavaness.quartzbook=INFO +log4j.logger.org.quartz=DEBUG +log4j.logger.com.ximple.eofms=DEBUG \ No newline at end of file diff --git a/xdgnjobs/ximple-jobcarrier/pom.xml b/xdgnjobs/ximple-jobcarrier/pom.xml index 6e45321..820aab7 100644 --- a/xdgnjobs/ximple-jobcarrier/pom.xml +++ b/xdgnjobs/ximple-jobcarrier/pom.xml @@ -6,19 +6,19 @@ <parent> <groupId>com.ximple.eofms</groupId> <artifactId>ximple-dgnjobs</artifactId> - <version>0.9.0</version> + <version>2.1.1</version> </parent> <groupId>com.ximple.eofms</groupId> <artifactId>ximple-jobcarrier</artifactId> - <version>0.9.0</version> + <version>2.1.1</version> <packaging>jar</packaging> <name>ximple-jobcarrier</name> <url>http://maven.apache.org</url> <properties> - <xdgnio.version>0.9.0</xdgnio.version> + <xdgnio.version>2.1.1</xdgnio.version> </properties> <scm> @@ -37,7 +37,7 @@ <url>http://www.ximple.com.tw</url> </organization> - <inceptionYear>2008</inceptionYear> + <inceptionYear>2012</inceptionYear> <developers> <developer> @@ -54,13 +54,59 @@ <contributors> </contributors> + <profiles> + <profile> + <id>qa</id> + <build> + <plugins> + <plugin> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <phase>install</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/lib</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + <!-- =========================================================== --> <!-- Dependencies to be inherited by all modules. --> <!-- =========================================================== --> <dependencies> <dependency> + <groupId>org.quartz-scheduler</groupId> <artifactId>quartz</artifactId> - <groupId>opensymphony</groupId> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.quartz-scheduler</groupId> + <artifactId>quartz-jobs</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> </dependency> <dependency> @@ -71,50 +117,61 @@ <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-shapefile</artifactId> + <artifactId>gt-shapefile</artifactId> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-sample-data</artifactId> + <artifactId>gt-sample-data</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-data</artifactId> + <artifactId>gt-data</artifactId> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-jdbc</artifactId> + <artifactId>gt-opengis</artifactId> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-postgis</artifactId> + <artifactId>gt-jdbc</artifactId> + </dependency> + <dependency> + <groupId>org.geotools.jdbc</groupId> + <artifactId>gt-jdbc-postgis</artifactId> + </dependency> + <dependency> + <groupId>org.geotools.jdbc</groupId> + <artifactId>gt-jdbc-oracle</artifactId> + </dependency> + <dependency> + <groupId>org.geotools.jdbc</groupId> + <artifactId>gt-jdbc-mysql</artifactId> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-oracle-spatial</artifactId> + <artifactId>gt-opengis</artifactId> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-mysql</artifactId> + <artifactId>gt-metadata</artifactId> </dependency> <!-- because main and sample-data depend on referencing we need a tie breaker --> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-referencing</artifactId> + <artifactId>gt-referencing</artifactId> </dependency> <!-- We need this to make the referencing module useful --> <dependency> - <artifactId>gt2-epsg-hsql</artifactId> <groupId>org.geotools</groupId> - <scope>test</scope> + <artifactId>gt-epsg-wkt</artifactId> </dependency> <dependency> <artifactId>jdom</artifactId> - <groupId>jdom</groupId> + <groupId>org.jdom</groupId> </dependency> <dependency> @@ -149,24 +206,30 @@ <artifactId>sdoutl</artifactId> </dependency> - <dependency> + <!--dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> </dependency> <dependency> <groupId>org.postgis</groupId> <artifactId>postgis-driver</artifactId> - </dependency> + </dependency--> - <dependency> + <!--dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> - </dependency> + </dependency--> <!-- AWL --> <dependency> <groupId>org.awl</groupId> <artifactId>awl</artifactId> + </dependency> + + <dependency> + <groupId>xml-apis</groupId> + <artifactId>xml-apis</artifactId> + <version>1.4.01</version> </dependency> <!-- Ximple Library --> @@ -178,7 +241,7 @@ <dependency> <artifactId>ximple-spatialjob</artifactId> <groupId>com.ximple.eofms</groupId> - <version>${xdgnio.version}</version> + <version>${project.version}</version> </dependency> </dependencies> @@ -207,23 +270,28 @@ Use maven from the command line: mvn exec:java -Dexec.mainClass="com.ximple.eofms.XQuartzJobCarrier" --> - <artifactId>exec-maven-plugin</artifactId> <groupId>org.codehaus.mojo</groupId> - <!-- + <artifactId>exec-maven-plugin</artifactId> + <version>1.2.1</version> <executions> <execution> - <phase>package</phase> + <!--<phase>package</phase> --> <goals> - <goal>run</goal> + <goal>java</goal> </goals> </execution> </executions> - --> <configuration> <mainClass>com.ximple.eofms.XQuartzJobCarrier</mainClass> <!-- - <commandlineArgs>-wizard</commandlineArgs> + <commandlineArgs>-Dlog4j.configuration=log4j.properties</commandlineArgs> --> + <systemProperties> + <systemProperty> + <key>log4j.configuration</key> + <value>log4j.properties</value> + </systemProperty> + </systemProperties> </configuration> <!-- <dependencies> @@ -251,7 +319,7 @@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>native2ascii-maven-plugin</artifactId> - <version>1.0-alpha-1</version> + <version>1.0-beta-1</version> <configuration> <dest>target/classes/com/ximple/eofms</dest> <src>src/main/resources/com/ximple/eofms</src> @@ -264,13 +332,16 @@ </goals> <configuration> <encoding>UTF8</encoding> - <includes>XQuartzJobWizard_zh*.properties</includes> + <includes> + <include>XQuartzJobWizard_zh*.properties</include> + </includes> </configuration> </execution> </executions> </plugin> </plugins> <resources> + <!-- <resource> <directory>src/main/resources/com/ximple/eofms</directory> <excludes> @@ -278,15 +349,24 @@ </excludes> <filtering>true</filtering> </resource> + --> <resource> <directory>src/main/resources</directory> <includes> <include>log4j.properties</include> <include>quartz.properties</include> <include>quartz_jobs.xml</include> + <include>quartz_jobs_edb.xml</include> + <include>quartz_jobs_sharpefiles.xml</include> </includes> <!-- <excludes> + <exclude>log4j.properties</exclude> + <exclude>quartz_jobs.xml</exclude> + </excludes> + --> + <!-- + <excludes> <exclude>XQuartzJobWizard*.properties</exclude> <exclude>quartz_jobs.xml</exclude> <exclude>quartz_jobs_shapefiles.xml</exclude> diff --git a/xdgnjobs/ximple-jobcarrier/quartz.properties b/xdgnjobs/ximple-jobcarrier/quartz.properties new file mode 100644 index 0000000..e491e0d --- /dev/null +++ b/xdgnjobs/ximple-jobcarrier/quartz.properties @@ -0,0 +1,33 @@ +#=============================================================== +#Configure Main Scheduler Properties +#=============================================================== +org.quartz.scheduler.instanceName = QuartzScheduler +org.quartz.scheduler.instanceId = AUTO + +#=============================================================== +#Configure ThreadPool +#=============================================================== +org.quartz.threadPool.threadCount = 5 +org.quartz.threadPool.threadPriority = 5 +org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool + +#=============================================================== +#Configure JobStore +#=============================================================== +org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore +org.quartz.jobStore.misfireThreshold = 60000 + +#=============================================================== +#Configure Plugins +#=============================================================== +org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingJobHistoryPlugin + +org.quartz.plugin.jobInitializer.class: org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin +org.quartz.plugin.jobInitializer.fileNames = quartz_jobs.xml +#org.quartz.plugin.jobInitializer.fileNames = quartz_jobs_edb.xml +org.quartz.plugin.jobInitializer.failOnFileNotFound = true +org.quartz.plugin.jobInitializer.scanInterval = 10 +org.quartz.plugin.jobInitializer.wrapInUserTransaction = false + +org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin +org.quartz.plugin.shutdownhook.cleanShutdown = true \ No newline at end of file diff --git a/xdgnjobs/ximple-jobcarrier/quartz_jobs.xml b/xdgnjobs/ximple-jobcarrier/quartz_jobs.xml new file mode 100644 index 0000000..c47943b --- /dev/null +++ b/xdgnjobs/ximple-jobcarrier/quartz_jobs.xml @@ -0,0 +1,165 @@ +<?xml version='1.0' encoding='utf-8'?> + +<job-scheduling-data xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd" + version="1.8"> + + <pre-processing-commands> + <delete-jobs-in-group>*</delete-jobs-in-group> <!-- clear all jobs in scheduler --> + <delete-triggers-in-group>*</delete-triggers-in-group> <!-- clear all triggers in scheduler --> + </pre-processing-commands> + + <processing-directives> + <!-- if there are any jobs/trigger in scheduler of same name (as in this file), overwrite them --> + <overwrite-existing-data>true</overwrite-existing-data> + <!-- if there are any jobs/trigger in scheduler of same name (as in this file), and over-write is false, ignore them rather then generating an error --> + <ignore-duplicates>false</ignore-duplicates> + </processing-directives> + + <schedule> + <job> + <name>ConvertDMMS2PostGisWithGeoserver</name> + <group>DEFAULT</group> + <description>A job that convert dgn to postgis</description> + <!--job-class>com.ximple.eofms.jobs.OracleConvertDgn2PostGISJob</job-class--> + <job-class>com.ximple.eofms.jobs.GeoserverIntegrateConfigJob</job-class> + <!--volatility>false</volatility--> + <durability>false</durability> + <recover>false</recover> + <!--job-data-map allows-transient-data="true"--> + <job-data-map> + <entry> + <key>JOBDATA_DIR</key> + <!--value>/Users/Shared/Public/Projects/XGeoDMMS/xjobrun/nstpcjobs/jobdata</value--> + <value>/mnt/hdisk/home.data/private/projects/xdcad/xjobrun/nntpcjobs/jobdata</value> + </entry> + <entry> + <key>PGHOST</key> + <value>192.168.11.99</value> + </entry> + <entry> + <key>PGDATBASE</key> + <value>pgNNTPC</value> + </entry> + <entry> + <key>PGPORT</key> + <value>5432</value> + </entry> + <entry> + <key>PGSCHEMA</key> + <value>public</value> + </entry> + <entry> + <key>PGUSER</key> + <value>tpcdb</value> + </entry> + <entry> + <key>PGPASS</key> + <value>simple000</value> + </entry> + <entry> + <key>ORAHOST</key> + <value>10.10.1.7</value> + </entry> + <entry> + <key>ORAINST</key> + <value>orcl</value> + </entry> + <entry> + <key>ORAPORT</key> + <value>1521</value> + </entry> + <entry> + <key>ORAUSER</key> + <value>system</value> + </entry> + <entry> + <key>ORAPASS</key> + <value>simple000</value> + </entry> + <entry> + <key>ORGSCHEMA</key> + <!--value>SPATIALDB</value--> + <value>SPATIALDB, CMMS_SPATIALDB</value> + </entry> + <entry> + <key>CONVERTDB</key> + <value>true</value> + </entry> + <entry> + <key>CONVERTFILE</key> + <value>true</value> + </entry> + <entry> + <key>CONVERTELEMIN</key> + <value>false</value> + </entry> + <entry> + <key>CREATEDUMMY</key> + <value>false</value> + </entry> + <entry> + <key>ELEMLOG</key> + <value>true</value> + </entry> + <entry> + <key>USEWKB</key> + <value>true</value> + </entry> + <entry> + <key>TESTMODE</key> + <value>false</value> + </entry> + <entry> + <key>TESTCOUNT</key> + <value>2</value> + </entry> + <entry> + <key>COPYCONNECTIVITYMODE</key> + <value>true</value> + </entry> + <entry> + <key>PROFILEMODE</key> + <value>true</value> + </entry> + <entry> + <key>USEZONE121</key> + <value>true</value> + </entry> + <entry> + <key>GEOSERVER_URL</key> + <value>http://192.168.11.99:8080/geoserver</value> + </entry> + <entry> + <key>GEOSERVER_USER</key> + <value>admin</value> + </entry> + <entry> + <key>GEOSERVER_PASS</key> + <value>geoserver</value> + </entry> + <entry> + <key>IGNORE_DBETL</key> + <value>false</value> + </entry> + </job-data-map> + </job> + + <trigger> + <simple> + <name>convertTrigger</name> + <group>DEFAULT</group> + <job-name>ConvertDMMS2PostGisWithGeoserver</job-name> + <job-group>DEFAULT</job-group> + <start-time>2013-03-01T18:00:00</start-time> + <!-- repeat indefinitely every 10 seconds --> + <repeat-count>0</repeat-count> + <repeat-interval>500</repeat-interval> + <!-- <repeat-interval>72000000</repeat-interval> --> + </simple> + </trigger> + + </schedule> + +</job-scheduling-data> diff --git a/xdgnjobs/ximple-jobcarrier/src/main/java/com/ximple/eofms/XQuartzJobCarrier.java b/xdgnjobs/ximple-jobcarrier/src/main/java/com/ximple/eofms/XQuartzJobCarrier.java index 2bb7fee..a625b7c 100644 --- a/xdgnjobs/ximple-jobcarrier/src/main/java/com/ximple/eofms/XQuartzJobCarrier.java +++ b/xdgnjobs/ximple-jobcarrier/src/main/java/com/ximple/eofms/XQuartzJobCarrier.java @@ -1,8 +1,8 @@ package com.ximple.eofms; -import java.util.Date; import javax.swing.JFrame; import javax.swing.SwingUtilities; +import java.util.Date; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; @@ -15,11 +15,15 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.awl.Wizard; +import org.quartz.DateBuilder; +import org.quartz.JobBuilder; import org.quartz.JobDetail; import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.quartz.Trigger; +import org.quartz.TriggerBuilder; import org.quartz.TriggerUtils; +import org.quartz.impl.JobDetailImpl; import org.quartz.impl.StdSchedulerFactory; import com.ximple.eofms.jobs.OracleConvertDgn2ShpJob; @@ -27,22 +31,19 @@ /** * Hello world! */ -public class XQuartzJobCarrier -{ +public class XQuartzJobCarrier { static Log logger = LogFactory.getLog(XQuartzJobCarrier.class); static Options options = new Options(); - private static final String VERSION = "0.9.0"; + private static final String VERSION = "1.3.1"; - public static void main(String[] args) - { + public static void main(String[] args) { XQuartzJobCarrier instance = new XQuartzJobCarrier(); instance.initializeOption(); instance.execute(args); } - private void initializeOption() - { + private void initializeOption() { Option option; option = OptionBuilder.create("help"); option.setDescription("print this message"); @@ -71,32 +72,25 @@ } - private void execute(String[] args) - { + private void execute(String[] args) { // CommandLineParser parser = new GnuParser(); CommandLineParser parser = new PosixParser(); CommandLine commandLine = null; - try - { + try { // parse the command commandLine arguments commandLine = parser.parse(options, args); } - catch (ParseException exp) - { + catch (ParseException exp) { // oops, something went wrong System.err.println("Parsing failed. Reason: " + exp.getMessage()); } - if ((commandLine != null) && (commandLine.getOptions().length > 0)) - { - if (commandLine.hasOption("help")) - { + if ((commandLine != null) && (commandLine.getOptions().length > 0)) { + if (commandLine.hasOption("help")) { printHelpMessage(); - } else if (commandLine.hasOption("version")) - { + } else if (commandLine.hasOption("version")) { printVersionMessage(); - } else if (commandLine.hasOption("wizard")) - { + } else if (commandLine.hasOption("wizard")) { startWizardMode(); } return; @@ -104,46 +98,37 @@ startScheduler(); } - private void printHelpMessage() - { + private void printHelpMessage() { HelpFormatter formatter = new HelpFormatter(); formatter.printHelp("XQuartzJobCarrier", options); } - private void printVersionMessage() - { + private void printVersionMessage() { System.out.println("XQuartzJobCarrier - " + VERSION); } - public void startWizardMode() - { - Runnable runnable = new Runnable() - { - public void run() - { + public void startWizardMode() { + Runnable runnable = new Runnable() { + public void run() { Wizard wizard = new XQuartzJobWizard((JFrame) null); wizard.pack(); wizard.setVisibleOnCenterOfScreen(); } }; - try - { + try { SwingUtilities.invokeLater(runnable); } - catch (Exception ex) - { + catch (Exception ex) { ex.printStackTrace(); } } - public void startScheduler() - { + public void startScheduler() { Scheduler scheduler = null; boolean shutdown = false; - try - { + try { // Get a Scheduler instance from the Factory scheduler = StdSchedulerFactory.getDefaultScheduler(); @@ -151,23 +136,18 @@ scheduler.start(); logger.info("Scheduler started at " + new Date()); - } catch (SchedulerException ex) - { + } catch (SchedulerException ex) { // deal with any exceptions - logger.error(ex); + logger.error(ex, ex); shutdown = true; - } catch (Throwable throwable) - { + } catch (Throwable throwable) { logger.error(throwable.getMessage(), throwable); shutdown = true; } - if (shutdown) - { - try - { + if (shutdown) { + try { scheduler.shutdown(); - } catch (SchedulerException e) - { + } catch (SchedulerException e) { logger.error(e.getMessage(), e); } } @@ -176,27 +156,33 @@ /* * return an instance of the Scheduler from the factory */ - public Scheduler createScheduler() throws SchedulerException - { + public Scheduler createScheduler() throws SchedulerException { return StdSchedulerFactory.getDefaultScheduler(); } // Create and Schedule a ScanDirectoryJob with the Scheduler - private void scheduleJob(Scheduler scheduler) throws SchedulerException - { + private void scheduleJob(Scheduler scheduler) throws SchedulerException { // Create a JobDetail for the Job - JobDetail jobDetail = new JobDetail("ScanDirectory", Scheduler.DEFAULT_GROUP, - OracleConvertDgn2ShpJob.class); - + /* + JobDetailImpl jobDetail = new JobDetailImpl("ScanDirectory", Scheduler.DEFAULT_GROUP, + OracleConvertDgn2ShpJob.class); + */ + JobDetail jobDetail = JobBuilder.newJob(OracleConvertDgn2ShpJob.class) + .withIdentity("ScanDirectory", Scheduler.DEFAULT_GROUP) + .usingJobData("SCAN_DIR", "c:\\quartz-book\\input") + .build(); // Configure the directory to scan - jobDetail.getJobDataMap().put("SCAN_DIR", "c:\\quartz-book\\input"); + // jobDetail.getJobDataMap().put("SCAN_DIR", "c:\\quartz-book\\input"); // Create a trigger that fires every 10 seconds, forever - Trigger trigger = TriggerUtils.makeSecondlyTrigger(10); - trigger.setName("scanTrigger"); + // Trigger trigger = TriggerUtils.makeSecondlyTrigger(10); + // trigger.setName("scanTrigger"); + Trigger trigger = TriggerBuilder.newTrigger().withIdentity("scanTrigger") + .startAt(DateBuilder.futureDate(10, DateBuilder.IntervalUnit.SECOND)) + .build(); // Start the trigger firing from now - trigger.setStartTime(new Date()); + // trigger.setStartTime(new Date()); // Associate the trigger with the job in the scheduler scheduler.scheduleJob(jobDetail, trigger); diff --git a/xdgnjobs/ximple-jobcarrier/src/main/java/com/ximple/eofms/XQuartzJobWizard.java b/xdgnjobs/ximple-jobcarrier/src/main/java/com/ximple/eofms/XQuartzJobWizard.java index 659c739..3b5015e 100644 --- a/xdgnjobs/ximple-jobcarrier/src/main/java/com/ximple/eofms/XQuartzJobWizard.java +++ b/xdgnjobs/ximple-jobcarrier/src/main/java/com/ximple/eofms/XQuartzJobWizard.java @@ -1,14 +1,5 @@ package com.ximple.eofms; -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.event.ActionEvent; -import java.io.File; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ResourceBundle; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.BorderFactory; @@ -32,6 +23,15 @@ import javax.swing.event.ChangeListener; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.event.ActionEvent; +import java.io.File; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ResourceBundle; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -45,8 +45,7 @@ import org.awl.header.EclipseWizardHeader; import org.awl.message.MessageLevel; -public class XQuartzJobWizard extends DefaultWizard -{ +public class XQuartzJobWizard extends DefaultWizard { static Log logger = LogFactory.getLog(XQuartzJobWizard.class); /** @@ -87,8 +86,7 @@ /** * Creates a new instance of AwlDemo */ - public XQuartzJobWizard(JFrame frame) - { + public XQuartzJobWizard(JFrame frame) { super(frame); AbstractWizardHeader header = new EclipseWizardHeader(); @@ -119,28 +117,22 @@ secondPage.setMessage(rb.getString("second.messageContent"), MessageLevel.INFO); URL licenseUrl = null; - try - { + try { licenseUrl = new URL("http://www.gnu.org/licenses/lgpl-2.1.txt"); } - catch (MalformedURLException e) - { + catch (MalformedURLException e) { e.printStackTrace(); } JEditorPane licensePane = null; - if (licenseUrl == null) - { + if (licenseUrl == null) { licensePane = new JEditorPane(); licensePane.setText("license LGPL 2.1"); - } else - { - try - { + } else { + try { licensePane = new JEditorPane(licenseUrl); } - catch (IOException e) - { + catch (IOException e) { licensePane = new JEditorPane(); licensePane.setText("license LGPL 2.1"); } @@ -155,13 +147,11 @@ licenseButtonGroup.add(radioAcceptLicense); licenseButtonGroup.add(radioRefuseLicense); - ChangeListener changeListener = new ChangeListener() - { - public void stateChanged(ChangeEvent e) - { + ChangeListener changeListener = new ChangeListener() { + public void stateChanged(ChangeEvent e) { secondPage.setNextPageAuthorization( - radioAcceptLicense.isSelected() ? NavigationAuthorization.DEFAULT : - NavigationAuthorization.FORBIDDEN); + radioAcceptLicense.isSelected() ? NavigationAuthorization.DEFAULT : + NavigationAuthorization.FORBIDDEN); } }; @@ -210,52 +200,42 @@ /** third page */ final JTextField locationField = new JTextField(20); - final Action chooseLocation = new AbstractAction() - { - public void actionPerformed(ActionEvent e) - { + final Action chooseLocation = new AbstractAction() { + public void actionPerformed(ActionEvent e) { File current = null; String text = locationField.getText(); - if (text != null && text.trim().length() > 0) - { - try - { + if (text != null && text.trim().length() > 0) { + try { current = new File(text); - if (!current.exists()) - { + if (!current.exists()) { current = null; } } - catch (Exception ex) - { } + catch (Exception ex) { + } } JFileChooser chooser = new JFileChooser(current); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - chooser.setFileFilter(new javax.swing.filechooser.FileFilter() - { - public boolean accept(File f) - { + chooser.setFileFilter(new javax.swing.filechooser.FileFilter() { + public boolean accept(File f) { boolean result = false; - if (f != null && f.isDirectory()) - { + if (f != null && f.isDirectory()) { result = true; } return result; } - public String getDescription() - { + public String getDescription() { return rb.getString("third.fileChooser.description"); } }); chooser.setMultiSelectionEnabled(false); int answer = chooser.showDialog(XQuartzJobWizard.this, rb.getString("third.fileChooser.selectLabel")); - if (answer == JFileChooser.CANCEL_OPTION) - { + if (answer == JFileChooser.CANCEL_OPTION) { locationField.setText(""); thirdPage.setMessage(rb.getString("third.messageContent"), MessageLevel.WARN); } else // aprove @@ -264,13 +244,10 @@ } } }; - this.thirdPage = new DefaultWizardPageDescriptor() - { - public void displayingPanel(Wizard wizard) - { + this.thirdPage = new DefaultWizardPageDescriptor() { + public void displayingPanel(Wizard wizard) { /** open file dialog box */ - if (locationField.getText().trim().length() == 0) - { + if (locationField.getText().trim().length() == 0) { chooseLocation.actionPerformed(null); } } @@ -278,25 +255,20 @@ chooseLocation.putValue(Action.SMALL_ICON, new ImageIcon(AwlDemo.class.getResource("/org/awl/rc/folder.png"))); thirdPage.setNextPageAuthorization(NavigationAuthorization.FORBIDDEN); - locationField.getDocument().addDocumentListener(new DocumentListener() - { - public void changedUpdate(DocumentEvent e) - { } + locationField.getDocument().addDocumentListener(new DocumentListener() { + public void changedUpdate(DocumentEvent e) { } - public void insertUpdate(DocumentEvent e) - { + public void insertUpdate(DocumentEvent e) { this.changeNavigation(); } - public void removeUpdate(DocumentEvent e) - { + public void removeUpdate(DocumentEvent e) { this.changeNavigation(); } - private void changeNavigation() - { + private void changeNavigation() { thirdPage.setNextPageAuthorization(locationField.getText().trim().length() > 0 ? NavigationAuthorization.DEFAULT : - NavigationAuthorization.FORBIDDEN); + NavigationAuthorization.FORBIDDEN); } }); @@ -350,38 +322,27 @@ final JProgressBar installProgressBar = new JProgressBar(); final JLabel progressLabel = new JLabel(rb.getString("fourth.inProgress.text")); - this.fourthPage = new DefaultWizardPageDescriptor() - { - public void displayingPanel(Wizard wizard) - { + this.fourthPage = new DefaultWizardPageDescriptor() { + public void displayingPanel(Wizard wizard) { /* begin installation */ this.setPreviousPageAuthorization(NavigationAuthorization.FORBIDDEN); this.setFinishAuthorization(NavigationAuthorization.FORBIDDEN); /* begin new thread */ - Runnable runnable = new Runnable() - { - public void run() - { - while (installProgressBar.getValue() < installProgressBar.getMaximum()) - { - Runnable r = new Runnable() - { - public void run() - { installProgressBar.setValue(installProgressBar.getValue() + 1); } + Runnable runnable = new Runnable() { + public void run() { + while (installProgressBar.getValue() < installProgressBar.getMaximum()) { + Runnable r = new Runnable() { + public void run() { installProgressBar.setValue(installProgressBar.getValue() + 1); } }; SwingUtilities.invokeLater(r); - try - { + try { Thread.sleep(50); } - catch (InterruptedException e) - { - Runnable r1 = new Runnable() - { - public void run() - { installProgressBar.setValue(installProgressBar.getMaximum()); } + catch (InterruptedException e) { + Runnable r1 = new Runnable() { + public void run() { installProgressBar.setValue(installProgressBar.getMaximum()); } }; SwingUtilities.invokeLater(r1); @@ -389,10 +350,8 @@ } } - Runnable r2 = new Runnable() - { - public void run() - { progressLabel.setText(rb.getString("fourth.finished.text")); } + Runnable r2 = new Runnable() { + public void run() { progressLabel.setText(rb.getString("fourth.finished.text")); } }; SwingUtilities.invokeLater(r2); @@ -429,12 +388,9 @@ this.addPage(fourthPage, "4"); } - public static void main(String[] args) - { - Runnable runnable = new Runnable() - { - public void run() - { + public static void main(String[] args) { + Runnable runnable = new Runnable() { + public void run() { Wizard wizard = new XQuartzJobWizard((JFrame) null); wizard.pack(); @@ -442,12 +398,10 @@ } }; - try - { + try { SwingUtilities.invokeLater(runnable); } - catch (Exception ex) - { + catch (Exception ex) { ex.printStackTrace(); } } diff --git a/xdgnjobs/ximple-jobcarrier/src/main/resources/com/ximple/eofms/XQuartzJobWizard_zh_TW.properties b/xdgnjobs/ximple-jobcarrier/src/main/resources/com/ximple/eofms/XQuartzJobWizard_zh_TW.properties index 0323202..80e1bf3 100644 --- a/xdgnjobs/ximple-jobcarrier/src/main/resources/com/ximple/eofms/XQuartzJobWizard_zh_TW.properties +++ b/xdgnjobs/ximple-jobcarrier/src/main/resources/com/ximple/eofms/XQuartzJobWizard_zh_TW.properties @@ -1,23 +1,23 @@ title=Ximple Quartz Job Wizard -first.title=�Ŷ�����ഫ -first.description=�Ŷ�����ഫ�N�|Ū�� OMS/CMMS �Ŷ���Ʈw���e�ഫ�� PostGIS �Ŷ���Ʈw +first.title=空間資料轉換 +first.description=空間資料轉換將會讀取 OMS/CMMS 空間資料庫內容轉換至 PostGIS 空間資料庫 first.label.text=<html>This wizard will not install anything on your computer.<br/>It only demonstrates <b>Awl</b> functionnalities.</html> -second.title=���v�n�� +second.title=版權聲明 second.description=Accept the license of this software second.licenseAccepted=I accept the terms of this license agreement second.licenseRefused=I do not accept the terms of this license agreement second.messageContent=Accept the terms of the license -third.title=�պA�]�w��m +third.title=組態設定位置 third.description=Select the location where to install this software third.label.text=Install location third.fileChooser.selectLabel=Select third.fileChooser.description=Select third.messageContent=You must choose a valid location -fourth.title=�}�l����... +fourth.title=開始轉檔... fourth.description=Installation progress fourth.inProgress.text=Installation in progress... -fourth.finished.text=Installation finished +fourth.finished.text=Installation finished \ No newline at end of file diff --git a/xdgnjobs/ximple-jobcarrier/src/main/resources/log4j.properties b/xdgnjobs/ximple-jobcarrier/src/main/resources/log4j.properties index 2691982..6437a4e 100644 --- a/xdgnjobs/ximple-jobcarrier/src/main/resources/log4j.properties +++ b/xdgnjobs/ximple-jobcarrier/src/main/resources/log4j.properties @@ -25,4 +25,6 @@ # Print messages of level INFO or above for examples log4j.logger.org.cavaness.quartzbook=INFO -log4j.logger.com.ximple.eofms=INFO \ No newline at end of file +log4j.logger.com.ximple.eofms=INFO + +it.geosolutions.geoserver=INIFO \ No newline at end of file diff --git a/xdgnjobs/ximple-jobcarrier/src/main/resources/quartz.properties b/xdgnjobs/ximple-jobcarrier/src/main/resources/quartz.properties index be35e19..15de783 100644 --- a/xdgnjobs/ximple-jobcarrier/src/main/resources/quartz.properties +++ b/xdgnjobs/ximple-jobcarrier/src/main/resources/quartz.properties @@ -15,14 +15,20 @@ #Configure JobStore #=============================================================== org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore +org.quartz.jobStore.misfireThreshold = 60000 #=============================================================== #Configure Plugins #=============================================================== -org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.JobInitializationPlugin +org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingJobHistoryPlugin -org.quartz.plugin.jobInitializer.fileName = quartz_jobs.xml +org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin +org.quartz.plugin.jobInitializer.fileNames = quartz_jobs.xml +#org.quartz.plugin.jobInitializer.fileNames = quartz_jobs_edb.xml -org.quartz.plugin.jobInitializer.overWriteExistingJobs = true org.quartz.plugin.jobInitializer.failOnFileNotFound = true -org.quartz.plugin.jobInitializer.validating=false +org.quartz.plugin.jobInitializer.scanInterval = 10 +org.quartz.plugin.jobInitializer.wrapInUserTransaction = false + +org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin +org.quartz.plugin.shutdownhook.cleanShutdown = true \ No newline at end of file diff --git a/xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs.xml b/xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs.xml index 73cb85a..75420ba 100644 --- a/xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs.xml +++ b/xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs.xml @@ -1,32 +1,49 @@ <?xml version='1.0' encoding='utf-8'?> -<quartz xmlns="http://www.opensymphony.com/quartz/JobSchedulingData" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.opensymphony.com/quartz/JobSchedulingData - http://www.opensymphony.com/quartz/xml/job_scheduling_data_1_5.xsd" - version="1.5"> +<job-scheduling-data xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd" + version="1.8"> - <job> - <job-detail> - <name>ConvertDgn2PostGisIntoPostgre</name> + <pre-processing-commands> + <delete-jobs-in-group>*</delete-jobs-in-group> + <!-- clear all jobs in scheduler --> + <delete-triggers-in-group>*</delete-triggers-in-group> + <!-- clear all triggers in scheduler --> + </pre-processing-commands> + + <processing-directives> + <!-- if there are any jobs/trigger in scheduler of same name (as in this file), overwrite them --> + <overwrite-existing-data>true</overwrite-existing-data> + <!-- if there are any jobs/trigger in scheduler of same name (as in this file), and over-write is false, ignore them rather then generating an error --> + <ignore-duplicates>false</ignore-duplicates> + </processing-directives> + + <schedule> + <job> + <name>ConvertDMMS2PostGisWithGeoserver</name> <group>DEFAULT</group> - <description>A job that convert dgn to shapefiles</description> - <job-class>com.ximple.eofms.jobs.OracleConvertDgn2PostGISJob</job-class> - <volatility>false</volatility> + <description>A job that convert dgn to postgis</description> + <!--job-class>com.ximple.eofms.jobs.OracleConvertDgn2PostGISJob</job-class--> + <job-class>com.ximple.eofms.jobs.GeoserverIntegrateConfigJob</job-class> + <!--job-class>com.ximple.eofms.jobs.OracleTransformColorOwnerJob</job-class--> + <!--job-class>com.ximple.eofms.jobs.OracleTransformColorOwner2CSVJob</job-class--> + <!--volatility>false</volatility--> <durability>false</durability> <recover>false</recover> - <job-data-map allows-transient-data="true"> + <!--job-data-map allows-transient-data="true"--> + <job-data-map> <entry> <key>JOBDATA_DIR</key> - <value>G:\Temp\JobData\tctpc</value> + <value>/Users/Shared/Public/Projects/XGeoDMMS/xjobrun/tctpcjobs/jobdata</value> </entry> <entry> <key>PGHOST</key> - <value>192.168.11.200</value> + <value>10.10.1.17</value> </entry> <entry> - <key>PGDDATBASE</key> - <value>tctpc</value> + <key>PGDATBASE</key> + <value>pgDMMS</value> </entry> <entry> <key>PGPORT</key> @@ -38,19 +55,19 @@ </entry> <entry> <key>PGUSER</key> - <value>spatialdb</value> + <value>tpcdb</value> </entry> <entry> <key>PGPASS</key> - <value>spatialdb000</value> + <value>simple000</value> </entry> <entry> <key>ORAHOST</key> - <value>192.168.11.200</value> + <value>10.10.1.17</value> </entry> <entry> <key>ORAINST</key> - <value>tctpc</value> + <value>orcl</value> </entry> <entry> <key>ORAPORT</key> @@ -58,27 +75,32 @@ </entry> <entry> <key>ORAUSER</key> - <value>spatialdb</value> + <value>system</value> </entry> <entry> <key>ORAPASS</key> - <value>spatialdb000</value> + <value>simple000</value> </entry> <entry> <key>ORGSCHEMA</key> + <!--value>SPATIALDB</value--> <value>SPATIALDB, CMMS_SPATIALDB</value> </entry> <entry> <key>CONVERTDB</key> - <value>true</value> + <value>false</value> </entry> <entry> <key>CONVERTFILE</key> - <value>true</value> + <value>false</value> </entry> <entry> <key>CONVERTELEMIN</key> <value>false</value> + </entry> + <entry> + <key>CONVERTPWTHEMES</key> + <value>true</value> </entry> <entry> <key>CREATEDUMMY</key> @@ -104,16 +126,40 @@ <key>COPYCONNECTIVITYMODE</key> <value>true</value> </entry> + <entry> + <key>PROFILEMODE</key> + <value>true</value> + </entry> + <entry> + <key>USEZONE121</key> + <value>true</value> + </entry> + <entry> + <key>GEOSERVER_URL</key> + <value>http://10.10.1.17:8080/geoserver</value> + </entry> + <entry> + <key>GEOSERVER_USER</key> + <value>admin</value> + </entry> + <entry> + <key>GEOSERVER_PASS</key> + <value>geoserver</value> + </entry> + <entry> + <key>IGNORE_DBETL</key> + <value>false</value> + </entry> </job-data-map> - </job-detail> + </job> <trigger> <simple> <name>convertTrigger</name> <group>DEFAULT</group> - <job-name>ConvertDgn2PostGisIntoPostgre</job-name> + <job-name>ConvertDMMS2PostGisWithGeoserver</job-name> <job-group>DEFAULT</job-group> - <start-time>2008-03-01T18:10:00</start-time> + <start-time>2013-03-01T18:00:00</start-time> <!-- repeat indefinitely every 10 seconds --> <repeat-count>0</repeat-count> <repeat-interval>500</repeat-interval> @@ -121,5 +167,6 @@ </simple> </trigger> - </job> -</quartz> + </schedule> + +</job-scheduling-data> diff --git a/xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs_edb.xml b/xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs_edb.xml new file mode 100644 index 0000000..d625519 --- /dev/null +++ b/xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs_edb.xml @@ -0,0 +1,148 @@ +<?xml version='1.0' encoding='utf-8'?> + +<job-scheduling-data xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd" + version="1.8"> + + <pre-processing-commands> + <delete-jobs-in-group>*</delete-jobs-in-group> + <!-- clear all jobs in scheduler --> + <delete-triggers-in-group>*</delete-triggers-in-group> + <!-- clear all triggers in scheduler --> + </pre-processing-commands> + + <processing-directives> + <!-- if there are any jobs/trigger in scheduler of same name (as in this file), overwrite them --> + <overwrite-existing-data>true</overwrite-existing-data> + <!-- if there are any jobs/trigger in scheduler of same name (as in this file), and over-write is false, ignore them rather then generating an error --> + <ignore-duplicates>false</ignore-duplicates> + </processing-directives> + + <schedule> + <job> + <name>ConvertDgn2GeoSpatialIntoEdb</name> + <group>DEFAULT</group> + <description>A job that convert dgn to gdb spatial</description> + <!--job-class>com.ximple.eofms.jobs.OracleConvertDgn2EdbGeoJob</job-class--> + <job-class>com.ximple.eofms.jobs.OracleConvertDgn2EdbGeoJob</job-class> + <volatility>false</volatility> + <durability>false</durability> + <recover>false</recover> + <!--job-data-map allows-transient-data="true"--> + <job-data-map> + <entry> + <key>JOBDATA_DIR</key> + <value>C:\Usr\Projects\XDCAD\nstpcjobs\jobdata</value> + </entry> + <entry> + <key>EDBHOST</key> + <value>192.168.11.99</value> + </entry> + <entry> + <key>EDBDATBASE</key> + <value>tpcdb</value> + </entry> + <entry> + <key>EDBPORT</key> + <value>5444</value> + </entry> + <entry> + <key>EDBSCHEMA</key> + <value>public</value> + </entry> + <entry> + <key>EDBUSER</key> + <value>tpcdb</value> + </entry> + <entry> + <key>EDBPASS</key> + <value>simple000</value> + </entry> + <entry> + <key>ORAHOST</key> + <value>192.168.11.200</value> + </entry> + <entry> + <key>ORAINST</key> + <value>nntpc</value> + </entry> + <entry> + <key>ORAPORT</key> + <value>1521</value> + </entry> + <entry> + <key>ORAUSER</key> + <value>spatialdb</value> + </entry> + <entry> + <key>ORAPASS</key> + <value>spatialdb000</value> + </entry> + <entry> + <key>ORGSCHEMA</key> + <value>SPATIALDB, CMMS_SPATIALDB</value> + </entry> + <entry> + <key>CONVERTDB</key> + <value>true</value> + </entry> + <entry> + <key>CONVERTFILE</key> + <value>false</value> + </entry> + <entry> + <key>CONVERTELEMIN</key> + <value>false</value> + </entry> + <entry> + <key>CREATEDUMMY</key> + <value>false</value> + </entry> + <entry> + <key>ELEMLOG</key> + <value>true</value> + </entry> + <entry> + <key>USEWKB</key> + <value>true</value> + </entry> + <entry> + <key>TESTMODE</key> + <value>false</value> + </entry> + <entry> + <key>TESTCOUNT</key> + <value>2</value> + </entry> + <entry> + <key>COPYCONNECTIVITYMODE</key> + <value>false</value> + </entry> + <entry> + <key>PROFILEMODE</key> + <value>true</value> + </entry> + <entry> + <key>USEZONE121</key> + <value>true</value> + </entry> + </job-data-map> + </job> + + <trigger> + <simple> + <name>convertTrigger</name> + <group>DEFAULT</group> + <job-name>ConvertDgn2GeoSpatialIntoEdb</job-name> + <job-group>DEFAULT</job-group> + <start-time>2008-03-01T18:10:00</start-time> + <!-- repeat indefinitely every 10 seconds --> + <repeat-count>0</repeat-count> + <repeat-interval>500</repeat-interval> + <!-- <repeat-interval>72000000</repeat-interval> --> + </simple> + </trigger> + + </schedule> +</job-scheduling-data> diff --git a/xdgnjobs/ximple-jobcarrier/src/test/java/com/ximple/eofms/XQuartzJobCarrierTest.java b/xdgnjobs/ximple-jobcarrier/src/test/java/com/ximple/eofms/XQuartzJobCarrierTest.java index d907cc1..9a5384e 100644 --- a/xdgnjobs/ximple-jobcarrier/src/test/java/com/ximple/eofms/XQuartzJobCarrierTest.java +++ b/xdgnjobs/ximple-jobcarrier/src/test/java/com/ximple/eofms/XQuartzJobCarrierTest.java @@ -6,14 +6,12 @@ /** * Unit test for simple App. */ -public class XQuartzJobCarrierTest -{ +public class XQuartzJobCarrierTest { /** * Rigourous Test :-) */ @Test - public void testApp() - { + public void testApp() { Assert.assertTrue(true); } } diff --git a/xdgnjobs/ximple-spatialjob/pom.xml b/xdgnjobs/ximple-spatialjob/pom.xml index 1a4d8db..835fe67 100644 --- a/xdgnjobs/ximple-spatialjob/pom.xml +++ b/xdgnjobs/ximple-spatialjob/pom.xml @@ -7,18 +7,18 @@ <parent> <groupId>com.ximple.eofms</groupId> <artifactId>ximple-dgnjobs</artifactId> - <version>0.9.0</version> + <version>2.1.1</version> </parent> <groupId>com.ximple.eofms</groupId> <artifactId>ximple-spatialjob</artifactId> - <version>0.9.0</version> + <version>2.1.1</version> <packaging>jar</packaging> <name>ximple-spatialjob</name> <url>http://www.ximple.com.tw</url> <properties> - <xdgnio.version>0.9.0</xdgnio.version> + <xdgnio.version>2.1.1</xdgnio.version> </properties> <description> @@ -30,7 +30,7 @@ <url>http://www.ximple.com.tw</url> </organization> - <inceptionYear>2008</inceptionYear> + <inceptionYear>2010</inceptionYear> <developers> <developer> @@ -52,56 +52,71 @@ <!-- =========================================================== --> <dependencies> <dependency> + <groupId>org.quartz-scheduler</groupId> <artifactId>quartz</artifactId> - <groupId>opensymphony</groupId> + </dependency> + <dependency> + <groupId>org.quartz-scheduler</groupId> + <artifactId>quartz-jobs</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-shapefile</artifactId> + <artifactId>gt-shapefile</artifactId> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-sample-data</artifactId> + <artifactId>gt-sample-data</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-data</artifactId> + <artifactId>gt-data</artifactId> </dependency> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-jdbc</artifactId> + <artifactId>gt-jdbc</artifactId> </dependency> <dependency> - <groupId>org.geotools</groupId> - <artifactId>gt2-postgis</artifactId> + <groupId>org.geotools.jdbc</groupId> + <artifactId>gt-jdbc-postgis</artifactId> </dependency> <dependency> - <groupId>org.geotools</groupId> - <artifactId>gt2-oracle-spatial</artifactId> + <groupId>org.geotools.jdbc</groupId> + <artifactId>gt-jdbc-oracle</artifactId> </dependency> <dependency> - <groupId>org.geotools</groupId> - <artifactId>gt2-mysql</artifactId> + <groupId>org.geotools.jdbc</groupId> + <artifactId>gt-jdbc-mysql</artifactId> </dependency> <!-- because main and sample-data depend on referencing we need a tie breaker --> <dependency> <groupId>org.geotools</groupId> - <artifactId>gt2-referencing</artifactId> + <artifactId>gt-referencing</artifactId> </dependency> <!-- We need this to make the referencing module useful --> <dependency> - <artifactId>gt2-epsg-hsql</artifactId> <groupId>org.geotools</groupId> - <scope>test</scope> + <artifactId>gt-epsg-wkt</artifactId> </dependency> <dependency> <artifactId>jdom</artifactId> - <groupId>jdom</groupId> + <groupId>org.jdom</groupId> </dependency> <dependency> @@ -127,18 +142,29 @@ <artifactId>sdoutl</artifactId> </dependency> - <dependency> + <!--dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> - </dependency> + </dependency--> <dependency> <groupId>org.postgis</groupId> <artifactId>postgis-driver</artifactId> </dependency> <dependency> + <groupId>com.ximple.eofms</groupId> + <artifactId>xedb-gt-geospatial</artifactId> + </dependency> + + <!--dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> + </dependency--> + + <dependency> + <groupId>net.sf.opencsv</groupId> + <artifactId>opencsv</artifactId> + <version>2.3</version> </dependency> <!-- Ximple Library --> diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/collector/FeatureClassification.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/collector/FeatureClassification.java index e4024ec..15be863 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/collector/FeatureClassification.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/collector/FeatureClassification.java @@ -2,27 +2,22 @@ import java.util.TreeMap; -public class FeatureClassification -{ +public class FeatureClassification { private TreeMap<String, FeatureTypeCollector> clasificationRules; - public FeatureClassification() - { + public FeatureClassification() { clasificationRules = new TreeMap<String, FeatureTypeCollector>(); } - public void addCollector(FeatureTypeCollector collector) - { + public void addCollector(FeatureTypeCollector collector) { collector.getName(); } - public boolean containsKey(String typeName) - { + public boolean containsKey(String typeName) { return clasificationRules.containsKey(typeName); } - public TreeMap<String, FeatureTypeCollector> getClasificationRules() - { + public TreeMap<String, FeatureTypeCollector> getClasificationRules() { return clasificationRules; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/collector/FeatureTypeCollector.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/collector/FeatureTypeCollector.java index 7309b3f..e0ced6f 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/collector/FeatureTypeCollector.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/collector/FeatureTypeCollector.java @@ -4,44 +4,36 @@ import com.ximple.eofms.util.StringUtils; -public class FeatureTypeCollector -{ +public class FeatureTypeCollector { private String name; private String description; private String featuretypeList; private ArrayList<String> featureTypeNameList; - public FeatureTypeCollector() - { + public FeatureTypeCollector() { } - public String getName() - { + public String getName() { return name; } - public void setName(String name) - { + public void setName(String name) { this.name = name; } - public String getDescription() - { + public String getDescription() { return description; } - public void setDescription(String description) - { + public void setDescription(String description) { this.description = description; } - public String getFeaturetypeList() - { + public String getFeaturetypeList() { return featuretypeList; } - public void setFeaturetypeList(String featuretypeList) - { + public void setFeaturetypeList(String featuretypeList) { featureTypeNameList = StringUtils.split(featuretypeList, ","); this.featuretypeList = featuretypeList; } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractDispatchableFilter.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractDispatchableFilter.java index d6e91b1..35973ee 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractDispatchableFilter.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractDispatchableFilter.java @@ -1,99 +1,80 @@ package com.ximple.eofms.filter; -import java.util.LinkedList; - -import javax.swing.event.EventListenerList; - +import com.ximple.io.dgn7.Element; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import com.ximple.io.dgn7.Element; +import javax.swing.event.EventListenerList; +import java.util.LinkedList; -public abstract class AbstractDispatchableFilter implements ElementDispatchableFilter -{ +public abstract class AbstractDispatchableFilter implements ElementDispatchableFilter { private String name; private String description; private LinkedList<ElementTypeCriterion> typeIdCriterions; private LinkedList<ElementLevelCriterion> levelCriterions; - protected Log logger = LogFactory.getLog(AbstractFLinkageDispatchableFilter.class); + protected static final Log logger = LogFactory.getLog(AbstractDispatchableFilter.class); // Create the listener list protected EventListenerList listenerList = new EventListenerList(); - public AbstractDispatchableFilter() - { + public AbstractDispatchableFilter() { typeIdCriterions = new LinkedList<ElementTypeCriterion>(); levelCriterions = new LinkedList<ElementLevelCriterion>(); } - public String getName() - { + public String getName() { return name; } - public void setName(String name) - { + public void setName(String name) { this.name = name; } - public String getDescription() - { + public String getDescription() { return description; } - public void setDescription(String description) - { + public void setDescription(String description) { this.description = description; } - public void addCriterion(ElementTypeCriterion criterion) - { + public void addCriterion(ElementTypeCriterion criterion) { typeIdCriterions.add(criterion); } - public void addLevelCriterion(ElementLevelCriterion criterion) - { + public void addLevelCriterion(ElementLevelCriterion criterion) { levelCriterions.add(criterion); } - protected int compareType(Element element) - { - for (ElementTypeCriterion criterion : typeIdCriterions) - { + protected int compareType(Element element) { + for (ElementTypeCriterion criterion : typeIdCriterions) { if (criterion.compareTo(element) == 0) return 0; } return -1; } - protected int compareLevel(Element element) - { - for (ElementLevelCriterion criterion : levelCriterions) - { + protected int compareLevel(Element element) { + for (ElementLevelCriterion criterion : levelCriterions) { if (criterion.compareTo(element) == 0) return 0; } return -1; } - public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.add(CreateFeatureTypeEventListener.class, listener); } - public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.remove(CreateFeatureTypeEventListener.class, listener); } - protected void fireFeatureTypeEvent(FeatureTypeEvent evt) - { + protected void fireFeatureTypeEvent(FeatureTypeEvent evt) { Object[] listeners = listenerList.getListenerList(); - for (int i = 0; i < listeners.length; i += 2) - { - if (listeners[i] == CreateFeatureTypeEventListener.class) - { + for (int i = 0; i < listeners.length; i += 2) { + if (listeners[i] == CreateFeatureTypeEventListener.class) { ((CreateFeatureTypeEventListener) listeners[i + 1]).createFeatureTypeOccurred(evt); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractFLinkageDispatchableFilter.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractFLinkageDispatchableFilter.java index 48be949..3a67712 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractFLinkageDispatchableFilter.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractFLinkageDispatchableFilter.java @@ -1,25 +1,31 @@ package com.ximple.eofms.filter; -import java.util.List; - import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.FrammeAttributeData; import com.ximple.io.dgn7.UserAttributeData; -public abstract class AbstractFLinkageDispatchableFilter extends AbstractDispatchableFilter -{ - public static FrammeAttributeData getFeatureLinkage(Element element) - { +import java.util.List; + +public abstract class AbstractFLinkageDispatchableFilter extends AbstractDispatchableFilter { + public static FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; - List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) + try { + List<UserAttributeData> usrDatas = element.getUserAttributeData(); + + if(usrDatas == null) { - return (FrammeAttributeData) anUsrData; + return null; } + + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { + return (FrammeAttributeData) anUsrData; + } + } + } catch (ArrayIndexOutOfBoundsException e) { + logger.debug(e.getMessage(), e); } return null; } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateArcLineStringStrategy.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateArcLineStringStrategy.java index 1b80073..b2de9ae 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateArcLineStringStrategy.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateArcLineStringStrategy.java @@ -1,89 +1,81 @@ package com.ximple.eofms.filter; -import java.util.List; -import java.util.TreeMap; - -import javax.swing.event.EventListenerList; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; - -import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.Geometry; - -import com.ximple.eofms.util.DefaultColorTable; -import com.ximple.eofms.util.FeatureTypeBuilderUtil; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; +import com.vividsolutions.jts.geom.GeometryFactory; +import com.ximple.eofms.util.*; import com.ximple.io.dgn7.ArcElement; import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.FrammeAttributeData; import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.geotools.feature.SchemaException; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; -public class CreateArcLineStringStrategy implements CreateFeatureTypeStrategy -{ +import javax.swing.event.EventListenerList; +import java.util.List; +import java.util.TreeMap; + +public class CreateArcLineStringStrategy implements CreateFeatureTypeStrategy { static final Log logger = LogFactory.getLog(CreateLineStringStrategy.class); - GeometryFactory geometryFactory = new GeometryFactory(); - TreeMap<String, FeatureTypeBuilder> typeBuilders = new TreeMap<String, FeatureTypeBuilder>(); - TWD97GeometryConverterDecorator convertDecorator = new TWD97GeometryConverterDecorator(); + GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); + TreeMap<String, SimpleFeatureType> typeBuilders = new TreeMap<String, SimpleFeatureType>(); // Create the listener list protected EventListenerList listenerList = new EventListenerList(); - public CreateArcLineStringStrategy() - { + public CreateArcLineStringStrategy() { } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } return null; } - public FeatureType createFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createArcFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); + public SimpleFeatureType createFeatureElement(String featureName) throws SchemaException { + if (!typeBuilders.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createArcFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + typeBuilders.put(featureName, featureType); + fireFeatureTypeEvent(new FeatureTypeEvent(this, featureType)); + } - return typeBuilders.get(featureName).getFeatureType(); + return typeBuilders.get(featureName); } - public Feature createFeature(FeatureType featureType, Element element, boolean useTransform) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element, + short distId, boolean useTransform) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); FrammeAttributeData fLinkage = getFeatureLinkage(element); - Feature feature = null; + SimpleFeature feature = null; if (fLinkage == null) return null; - if (element instanceof ArcElement) - { + if (element instanceof ArcElement) { ArcElement lineStringElement = (ArcElement) element; Geometry gobj; - if (useTransform) - { + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(lineStringElement); gobj = convertDecorator.toGeometry(geometryFactory); } else { gobj = lineStringElement.toGeometry(geometryFactory); } if (gobj != null) - feature = featureType.create(new Object[]{ + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ gobj, + distId, fLinkage.getFsc(), (long) fLinkage.getUfid(), (short) fLinkage.getComponentID(), @@ -92,28 +84,23 @@ colorTable.getColorCode(lineStringElement.getColorIndex()), (short) lineStringElement.getWeight(), (short) lineStringElement.getLineStyle() - }); + }, null); } return feature; } - public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.add(CreateFeatureTypeEventListener.class, listener); } - public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.remove(CreateFeatureTypeEventListener.class, listener); } - protected void fireFeatureTypeEvent(FeatureTypeEvent evt) - { + protected void fireFeatureTypeEvent(FeatureTypeEvent evt) { Object[] listeners = listenerList.getListenerList(); - for (int i = 0; i < listeners.length; i += 2) - { - if (listeners[i] == CreateFeatureTypeEventListener.class) - { + for (int i = 0; i < listeners.length; i += 2) { + if (listeners[i] == CreateFeatureTypeEventListener.class) { ((CreateFeatureTypeEventListener) listeners[i + 1]).createFeatureTypeOccurred(evt); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateComplexChainStrategy.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateComplexChainStrategy.java index bb9f832..ce0c8b6 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateComplexChainStrategy.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateComplexChainStrategy.java @@ -1,212 +1,185 @@ package com.ximple.eofms.filter; -import java.util.List; -import java.util.TreeMap; -import javax.swing.event.EventListenerList; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; - import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.LineString; +import com.ximple.eofms.util.*; +import com.ximple.io.dgn7.*; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.geotools.feature.SchemaException; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; -import com.ximple.eofms.util.DefaultColorTable; -import com.ximple.eofms.util.FeatureTypeBuilderUtil; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; -import com.ximple.io.dgn7.ArcElement; -import com.ximple.io.dgn7.ComplexChainElement; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.io.dgn7.LineElement; -import com.ximple.io.dgn7.LineStringElement; -import com.ximple.io.dgn7.UserAttributeData; +import javax.swing.event.EventListenerList; +import java.util.List; +import java.util.TreeMap; -public class CreateComplexChainStrategy implements CreateFeatureTypeStrategy -{ +public class CreateComplexChainStrategy implements CreateFeatureTypeStrategy { static final Log logger = LogFactory.getLog(CreateLineStringStrategy.class); - GeometryFactory geometryFactory = new GeometryFactory(); - TreeMap<String, FeatureTypeBuilder> typeBuilders = new TreeMap<String, FeatureTypeBuilder>(); - TWD97GeometryConverterDecorator convertDecorator = new TWD97GeometryConverterDecorator(); + GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); + TreeMap<String, SimpleFeatureType> typeBuilders = new TreeMap<String, SimpleFeatureType>(); // Create the listener list protected EventListenerList listenerList = new EventListenerList(); - public CreateComplexChainStrategy() - { + public CreateComplexChainStrategy() { } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } return null; } - public FeatureType createFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createMultiLineFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); - fireFeatureTypeEvent(new FeatureTypeEvent(this, typeBuilder.getFeatureType())); + public SimpleFeatureType createFeatureElement(String featureName) throws SchemaException { + if (!typeBuilders.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createMultiLineFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + typeBuilders.put(featureName, featureType); + fireFeatureTypeEvent(new FeatureTypeEvent(this, featureType)); } - return typeBuilders.get(featureName).getFeatureType(); + return typeBuilders.get(featureName); } - public Feature createFeature(FeatureType featureType, Element element, boolean useTransform) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element, + short distId, boolean useTransform) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); FrammeAttributeData fLinkage = getFeatureLinkage(element); - Feature feature = null; + SimpleFeature feature = null; if (fLinkage == null) return null; - if (element instanceof LineStringElement) - { + if (element instanceof LineStringElement) { LineStringElement lineStringElement = (LineStringElement) element; Geometry gobj; - if (useTransform) - { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); + if (useTransform) { convertDecorator.setConverter(lineStringElement); gobj = convertDecorator.toGeometry(geometryFactory); - } else - { + } else { gobj = lineStringElement.toGeometry(geometryFactory); } - if (gobj instanceof LineString) - { + if (gobj instanceof LineString) { gobj = geometryFactory.createMultiLineString(new LineString[]{(LineString) gobj}); } if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) lineStringElement.getLevelIndex(), - colorTable.getColorCode(lineStringElement.getColorIndex()), - (short) lineStringElement.getWeight(), - (short) lineStringElement.getLineStyle() - }); - } else if (element instanceof ComplexChainElement) - { + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) lineStringElement.getLevelIndex(), + colorTable.getColorCode(lineStringElement.getColorIndex()), + (short) lineStringElement.getWeight(), + (short) lineStringElement.getLineStyle() + }, null); + } else if (element instanceof ComplexChainElement) { ComplexChainElement complexChain = (ComplexChainElement) element; Geometry gobj; - if (useTransform) - { + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(complexChain); gobj = convertDecorator.toGeometry(geometryFactory); } else gobj = complexChain.toGeometry(geometryFactory); - if (gobj instanceof LineString) - { + if (gobj instanceof LineString) { gobj = geometryFactory.createMultiLineString(new LineString[]{(LineString) gobj}); } if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) complexChain.getLevelIndex(), - colorTable.getColorCode(complexChain.getColorIndex()), - (short) complexChain.getWeight(), - (short) complexChain.getLineStyle() - }); - } else if (element instanceof LineElement) - { + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) complexChain.getLevelIndex(), + colorTable.getColorCode(complexChain.getColorIndex()), + (short) complexChain.getWeight(), + (short) complexChain.getLineStyle() + }, null); + } else if (element instanceof LineElement) { LineElement lineElement = (LineElement) element; Geometry gobj; - if (useTransform) - { + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(lineElement); gobj = convertDecorator.toGeometry(geometryFactory); - } else - { + } else { gobj = lineElement.toGeometry(geometryFactory); } - if (gobj instanceof LineString) - { + if (gobj instanceof LineString) { gobj = geometryFactory.createMultiLineString(new LineString[]{(LineString) gobj}); } if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) lineElement.getLevelIndex(), - colorTable.getColorCode(lineElement.getColorIndex()), - (short) lineElement.getWeight(), - (short) lineElement.getLineStyle() - }); + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) lineElement.getLevelIndex(), + colorTable.getColorCode(lineElement.getColorIndex()), + (short) lineElement.getWeight(), + (short) lineElement.getLineStyle() + }, null); return feature; - } else if (element instanceof ArcElement) - { + } else if (element instanceof ArcElement) { ArcElement arcElement = (ArcElement) element; Geometry gobj; - if (useTransform) - { + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(arcElement); gobj = convertDecorator.toGeometry(geometryFactory); - } else - { + } else { gobj = arcElement.toGeometry(geometryFactory); } - if (gobj instanceof LineString) - { + if (gobj instanceof LineString) { gobj = geometryFactory.createMultiLineString(new LineString[]{(LineString) gobj}); } if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) arcElement.getLevelIndex(), - colorTable.getColorCode(arcElement.getColorIndex()), - (short) arcElement.getWeight(), - (short) arcElement.getLineStyle() - }); + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) arcElement.getLevelIndex(), + colorTable.getColorCode(arcElement.getColorIndex()), + (short) arcElement.getWeight(), + (short) arcElement.getLineStyle() + }, null); } return feature; } - public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.add(CreateFeatureTypeEventListener.class, listener); } - public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.remove(CreateFeatureTypeEventListener.class, listener); } - protected void fireFeatureTypeEvent(FeatureTypeEvent evt) - { + protected void fireFeatureTypeEvent(FeatureTypeEvent evt) { Object[] listeners = listenerList.getListenerList(); - for (int i = 0; i < listeners.length; i += 2) - { - if (listeners[i] == CreateFeatureTypeEventListener.class) - { + for (int i = 0; i < listeners.length; i += 2) { + if (listeners[i] == CreateFeatureTypeEventListener.class) { ((CreateFeatureTypeEventListener) listeners[i + 1]).createFeatureTypeOccurred(evt); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateEllipseShapeStrategy.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateEllipseShapeStrategy.java index d7f07b6..1f65012 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateEllipseShapeStrategy.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateEllipseShapeStrategy.java @@ -1,119 +1,104 @@ package com.ximple.eofms.filter; -import java.util.List; -import java.util.TreeMap; -import javax.swing.event.EventListenerList; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; - import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; - -import com.ximple.eofms.util.DefaultColorTable; -import com.ximple.eofms.util.FeatureTypeBuilderUtil; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; +import com.ximple.eofms.util.*; import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.EllipseElement; import com.ximple.io.dgn7.FrammeAttributeData; import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.geotools.feature.SchemaException; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; -public class CreateEllipseShapeStrategy implements CreateFeatureTypeStrategy -{ +import javax.swing.event.EventListenerList; +import java.util.List; +import java.util.TreeMap; + +public class CreateEllipseShapeStrategy implements CreateFeatureTypeStrategy { static final Log logger = LogFactory.getLog(CreateShapeStrategy.class); - GeometryFactory geometryFactory = new GeometryFactory(); - TreeMap<String, FeatureTypeBuilder> typeBuilders = new TreeMap<String, FeatureTypeBuilder>(); - TWD97GeometryConverterDecorator convertDecorator = new TWD97GeometryConverterDecorator(); + GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); + TreeMap<String, SimpleFeatureType> typeBuilders = new TreeMap<String, SimpleFeatureType>(); // Create the listener list protected EventListenerList listenerList = new EventListenerList(); - public CreateEllipseShapeStrategy() - { + public CreateEllipseShapeStrategy() { } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } return null; } - public FeatureType createFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createEllipseFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); + public SimpleFeatureType createFeatureElement(String featureName) throws SchemaException { + if (!typeBuilders.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createEllipseFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + typeBuilders.put(featureName, featureType); } - return typeBuilders.get(featureName).getFeatureType(); + return typeBuilders.get(featureName); } - public Feature createFeature(FeatureType featureType, Element element, boolean useTransform) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element, + short distId, boolean useTransform) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); FrammeAttributeData fLinkage = getFeatureLinkage(element); - Feature feature = null; + SimpleFeature feature = null; if (fLinkage == null) return null; - if (element instanceof EllipseElement) - { + if (element instanceof EllipseElement) { EllipseElement ellipseElement = (EllipseElement) element; Geometry gobj; - if (useTransform) - { + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(ellipseElement); gobj = convertDecorator.toGeometry(geometryFactory); - } else - { + } else { gobj = ellipseElement.toGeometry(geometryFactory); } if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) ellipseElement.getLevelIndex(), - colorTable.getColorCode(ellipseElement.getColorIndex()), - (short) ellipseElement.getWeight(), - (short) ellipseElement.getLineStyle() - }); + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) ellipseElement.getLevelIndex(), + colorTable.getColorCode(ellipseElement.getColorIndex()), + (short) ellipseElement.getWeight(), + (short) ellipseElement.getLineStyle() + }, null); } return feature; } - public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.add(CreateFeatureTypeEventListener.class, listener); } - public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.remove(CreateFeatureTypeEventListener.class, listener); } - protected void fireFeatureTypeEvent(FeatureTypeEvent evt) - { + protected void fireFeatureTypeEvent(FeatureTypeEvent evt) { Object[] listeners = listenerList.getListenerList(); - for (int i = 0; i < listeners.length; i += 2) - { - if (listeners[i] == CreateFeatureTypeEventListener.class) - { + for (int i = 0; i < listeners.length; i += 2) { + if (listeners[i] == CreateFeatureTypeEventListener.class) { ((CreateFeatureTypeEventListener) listeners[i + 1]).createFeatureTypeOccurred(evt); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateFeatureTypeEventListener.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateFeatureTypeEventListener.java index 4a81200..2d457e5 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateFeatureTypeEventListener.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateFeatureTypeEventListener.java @@ -2,7 +2,6 @@ import java.util.EventListener; -public interface CreateFeatureTypeEventListener extends EventListener -{ +public interface CreateFeatureTypeEventListener extends EventListener { public void createFeatureTypeOccurred(FeatureTypeEvent evt); } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateFeatureTypeStrategy.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateFeatureTypeStrategy.java index 6372609..c88783f 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateFeatureTypeStrategy.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateFeatureTypeStrategy.java @@ -1,17 +1,18 @@ package com.ximple.eofms.filter; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; - import com.ximple.io.dgn7.Element; +import org.geotools.feature.SchemaException; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; -public interface CreateFeatureTypeStrategy -{ - public FeatureType createFeatureElement(String featureName) throws SchemaException; - public Feature createFeature(FeatureType featureType, Element element, boolean useTransform) throws IllegalAttributeException; +public interface CreateFeatureTypeStrategy { + public SimpleFeatureType createFeatureElement(String featureName) throws SchemaException; + + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element, + short distId, boolean useTransform) throws IllegalAttributeException; public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener); + public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener); } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineStringStrategy.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineStringStrategy.java index b7ddf6f..7d10932 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineStringStrategy.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineStringStrategy.java @@ -1,210 +1,184 @@ package com.ximple.eofms.filter; -import java.util.List; -import java.util.TreeMap; -import javax.swing.event.EventListenerList; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; - import com.vividsolutions.jts.geom.CoordinateList; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.MultiLineString; +import com.ximple.eofms.util.*; +import com.ximple.io.dgn7.*; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.geotools.feature.SchemaException; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; -import com.ximple.eofms.util.DefaultColorTable; -import com.ximple.eofms.util.FeatureTypeBuilderUtil; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; -import com.ximple.io.dgn7.ArcElement; -import com.ximple.io.dgn7.ComplexChainElement; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.io.dgn7.LineElement; -import com.ximple.io.dgn7.LineStringElement; -import com.ximple.io.dgn7.UserAttributeData; +import javax.swing.event.EventListenerList; +import java.util.List; +import java.util.TreeMap; -public class CreateLineStringStrategy implements CreateFeatureTypeStrategy -{ +public class CreateLineStringStrategy implements CreateFeatureTypeStrategy { static final Log logger = LogFactory.getLog(CreateLineStringStrategy.class); - GeometryFactory geometryFactory = new GeometryFactory(); - TreeMap<String, FeatureTypeBuilder> typeBuilders = new TreeMap<String, FeatureTypeBuilder>(); - TWD97GeometryConverterDecorator convertDecorator = new TWD97GeometryConverterDecorator(); + GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); + TreeMap<String, SimpleFeatureType> typeBuilders = new TreeMap<String, SimpleFeatureType>(); // Create the listener list protected EventListenerList listenerList = new EventListenerList(); - public CreateLineStringStrategy() - { + public CreateLineStringStrategy() { } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } return null; } - public FeatureType createFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createLineFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); - fireFeatureTypeEvent(new FeatureTypeEvent(this, typeBuilder.getFeatureType())); + public SimpleFeatureType createFeatureElement(String featureName) throws SchemaException { + if (!typeBuilders.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createLineFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + typeBuilders.put(featureName, featureType); + fireFeatureTypeEvent(new FeatureTypeEvent(this, featureType)); } - return typeBuilders.get(featureName).getFeatureType(); + return typeBuilders.get(featureName); } - public Feature createFeature(FeatureType featureType, Element element, boolean useTransform) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element, + short distId, boolean useTransform) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); FrammeAttributeData fLinkage = getFeatureLinkage(element); - Feature feature = null; + SimpleFeature feature = null; if (fLinkage == null) return null; - if (element instanceof LineStringElement) - { + if (element instanceof LineStringElement) { LineStringElement lineStringElement = (LineStringElement) element; Geometry gobj; - if (useTransform) - { + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(lineStringElement); gobj = convertDecorator.toGeometry(geometryFactory); - } else - { + } else { gobj = lineStringElement.toGeometry(geometryFactory); } if (gobj != null) - feature = featureType.create(new Object[]{ - convertDecorator.toGeometry(geometryFactory), - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) lineStringElement.getLevelIndex(), - colorTable.getColorCode(lineStringElement.getColorIndex()), - (short) lineStringElement.getWeight(), - (short) lineStringElement.getLineStyle() - }); - } else if (element instanceof ComplexChainElement) - { + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) lineStringElement.getLevelIndex(), + colorTable.getColorCode(lineStringElement.getColorIndex()), + (short) lineStringElement.getWeight(), + (short) lineStringElement.getLineStyle() + }, null); + } else if (element instanceof ComplexChainElement) { ComplexChainElement complexChain = (ComplexChainElement) element; Geometry gobj; - if (useTransform) - { + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(complexChain); gobj = convertDecorator.toGeometry(geometryFactory); - } else - { + } else { gobj = complexChain.toGeometry(geometryFactory); } - if ((gobj != null) && (gobj instanceof MultiLineString)) - { + if ((gobj != null) && (gobj instanceof MultiLineString)) { MultiLineString mline = (MultiLineString) gobj; CoordinateList coordinateList = new CoordinateList(); - for (int i = 0; i < mline.getNumGeometries(); i++) - { + for (int i = 0; i < mline.getNumGeometries(); i++) { coordinateList.add(mline.getGeometryN(i).getCoordinates(), true); } gobj = geometryFactory.createLineString(coordinateList.toCoordinateArray()); } if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) complexChain.getLevelIndex(), - colorTable.getColorCode(complexChain.getColorIndex()), - (short) complexChain.getWeight(), - (short) complexChain.getLineStyle() - }); - } else if (element instanceof LineElement) - { + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) complexChain.getLevelIndex(), + colorTable.getColorCode(complexChain.getColorIndex()), + (short) complexChain.getWeight(), + (short) complexChain.getLineStyle() + }, null); + } else if (element instanceof LineElement) { LineElement lineElement = (LineElement) element; Geometry gobj; - if (useTransform) - { + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(lineElement); gobj = convertDecorator.toGeometry(geometryFactory); - } else - { + } else { gobj = lineElement.toGeometry(geometryFactory); } if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) lineElement.getLevelIndex(), - colorTable.getColorCode(lineElement.getColorIndex()), - (short) lineElement.getWeight(), - (short) lineElement.getLineStyle() - }); + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) lineElement.getLevelIndex(), + colorTable.getColorCode(lineElement.getColorIndex()), + (short) lineElement.getWeight(), + (short) lineElement.getLineStyle() + }, null); return feature; - } else if (element instanceof ArcElement) - { + } else if (element instanceof ArcElement) { ArcElement arcElement = (ArcElement) element; Geometry gobj; - if (useTransform) - { + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(arcElement); gobj = convertDecorator.toGeometry(geometryFactory); - } else - { + } else { gobj = arcElement.toGeometry(geometryFactory); } if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) arcElement.getLevelIndex(), - colorTable.getColorCode(arcElement.getColorIndex()), - (short) arcElement.getWeight(), - (short) arcElement.getLineStyle() - }); + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) arcElement.getLevelIndex(), + colorTable.getColorCode(arcElement.getColorIndex()), + (short) arcElement.getWeight(), + (short) arcElement.getLineStyle() + }, null); } return feature; } - public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.add(CreateFeatureTypeEventListener.class, listener); } - public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.remove(CreateFeatureTypeEventListener.class, listener); } - protected void fireFeatureTypeEvent(FeatureTypeEvent evt) - { + protected void fireFeatureTypeEvent(FeatureTypeEvent evt) { Object[] listeners = listenerList.getListenerList(); - for (int i = 0; i < listeners.length; i += 2) - { - if (listeners[i] == CreateFeatureTypeEventListener.class) - { + for (int i = 0; i < listeners.length; i += 2) { + if (listeners[i] == CreateFeatureTypeEventListener.class) { ((CreateFeatureTypeEventListener) listeners[i + 1]).createFeatureTypeOccurred(evt); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineTextStrategy.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineTextStrategy.java index 924697d..100bb1b 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineTextStrategy.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineTextStrategy.java @@ -1,98 +1,76 @@ package com.ximple.eofms.filter; +import com.vividsolutions.jts.geom.*; +import com.ximple.eofms.util.*; +import com.ximple.io.dgn7.*; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.geotools.feature.SchemaException; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; + +import javax.swing.event.EventListenerList; import java.util.List; import java.util.TreeMap; -import javax.swing.event.EventListenerList; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; - -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.GeometryFactory; -import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.MultiLineString; -import com.vividsolutions.jts.geom.CoordinateList; - -import com.ximple.eofms.util.DefaultColorTable; -import com.ximple.eofms.util.FeatureTypeBuilderUtil; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; -import com.ximple.eofms.util.TWDDatumConverter; -import com.ximple.io.dgn7.ComplexChainElement; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.io.dgn7.LineElement; -import com.ximple.io.dgn7.LineStringElement; -import com.ximple.io.dgn7.TextElement; -import com.ximple.io.dgn7.UserAttributeData; - -public class CreateLineTextStrategy implements CreateFeatureTypeStrategy -{ +public class CreateLineTextStrategy implements CreateFeatureTypeStrategy { static final Log logger = LogFactory.getLog(CreateLineTextStrategy.class); - GeometryFactory geometryFactory = new GeometryFactory(); - TreeMap<String, FeatureTypeBuilder> typeBuilders = new TreeMap<String, FeatureTypeBuilder>(); - TWD97GeometryConverterDecorator convertDecorator = new TWD97GeometryConverterDecorator(); + GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); + TreeMap<String, SimpleFeatureType> typeBuilders = new TreeMap<String, SimpleFeatureType>(); // Create the listener list protected EventListenerList listenerList = new EventListenerList(); - public CreateLineTextStrategy() - { + public CreateLineTextStrategy() { } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } return null; } - public FeatureType createFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createLineFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); - fireFeatureTypeEvent(new FeatureTypeEvent(this, typeBuilder.getFeatureType())); + public SimpleFeatureType createFeatureElement(String featureName) throws SchemaException { + if (!typeBuilders.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createLineFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + typeBuilders.put(featureName, featureType); + fireFeatureTypeEvent(new FeatureTypeEvent(this, featureType)); } - return typeBuilders.get(featureName).getFeatureType(); + return typeBuilders.get(featureName); } - public Feature createFeature(FeatureType featureType, Element element, boolean useTransform) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element, + short distId, boolean useTransform) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); FrammeAttributeData fLinkage = getFeatureLinkage(element); - Feature feature = null; + SimpleFeature feature = null; if (fLinkage == null) return null; - if (element instanceof LineStringElement) - { + if (element instanceof LineStringElement) { LineStringElement lineStringElement = (LineStringElement) element; Geometry gobj; - if (useTransform) - { - convertDecorator.setConverter(lineStringElement); - gobj = convertDecorator.toGeometry(geometryFactory); + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); + convertDecorator.setConverter(lineStringElement); + gobj = convertDecorator.toGeometry(geometryFactory); } else { gobj = lineStringElement.toGeometry(geometryFactory); } if (gobj != null) - feature = featureType.create(new Object[]{ + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ gobj, + distId, fLinkage.getFsc(), (long) fLinkage.getUfid(), (short) fLinkage.getComponentID(), @@ -101,19 +79,21 @@ colorTable.getColorCode(lineStringElement.getColorIndex()), (short) lineStringElement.getWeight(), (short) lineStringElement.getLineStyle() - }); - } else if (element instanceof TextElement) - { + }, null); + } else if (element instanceof TextElement) { TextElement txtElement = (TextElement) element; Coordinate ptOrigin = txtElement.getUserOrigin(); Coordinate ptEnd = new Coordinate(); ptEnd.x = ptOrigin.x; ptEnd.y = ptOrigin.y + txtElement.getTextHeight(); Coordinate[] vect = new Coordinate[2]; - if (useTransform) - { - vect[0] = TWDDatumConverter.fromTM2ToTWD97(ptOrigin); - vect[1] = TWDDatumConverter.fromTM2ToTWD97(ptEnd); + if (useTransform) { + vect[0] = (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826) ? + TWDDatumConverter.fromTM2ToEPSG3826(ptOrigin) : + TWDDatumConverter.fromTM2ToEPSG3825(ptOrigin); + vect[1] = FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826 ? + TWDDatumConverter.fromTM2ToEPSG3826(ptEnd) : + TWDDatumConverter.fromTM2ToEPSG3825(ptEnd); } else { vect[0] = new Coordinate(ptOrigin); vect[1] = new Coordinate(ptEnd); @@ -125,36 +105,33 @@ txtElement.getRotationAngle(); - feature = featureType.create(new Object[]{ - line, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) txtElement.getLevelIndex(), - colorTable.getColorCode(txtElement.getColorIndex()), - (short) txtElement.getWeight(), - (short) txtElement.getLineStyle() - }); - } else if (element instanceof ComplexChainElement) - { + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + line, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) txtElement.getLevelIndex(), + colorTable.getColorCode(txtElement.getColorIndex()), + (short) txtElement.getWeight(), + (short) txtElement.getLineStyle() + }, null); + } else if (element instanceof ComplexChainElement) { ComplexChainElement complexChain = (ComplexChainElement) element; Geometry gobj; - if (useTransform) - { - convertDecorator.setConverter(complexChain); - gobj = convertDecorator.toGeometry(geometryFactory); + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); + convertDecorator.setConverter(complexChain); + gobj = convertDecorator.toGeometry(geometryFactory); } else { gobj = complexChain.toGeometry(geometryFactory); } - if ((gobj != null) && (gobj instanceof MultiLineString)) - { + if ((gobj != null) && (gobj instanceof MultiLineString)) { MultiLineString mline = (MultiLineString) gobj; CoordinateList coordinateList = new CoordinateList(); - if (mline.getNumGeometries() == 1) - { - for (int i = 0; i < mline.getNumGeometries(); i++) - { + if (mline.getNumGeometries() == 1) { + for (int i = 0; i < mline.getNumGeometries(); i++) { coordinateList.add(mline.getGeometryN(i).getCoordinates(), true); } } @@ -162,8 +139,9 @@ gobj = geometryFactory.createLineString(coordinateList.toCoordinateArray()); } if (gobj != null) - feature = featureType.create(new Object[]{ + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ gobj, + distId, fLinkage.getFsc(), (long) fLinkage.getUfid(), (short) fLinkage.getComponentID(), @@ -172,52 +150,47 @@ colorTable.getColorCode(complexChain.getColorIndex()), (short) complexChain.getWeight(), (short) complexChain.getLineStyle() - }); - } else if (element instanceof LineElement) - { + }, null); + } else if (element instanceof LineElement) { LineElement lineElement = (LineElement) element; Geometry gobj; - if (useTransform) - { + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(lineElement); gobj = convertDecorator.toGeometry(geometryFactory); } else { gobj = lineElement.toGeometry(geometryFactory); } - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) lineElement.getLevelIndex(), - colorTable.getColorCode(lineElement.getColorIndex()), - (short) lineElement.getWeight(), - (short) lineElement.getLineStyle() - }); + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) lineElement.getLevelIndex(), + colorTable.getColorCode(lineElement.getColorIndex()), + (short) lineElement.getWeight(), + (short) lineElement.getLineStyle() + }, null); } return feature; } - public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.add(CreateFeatureTypeEventListener.class, listener); } - public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.remove(CreateFeatureTypeEventListener.class, listener); } - protected void fireFeatureTypeEvent(FeatureTypeEvent evt) - { + protected void fireFeatureTypeEvent(FeatureTypeEvent evt) { Object[] listeners = listenerList.getListenerList(); - for (int i = 0; i < listeners.length; i += 2) - { - if (listeners[i] == CreateFeatureTypeEventListener.class) - { + for (int i = 0; i < listeners.length; i += 2) { + if (listeners[i] == CreateFeatureTypeEventListener.class) { ((CreateFeatureTypeEventListener) listeners[i + 1]).createFeatureTypeOccurred(evt); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateMultiSymbolStrategy.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateMultiSymbolStrategy.java index 8340448..2454a37 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateMultiSymbolStrategy.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateMultiSymbolStrategy.java @@ -1,234 +1,264 @@ package com.ximple.eofms.filter; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.List; -import java.util.TreeMap; -import javax.swing.event.EventListenerList; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; - +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.CoordinateList; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; -import com.vividsolutions.jts.geom.CoordinateList; -import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.util.Assert; +import com.ximple.eofms.util.*; +import com.ximple.io.dgn7.*; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.geotools.feature.SchemaException; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; -import com.ximple.eofms.util.DefaultColorTable; -import com.ximple.eofms.util.FeatureTypeBuilderUtil; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.io.dgn7.GeometryConverter; -import com.ximple.io.dgn7.TextElement; -import com.ximple.io.dgn7.TextNodeElement; -import com.ximple.io.dgn7.UserAttributeData; +import javax.swing.event.EventListenerList; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Iterator; +import java.util.List; +import java.util.TreeMap; -public class CreateMultiSymbolStrategy implements CreateFeatureTypeStrategy -{ +public class CreateMultiSymbolStrategy implements CreateFeatureTypeStrategy { static final Log logger = LogFactory.getLog(CreateMultiSymbolStrategy.class); - GeometryFactory geometryFactory = new GeometryFactory(); - TreeMap<String, FeatureTypeBuilder> typeBuilders = new TreeMap<String, FeatureTypeBuilder>(); - TWD97AnchorGeometryConverterDecorator convertDecorator = new TWD97AnchorGeometryConverterDecorator(); + GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); + TreeMap<String, SimpleFeatureType> typeBuilders = new TreeMap<String, SimpleFeatureType>(); // Create the listener list protected EventListenerList listenerList = new EventListenerList(); - public CreateMultiSymbolStrategy() - { + public CreateMultiSymbolStrategy() { } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } return null; } - public FeatureType createFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createMultiSymbolFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); - fireFeatureTypeEvent(new FeatureTypeEvent(this, typeBuilder.getFeatureType())); + public SimpleFeatureType createFeatureElement(String featureName) throws SchemaException { + if (!typeBuilders.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createMultiSymbolFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + typeBuilders.put(featureName, featureType); + fireFeatureTypeEvent(new FeatureTypeEvent(this, featureType)); } - return typeBuilders.get(featureName).getFeatureType(); + return typeBuilders.get(featureName); } - public Feature createFeature(FeatureType featureType, Element element, boolean useTransform) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element, + short distId, boolean useTransform) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); FrammeAttributeData fLinkage = getFeatureLinkage(element); - Feature feature = null; + SimpleFeature feature = null; if (fLinkage == null) return null; - if (element instanceof TextElement) - { + if (element instanceof TextElement) { TextElement txtElement = (TextElement) element; double angle = txtElement.getRotationAngle(); angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); - if (txtElement.getText().length() == 0) - { + String content = txtElement.getText().trim(); + if (content.length() == 0) { logger.info("CreateMultiSymbolStrategy cannot conver " + element.toString() + "to Feature - getText() is empty."); return null; } StringBuilder sb = new StringBuilder(); sb.append("OCT"); - char id = txtElement.getText().toCharArray()[0]; + char id = content.toCharArray()[0]; sb.append(Integer.toOctalString((int) id)); sb.append("-"); sb.append(txtElement.getFontIndex()); Geometry gobj; - if (useTransform) - { - convertDecorator.setConverter(txtElement); - gobj = convertDecorator.toGeometry(geometryFactory); + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); + convertDecorator.setConverter(txtElement); + gobj = convertDecorator.toGeometry(geometryFactory); } else { gobj = txtElement.toGeometry(geometryFactory); } if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) txtElement.getLevelIndex(), - colorTable.getColorCode(txtElement.getColorIndex()), - (short) txtElement.getWeight(), - (short) txtElement.getLineStyle(), - (short) txtElement.getJustification(), - (float) txtElement.getTextHeight(), - (float) txtElement.getTextWidth(), - (float) angle, - sb.toString() - }); - } else if (element instanceof TextNodeElement) - { + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) txtElement.getLevelIndex(), + colorTable.getColorCode(txtElement.getColorIndex()), + (short) txtElement.getWeight(), + (short) txtElement.getLineStyle(), + (short) txtElement.getJustification(), + (float) txtElement.getTextHeight(), + (float) txtElement.getTextWidth(), + (float) angle, + sb.toString() + }, null); + } else if (element instanceof TextNodeElement) { TextNodeElement nodeElement = (TextNodeElement) element; + double angle = nodeElement.getRotationAngle(); angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); - if (nodeElement.size() == 0) - { + if (nodeElement.size() == 0) { logger.info("CreateMultiSymbolStrategy cannot conver " + element.toString() + "to Feature - getText() is empty."); return null; } - String[] tmpstrs = nodeElement.getTextArray(); + Iterator<Element> txtElement = nodeElement.iterator(); - StringBuilder sb = new StringBuilder(); - sb.append("OCT"); - char id = tmpstrs[0].toCharArray()[0]; - sb.append(Integer.toOctalString((int) id)); - sb.append("-"); - sb.append(nodeElement.getFontIndex()); + while (txtElement.hasNext()) { + if (txtElement instanceof TextElement) { + TextElement txtChildElement = (TextElement) element; + char[] charArray = txtChildElement.getText().toCharArray(); - Geometry gobj; - if (useTransform) - { - convertDecorator.setConverter(nodeElement); - gobj = convertDecorator.toGeometry(geometryFactory); - } else { - gobj = nodeElement.toGeometry(geometryFactory); + + if (charArray.length == 0) { + logger.info("CreateMultiSymbolStrategy cannot conver " + element.toString() + + "to Feature - getText() is empty."); + return null; + } + + + for (int i = 0; i < charArray.length; i++) { + + StringBuilder sb = new StringBuilder(); + sb.append("OCT"); + char id = charArray[i]; + sb.append(Integer.toOctalString((int) id)); + sb.append("-"); + sb.append(txtChildElement.getFontIndex()); + + Geometry gobj; + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); + convertDecorator.setConverter(txtChildElement); + gobj = convertDecorator.toGeometry(geometryFactory); + } else { + gobj = txtChildElement.toGeometry(geometryFactory); + } + + if (gobj != null) + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) txtChildElement.getLevelIndex(), + colorTable.getColorCode(nodeElement.getColorIndex()), + (short) txtChildElement.getWeight(), + (short) txtChildElement.getLineStyle(), + (short) txtChildElement.getJustification(), + (float) txtChildElement.getTextHeight(), + (float) txtChildElement.getTextWidth(), + (float) angle, + sb.toString() + }, null); + } + } else { + logger.info("CreateMultiSymbolStrategy cannot conver " + element.toString() + "to Feature"); + return null; + } } - if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) nodeElement.getLevelIndex(), - colorTable.getColorCode(nodeElement.getColorIndex()), - (short) nodeElement.getWeight(), - (short) nodeElement.getLineStyle(), - (short) nodeElement.getJustification(), - (float) nodeElement.getTextNodeHeight(), - (float) nodeElement.getTextNodeLength(), - (float) angle, - sb.toString() - }); - } else - { + } else { logger.info("CreateMultiSymbolStrategy cannot conver " + element.toString() + "to Feature"); + return null; } return feature; } - public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.add(CreateFeatureTypeEventListener.class, listener); } - public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.remove(CreateFeatureTypeEventListener.class, listener); } - protected void fireFeatureTypeEvent(FeatureTypeEvent evt) - { + protected void fireFeatureTypeEvent(FeatureTypeEvent evt) { Object[] listeners = listenerList.getListenerList(); - for (int i = 0; i < listeners.length; i += 2) - { - if (listeners[i] == CreateFeatureTypeEventListener.class) - { + for (int i = 0; i < listeners.length; i += 2) { + if (listeners[i] == CreateFeatureTypeEventListener.class) { ((CreateFeatureTypeEventListener) listeners[i + 1]).createFeatureTypeOccurred(evt); } } } - private static class TWD97AnchorGeometryConverterDecorator extends TWD97GeometryConverterDecorator - { - public Geometry toGeometry(GeometryFactory factory) - { + private static class EPSG3826AnchorGeometryConverterDecorator extends EPSG3826GeometryConverterDecorator { + public Geometry toGeometry(GeometryFactory factory) { if (getConverter() == null) Assert.shouldNeverReachHere(); getCoordinatesFilter().reset(); GeometryConverter converter = getConverter(); Geometry geom = null; - try - { - if (converter instanceof TextElement) - { + try { + if (converter instanceof TextElement) { geom = ((TextElement) converter).toAnchorGeometry(factory); - } else if (converter instanceof TextNodeElement) - { + } else if (converter instanceof TextNodeElement) { geom = ((TextNodeElement) converter).toAnchorGeometry(factory); } - } catch (ArrayStoreException e) - { + } catch (ArrayStoreException e) { logger.warn(e.getMessage(), e); - if (converter instanceof TextNodeElement) - { + if (converter instanceof TextNodeElement) { TextNodeElement node = (TextNodeElement) converter; CoordinateList pts = new CoordinateList(); - for (int i = 0; i < node.size(); i++) - { + for (int i = 0; i < node.size(); i++) { TextElement txtElm = (TextElement) node.get(i); Coordinate[] coords = txtElm.toAnchorCoordinates(); logger.warn("-coords=[" + coords.length + "]"); - for (int j = 0; j < coords.length; j++) - { + for (int j = 0; j < coords.length; j++) { + logger.warn("[" + j + "]-" + coords.toString()); + } + } + } + } + if (geom == null) return null; + geom.apply(getCoordinatesFilter()); + return geom; + } + } + + private static class EPSG3825AnchorGeometryConverterDecorator extends EPSG3825GeometryConverterDecorator { + public Geometry toGeometry(GeometryFactory factory) { + if (getConverter() == null) Assert.shouldNeverReachHere(); + + getCoordinatesFilter().reset(); + + GeometryConverter converter = getConverter(); + Geometry geom = null; + try { + if (converter instanceof TextElement) { + geom = ((TextElement) converter).toAnchorGeometry(factory); + } else if (converter instanceof TextNodeElement) { + geom = ((TextNodeElement) converter).toAnchorGeometry(factory); + } + } catch (ArrayStoreException e) { + logger.warn(e.getMessage(), e); + if (converter instanceof TextNodeElement) { + TextNodeElement node = (TextNodeElement) converter; + CoordinateList pts = new CoordinateList(); + for (int i = 0; i < node.size(); i++) { + TextElement txtElm = (TextElement) node.get(i); + Coordinate[] coords = txtElm.toAnchorCoordinates(); + logger.warn("-coords=[" + coords.length + "]"); + for (int j = 0; j < coords.length; j++) { logger.warn("[" + j + "]-" + coords.toString()); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateShapeStrategy.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateShapeStrategy.java index 16de1e8..f36679d 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateShapeStrategy.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateShapeStrategy.java @@ -1,147 +1,127 @@ package com.ximple.eofms.filter; -import java.util.List; -import java.util.TreeMap; -import javax.swing.event.EventListenerList; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; - import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; +import com.ximple.eofms.util.*; +import com.ximple.io.dgn7.*; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.geotools.feature.SchemaException; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; -import com.ximple.eofms.util.DefaultColorTable; -import com.ximple.eofms.util.FeatureTypeBuilderUtil; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; -import com.ximple.io.dgn7.ComplexShapeElement; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.io.dgn7.ShapeElement; -import com.ximple.io.dgn7.UserAttributeData; +import javax.swing.event.EventListenerList; +import java.util.List; +import java.util.TreeMap; -public class CreateShapeStrategy implements CreateFeatureTypeStrategy -{ +public class CreateShapeStrategy implements CreateFeatureTypeStrategy { static final Log logger = LogFactory.getLog(CreateShapeStrategy.class); - GeometryFactory geometryFactory = new GeometryFactory(); - TreeMap<String, FeatureTypeBuilder> typeBuilders = new TreeMap<String, FeatureTypeBuilder>(); - TWD97GeometryConverterDecorator convertDecorator = new TWD97GeometryConverterDecorator(); + GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); + TreeMap<String, SimpleFeatureType> typeBuilders = new TreeMap<String, SimpleFeatureType>(); // Create the listener list protected EventListenerList listenerList = new EventListenerList(); - public CreateShapeStrategy() - { + public CreateShapeStrategy() { } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } return null; } - public FeatureType createFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createPolygonFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); - fireFeatureTypeEvent(new FeatureTypeEvent(this, typeBuilder.getFeatureType())); + public SimpleFeatureType createFeatureElement(String featureName) throws SchemaException { + if (!typeBuilders.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createPolygonFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + typeBuilders.put(featureName, featureType); + fireFeatureTypeEvent(new FeatureTypeEvent(this, featureType)); } - return typeBuilders.get(featureName).getFeatureType(); + return typeBuilders.get(featureName); } - public Feature createFeature(FeatureType featureType, Element element, boolean useTransform) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element, + short distId, boolean useTransform) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); FrammeAttributeData fLinkage = getFeatureLinkage(element); - Feature feature = null; + SimpleFeature feature = null; if (fLinkage == null) return null; - if (element instanceof ShapeElement) - { + if (element instanceof ShapeElement) { ShapeElement shapeElement = (ShapeElement) element; Geometry gobj; - if (useTransform) - { + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(shapeElement); gobj = convertDecorator.toGeometry(geometryFactory); - } else - { + } else { gobj = shapeElement.toGeometry(geometryFactory); } if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) shapeElement.getLevelIndex(), - colorTable.getColorCode(shapeElement.getColorIndex()), - (short) shapeElement.getWeight(), - (short) shapeElement.getLineStyle() - }); - } else if (element instanceof ComplexShapeElement) - { + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) shapeElement.getLevelIndex(), + colorTable.getColorCode(shapeElement.getColorIndex()), + (short) shapeElement.getWeight(), + (short) shapeElement.getLineStyle() + }, null); + } else if (element instanceof ComplexShapeElement) { ComplexShapeElement complexShape = (ComplexShapeElement) element; Geometry gobj; - if (useTransform) - { + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(complexShape); gobj = convertDecorator.toGeometry(geometryFactory); - } else - { + } else { gobj = complexShape.toGeometry(geometryFactory); } if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) complexShape.getLevelIndex(), - colorTable.getColorCode(complexShape.getColorIndex()), - (short) complexShape.getWeight(), - (short) complexShape.getLineStyle() - }); + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) complexShape.getLevelIndex(), + colorTable.getColorCode(complexShape.getColorIndex()), + (short) complexShape.getWeight(), + (short) complexShape.getLineStyle() + }, null); } return feature; } - public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.add(CreateFeatureTypeEventListener.class, listener); } - public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.remove(CreateFeatureTypeEventListener.class, listener); } - protected void fireFeatureTypeEvent(FeatureTypeEvent evt) - { + protected void fireFeatureTypeEvent(FeatureTypeEvent evt) { Object[] listeners = listenerList.getListenerList(); - for (int i = 0; i < listeners.length; i += 2) - { - if (listeners[i] == CreateFeatureTypeEventListener.class) - { + for (int i = 0; i < listeners.length; i += 2) { + if (listeners[i] == CreateFeatureTypeEventListener.class) { ((CreateFeatureTypeEventListener) listeners[i + 1]).createFeatureTypeOccurred(evt); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateSymbolStrategy.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateSymbolStrategy.java index 591a390..62daf9b 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateSymbolStrategy.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateSymbolStrategy.java @@ -1,86 +1,79 @@ package com.ximple.eofms.filter; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.List; -import java.util.TreeMap; -import javax.swing.event.EventListenerList; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; - +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.Envelope; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; - -import com.ximple.eofms.util.DefaultColorTable; -import com.ximple.eofms.util.FeatureTypeBuilderUtil; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; +import com.vividsolutions.jts.geom.Point; +import com.ximple.eofms.util.*; import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.FrammeAttributeData; import com.ximple.io.dgn7.TextElement; import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.geotools.feature.SchemaException; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; -public class CreateSymbolStrategy implements CreateFeatureTypeStrategy -{ +import javax.swing.event.EventListenerList; +import java.awt.geom.AffineTransform; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.List; +import java.util.TreeMap; + +public class CreateSymbolStrategy implements CreateFeatureTypeStrategy { static final Log logger = LogFactory.getLog(CreateSymbolStrategy.class); - GeometryFactory geometryFactory = new GeometryFactory(); - TreeMap<String, FeatureTypeBuilder> typeBuilders = new TreeMap<String, FeatureTypeBuilder>(); - TWD97GeometryConverterDecorator convertDecorator = new TWD97GeometryConverterDecorator(); + GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); + TreeMap<String, SimpleFeatureType> typeBuilders = new TreeMap<String, SimpleFeatureType>(); // Create the listener list protected EventListenerList listenerList = new EventListenerList(); - public CreateSymbolStrategy() - { + public CreateSymbolStrategy() { } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } return null; } - public FeatureType createFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createSymbolFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); - fireFeatureTypeEvent(new FeatureTypeEvent(this, typeBuilder.getFeatureType())); + public SimpleFeatureType createFeatureElement(String featureName) throws SchemaException { + if (!typeBuilders.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createSymbolFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + typeBuilders.put(featureName, featureType); + fireFeatureTypeEvent(new FeatureTypeEvent(this, featureType)); } - return typeBuilders.get(featureName).getFeatureType(); + return typeBuilders.get(featureName); } - public Feature createFeature(FeatureType featureType, Element element, boolean useTransform) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element, + short distId, boolean useTransform) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); FrammeAttributeData fLinkage = getFeatureLinkage(element); - Feature feature = null; + SimpleFeature feature = null; if (fLinkage == null) return null; - if (element instanceof TextElement) - { + if (element instanceof TextElement) { TextElement txtElement = (TextElement) element; double angle = txtElement.getRotationAngle(); angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); - if (txtElement.getText().length() == 0) - { + if (txtElement.getText().length() == 0) { logger.info("CreateSymbolStrategy cannot conver " + element.toString() + - "to Feature - getText() is empty."); + "to Feature - getText() is empty."); return null; } StringBuilder sb = new StringBuilder(); @@ -90,60 +83,147 @@ sb.append("-"); sb.append(txtElement.getFontIndex()); - Geometry gobj; - if (useTransform) - { + Geometry gobj, geomOrigin = null; + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(txtElement); gobj = convertDecorator.toGeometry(geometryFactory); - } else - { + } else { gobj = txtElement.toGeometry(geometryFactory); } + + if (gobj instanceof Point) { + geomOrigin = gobj; + Coordinate originPt = gobj.getCoordinate(); + gobj = buildBoundaryPolygon(originPt, // txtElement.getOrigin() + txtElement.getTextWidth(), txtElement.getTextHeight(), + angle, txtElement.getJustification(), gobj.getSRID()); + } else { + gobj = null; + } + if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) txtElement.getLevelIndex(), - colorTable.getColorCode(txtElement.getColorIndex()), - (short) txtElement.getWeight(), - (short) txtElement.getLineStyle(), - (short) txtElement.getJustification(), - (float) txtElement.getTextHeight(), - (float) txtElement.getTextWidth(), - (float) angle, - sb.toString() - }); - } else - { + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) txtElement.getLevelIndex(), + colorTable.getColorCode(txtElement.getColorIndex()), + (short) txtElement.getWeight(), + (short) txtElement.getLineStyle(), + (short) txtElement.getJustification(), + (float) txtElement.getTextHeight(), + (float) txtElement.getTextWidth(), + (float) angle, + sb.toString(), + geomOrigin + }, null); + } else { logger.info("CreateSymbolStrategy cannot conver " + element.toString() + "to Feature"); } return feature; } - public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.add(CreateFeatureTypeEventListener.class, listener); } - public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.remove(CreateFeatureTypeEventListener.class, listener); } - protected void fireFeatureTypeEvent(FeatureTypeEvent evt) - { + protected void fireFeatureTypeEvent(FeatureTypeEvent evt) { Object[] listeners = listenerList.getListenerList(); - for (int i = 0; i < listeners.length; i += 2) - { - if (listeners[i] == CreateFeatureTypeEventListener.class) - { + for (int i = 0; i < listeners.length; i += 2) { + if (listeners[i] == CreateFeatureTypeEventListener.class) { ((CreateFeatureTypeEventListener) listeners[i + 1]).createFeatureTypeOccurred(evt); } } } + + private Geometry buildBoundaryPolygon(Coordinate p, double symbolWidth, double symbolHeight, double rotationAngle, + int justification, int srid) { + double angle = Math.toRadians(rotationAngle); + + AffineTransform at = new AffineTransform(); + // at.translate(width, height); + at.setToRotation(angle, p.x, p.y); + at.scale(1, 1); + + double width = symbolWidth; + switch (justification) { + case TextElement.TXTJUST_LT: + case TextElement.TXTJUST_LC: + case TextElement.TXTJUST_LB: + width = width / 2; + break; + + case TextElement.TXTJUST_CT: + case TextElement.TXTJUST_CC: + case TextElement.TXTJUST_CB: + width = 0; + break; + + case TextElement.TXTJUST_RT: + case TextElement.TXTJUST_RC: + case TextElement.TXTJUST_RB: + width = -(width / 2); + break; + } + + double height = symbolHeight; + switch (justification) { + case TextElement.TXTJUST_LB: + case TextElement.TXTJUST_CB: + case TextElement.TXTJUST_RB: // bottom + height = height / 2; + break; + + case TextElement.TXTJUST_LC: + case TextElement.TXTJUST_CC: + case TextElement.TXTJUST_RC: // center + height = 0; + break; + + case TextElement.TXTJUST_LT: + case TextElement.TXTJUST_CT: + case TextElement.TXTJUST_RT: // height + height = -(height / 2); + break; + } + + + Envelope envelope = new Envelope(new Coordinate(p.x + width, p.y + height)); + envelope.expandBy(symbolWidth / 2, symbolHeight / 2); + + double[] srcPt = new double[8]; + double[] dstPt = new double[8]; + srcPt[0] = envelope.getMinX(); + srcPt[1] = envelope.getMinY(); + srcPt[2] = envelope.getMinX(); + srcPt[3] = envelope.getMaxY(); + srcPt[4] = envelope.getMaxX(); + srcPt[5] = envelope.getMaxY(); + srcPt[6] = envelope.getMaxX(); + srcPt[7] = envelope.getMinY(); + + at.transform(srcPt, 0, dstPt, 0, 4); + + Coordinate[] coords = new Coordinate[5]; + for (int i = 0; i < 4; i++) { + coords[i] = new Coordinate(dstPt[i*2], dstPt[i*2+1]); + } + coords[4] = new Coordinate(dstPt[0], dstPt[1]); + + Geometry geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(coords), null); + if (geom.getSRID() != srid) { + geom.setSRID(srid); + } + return geom; + } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateTextStrategy.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateTextStrategy.java index 05e5a2f..826019d 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateTextStrategy.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateTextStrategy.java @@ -1,118 +1,102 @@ package com.ximple.eofms.filter; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.GeometryFactory; +import com.ximple.eofms.util.*; +import com.ximple.io.dgn7.*; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.geotools.feature.SchemaException; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; + +import javax.swing.event.EventListenerList; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.List; import java.util.TreeMap; -import javax.swing.event.EventListenerList; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; - -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryFactory; - -import com.ximple.eofms.util.DefaultColorTable; -import com.ximple.eofms.util.FeatureTypeBuilderUtil; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.io.dgn7.TextElement; -import com.ximple.io.dgn7.TextNodeElement; -import com.ximple.io.dgn7.UserAttributeData; - -public class CreateTextStrategy implements CreateFeatureTypeStrategy -{ +public class CreateTextStrategy implements CreateFeatureTypeStrategy { static final Log logger = LogFactory.getLog(CreateTextStrategy.class); - GeometryFactory geometryFactory = new GeometryFactory(); - TreeMap<String, FeatureTypeBuilder> typeBuilders = new TreeMap<String, FeatureTypeBuilder>(); - TWD97GeometryConverterDecorator convertDecorator = new TWD97GeometryConverterDecorator(); + GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); + TreeMap<String, SimpleFeatureType> typeBuilders = new TreeMap<String, SimpleFeatureType>(); // Create the listener list protected EventListenerList listenerList = new EventListenerList(); - public CreateTextStrategy() - { + public CreateTextStrategy() { } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } return null; } - public FeatureType createFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createPointFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); - fireFeatureTypeEvent(new FeatureTypeEvent(this, typeBuilder.getFeatureType())); + public SimpleFeatureType createFeatureElement(String featureName) throws SchemaException { + if (!typeBuilders.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createPointFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + typeBuilders.put(featureName, featureType); + fireFeatureTypeEvent(new FeatureTypeEvent(this, featureType)); } - return typeBuilders.get(featureName).getFeatureType(); + return typeBuilders.get(featureName); } - public Feature createFeature(FeatureType featureType, Element element, boolean useTransform) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element, + short distId, boolean useTransform) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); FrammeAttributeData fLinkage = getFeatureLinkage(element); - Feature feature = null; + SimpleFeature feature = null; if (fLinkage == null) return null; - if (element instanceof TextElement) - { + if (element instanceof TextElement) { TextElement txtElement = (TextElement) element; double angle = txtElement.getRotationAngle(); angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); String content = txtElement.getText(); content = content.replace('\u0000', ' '); Geometry gobj; - if (useTransform) - { + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(txtElement); gobj = convertDecorator.toGeometry(geometryFactory); - } else - { + } else { gobj = txtElement.toGeometry(geometryFactory); } if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) txtElement.getLevelIndex(), - colorTable.getColorCode(txtElement.getColorIndex()), - (short) txtElement.getWeight(), - (short) txtElement.getLineStyle(), - (short) txtElement.getJustification(), - (float) txtElement.getTextHeight(), - (float) txtElement.getTextWidth(), - (float) angle, - content - }); - } else if (element instanceof TextNodeElement) - { + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) txtElement.getLevelIndex(), + colorTable.getColorCode(txtElement.getColorIndex()), + (short) txtElement.getWeight(), + (short) txtElement.getLineStyle(), + (short) txtElement.getJustification(), + (float) txtElement.getTextHeight(), + (float) txtElement.getTextWidth(), + (float) angle, + content + }, null); + } else if (element instanceof TextNodeElement) { TextNodeElement nodeElement = (TextNodeElement) element; String[] texts = nodeElement.getTextArray(); StringBuilder sb = new StringBuilder(); - for (String text : texts) - { + for (String text : texts) { if (sb.length() != 0) sb.append("\n"); String content = text.replace('\u0000', ' '); @@ -122,52 +106,47 @@ double angle = nodeElement.getRotationAngle(); angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); Geometry gobj; - if (useTransform) - { + if (useTransform) { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(nodeElement); gobj = convertDecorator.toGeometry(geometryFactory); - } else - { + } else { gobj = nodeElement.toGeometry(geometryFactory); } if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - fLinkage.getFsc(), - (long) fLinkage.getUfid(), - (short) fLinkage.getComponentID(), - fLinkage.getOccID(), - (short) nodeElement.getLevelIndex(), - colorTable.getColorCode(nodeElement.getColorIndex()), - (short) nodeElement.getWeight(), - (short) nodeElement.getLineStyle(), - (short) nodeElement.getJustification(), - (float) nodeElement.getTextNodeHeight(), - (float) nodeElement.getTextNodeLength(), - (float) angle, - sb.toString() - }); + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + distId, + fLinkage.getFsc(), + (long) fLinkage.getUfid(), + (short) fLinkage.getComponentID(), + fLinkage.getOccID(), + (short) nodeElement.getLevelIndex(), + colorTable.getColorCode(nodeElement.getColorIndex()), + (short) nodeElement.getWeight(), + (short) nodeElement.getLineStyle(), + (short) nodeElement.getJustification(), + (float) nodeElement.getTextNodeHeight(), + (float) nodeElement.getTextNodeLength(), + (float) angle, + sb.toString() + }, null); } return feature; } - public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.add(CreateFeatureTypeEventListener.class, listener); } - public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.remove(CreateFeatureTypeEventListener.class, listener); } - protected void fireFeatureTypeEvent(FeatureTypeEvent evt) - { + protected void fireFeatureTypeEvent(FeatureTypeEvent evt) { Object[] listeners = listenerList.getListenerList(); - for (int i = 0; i < listeners.length; i += 2) - { - if (listeners[i] == CreateFeatureTypeEventListener.class) - { + for (int i = 0; i < listeners.length; i += 2) { + if (listeners[i] == CreateFeatureTypeEventListener.class) { ((CreateFeatureTypeEventListener) listeners[i + 1]).createFeatureTypeOccurred(evt); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementDispatchableFilter.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementDispatchableFilter.java index 9e750da..e1462e2 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementDispatchableFilter.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementDispatchableFilter.java @@ -1,14 +1,12 @@ package com.ximple.eofms.filter; -import org.geotools.feature.Feature; - import com.ximple.io.dgn7.Element; +import org.opengis.feature.simple.SimpleFeature; -public interface ElementDispatchableFilter -{ +public interface ElementDispatchableFilter { public boolean isDispatchable(Element element); - public Feature execute(Element element, boolean useTransform); + public SimpleFeature execute(Element element, short distId, boolean useTransform); void setUseLongName(boolean useLongName); diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementDispatcher.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementDispatcher.java index 6180e4a..6e7dd9f 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementDispatcher.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementDispatcher.java @@ -1,91 +1,72 @@ package com.ximple.eofms.filter; -import java.util.LinkedList; +import com.ximple.io.dgn7.Element; +import org.opengis.feature.simple.SimpleFeature; import javax.swing.event.EventListenerList; +import java.util.LinkedList; -import org.geotools.feature.Feature; - -import com.ximple.io.dgn7.Element; - -public class ElementDispatcher implements CreateFeatureTypeEventListener -{ +public class ElementDispatcher implements CreateFeatureTypeEventListener { private LinkedList<ElementDispatchableFilter> rules; private boolean useLongName = false; // Create the listener list protected EventListenerList listenerList = new EventListenerList(); - public ElementDispatcher() - { + public ElementDispatcher() { rules = new LinkedList<ElementDispatchableFilter>(); } - public LinkedList<ElementDispatchableFilter> getRules() - { + public LinkedList<ElementDispatchableFilter> getRules() { return rules; } - public void addRule(ElementDispatchableFilter rule) - { + public void addRule(ElementDispatchableFilter rule) { rule.setUseLongName(useLongName); rule.addCreateFeatureTypeEventListener(this); rules.add(rule); } - public boolean isUseLongName() - { + public boolean isUseLongName() { return useLongName; } - public void setUseLongName(boolean useLongName) - { - if (this.useLongName != useLongName) - { + public void setUseLongName(boolean useLongName) { + if (this.useLongName != useLongName) { this.useLongName = useLongName; - for (ElementDispatchableFilter filter : rules) - { + for (ElementDispatchableFilter filter : rules) { filter.setUseLongName(useLongName); } } } - public Feature execute(Element element, boolean useTransform) - { - for (ElementDispatchableFilter rule : rules) - { - if (rule.isDispatchable(element)) - { - return rule.execute(element, useTransform); + public SimpleFeature execute(Element element, short distId, boolean useTransform) { + for (ElementDispatchableFilter rule : rules) { + if (rule.isDispatchable(element)) { + return rule.execute(element, distId, useTransform); } } return null; } - public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void addCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.add(CreateFeatureTypeEventListener.class, listener); } - public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) - { + public void removeCreateFeatureTypeEventListener(CreateFeatureTypeEventListener listener) { listenerList.remove(CreateFeatureTypeEventListener.class, listener); } - protected void fireFeatureTypeEvent(FeatureTypeEvent evt) - { + protected void fireFeatureTypeEvent(FeatureTypeEvent evt) { Object[] listeners = listenerList.getListenerList(); - for (int i = 0; i < listeners.length; i += 2) - { - if (listeners[i] == CreateFeatureTypeEventListener.class) - { + for (int i = 0; i < listeners.length; i += 2) { + if (listeners[i] == CreateFeatureTypeEventListener.class) { ((CreateFeatureTypeEventListener) listeners[i + 1]).createFeatureTypeOccurred(evt); } } } - public void createFeatureTypeOccurred(FeatureTypeEvent evt) - { + public void createFeatureTypeOccurred(FeatureTypeEvent evt) { fireFeatureTypeEvent(evt); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementLevelCriterion.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementLevelCriterion.java index 679c157..bca9f31 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementLevelCriterion.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementLevelCriterion.java @@ -1,28 +1,23 @@ package com.ximple.eofms.filter; -import java.util.ArrayList; - import com.ximple.io.dgn7.Element; -public class ElementLevelCriterion implements Comparable -{ +import java.util.ArrayList; + +public class ElementLevelCriterion implements Comparable { private int elementLevel; private ArrayList<Integer> elementLevelArray; - public ElementLevelCriterion() - { + public ElementLevelCriterion() { elementLevelArray = new ArrayList<Integer>(); } - public int compareTo(Object o) - { - if (o instanceof Element) - { + public int compareTo(Object o) { + if (o instanceof Element) { Element elm = (Element) o; - for (Integer elevel : getElementLevelArray()) - { - if (elm.getElementType().id == elevel.intValue()) + for (Integer elevel : getElementLevelArray()) { + if (elm.getElementType().id == elevel) return 0; } @@ -30,18 +25,15 @@ return -1; } - public int getElementLevel() - { + public int getElementLevel() { return elementLevel; } - public ArrayList<Integer> getElementLevelArray() - { + public ArrayList<Integer> getElementLevelArray() { return elementLevelArray; } - public void setElementLevel(int iLevel) - { + public void setElementLevel(int iLevel) { this.elementLevel = iLevel; this.elementLevelArray.add(iLevel); } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementTypeCriterion.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementTypeCriterion.java index 7d79918..2fe04d3 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementTypeCriterion.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/ElementTypeCriterion.java @@ -1,27 +1,22 @@ package com.ximple.eofms.filter; -import java.util.ArrayList; - import com.ximple.io.dgn7.Element; -public class ElementTypeCriterion implements Comparable -{ +import java.util.ArrayList; + +public class ElementTypeCriterion implements Comparable { private int elementType; private ArrayList<Integer> elementTypeArray; - public ElementTypeCriterion() - { + public ElementTypeCriterion() { elementTypeArray = new ArrayList<Integer>(); } - public int compareTo(Object o) - { - if (o instanceof Element) - { + public int compareTo(Object o) { + if (o instanceof Element) { Element elm = (Element) o; - for (Integer etype : getElementTypeArray()) - { + for (Integer etype : getElementTypeArray()) { if (elm.getElementType().id == etype.intValue()) return 0; } @@ -30,18 +25,15 @@ return -1; } - public int getElementType() - { + public int getElementType() { return elementType; } - public ArrayList<Integer> getElementTypeArray() - { + public ArrayList<Integer> getElementTypeArray() { return elementTypeArray; } - public void setElementType(int itype) - { + public void setElementType(int itype) { this.elementType = itype; this.elementTypeArray.add(itype); } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/FeatureTypeEvent.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/FeatureTypeEvent.java index c821382..ebede68 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/FeatureTypeEvent.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/FeatureTypeEvent.java @@ -1,28 +1,25 @@ package com.ximple.eofms.filter; +import org.opengis.feature.simple.SimpleFeatureType; + import java.util.EventObject; -import org.geotools.feature.FeatureType; - -public class FeatureTypeEvent extends EventObject -{ - private FeatureType featureType; +public class FeatureTypeEvent extends EventObject { + private SimpleFeatureType featureType; /** * Constructs a prototypical Event. * - * @param source The object on which the Event initially occurred. + * @param source The object on which the Event initially occurred. * @param featureType featureType * @throws IllegalArgumentException if source is null. */ - public FeatureTypeEvent(Object source, FeatureType featureType) - { + public FeatureTypeEvent(Object source, SimpleFeatureType featureType) { super(source); this.featureType = featureType; } - public FeatureType getFeatureType() - { + public SimpleFeatureType getFeatureType() { return featureType; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompIdDispatchableFilter.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompIdDispatchableFilter.java index ddbf8c3..2a0a428 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompIdDispatchableFilter.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompIdDispatchableFilter.java @@ -1,30 +1,26 @@ package com.ximple.eofms.filter; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; - +import com.ximple.eofms.util.StringUtils; import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.eofms.util.StringUtils; +import org.geotools.feature.SchemaException; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; public class TypeCompIdDispatchableFilter extends AbstractFLinkageDispatchableFilter - implements CreateFeatureTypeEventListener -{ + implements CreateFeatureTypeEventListener { private int tid; private int cid; private CreateFeatureTypeStrategy createStrategy; private boolean useLongName = false; - public TypeCompIdDispatchableFilter() - { + public TypeCompIdDispatchableFilter() { } public TypeCompIdDispatchableFilter(String fname, CreateFeatureTypeStrategy createStrategy, - int tid, int compid) - { + int tid, int compid) { this.setName(fname); this.tid = tid; this.cid = compid; @@ -32,98 +28,79 @@ this.createStrategy.addCreateFeatureTypeEventListener(this); } - public int getTid() - { + public int getTid() { return tid; } - public void setTid(int tid) - { + public void setTid(int tid) { this.tid = tid; } - public int getCid() - { + public int getCid() { return cid; } - public void setCid(int cid) - { + public void setCid(int cid) { this.cid = cid; } - public CreateFeatureTypeStrategy getCreateStrategy() - { + public CreateFeatureTypeStrategy getCreateStrategy() { return createStrategy; } - public void setCreateStrategy(CreateFeatureTypeStrategy createStrategy) - { - if (this.createStrategy != null) - { + public void setCreateStrategy(CreateFeatureTypeStrategy createStrategy) { + if (this.createStrategy != null) { this.createStrategy.removeCreateFeatureTypeEventListener(this); } this.createStrategy = createStrategy; - if (this.createStrategy != null) - { + if (this.createStrategy != null) { this.createStrategy.addCreateFeatureTypeEventListener(this); } } - public boolean isUseLongName() - { + public boolean isUseLongName() { return useLongName; } - public void setUseLongName(boolean useLongName) - { + public void setUseLongName(boolean useLongName) { this.useLongName = useLongName; } - //�P�_�O�_�ũM���� - public boolean isDispatchable(Element element) - { + //�P�_�O�_�ũM��� + public boolean isDispatchable(Element element) { FrammeAttributeData featureLinkage = getFeatureLinkage(element); return featureLinkage != null && tid == featureLinkage.getFsc() && - (cid == featureLinkage.getComponentID()) && - (compareType(element) == 0); + (cid == featureLinkage.getComponentID()) && + (compareType(element) == 0); } - public Feature execute(Element element, boolean useTransform) - { - try - { + public SimpleFeature execute(Element element, short distId, boolean useTransform) { + try { String ftName = getFeatureTypeName(element); - FeatureType ftype = createStrategy.createFeatureElement(ftName); - return createStrategy.createFeature(ftype, element, useTransform); - } catch (SchemaException e) - { + SimpleFeatureType ftype = createStrategy.createFeatureElement(ftName); + return createStrategy.createFeature(ftype, element, distId, useTransform); + } catch (SchemaException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (NullPointerException e) - { + } catch (NullPointerException e) { logger.error(e.getMessage(), e); } return null; } - public String getFeatureTypeName(Element element) - { + public String getFeatureTypeName(Element element) { StringBuilder sb = new StringBuilder(); String name = getName().toLowerCase(); String[] pices = StringUtils.splitToArray(name, "."); boolean bfirst = true; - for (String temp : pices) - { + for (String temp : pices) { if (bfirst) bfirst = false; else sb.append('-'); sb.append(temp); } - if (useLongName) - { + if (useLongName) { sb.append("_"); sb.append(element.getLevelIndex()); sb.append("_"); @@ -132,8 +109,7 @@ return sb.toString(); } - public void createFeatureTypeOccurred(FeatureTypeEvent evt) - { + public void createFeatureTypeOccurred(FeatureTypeEvent evt) { fireFeatureTypeEvent(evt); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompLevelIdDispatchableFilter.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompLevelIdDispatchableFilter.java index b590154..b8e7cd0 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompLevelIdDispatchableFilter.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompLevelIdDispatchableFilter.java @@ -1,31 +1,27 @@ package com.ximple.eofms.filter; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; - +import com.ximple.eofms.util.StringUtils; import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.eofms.util.StringUtils; +import org.geotools.feature.SchemaException; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; public class TypeCompLevelIdDispatchableFilter extends AbstractFLinkageDispatchableFilter - implements CreateFeatureTypeEventListener -{ + implements CreateFeatureTypeEventListener { private int tid; private int cid; private int lid; private CreateFeatureTypeStrategy createStrategy; private boolean useLongName = false; - public TypeCompLevelIdDispatchableFilter() - { + public TypeCompLevelIdDispatchableFilter() { } public TypeCompLevelIdDispatchableFilter(String fname, CreateFeatureTypeStrategy createStrategy, - int tid, int compid, int level) - { + int tid, int compid, int level) { this.setName(fname); this.tid = tid; this.cid = compid; @@ -34,105 +30,85 @@ this.createStrategy.addCreateFeatureTypeEventListener(this); } - public int getTid() - { + public int getTid() { return tid; } - public void setTid(int tid) - { + public void setTid(int tid) { this.tid = tid; } - public int getCid() - { + public int getCid() { return cid; } - public void setCid(int cid) - { + public void setCid(int cid) { this.cid = cid; } - public int getLid() - { + public int getLid() { return lid; } - public void setLid(int lid) - { + public void setLid(int lid) { this.lid = lid; } - public CreateFeatureTypeStrategy getCreateStrategy() - { + public CreateFeatureTypeStrategy getCreateStrategy() { return createStrategy; } - public void setCreateStrategy(CreateFeatureTypeStrategy createStrategy) - { - if (this.createStrategy != null) - { + public void setCreateStrategy(CreateFeatureTypeStrategy createStrategy) { + if (this.createStrategy != null) { this.createStrategy.removeCreateFeatureTypeEventListener(this); } this.createStrategy = createStrategy; - if (this.createStrategy != null) - { + if (this.createStrategy != null) { this.createStrategy.addCreateFeatureTypeEventListener(this); } } - public boolean isUseLongName() - { + public boolean isUseLongName() { return useLongName; } - public void setUseLongName(boolean useLongName) - { + public void setUseLongName(boolean useLongName) { this.useLongName = useLongName; } - public boolean isDispatchable(Element element) - { + public boolean isDispatchable(Element element) { FrammeAttributeData featureLinkage = getFeatureLinkage(element); return featureLinkage != null && tid == featureLinkage.getFsc() && - (cid == featureLinkage.getComponentID()) && - (lid == element.getLevelIndex()) && (compareLevel(element) == 0); + (cid == featureLinkage.getComponentID()) && + (lid == element.getLevelIndex()) && (compareLevel(element) == 0); } - public Feature execute(Element element, boolean useTransform) - { - try - { + public SimpleFeature execute(Element element, short distId, boolean useTransform) { + try { String ftName = getFeatureTypeName(element); - FeatureType ftype = createStrategy.createFeatureElement(ftName); - return createStrategy.createFeature(ftype, element, useTransform); - } catch (SchemaException e) - { + SimpleFeatureType ftype = createStrategy.createFeatureElement(ftName); + return createStrategy.createFeature(ftype, element, distId, useTransform); + } catch (SchemaException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); } return null; } - public String getFeatureTypeName(Element element) - { + public String getFeatureTypeName(Element element) { StringBuilder sb = new StringBuilder(); String name = getName().toLowerCase(); String[] pices = StringUtils.splitToArray(name, "."); boolean bfirst = true; - for (String temp : pices) - { + for (String temp : pices) { if (bfirst) bfirst = false; else sb.append('-'); sb.append(temp); } - if (useLongName) - { + if (useLongName) { sb.append("_"); sb.append(element.getLevelIndex()); sb.append("_"); @@ -141,8 +117,7 @@ return sb.toString(); } - public void createFeatureTypeOccurred(FeatureTypeEvent evt) - { + public void createFeatureTypeOccurred(FeatureTypeEvent evt) { fireFeatureTypeEvent(evt); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeIdDispatchableFilter.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeIdDispatchableFilter.java index bb4b318..02a84f2 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeIdDispatchableFilter.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeIdDispatchableFilter.java @@ -1,110 +1,90 @@ package com.ximple.eofms.filter; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; - +import com.ximple.eofms.util.StringUtils; import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.eofms.util.StringUtils; +import org.geotools.feature.SchemaException; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; -public class TypeIdDispatchableFilter extends AbstractFLinkageDispatchableFilter implements CreateFeatureTypeEventListener -{ +public class TypeIdDispatchableFilter extends AbstractFLinkageDispatchableFilter implements CreateFeatureTypeEventListener { private int tid; private CreateFeatureTypeStrategy createStrategy; private boolean useLongName = false; - public TypeIdDispatchableFilter() - { + public TypeIdDispatchableFilter() { } public TypeIdDispatchableFilter(String fname, CreateFeatureTypeStrategy createStrategy, - int tid) - { + int tid) { this.setName(fname); this.tid = tid; this.createStrategy = createStrategy; this.createStrategy.addCreateFeatureTypeEventListener(this); } - public int getTid() - { + public int getTid() { return tid; } - public void setTid(int tid) - { + public void setTid(int tid) { this.tid = tid; } - public CreateFeatureTypeStrategy getCreateStrategy() - { + public CreateFeatureTypeStrategy getCreateStrategy() { return createStrategy; } - public void setCreateStrategy(CreateFeatureTypeStrategy createStrategy) - { - if (this.createStrategy != null) - { + public void setCreateStrategy(CreateFeatureTypeStrategy createStrategy) { + if (this.createStrategy != null) { this.createStrategy.removeCreateFeatureTypeEventListener(this); } this.createStrategy = createStrategy; - if (this.createStrategy != null) - { + if (this.createStrategy != null) { this.createStrategy.addCreateFeatureTypeEventListener(this); } } - public boolean isDispatchable(Element element) - { + public boolean isDispatchable(Element element) { FrammeAttributeData featureLinkage = getFeatureLinkage(element); return featureLinkage != null && tid == featureLinkage.getFsc() && - (compareType(element) == 0); + (compareType(element) == 0); } - public Feature execute(Element element, boolean useTransform) - { - try - { + public SimpleFeature execute(Element element, short distId, boolean useTransform) { + try { String ftName = getFeatureTypeName(element); - FeatureType ftype = createStrategy.createFeatureElement(ftName); - return createStrategy.createFeature(ftype, element, useTransform); - } catch (SchemaException e) - { + SimpleFeatureType ftype = createStrategy.createFeatureElement(ftName); + return createStrategy.createFeature(ftype, element, distId, useTransform); + } catch (SchemaException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); } return null; } - public boolean isUseLongName() - { + public boolean isUseLongName() { return useLongName; } - public void setUseLongName(boolean useLongName) - { + public void setUseLongName(boolean useLongName) { this.useLongName = useLongName; } - public String getFeatureTypeName(Element element) - { + public String getFeatureTypeName(Element element) { StringBuilder sb = new StringBuilder(); String name = getName().toLowerCase(); String[] pices = StringUtils.splitToArray(name, "."); boolean bfirst = true; - for (String temp : pices) - { + for (String temp : pices) { if (bfirst) bfirst = false; else sb.append('-'); sb.append(temp); } - if (useLongName) - { + if (useLongName) { sb.append("_"); sb.append(element.getLevelIndex()); sb.append("_"); @@ -113,8 +93,7 @@ return sb.toString(); } - public void createFeatureTypeOccurred(FeatureTypeEvent evt) - { + public void createFeatureTypeOccurred(FeatureTypeEvent evt) { fireFeatureTypeEvent(evt); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/geoserver/config/XGeosDataConfig.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/geoserver/config/XGeosDataConfig.java new file mode 100644 index 0000000..229f948 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/geoserver/config/XGeosDataConfig.java @@ -0,0 +1,72 @@ +package com.ximple.eofms.geoserver.config; + +public class XGeosDataConfig { + private String PG; + private short FSC; + private short COMP; + private short LEV; + private short WEIGHT; + private String FTYPE; + + public XGeosDataConfig() { + } + + public String getPG() { + return PG; + } + + public void setPG(String PG) { + this.PG = PG; + } + + public short getFSC() { + return FSC; + } + + public void setFSC(short FSC) { + this.FSC = FSC; + } + + public short getCOMP() { + return COMP; + } + + public void setCOMP(short COMP) { + this.COMP = COMP; + } + + public short getLEV() { + return LEV; + } + + public void setLEV(short LEV) { + this.LEV = LEV; + } + + public short getWEIGHT() { + return WEIGHT; + } + + public void setWEIGHT(short WEIGHT) { + this.WEIGHT = WEIGHT; + } + + public String getFTYPE() { + return FTYPE; + } + + public void setFTYPE(String FTYPE) { + this.FTYPE = FTYPE; + } + + public String toString() { + return "XGeosDataConfig{" + + "PG='" + (PG != null ? PG : "null") + '\'' + + ", FSC=" + FSC + + ", COMP=" + COMP + + ", LEV=" + LEV + + ", WEIGHT=" + WEIGHT + + ", FTYPE='" + (FTYPE != null ? FTYPE : "null") + '\'' + + '}'; + } +} \ No newline at end of file diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/geoserver/config/XGeosDataConfigMapping.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/geoserver/config/XGeosDataConfigMapping.java new file mode 100644 index 0000000..7e144a3 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/geoserver/config/XGeosDataConfigMapping.java @@ -0,0 +1,20 @@ +package com.ximple.eofms.geoserver.config; + +import org.apache.commons.collections.MultiMap; +import org.apache.commons.collections.map.MultiValueMap; + +public class XGeosDataConfigMapping { + private MultiValueMap mappings; + + public XGeosDataConfigMapping() { + mappings = new MultiValueMap(); + } + + public void addConfig(XGeosDataConfig config) { + mappings.put(config.getPG(), config); + } + + public MultiMap getMapping() { + return mappings; + } +} \ No newline at end of file diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/AbstractOracleDatabaseJob.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/AbstractOracleDatabaseJob.java index f419c5d..841a5e9 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/AbstractOracleDatabaseJob.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/AbstractOracleDatabaseJob.java @@ -3,32 +3,32 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.nio.BufferOverflowException; import java.nio.ByteBuffer; +import java.sql.Connection; +import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.Statement; import java.util.ArrayList; import java.util.Map; import java.util.StringTokenizer; import java.util.TreeMap; +import com.vividsolutions.jts.util.Assert; +import com.ximple.eofms.jobs.context.AbstractOracleJobContext; +import com.ximple.eofms.util.FeatureTypeBuilderUtil; +import oracle.sql.BLOB; import org.apache.commons.logging.Log; import org.geotools.data.DataStore; -import org.geotools.data.jdbc.ConnectionPoolManager; -import org.geotools.data.oracle.OracleDataStore; -import org.geotools.data.oracle.OracleDataStoreFactory; +import org.geotools.data.oracle.OracleNGDataStoreFactory; +import org.geotools.jdbc.JDBCDataStore; import org.quartz.Job; import org.quartz.JobDataMap; import org.quartz.JobDetail; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; -import com.vividsolutions.jts.util.Assert; - -import oracle.sql.BLOB; - -import com.ximple.eofms.jobs.context.AbstractOracleJobContext; - -public abstract class AbstractOracleDatabaseJob implements Job -{ +public abstract class AbstractOracleDatabaseJob implements Job { /** * The Oracle driver class name */ @@ -44,6 +44,7 @@ private static final String CONVERTDB = "CONVERTDB"; private static final String CONVERTFILE = "CONVERTFILE"; private static final String CONVERTELEMIN = "CONVERTELEMIN"; + private static final String CONVERTPWTHEMES = "CONVERTPWTHEMES"; private static final String CREATEDUMMY = "CREATEDUMMY"; private static final String ELEMLOG = "ELEMLOG"; private static final String ORAHOST = "ORAHOST"; @@ -54,8 +55,11 @@ private static final String TESTMODE = "TESTMODE"; private static final String TESTCOUNT = "TESTCOUNT"; private static final String COPYCONNECTIVITYMODE = "COPYCONNECTIVITYMODE"; + private static final String PROFILEMODE = "PROFILEMODE"; + private static final String USEZONE121 = "USEZONE121"; + private static final String IGNORE_DBETL = "IGNORE_DBETL"; - protected static OracleDataStoreFactory dataStoreFactory = new OracleDataStoreFactory(); + protected static OracleNGDataStoreFactory dataStoreFactory = new OracleNGDataStoreFactory(); protected String _dataPath; protected String _filterPath; @@ -67,22 +71,30 @@ protected String _convertDB; protected String _convertFile; protected String _convertElementIn; + protected String _convertPWThemes; protected String _elementLogging; protected String _createDummy; protected ArrayList<String> _orgSchema = new ArrayList<String>(); protected boolean _testMode = false; protected boolean _copyConnectivityMode = false; + protected boolean _profileMode = false; + protected boolean _useZone121 = true; + protected boolean _useTransform = true; + protected boolean _ignoreDBETL = false; + protected int _testCount = -1; - protected OracleDataStore sourceDataStore; + protected JDBCDataStore sourceDataStore; private boolean driverFound = true; - protected AbstractOracleDatabaseJob() - { - try - { + private long _processTime; + private long _updateTime; + private long _processTimeStart; + private long _updateTimeStart; + + protected AbstractOracleDatabaseJob() { + try { Class.forName(JDBC_DRIVER); - } catch (Throwable t) - { + } catch (Throwable t) { // must be running off dummy jar! driverFound = false; } @@ -92,8 +104,7 @@ public abstract Log getLogger(); - protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException - { + protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException { // The directory to scan is stored in the job map JobDataMap dataMap = jobDetail.getJobDataMap(); _dataPath = dataMap.getString(JOBDATA_DIR); @@ -106,6 +117,7 @@ _convertDB = dataMap.getString(CONVERTDB); _convertFile = dataMap.getString(CONVERTFILE); _convertElementIn = dataMap.getString(CONVERTELEMIN); + _convertPWThemes = dataMap.getString(CONVERTPWTHEMES); _elementLogging = dataMap.getString(ELEMLOG); _createDummy = dataMap.getString(CREATEDUMMY); @@ -126,20 +138,26 @@ String strSchema = dataMap.getString(SPATAILSCHEMA); StringTokenizer st = new StringTokenizer(strSchema, ","); - while (st.hasMoreTokens()) - { + while (st.hasMoreTokens()) { String aSchema = st.nextToken().trim(); _orgSchema.add(aSchema); } _testMode = dataMap.getBooleanFromString(TESTMODE); _testCount = dataMap.getIntFromString(TESTCOUNT); _copyConnectivityMode = dataMap.getBooleanFromString(COPYCONNECTIVITYMODE); + _profileMode = dataMap.getBooleanFromString(PROFILEMODE); + _useZone121 = dataMap.getBooleanFromString(USEZONE121); + _ignoreDBETL = dataMap.getBooleanFromString(IGNORE_DBETL); + + if (_useZone121) { + FeatureTypeBuilderUtil.setDefaultFeatureSRID(3826); + } else { + FeatureTypeBuilderUtil.setDefaultFeatureSRID(3825); + } // Validate the required input - if (_dataPath == null) - { - if (logger != null) - { + if (_dataPath == null) { + if (logger != null) { logger.warn("Cannot found data directory in configarion."); } throw new JobExecutionException("Directory not configured"); @@ -147,47 +165,40 @@ // Make sure the directory exists File dir = new File(_dataPath); - if (!dir.exists()) - { + if (!dir.exists()) { logger = getLogger(); - if (logger != null) - { + if (logger != null) { logger.warn("Cannot found data directory in file system.[" + _dataPath + "]"); } throw new JobExecutionException("Invalid Dir " + _dataPath); } - if (_oracleHost == null) - { + if (_oracleHost == null) { logger.warn("OracleHOST is null"); throw new JobExecutionException("Unknown Oracle Host."); } - if (_oracleInstance == null) - { + if (_oracleInstance == null) { logger.warn("OracleINSTANCE is null"); throw new JobExecutionException("Unknown Oracle Instance."); } - if (_username == null) - { + if (_username == null) { logger.warn("OracleUSER is null"); throw new JobExecutionException("Unknown Oracle Username."); } - if (_password == null) - { + if (_password == null) { logger.warn("OraclePASS is null"); throw new JobExecutionException("Unknown Oracle Password."); } - if (_orgSchema == null) - { + if (_orgSchema == null) { logger.warn("OracleSchema is null"); throw new JobExecutionException("Unknown Spatial Database Schema."); } } - protected abstract AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath); + protected abstract AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath, + boolean profileMode, boolean useTransform); - protected static byte[] getBytesFromBLOB(BLOB blob) throws SQLException - { + protected byte[] getBytesFromBLOB(BLOB blob) throws SQLException, BufferOverflowException { byte[] raw = null; // BLOB blob = (BLOB) rs.getBlob(1); @@ -195,220 +206,328 @@ byte[] chunk = new byte[optimalSize]; InputStream is = blob.getBinaryStream(0); ByteBuffer buffer = null; // ByteBuffer.allocate(optimalSize); - int len; + int len = 0; - try - { - while ((len = (is.read(chunk))) != -1) - { - if (buffer != null) - { + try { + while ((len = (is.read(chunk))) != -1) { + if (buffer != null) { buffer.limit(buffer.limit() + len); - } else - { + } else { buffer = ByteBuffer.allocate(len); } - buffer.put(chunk); + buffer.put(chunk, 0, len); } - - is.close(); assert buffer != null; buffer.position(0); raw = buffer.array(); - } catch (IOException e) - { + } catch (IOException e) { e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates. Assert.shouldNeverReachHere(); + } catch (BufferOverflowException e) { + getLogger().warn("BufferOverflowException:: len = " + len + "buffer.limit=" + buffer.limit()); + } finally { + try { + is.close(); + } catch (IOException e) { + getLogger().warn("InputStream cannot close", e); + } + ; } return raw; } - public boolean isDriverFound() - { + public boolean isDriverFound() { return driverFound; } - public String getDataPath() - { + public String getDataPath() { return _dataPath; } - public String getFilterPath() - { + public String getFilterPath() { return _filterPath; } - public String getOracleHost() - { + public String getOracleHost() { return _oracleHost; } - public String getOracleInstance() - { + public String getOracleInstance() { return _oracleInstance; } - public String getOraclePort() - { + public String getOraclePort() { return _oraclePort; } - public String getUsername() - { + public String getUsername() { return _username; } - public String getPassword() - { + public String getPassword() { return _password; } - public ArrayList<String> getOriginSchema() - { + public ArrayList<String> getOriginSchema() { return _orgSchema; } - public boolean isTestMode() - { + public boolean isTestMode() { return _testMode; } - public int getTestCount() - { + public int getTestCount() { return _testCount; } - public String getConvertDB() - { + public String getConvertDB() { return _convertDB; } - public void setConvertDB(String convertDB) - { + public void setConvertDB(String convertDB) { _convertDB = convertDB; } - public String getConvertFile() - { + public String getConvertFile() { return _convertFile; } - public void setConvertFile(String convertFile) - { + public void setConvertFile(String convertFile) { _convertFile = convertFile; } - public String getConvertElementIn() - { + public String getConvertElementIn() { return _convertElementIn; } - public void setConvertElementIn(String convertElementIn) - { + public void setConvertElementIn(String convertElementIn) { _convertElementIn = convertElementIn; } - public boolean checkConvertDB() - { + public boolean checkConvertDB() { return _convertDB != null && !_convertDB.equalsIgnoreCase("false") && - !_convertDB.equalsIgnoreCase("no") && !_convertDB.equalsIgnoreCase("0"); + !_convertDB.equalsIgnoreCase("no") && !_convertDB.equalsIgnoreCase("0"); } - public boolean checkConvertFile() - { + public boolean checkConvertFile() { return _convertFile != null && !_convertFile.equalsIgnoreCase("false") && - !_convertFile.equalsIgnoreCase("no") && !_convertFile.equalsIgnoreCase("0"); + !_convertFile.equalsIgnoreCase("no") && !_convertFile.equalsIgnoreCase("0"); } - public boolean checkConvertElementIn() - { + public boolean checkConvertElementIn() { return _convertElementIn != null && !_convertElementIn.equalsIgnoreCase("false") && - !_convertElementIn.equalsIgnoreCase("no") && !_convertElementIn.equalsIgnoreCase("0"); + !_convertElementIn.equalsIgnoreCase("no") && !_convertElementIn.equalsIgnoreCase("0"); } - public String getElementLogging() - { + public boolean checkConvertPWThemes() { + return _convertPWThemes != null && !_convertPWThemes.equalsIgnoreCase("false") && + !_convertPWThemes.equalsIgnoreCase("no") && !_convertPWThemes.equalsIgnoreCase("0"); + } + + public String getElementLogging() { return _elementLogging; } - public void setElementLogging(String elementLogging) - { + public void setElementLogging(String elementLogging) { this._elementLogging = elementLogging; } - public boolean checkElementLogging() - { + public boolean checkElementLogging() { return _elementLogging != null && !_elementLogging.equalsIgnoreCase("false") && - !_elementLogging.equalsIgnoreCase("no") && !_elementLogging.equalsIgnoreCase("0"); + !_elementLogging.equalsIgnoreCase("no") && !_elementLogging.equalsIgnoreCase("0"); } - public boolean checkCreateDummy() - { + public boolean checkCreateDummy() { return _createDummy != null && !_createDummy.equalsIgnoreCase("false") && - !_createDummy.equalsIgnoreCase("no") && !_createDummy.equalsIgnoreCase("0"); + !_createDummy.equalsIgnoreCase("no") && !_createDummy.equalsIgnoreCase("0"); } - public boolean isCopyConnectivityMode() - { + public boolean isCopyConnectivityMode() { return _copyConnectivityMode; } - public DataStore getSourceDataStore() - { + public boolean isProfileMode() { + return _profileMode; + } + + public boolean isTransformed() { + return _useTransform; + } + + public boolean isZone121() { + return _useZone121; + } + + public boolean isIgnoreDBETL() { + return _ignoreDBETL; + } + + public void set_ignoreDBETL(boolean _ignoreDBETL) { + this._ignoreDBETL = _ignoreDBETL; + } + + public DataStore getSourceDataStore() { return sourceDataStore; } - protected void createSourceDataStore() throws JobExecutionException - { - if (sourceDataStore != null) - { + protected void createSourceDataStore() throws JobExecutionException { + if (sourceDataStore != null) { sourceDataStore.dispose(); sourceDataStore = null; } - if (!isDriverFound()) - { + if (!isDriverFound()) { throw new JobExecutionException("Oracle JDBC Driver not found.-" + JDBC_DRIVER); } Map<String, String> map = new TreeMap<String, String>(); - map.put("host", _oracleHost); - map.put("port", _oraclePort); - map.put("instance", _oracleInstance); - map.put("user", _username); - map.put("passwd", _password); - map.put("dbtype", "oracle"); - map.put("alias", _oracleInstance); - map.put("namespace", null); - if (!map.containsKey(OracleDataStoreFactory.MAXCONN.key)) - { - map.put(OracleDataStoreFactory.MAXCONN.key, "10"); + map.put(OracleNGDataStoreFactory.HOST.key, _oracleHost); + map.put(OracleNGDataStoreFactory.PORT.key, _oraclePort); + map.put(OracleNGDataStoreFactory.DATABASE.key, _oracleInstance); + map.put(OracleNGDataStoreFactory.USER.key, _username); + map.put(OracleNGDataStoreFactory.PASSWD.key, _password); + map.put(OracleNGDataStoreFactory.DBTYPE.key, "oracle"); + map.put(OracleNGDataStoreFactory.NAMESPACE.key, null); + + if (!map.containsKey(OracleNGDataStoreFactory.MAXCONN.key)) { + map.put(OracleNGDataStoreFactory.MAXCONN.key, "5"); } - if (!map.containsKey(OracleDataStoreFactory.MINCONN.key)) - { - map.put(OracleDataStoreFactory.MINCONN.key, "1"); + if (!map.containsKey(OracleNGDataStoreFactory.MINCONN.key)) { + map.put(OracleNGDataStoreFactory.MINCONN.key, "1"); } - if (!dataStoreFactory.canProcess(map)) - { + if (!dataStoreFactory.canProcess(map)) { getLogger().warn("cannot process properties-"); throw new JobExecutionException("cannot process properties-"); } - try - { - sourceDataStore = (OracleDataStore) dataStoreFactory.createDataStore(map); - } catch (IOException e) - { + try { + sourceDataStore = dataStoreFactory.createDataStore(map); + } catch (IOException e) { getLogger().warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); } } - protected void disconnect() - { - ConnectionPoolManager manager = ConnectionPoolManager.getInstance(); - manager.closeAll(); + protected void disconnect() { + // ConnectionPoolManager manager = ConnectionPoolManager.getInstance(); + // manager.closeAll(); + if (sourceDataStore != null) { + sourceDataStore.dispose(); + sourceDataStore = null; + } + } + + public final void accumulateProcessTime() { + _processTime += System.currentTimeMillis() - _processTimeStart; + } + + public final void accumulateUpdateTime() { + _updateTime += System.currentTimeMillis() - _updateTimeStart; + } + + public long getProcessTime() { + return _processTime; + } + + public long getUpdateTime() { + return _updateTime; + } + + public final void markProcessTime() { + _processTimeStart = System.currentTimeMillis(); + } + + public final void markUpdateTime() { + _updateTimeStart = System.currentTimeMillis(); + } + + public final void resetProcessTime() { + _processTime = 0; + } + + public final void resetUpdateTime() { + _updateTime = 0; + } + + /** + * Connectivity (Connectivity) + * + * @param jobContext job context + * @throws java.sql.SQLException sql exception + */ + protected void copyConnectivity(AbstractOracleJobContext jobContext) throws SQLException { + Connection connection = jobContext.getOracleConnection(); + ResultSet rsMeta = connection.getMetaData().getTables(null, "BASEDB", + AbstractOracleJobContext.CONNECTIVITY_WEBCHECK_NAME + "%", + new String[]{"TABLE"}); + + boolean found = false; + try { + while (rsMeta.next()) { + String tablename = rsMeta.getString(3); + if (AbstractOracleJobContext.CONNECTIVITY_WEBCHECK_NAME.equalsIgnoreCase(tablename)) { + found = true; + break; + } + } + // } catch (SQLException e) + } finally { + if (rsMeta != null) { + rsMeta.close(); + rsMeta = null; + } + } + Statement stmt = connection.createStatement(); + if (found) { + stmt.execute(AbstractOracleJobContext.TRUNCATE_CONNECTIVITY_WEBCHECK); + } else { + getLogger().info("Create CONNECTIVITY_WEBCHECK table."); + stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK); + stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_1); + stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_2); + stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_3); + stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_4); + stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_5); + stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_6); + stmt.execute(AbstractOracleJobContext.ALTER_CONNECTIVITY_WEBCHECK_1); + stmt.execute(AbstractOracleJobContext.ALTER_CONNECTIVITY_WEBCHECK_2); + } + + stmt.execute(AbstractOracleJobContext.COPY_CONNECTIVITY_TO_WEBCHECK); + stmt.close(); + } + + protected void fetchTPData(AbstractOracleJobContext jobContext) { + Connection connection = jobContext.getOracleConnection(); + + try { + Statement stmt = connection.createStatement(); + ResultSet rs = stmt.executeQuery(AbstractOracleJobContext.FETCH_TPDATA); + if (rs.next()) { + short disId = rs.getShort(1); + jobContext.setDistId(disId); + + String distName = rs.getString(2); + jobContext.setDistName(distName); + } + rs.close(); + stmt.close(); + } catch (SQLException e) { + getLogger().warn("Fetch TPDATA Error.", e); + } + } + + protected void createHibernateSequence(AbstractOracleJobContext jobContext) throws SQLException { + Connection connection = jobContext.getOracleConnection(); + + try { + Statement stmt = connection.createStatement(); + stmt.execute(AbstractOracleJobContext.CREATE_HIBERNATE_SEQUENCE); + stmt.close(); + } catch (SQLException e) { + getLogger().warn("HIBERNATE_SEQUENCE is already exist."); + } } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/DataReposVersionManager.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/DataReposVersionManager.java index c6f2fd4..5f0d473 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/DataReposVersionManager.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/DataReposVersionManager.java @@ -1,16 +1,20 @@ package com.ximple.eofms.jobs; -public interface DataReposVersionManager -{ +public interface DataReposVersionManager { public static final String XGVERSIONTABLE_NAME = "xgeos_vsversion"; - public static final String[] DEFAULTXGVERSIONSCHEMA_NAMES = new String[] { - "gisrepo1", "gisrepo2" + public static final String[] DEFAULTXGVERSIONSCHEMA_NAMES = new String[]{ + "gisrepo1", "gisrepo2" }; - public static final short VSSTATUS_AVAILABLE= 0x0000; - public static final short VSSTATUS_USING = 0x0100; - public static final short VSSTATUS_CONFIG = 0x0020; + public static final String XPTVERSIONTABLE_NAME = "xpwthemes_vsversion"; + public static final String[] DEFAULTXPTVERSIONTABLE_NAMES = new String[]{ + "xpwtheme1", "xpwtheme2" + }; + + public static final short VSSTATUS_AVAILABLE = 0x0000; + public static final short VSSTATUS_USING = 0x0100; + public static final short VSSTATUS_CONFIG = 0x0020; public static final short VSSTATUS_LINKVIEW = 0x0010; - public static final short VSSTATUS_READY = 0x0002; - public static final short VSSTATUS_COVERT = 0x0001; + public static final short VSSTATUS_READY = 0x0002; + public static final short VSSTATUS_COVERT = 0x0001; } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/DummyFeatureConvertJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/DummyFeatureConvertJobContext.java index 10f3c5e..394509b 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/DummyFeatureConvertJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/DummyFeatureConvertJobContext.java @@ -10,26 +10,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; - -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.xmlrules.DigesterLoader; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.commons.transaction.memory.PessimisticMapWrapper; -import org.apache.commons.transaction.util.CommonsLoggingLogger; -import org.apache.commons.transaction.util.LoggerFacade; -import org.geotools.data.FeatureWriter; -import org.geotools.data.Transaction; -import org.geotools.data.shapefile.ShapefileDataStore; -import org.geotools.data.shapefile.indexed.IndexedShapefileDataStore; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; -import org.geotools.feature.SimpleFeature; -import org.xml.sax.SAXException; - -import com.vividsolutions.jts.geom.GeometryFactory; +import java.util.TimeZone; import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; import com.ximple.eofms.filter.ElementDispatchableFilter; @@ -38,21 +19,34 @@ import com.ximple.eofms.filter.TypeCompLevelIdDispatchableFilter; import com.ximple.eofms.filter.TypeIdDispatchableFilter; import com.ximple.eofms.jobs.context.AbstractDgnFileJobContext; +import com.ximple.eofms.util.ElementDigesterUtils; import com.ximple.io.dgn7.ComplexElement; import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.FrammeAttributeData; import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.digester3.Digester; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.transaction.memory.PessimisticMapWrapper; +import org.apache.commons.transaction.util.CommonsLoggingLogger; +import org.apache.commons.transaction.util.LoggerFacade; +import org.geotools.data.FeatureWriter; +import org.geotools.data.Transaction; +import org.geotools.data.shapefile.ShapefileDataStore; +import org.geotools.feature.SchemaException; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import org.xml.sax.SAXException; -public class DummyFeatureConvertJobContext extends AbstractDgnFileJobContext -{ +public class DummyFeatureConvertJobContext extends AbstractDgnFileJobContext { static final Log logger = LogFactory.getLog(DummyFeatureConvertJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); static final String SHPOUTPATH = "shpout"; private String dataOut = null; - private HashMap<String, ArrayList<Feature>> featuresContext = new HashMap<String, ArrayList<Feature>>(); + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; @@ -60,78 +54,62 @@ private ElementDispatcher elementDispatcher; private String _filterConfig; - public DummyFeatureConvertJobContext(String dataPath, String filterConfig) - { - super(dataPath); + public DummyFeatureConvertJobContext(String dataPath, String filterConfig, boolean profileMode, + boolean useTransform) { + super(dataPath, profileMode, useTransform); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); _filterConfig = filterConfig; elementDispatcher = createElementDispatcher(); } - private ElementDispatcher createElementDispatcher() - { - try - { - URL rulesURL = ElementDispatcher.class.getResource("ElementDispatcherRules.xml"); - assert rulesURL != null; - Digester digester = DigesterLoader.createDigester(rulesURL); + private ElementDispatcher createElementDispatcher() { + try { URL filterURL = null; - if (_filterConfig != null) - { + if (_filterConfig != null) { File config = new File(_filterConfig); - if (config.exists()) - { + if (config.exists()) { filterURL = config.toURI().toURL(); } } - if (filterURL == null) - { + if (filterURL == null) { // config = new File("conf/DefaultConvertShpFilter.xml"); filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); } assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); return (ElementDispatcher) digester.parse(filterURL); - } catch (UnsupportedEncodingException e) - { + } catch (UnsupportedEncodingException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (SAXException e) - { + } catch (SAXException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); } } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { assert elementDispatcher != null; - if (element == null) - { + if (element == null) { logger.warn("Unknown Element:" + null); return; } - // �P�_�O�_�ũM���� - Feature feature = elementDispatcher.execute(element, true); - if (feature == null) - { + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { FrammeAttributeData linkage = - AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); logger.warn("Unknown Element:" + element.getElementType().toString() + - ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + - (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); - if (element instanceof ComplexElement) - { + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); + if (element instanceof ComplexElement) { ComplexElement complex = (ComplexElement) element; logger.warn("----Complex Element size=" + complex.size()); } @@ -139,131 +117,116 @@ return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); } - public void startTransaction() - { + public void startTransaction() { assert elementDispatcher != null; - for (ElementDispatchableFilter filter : elementDispatcher.getRules()) - { - if (filter instanceof TypeCompIdDispatchableFilter) - { + for (ElementDispatchableFilter filter : elementDispatcher.getRules()) { + if (filter instanceof TypeCompIdDispatchableFilter) { ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); - } else if (filter instanceof TypeCompLevelIdDispatchableFilter) - { + } else if (filter instanceof TypeCompLevelIdDispatchableFilter) { ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); - } else if (filter instanceof TypeIdDispatchableFilter) - { + } else if (filter instanceof TypeIdDispatchableFilter) { ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); } } } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); File sfile = new File(getDataOutPath() + File.separator + featureType.getTypeName()); logger.debug("Begin Save shapefile:" + sfile.toURI()); FeatureWriter writer; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { + } else { // ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL()); /* ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL(), true, Charset.forName("UTF-8")); */ - if (!sfile.exists()) - { - ShapefileDataStore shapefileDataStore = new IndexedShapefileDataStore(sfile.toURI().toURL(), - null, true, true, IndexedShapefileDataStore.TREE_QIX, Charset.forName("UTF-8")); + ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL()); + /* + if(namespace != null) { + shapefileDataStore.setNamespaceURI(namespace.toString()); + } + */ + shapefileDataStore.setMemoryMapped(true); + // shapefileDataStore.setBufferCachingEnabled(cacheMemoryMaps); + shapefileDataStore.setCharset(Charset.forName("UTF-8")); + shapefileDataStore.setTimeZone(TimeZone.getDefault()); + shapefileDataStore.setIndexed(true); + shapefileDataStore.setIndexCreationEnabled(true); + + if (!sfile.exists()) { shapefileDataStore.createSchema(featureType); writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(), - Transaction.AUTO_COMMIT); - } else - { - ShapefileDataStore shapefileDataStore = new IndexedShapefileDataStore(sfile.toURI().toURL(), - null, true, true, IndexedShapefileDataStore.TREE_QIX, Charset.forName("UTF-8")); + Transaction.AUTO_COMMIT); + } else { writer = shapefileDataStore.getFeatureWriterAppend(featureType.getTypeName(), - Transaction.AUTO_COMMIT); + Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } - ArrayList<Feature> features = featuresContext.get(featureType); + ArrayList<SimpleFeature> features = featuresContext.get(featureType); Iterator itFeature = features.iterator(); - while (itFeature.hasNext()) - { - Feature feature = (Feature) itFeature.next(); - ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); } //writer.close(); logger.debug("End Save shapefile:" + sfile.toURI()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public String getDataOutPath() - { - if (dataOut == null) - { + public String getDataOutPath() { + if (dataOut == null) { File outPath = new File(getDataPath(), SHPOUTPATH); - if (!outPath.exists()) - { + if (!outPath.exists()) { outPath.mkdir(); - } else if (!outPath.isDirectory()) - { + } else if (!outPath.isDirectory()) { outPath.mkdir(); } dataOut = outPath.toString(); @@ -271,35 +234,29 @@ return dataOut; } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } return null; } - public Log getLogger() - { + public Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/GeoserverIntegrateConfigJob.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/GeoserverIntegrateConfigJob.java new file mode 100644 index 0000000..3a7b3d8 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/GeoserverIntegrateConfigJob.java @@ -0,0 +1,1192 @@ +package com.ximple.eofms.jobs; + +import com.vividsolutions.jts.geom.*; +import com.ximple.eofms.geoserver.config.XGeosDataConfig; +import com.ximple.eofms.geoserver.config.XGeosDataConfigMapping; +import com.ximple.eofms.jobs.context.AbstractOracleJobContext; +import com.ximple.eofms.util.PrintfFormat; +import com.ximple.eofms.util.XGeosConfigDigesterUtils; +import it.geosolutions.geoserver.rest.GeoServerRESTManager; +import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; +import it.geosolutions.geoserver.rest.GeoServerRESTReader; +import it.geosolutions.geoserver.rest.decoder.*; +import it.geosolutions.geoserver.rest.encoder.GSLayerEncoder; +import it.geosolutions.geoserver.rest.encoder.GSLayerGroupEncoder; +import it.geosolutions.geoserver.rest.encoder.GSLayerGroupEncoder23; +import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder; +import it.geosolutions.geoserver.rest.encoder.datastore.GSPostGISDatastoreEncoder; +import it.geosolutions.geoserver.rest.encoder.feature.GSFeatureTypeEncoder; +import it.geosolutions.geoserver.rest.manager.GeoServerRESTStoreManager; +import org.apache.commons.collections.MultiMap; +import org.apache.commons.digester3.Digester; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.geotools.data.Transaction; +import org.geotools.data.jdbc.JDBCUtils; +import org.geotools.geometry.GeneralEnvelope; +import org.jdom.Element; +import org.opengis.feature.type.FeatureType; +import org.opengis.feature.type.GeometryDescriptor; +import org.quartz.JobDataMap; +import org.quartz.JobDetail; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.xml.sax.SAXException; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.sql.*; +import java.util.*; +import java.util.Date; + +public class GeoserverIntegrateConfigJob extends OracleConvertDgn2PostGISJob { + final static Log logger = LogFactory.getLog(GeoserverIntegrateConfigJob.class); + + private static final String SKIPCONFIGJOB = "SKIPCONFIGJOB"; + private static final String MASTERMODE = "MASTERMODE"; + private static final String EPSG = "EPSG:"; + private static final String DEFAULT_NAMESPACE = "xtpc"; + private static final String XGEOSDATACONFIG_PATH = "xgeosdataconfig.xml"; + private static final String GEOSERVER_BASEURL = "GEOSERVER_URL"; + private static final String GEOSERVER_USER = "GEOSERVER_USER"; + private static final String GEOSERVER_PASS = "GEOSERVER_PASS"; + + // private static final int MAGIC_BLOCKSIZE = (64 * 1024 * 1024) - (32 * 1024); + + private static final String QUERY_VIEWDEFSQL = "SELECT table_name, view_definition FROM information_schema.views " + + "WHERE table_schema = ? AND table_name LIKE "; + + private static final String CREATE_VIEWSQL = "CREATE OR REPLACE VIEW \"%s\" AS SELECT * FROM \"%s\".\"%s\""; + private static final String EXTRAWHERE_VIEWSQL = " WHERE \"%s\".level = %s AND \"%s\".symweight = %s"; + + private static final String ALTER_VIEWSQL = "ALTER TABLE \"%s\" OWNER TO "; + // private static final String GRANT_VIEWSQL = "GRANT SELECT ON TABLE \"%s\" TO public"; + private static final int SRSID_TWD97_ZONE119 = 3825; + private static final int SRSID_TWD97_ZONE121 = 3826; + public static final String DEFAULT_STORENAME = "pgDMMS"; + public static final String DEFAULT_GEODMMS_NAMESPACE = "http://tpc.ximple.com.tw/geodmms"; + + private static XGeosDataConfigMapping xgeosDataConfigMapping = null; + + protected String _geoServerURL; + protected String _geoServerUser; + protected String _geoServerPass; + + private long queryTime = 0; + private long queryTimeStart = 0; + + public Log getLogger() { + return logger; + } + + protected AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath, + boolean profileMode, + boolean useTransform) { + return super.prepareJobContext(targetSchemaName, filterPath, profileMode, useTransform); + } + + protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException { + super.extractJobConfiguration(jobDetail); + + JobDataMap dataMap = jobDetail.getJobDataMap(); + _geoServerURL = dataMap.getString(GEOSERVER_BASEURL); + _geoServerUser = dataMap.getString(GEOSERVER_USER); + _geoServerPass = dataMap.getString(GEOSERVER_PASS); + + if (_geoServerURL == null) { + logger.warn("GEOSERVER_URL is null"); + throw new JobExecutionException("Unknown GEOSERVER_URL."); + } + if (_geoServerUser == null) { + logger.warn("GEOSERVER_USER is null"); + throw new JobExecutionException("Unknown GEOSERVER_USER."); + } + if (_geoServerPass == null) { + logger.warn("GEOSERVER_PASS is null"); + throw new JobExecutionException("Unknown GEOSERVER_PASS."); + } + } + + protected XGeosDataConfigMapping getConfigMapping() { + if (xgeosDataConfigMapping == null) { + Digester digester = XGeosConfigDigesterUtils.getXGeosConfigDigester(); + final URL configDataURL = XGeosDataConfigMapping.class.getResource(XGEOSDATACONFIG_PATH); + try { + xgeosDataConfigMapping = (XGeosDataConfigMapping) digester.parse(configDataURL); + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } catch (SAXException e) { + logger.warn(e.getMessage(), e); + } + + } + return xgeosDataConfigMapping; + } + + private void logTimeDiff(String message, long tBefore, long tCurrent) { + logger.warn(message + ":use time = " + ((int) ((tCurrent - tBefore) / 60000.0)) + " min - " + + (((int) ((tCurrent - tBefore) % 60000.0)) / 1000) + " sec"); + } + + @Override + public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { + + super.execute(jobExecutionContext); + + createTargetDataStore(); + + if (getTargetDataStore() == null) { + logger.warn("Cannot connect source postgreSQL database."); + throw new JobExecutionException("Cannot connect source postgreSQL database."); + } + + if (isProfileMode()) { + queryTime = 0; + } + + long t1 = System.currentTimeMillis(); + String targetSchemaName; + + try { + logger.info("-- step:resetPostgisViewMapping --"); + long tStep = System.currentTimeMillis(); + resetPostgisViewMapping(jobExecutionContext); + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-resetPostgisViewMapping", tStep, tStepEnd); + } + logger.info("-- step:resetGeoServerConfig --"); + tStep = System.currentTimeMillis(); + // resetGeoServerConfig(jobExecutionContext); + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-resetGeoServerConfig", tStep, tStepEnd); + } + } finally { + disconnect(); + } + } + + /** + * 重新建立所有重新建立所有PostGIS中的資料庫視景 + * + * @param executionContext 批次執行的關係 + */ + private void resetPostgisViewMapping(JobExecutionContext executionContext) { + assert executionContext != null; + Connection connection = null; + try { + connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + String ownerName = _pgUsername; + String currentTargetSchema = retrieveCurrentSchemaName(connection, + DataReposVersionManager.VSSTATUS_READY); + if (currentTargetSchema == null) { + logger.info("Cannot found schema that status is VSSTATUS_READY[" + + DataReposVersionManager.VSSTATUS_READY + "]"); + return; + } + + ArrayList<String> realTableNames = new ArrayList<String>(); + retrieveAllRealTableName(connection, currentTargetSchema, realTableNames); + + HashMap<String, String> viewDefs = retrieveViewDef(connection, "public", "fsc%"); + HashMap<String, String> tempViewDefs = retrieveViewDef(connection, "public", "indexshape%"); + viewDefs.putAll(tempViewDefs); + tempViewDefs = viewDefs = retrieveViewDef(connection, "public", "lndtpc%"); + viewDefs.putAll(tempViewDefs); + + for (String tableName : realTableNames) { + resetPostgisDataView(connection, viewDefs, ownerName, currentTargetSchema, tableName); + } + + resetExtraPostgisDataView(connection, ownerName, currentTargetSchema, realTableNames); + + updateCurrentRepositoryStatus(connection, currentTargetSchema, + DataReposVersionManager.VSSTATUS_LINKVIEW); + + String currentTargetThemesName = retrieveCurrentThemeName(connection, + DataReposVersionManager.VSSTATUS_READY); + if (currentTargetThemesName == null) { + logger.info("Cannot found themes that status is VSSTATUS_READY[" + + DataReposVersionManager.VSSTATUS_READY + "]"); + return; + } + + resetThemesBaseView(connection, ownerName, currentTargetThemesName); + + XGeosDataConfigMapping configMapping = getConfigMapping(); + String[] allView = retrieveTargetStoreAllViewNames(connection); + TreeSet<String> allViewNames = new TreeSet<String>(); + if (allView != null) { + allViewNames.addAll(Arrays.asList(allView)); + } + List values = (List) configMapping.getMapping().get("pgOMS"); + for (Object value : values) { + XGeosDataConfig xgeosConfig = (XGeosDataConfig) value; + short tid = xgeosConfig.getFSC(); + short cid = xgeosConfig.getCOMP(); + StringBuilder sbTable = new StringBuilder("fsc-"); + sbTable.append(tid).append("-c-"); + sbTable.append(cid); + + int index = realTableNames.indexOf(sbTable.toString()); + if (index == -1) { + logger.debug("pgOMS LayerView Cannot found-" + xgeosConfig.toString()); + continue; + } + + StringBuilder sbView = new StringBuilder("fsc-"); + sbView.append(tid).append("-c"); + sbView.append(cid).append("-l"); + sbView.append(xgeosConfig.getLEV()).append("-w"); + sbView.append(xgeosConfig.getWEIGHT()); + String viewName = sbView.toString(); + if (allViewNames.contains(viewName)) { + resetThemesPostgisDataView(connection, ownerName, null, viewName); + } + } + + updateCurrentThemeStatus(connection, currentTargetThemesName, + DataReposVersionManager.VSSTATUS_LINKVIEW); + + // String[] featureNames = dataStore.getTypeNames(); + // logger.info("featureNames[] size = " + featureNames.length); + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + } finally { + if (connection != null) + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); + // if (dataStore != null) dataStore.dispose(); + } + } + + private void retrieveAllRealTableName(Connection connection, String targetSchema, + ArrayList<String> realTableNames) throws SQLException { + ResultSet rsMeta = null; + try { + rsMeta = connection.getMetaData().getTables("", targetSchema, "fsc%", new String[]{"TABLE"}); + while (rsMeta.next()) { + String tableName = rsMeta.getString(3); + realTableNames.add(tableName); + } + rsMeta.close(); + rsMeta = null; + + rsMeta = connection.getMetaData().getTables("", targetSchema, "index%", new String[]{"TABLE"}); + while (rsMeta.next()) { + String tableName = rsMeta.getString(3); + realTableNames.add(tableName); + } + rsMeta.close(); + rsMeta = null; + + rsMeta = connection.getMetaData().getTables("", targetSchema, "lndtpc%", new String[]{"TABLE"}); + while (rsMeta.next()) { + String tableName = rsMeta.getString(3); + realTableNames.add(tableName); + } + } finally { + if (rsMeta != null) rsMeta.close(); + } + } + + private void resetPostgisDataView(Connection connection, HashMap<String, String> viewDefs, + String ownerName, String schemaName, String tableName) throws SQLException { + String[] splits = tableName.split("-"); + if (splits.length > 3) { + // feature table + + StringBuilder viewBuilder = new StringBuilder(); + viewBuilder.append(splits[0]); + viewBuilder.append('-'); + viewBuilder.append(splits[1]); + viewBuilder.append('-'); + viewBuilder.append(splits[2]); + viewBuilder.append(splits[3]); + String viewName = viewBuilder.toString(); + if (viewDefs.containsKey(viewName)) { + String viewDef = viewDefs.get(viewName); + int pos = viewDef.indexOf("FROM"); + String subView = viewDef.substring(pos + 4); + // String[] viewSources = subView.split("\\."); + String[] viewSources = subView.split("(\\.\"|\")"); + if (!viewSources[0].equalsIgnoreCase(schemaName)) { + createOrReplaceView(connection, schemaName, tableName, viewName, ownerName); + } + } else { + createOrReplaceView(connection, schemaName, tableName, viewName, ownerName); + } + + } else { + + splits = tableName.split("_"); + if (splits.length > 0) { + StringBuilder viewBuilder = new StringBuilder(); + viewBuilder.append(splits[0]); + if (splits.length > 1) viewBuilder.append(splits[1]); + if (splits.length > 2) viewBuilder.append(splits[2]); + String viewName = viewBuilder.toString(); + if (viewDefs.containsKey(viewName)) { + String viewDef = viewDefs.get(viewName); + int pos = viewDef.indexOf("FROM"); + String subView = viewDef.substring(pos + 4); + String[] viewSources = subView.split("(\\.\"|\")"); + if (!viewSources[0].equalsIgnoreCase(schemaName)) { + createOrReplaceView(connection, schemaName, tableName, viewName, ownerName); + } + } else { + createOrReplaceView(connection, schemaName, tableName, viewName, ownerName); + } + } + } + } + + private void resetExtraPostgisDataView(Connection connection, String ownerName, String currentSchema, + ArrayList<String> realTableNames) { + try { + // ArrayList<String> extraViewNames = new ArrayList<String>(); + XGeosDataConfigMapping configMapping = getConfigMapping(); + MultiMap configMultiMap = configMapping.getMapping(); + for (Object key : configMultiMap.keySet()) { + List values = (List) configMultiMap.get(key); + for (Object value : values) { + XGeosDataConfig xgeosConfig = (XGeosDataConfig) value; + short tid = xgeosConfig.getFSC(); + short cid = xgeosConfig.getCOMP(); + StringBuilder sbTable = new StringBuilder("fsc-"); + sbTable.append(tid).append("-c-"); + sbTable.append(cid); + int index = realTableNames.indexOf(sbTable.toString()); + if (index == -1) { + logger.debug("Cannot found-" + xgeosConfig.toString()); + continue; + } + StringBuilder sbView = new StringBuilder("fsc-"); + sbView.append(tid).append("-c"); + sbView.append(cid).append("-l"); + sbView.append(xgeosConfig.getLEV()).append("-w"); + sbView.append(xgeosConfig.getWEIGHT()); + // extraViewNames.add(sbView.toString()); + + createOrReplaceExtraView(connection, currentSchema, sbTable.toString(), sbView.toString(), + ownerName, xgeosConfig); + } + } + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + } + } + + private void resetThemesBaseView(Connection connection, String ownerName, String currentThemesName) + throws SQLException { + String viewName = "xpwtheme" + FDYNCOLOR_SUFFIX; + String tableName = currentThemesName + FDYNCOLOR_SUFFIX; + PrintfFormat pf = new PrintfFormat("CREATE OR REPLACE VIEW \"%s\" AS SELECT * FROM \"%s\""); + String sql = pf.sprintf(new Object[]{viewName, tableName}); + Statement stmt = connection.createStatement(); + try { + stmt.execute(sql); + pf = new PrintfFormat(ALTER_VIEWSQL + ownerName); + sql = pf.sprintf(viewName); + stmt.execute(sql); + + viewName = "xpwtheme" + FOWNER_SUFFIX; + tableName = currentThemesName + FOWNER_SUFFIX; + pf = new PrintfFormat("CREATE OR REPLACE VIEW \"%s\" AS SELECT * FROM \"%s\""); + sql = pf.sprintf(new Object[]{viewName, tableName}); + + stmt.execute(sql); + pf = new PrintfFormat(ALTER_VIEWSQL + ownerName); + sql = pf.sprintf(viewName); + stmt.execute(sql); + } catch (SQLException e) { + // logger.warn(e.getMessage(), e); + logger.info(sql == null ? "SQL=NULL" : "SQL=" + sql); + throw e; + } finally { + stmt.close(); + } + } + + + private void resetThemesPostgisDataView(Connection connection, String ownerName, + String currentSchema, String viewName) throws SQLException { + String themeViewName = viewName + "-oms"; + // PrintfFormat pf = new PrintfFormat(CREATE_VIEWSQL); + // String sql = pf.sprintf(new Object[]{viewName, schemaName, tableName}); + ResultSet rs = null; + Statement stmt = connection.createStatement(); + + try { + StringBuilder sbSQL = new StringBuilder("CREATE OR REPLACE VIEW \""); + sbSQL.append(themeViewName).append("\" AS SELECT "); + + rs = connection.getMetaData().getColumns(null, currentSchema, viewName, "%"); + while (rs.next()) { + String fieldName = rs.getString("COLUMN_NAME"); + sbSQL.append("t." + fieldName).append(", "); + } + sbSQL.append("fc.dyncolor, fo.fowner FROM "); + if (currentSchema != null) + sbSQL.append("\"").append(currentSchema).append("\".\"").append(viewName).append("\" AS t,"); + else + sbSQL.append("\"").append(viewName).append("\" AS t,"); + sbSQL.append("xpwtheme").append(FDYNCOLOR_SUFFIX).append(" AS fc,"); + sbSQL.append("xpwtheme").append(FOWNER_SUFFIX).append(" AS fo WHERE "); + sbSQL.append("t.tid = fc.tid AND t.oid = fc.oid AND "); + sbSQL.append("t.tid = fo.tid AND t.oid = fo.oid"); + + // sbSQL.delete(sbSQL.length() - 2, sbSQL.length()); + String sql = sbSQL.toString(); + stmt.execute(sql); + sbSQL.delete(0, sbSQL.length()); + + PrintfFormat pf = new PrintfFormat(ALTER_VIEWSQL + ownerName); + sql = pf.sprintf(themeViewName); + stmt.execute(sql); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + } + } + + private HashMap<String, String> retrieveViewDef(Connection connection, String schemaName, String tablePattern) throws SQLException { + PreparedStatement stmt = connection.prepareStatement(QUERY_VIEWDEFSQL + "'" + tablePattern + "'"); + stmt.setString(1, schemaName); + // stmt.setString(2, tablePattern); + HashMap<String, String> result = new HashMap<String, String>(); + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + String tableName = rs.getString(1); + String viewDef = rs.getString(2); + result.put(tableName, viewDef); + } + rs.close(); + stmt.close(); + return result; + } + + private void createOrReplaceView(Connection connection, String schemaName, String tableName, String viewName, + String ownerName) throws SQLException { + PrintfFormat pf = new PrintfFormat(CREATE_VIEWSQL); + String sql = pf.sprintf(new Object[]{viewName, schemaName, tableName}); + Statement stmt = connection.createStatement(); + try { + stmt.execute(sql); + pf = new PrintfFormat(ALTER_VIEWSQL + ownerName); + sql = pf.sprintf(viewName); + stmt.execute(sql); + } catch (SQLException e) { + // logger.warn(e.getMessage(), e); + logger.info(sql == null ? "SQL=NULL" : "SQL=" + sql); + throw e; + } finally { + stmt.close(); + } + // connection.commit(); + } + + private void createOrReplaceExtraView(Connection connection, String schemaName, String tableName, String viewName, + String ownerName, XGeosDataConfig xgeosConfig) throws SQLException { + PrintfFormat pf = new PrintfFormat(CREATE_VIEWSQL); + String sql = pf.sprintf(new Object[]{viewName, schemaName, tableName}); + + PrintfFormat pfWhere = new PrintfFormat(EXTRAWHERE_VIEWSQL); + sql += pfWhere.sprintf(new String[]{tableName, Short.toString(xgeosConfig.getLEV()), + tableName, Short.toString(xgeosConfig.getWEIGHT())}); + + Statement stmt = connection.createStatement(); + stmt.execute(sql); + + pf = new PrintfFormat(ALTER_VIEWSQL + ownerName); + sql = pf.sprintf(viewName); + stmt.execute(sql); + stmt.close(); + // connection.commit(); + } + + private Timestamp retrieveCurrentSchemaTimestamp(Connection connection, short status) throws SQLException { + StringBuilder sbSQL = new StringBuilder("SELECT vstimestamp, vsschema, vsstatus FROM "); + sbSQL.append(DataReposVersionManager.XGVERSIONTABLE_NAME); + sbSQL.append(" WHERE vsstatus = "); + sbSQL.append(status); + sbSQL.append(" ORDER BY vsid"); + + Timestamp result = null; + Statement stmt = null; + ResultSet rs = null; + + try { + stmt = connection.createStatement(); + rs = stmt.executeQuery(sbSQL.toString()); + // get first result + if (rs.next()) { + result = rs.getTimestamp(1); + } + return result; + } finally { + if (rs != null) rs.close(); + if (stmt != null) stmt.close(); + } + } + + private void updateCurrentRepositoryStatus(Connection connection, String schemaName, short newStatus) + throws SQLException { + StringBuilder sbSQL = new StringBuilder("UPDATE "); + sbSQL.append(DataReposVersionManager.XGVERSIONTABLE_NAME).append(' '); + sbSQL.append(" SET vsstatus = "); + sbSQL.append(newStatus); + sbSQL.append(", vstimestamp = CURRENT_TIMESTAMP WHERE vsschema = '"); + sbSQL.append(schemaName).append("'"); + + Statement stmt = null; + try { + stmt = connection.createStatement(); + stmt.executeUpdate(sbSQL.toString()); + } finally { + if (stmt != null) stmt.close(); + } + } + + private boolean checkCurrentRepositoryStatus(Connection connection, short status) { + try { + return (retrieveCurrentSchemaName(connection, status) != null); + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + return false; + } + } + + private String retrieveCurrentSchemaName(Connection connection, short status) throws SQLException { + StringBuilder sbSQL = new StringBuilder("SELECT vsschema, vstimestamp, vsstatus FROM "); + sbSQL.append(DataReposVersionManager.XGVERSIONTABLE_NAME); + sbSQL.append(" WHERE vsstatus = "); + sbSQL.append(status); + sbSQL.append(" ORDER BY vsid"); + + String result = null; + Statement stmt = null; + ResultSet rs = null; + + try { + stmt = connection.createStatement(); + rs = stmt.executeQuery(sbSQL.toString()); + // get first result + if (rs.next()) { + result = rs.getString(1); + } + return result; + } finally { + if (rs != null) rs.close(); + if (stmt != null) stmt.close(); + } + } + + private void updateCurrentThemeStatus(Connection connection, String schemaName, short newStatus) + throws SQLException { + StringBuilder sbSQL = new StringBuilder("UPDATE "); + sbSQL.append(DataReposVersionManager.XPTVERSIONTABLE_NAME).append(' '); + sbSQL.append(" SET vptstatus = "); + sbSQL.append(newStatus); + sbSQL.append(", vpttimestamp = CURRENT_TIMESTAMP WHERE vptname = '"); + sbSQL.append(schemaName).append("'"); + + Statement stmt = null; + try { + stmt = connection.createStatement(); + stmt.executeUpdate(sbSQL.toString()); + } finally { + if (stmt != null) stmt.close(); + } + } + + + private boolean checkCurrentThemeStatus(Connection connection, short status) { + try { + return (retrieveCurrentThemeName(connection, status) != null); + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + return false; + } + } + + + private String retrieveCurrentThemeName(Connection connection, short status) throws SQLException { + StringBuilder sbSQL = new StringBuilder("SELECT "); + sbSQL.append("vptname, vptstatus, vpttimestamp FROM "); + sbSQL.append(encodeSchemaTableName(_pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME)).append(' '); + sbSQL.append("ORDER BY vptid"); + + String result = null; + Statement stmt = null; + ResultSet rs = null; + + try { + stmt = connection.createStatement(); + rs = stmt.executeQuery(sbSQL.toString()); + // get first result + if (rs.next()) { + result = rs.getString(1); + } + return result; + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + } + } + + protected void transferXGeosVersionStatus(Connection connection, + short vsstatusBefore, short vsstatusAfter, boolean exclusive) throws JobExecutionException { + + try { + String currentTargetSchema = retrieveCurrentSchemaName(connection, vsstatusBefore); + if (currentTargetSchema == null) { + logger.info("Cannot found target schema in dataStore. status=" + vsstatusBefore); + return; + } + String existTargetSchema = null; + if (exclusive) + existTargetSchema = retrieveCurrentSchemaName(connection, vsstatusAfter); + + + updateCurrentRepositoryStatus(connection, currentTargetSchema, vsstatusAfter); + if ((exclusive) && (existTargetSchema != null)) { + updateCurrentRepositoryStatus(connection, existTargetSchema, + DataReposVersionManager.VSSTATUS_AVAILABLE); + } + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + throw new JobExecutionException("Update " + DataReposVersionManager.XGVERSIONTABLE_NAME + + " has error-", e); + } + } + + private HashMap<String, String> buildDefaultStylesMapping(XGeosDataConfigMapping configMapping) { + HashMap<String, String> result = new HashMap<String, String>(); + + for (Object key : configMapping.getMapping().keySet()) { + List xgeosConfigs = (List) configMapping.getMapping().get(key); + for (Object value : xgeosConfigs) { + XGeosDataConfig xgeosConfig = (XGeosDataConfig) value; + + StringBuilder sbView = new StringBuilder("fsc-"); + sbView.append(xgeosConfig.getFSC()).append("-c"); + sbView.append(xgeosConfig.getCOMP()).append("-l"); + sbView.append(xgeosConfig.getLEV()).append("-w"); + sbView.append(xgeosConfig.getWEIGHT()); + + String viewName = sbView.toString(); + if (!result.containsKey(viewName)) { + result.put(viewName, xgeosConfig.getFTYPE()); + } else { + if (xgeosConfig.getFTYPE() != null) { + if (!result.get(viewName).equals(xgeosConfig.getFTYPE())) + logger.info("Style Define Diff:" + result.get(viewName) + " - " + xgeosConfig.getFTYPE()); + } else { + logger.warn("xgeosConfig getFTYPE() is null - " + xgeosConfig.toString()); + } + } + } + } + return result; + } + + private String buildDefaultWMSLayerNames(String namespace, List xgeosConfigs, GSLayerGroupEncoder lgEncoder) { + StringBuilder sbLayers = new StringBuilder(); + boolean first = true; + + for (Object value : xgeosConfigs) { + if (!first) { + sbLayers.append(','); + } else { + first = false; + } + XGeosDataConfig xgeosConfig = (XGeosDataConfig) value; + + StringBuilder sbLayerName = new StringBuilder(namespace); + sbLayerName.append(':'); + sbLayerName.append("fsc-"); + sbLayerName.append(xgeosConfig.getFSC()).append("-c"); + sbLayerName.append(xgeosConfig.getCOMP()).append("-l"); + sbLayerName.append(xgeosConfig.getLEV()).append("-w"); + sbLayerName.append(xgeosConfig.getWEIGHT()); + + String layerName = sbLayerName.toString(); + sbLayers.append(layerName); + if (lgEncoder != null) { + lgEncoder.addLayer(layerName); + } + } + + return sbLayers.toString(); + } + + protected String[] retrieveTargetStoreAllViewNames(Connection connection) { + try { + final int TABLE_NAME_COL = 3; + List list = new ArrayList(); + + DatabaseMetaData meta = connection.getMetaData(); + // String[] tableType = { "TABLE", "VIEW" }; + String[] tableType = { "VIEW" }; + ResultSet tables = meta.getTables(null, _pgSchema, "%", tableType); + + while (tables.next()) { + String tableName = tables.getString(TABLE_NAME_COL); + list.add(tableName); + /* + if (allowTable(tableName)) { + list.add(tableName); + } + */ + } + tables.close(); + return (String[]) list.toArray(new String[list.size()]); + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + } + return null; + } + + private void resetFeatureTypesMapping(JobExecutionContext executionContext, GeoServerRESTManager manager) { + try { + GeoServerRESTReader reader = manager.getReader(); + GeoServerRESTPublisher publisher = manager.getPublisher(); + + Connection connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + if (!checkCurrentRepositoryStatus(connection, DataReposVersionManager.VSSTATUS_CONFIG)) { + return; + } + + List<String> styleList = reader.getStyles().getNames(); + Set<String> styles = new TreeSet<String>(styleList); + + XGeosDataConfigMapping mapping = getConfigMapping(); + HashMap<String, String> defaultStyles = buildDefaultStylesMapping(mapping); + + try { + String[] dsFTypeNames = retrieveTargetStoreAllViewNames(connection); + + for (String featureTypeName : dsFTypeNames) { + FeatureType featureType = null; + try { + featureType = targetDataStore.getFeatureSource(featureTypeName, Transaction.AUTO_COMMIT).getSchema(); + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } + if (featureType == null) continue; + + RESTLayer layer = reader.getLayer(DEFAULT_NAMESPACE, featureTypeName); + if (layer != null) { + // publisher.removeLayer(DEFAULT_NAMESPACE, featureTypeName); + if (!publisher.unpublishFeatureType(DEFAULT_NAMESPACE, DEFAULT_STORENAME, featureTypeName)) { + logger.info("Cannot remove featureType:" + featureTypeName); + } + } + + final GSFeatureTypeEncoder fte = new GSFeatureTypeEncoder(); + + // fte.setProjectionPolicy(GSResourceEncoder.ProjectionPolicy.REPROJECT_TO_DECLARED); + fte.setProjectionPolicy(GSResourceEncoder.ProjectionPolicy.FORCE_DECLARED); + fte.addKeyword("KEYWORD"); + fte.setTitle(featureTypeName); + fte.setName(featureTypeName); + String srs = "EPSG:" + SRSID_TWD97_ZONE121; + if (!this._useZone121) { + srs = "EPSG:" + SRSID_TWD97_ZONE119; + } + fte.setNativeCRS(srs); + fte.setSRS(srs); // srs=null?"EPSG:4326":srs); + + String defaultStyle = getDefaultFeatureTypeStyleId(styles, defaultStyles, featureType); + final GSLayerEncoder le = new GSLayerEncoder(); + le.setDefaultStyle(defaultStyle); + + if (!publisher.publishDBLayer(DEFAULT_NAMESPACE, DEFAULT_STORENAME, fte, le)) { + logger.info("Create Feature Failed. [" + featureTypeName + "]"); + } + } + } finally { + // if (dataStore != null) dataStore.dispose(); + if (connection != null) + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); + + } + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } + } + + private void resetGeoServerConfig(JobExecutionContext jobExecutionContext) throws JobExecutionException { + Connection connection = null; + try { + connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + transferXGeosVersionStatus(connection, DataReposVersionManager.VSSTATUS_LINKVIEW, + DataReposVersionManager.VSSTATUS_CONFIG, false); + URL geoServerURL = new URL(_geoServerURL); + GeoServerRESTManager manager = new GeoServerRESTManager(geoServerURL, _geoServerUser, _geoServerPass); + GeoServerRESTReader reader = manager.getReader(); + List<String> workSpaces = reader.getWorkspaceNames(); + boolean found = false; + for (String name : workSpaces) { + if (name.equalsIgnoreCase(DEFAULT_NAMESPACE)) { + found = true; + break; + } + } + + GeoServerRESTPublisher publisher = manager.getPublisher(); + if (!found) { + publisher.createWorkspace(DEFAULT_NAMESPACE, new URI(DEFAULT_GEODMMS_NAMESPACE)); + } + + RESTDataStore dataStore = reader.getDatastore(DEFAULT_NAMESPACE, DEFAULT_STORENAME); + if (dataStore == null) { + GeoServerRESTStoreManager storeManager = manager.getStoreManager(); + GSPostGISDatastoreEncoder store = new GSPostGISDatastoreEncoder(DEFAULT_STORENAME); + store.setHost(_pgHost); + store.setPort(Integer.parseInt(_pgPort)); + store.setDatabase(_pgDatabase); + store.setSchema(_pgSchema); + store.setUser(_pgUsername); + store.setPassword(_pgPassword); + storeManager.create(DEFAULT_NAMESPACE, store); + } + + + resetFeatureTypesMapping(jobExecutionContext, manager); + + resetGeoserverWMSConfig(jobExecutionContext, connection, manager, true); + resetWMSVirtualLayerMapping(jobExecutionContext, connection, manager, true); + + transferXGeosVersionStatus(connection, DataReposVersionManager.VSSTATUS_CONFIG, + DataReposVersionManager.VSSTATUS_USING, true); + Date lastUpdate = Calendar.getInstance().getTime(); + } catch (IOException e) { + logger.warn(e.getMessage(), e); + throw new JobExecutionException("resetGeoServerConfig has error-" + e.getMessage(), e); + } catch (URISyntaxException e) { + logger.warn(e.getMessage(), e); + throw new JobExecutionException("resetGeoServerConfig has error-" + e.getMessage(), e); + } finally { + if (connection != null) + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); + + } + } + + protected String getDefaultFeatureTypeStyleId(Set<String> styles, HashMap<String, String> defaultStyles, FeatureType featureType) { + String ftName = featureType.getName().getLocalPart(); + boolean isNormalFeature = false; + boolean isLandBased = false; + boolean isIndex = false; + boolean isSmallIndex = false; + boolean isSymbol = false; + GeometryDescriptor geomAttrType = featureType.getGeometryDescriptor(); + Class geomType = geomAttrType.getType().getBinding(); + if (defaultStyles.containsKey(ftName)) { + String defaultStyleName = defaultStyles.get(ftName); + String styleName = retrieveDefaultStyle(styles, defaultStyleName, "unknown"); + if (!styleName.equals("unknown")) { + return styleName; + } + } + + if (ftName.indexOf("fsc") != -1) { + isNormalFeature = true; + } + if (ftName.indexOf("indexshape") != -1) { + isIndex = true; + } + if (ftName.indexOf("indexshapes") != -1) { + isSmallIndex = true; + } + if (ftName.indexOf("lnd") != -1) { + isLandBased = true; + } + if (featureType.getDescriptor("symbol") != null) { + isSymbol = true; + } + + if (Point.class.equals(geomType)) { + if (isSymbol) { + return retrieveDefaultStyle(styles, "xtpc-symbol", "point"); + } else if (isIndex) { + return retrieveDefaultStyle(styles, "xtpc-text2", "point"); + } else { + return retrieveDefaultStyle(styles, "xtpc-text", "point"); + } + } else if (LineString.class.equals(geomType)) { + if ((!isIndex) && (!isLandBased)) { + return retrieveDefaultStyle(styles, "xtpc-conductor", "line"); + } else if (isIndex) { + if (isSmallIndex) + return retrieveDefaultStyle(styles, "xtpc-indexshapes", "line"); + + return retrieveDefaultStyle(styles, "xtpc-indexshape", "line"); + } else if (isLandBased) { + return retrieveDefaultStyle(styles, "xtpc-lndcityLine", "line"); + } + } else if (MultiPoint.class.equals(geomType)) { + if (isSymbol) { + return retrieveDefaultStyle(styles, "xtpc-symbol", "point"); + } else { + return retrieveDefaultStyle(styles, "xtpc-text", "point"); + } + } else if (Polygon.class.equals(geomType)) { + if (isSymbol) { + return retrieveDefaultStyle(styles, "xtpc-symbol", "polygon"); + } else if ((!isIndex) && (!isLandBased)) { + return retrieveDefaultStyle(styles, "polygon", "polygon"); + } else if (isIndex) { + return retrieveDefaultStyle(styles, "xtpc-indexshape", "polygon"); + } else if (isLandBased) { + return retrieveDefaultStyle(styles, "xtpc-lndcityPolygon", "polygon"); + } + } else if (LinearRing.class.equals(geomType)) { + if (!isIndex) { + return retrieveDefaultStyle(styles, "polygon", "polygon"); + } else { + return retrieveDefaultStyle(styles, "xtpc-indexshape", "polygon"); + } + } else if (MultiLineString.class.equals(geomType)) { + if ((!isIndex) && (!isLandBased)) { + return retrieveDefaultStyle(styles, "xtpc-conductor", "line"); + } else if (isLandBased) { + return retrieveDefaultStyle(styles, "xtpc-lndcityLine", "line"); + } else { + return retrieveDefaultStyle(styles, "xtpc-indexshape", "line"); + } + } else if (MultiPolygon.class.equals(geomType)) { + return "polygon"; + } + + return "xtpc-symbol"; + } + + private static String retrieveDefaultStyle(Set styles, String styleName, String defaultStyleName) { + if (styles.contains(styleName)) { + return styleName; + } else + return defaultStyleName; + } + + protected void resetGeoserverWMSConfig(JobExecutionContext executionContext, Connection connection, + GeoServerRESTManager manager, boolean masterMode) + throws JobExecutionException, IOException { + + if ((masterMode) && (!checkCurrentRepositoryStatus(connection, DataReposVersionManager.VSSTATUS_CONFIG))) { + return; + } + + GeoServerRESTReader reader = manager.getReader(); + GeoServerRESTPublisher publisher = manager.getPublisher(); + + List<String> baseMapNames = reader.getLayers().getNames(); + XGeosDataConfigMapping configMapping = getConfigMapping(); + if (configMapping.getMapping().isEmpty()) { + logger.warn("XGeosDataConfigMapping is empty! Pleace check XGeosDataConfig file."); + return; + } + + LinkedList defaultMapNames = new LinkedList(configMapping.getMapping().keySet()); + if (defaultMapNames.isEmpty()) { + logger.warn("DefaultMapNames is emptyin XGeosDataConfigMapping! Pleace check XGeosDataConfig file."); + } + + for (Object key : baseMapNames) { + String baseMapTitle = (String) key; + if (configMapping.getMapping().containsKey(baseMapTitle)) { + int index = defaultMapNames.indexOf(baseMapTitle); + if (index != -1) + defaultMapNames.remove(index); + + List configs = (List) configMapping.getMapping().get(baseMapTitle); + String defaultLayerNames = buildDefaultWMSLayerNames(DEFAULT_NAMESPACE, configs, null); + // wmsConfig.getBaseMapLayers().put(baseMapTitle, defaultLayerNames); + logger.info(baseMapTitle + ":" + defaultLayerNames); + } else { + logger.warn(key.toString() + "-lv='" + baseMapTitle + "' cannot found config information in XGeosDataConfigMapping."); + } + } + + for (Object key : defaultMapNames) { + List configs = (List) configMapping.getMapping().get(key); + GSLayerGroupEncoder lge = new GSLayerGroupEncoder23() { + @Override + protected void addToRoot(Element... elements) { + for (Element e : elements) { + if (e != null) { + getRoot().addContent(e.cloneContent()); + } + } + } + }; + lge.setBounds("EPSG:3826",293838.061931726,2758423.49415501,311845.457747425,2768966.72993585); + String defaultLayerNames = buildDefaultWMSLayerNames(DEFAULT_NAMESPACE, configs, lge); + // logger.info(key + ":" + defaultLayerNames); + // logger.info(lge.toString()); + // wmsConfig.getBaseMapLayers().put(key, defaultLayerNames); + String layerGroupName = key.toString(); + RESTLayerGroup layerGroup = reader.getLayerGroup(DEFAULT_NAMESPACE, layerGroupName); + if (layerGroup == null) { + if (!publisher.createLayerGroup(DEFAULT_NAMESPACE, layerGroupName, lge)) { + logger.warn("Cannot create layergroups:" + layerGroupName + "-" + lge.toString()); + } + } else { + publisher.configureLayerGroup(DEFAULT_NAMESPACE, layerGroupName, lge); + + } + } + } + + private void resetWMSVirtualLayerMapping(JobExecutionContext jobExecutionContext, Connection connection, + GeoServerRESTManager manager, boolean masterMode) + throws JobExecutionException, IOException { + if ((masterMode) && (!checkCurrentRepositoryStatus(connection, DataReposVersionManager.VSSTATUS_CONFIG))) { + return; + } + + GeoServerRESTReader reader = manager.getReader(); + List<String> layernames = reader.getLayers().getNames(); + ArrayList<String> baseMapNames = new ArrayList<String>(layernames); + // Map baseMapLayers = wmsConfig.getBaseMapLayers(); + // Map baseMapEnvelopes = wmsConfig.getBaseMapEnvelopes(); + + for (Object key : baseMapNames) { + String baseMapTitle = (String) key; + if (baseMapTitle.startsWith("pg")) { + // GeneralEnvelope envelope = (GeneralEnvelope) baseMapEnvelopes.get(baseMapTitle); + + GeneralEnvelope selectedEnvelope = null; + // String baseLayersValue = (String) wmsConfig.getBaseMapLayers().get(baseMapTitle); + RESTLayerGroup layerGroup = reader.getLayerGroup(DEFAULT_NAMESPACE, baseMapTitle); + String baseLayersValue = layerGroup.getName(); + String[] layerNames = null; + if (baseLayersValue != null) { + layerNames = baseLayersValue.split(","); + } else { + logger.info("vl='" + baseMapTitle + "' is empty value."); + continue; + } + + // RESTLayer layer = reader.getLayer(DEFAULT_NAMESPACE, baseMapTitle); + // layer.Type. + + ArrayList<String> newLayerNames = new ArrayList<String>(); + for (int i = 0; i < layerNames.length; i++) { + String layerName = layerNames[i].trim(); + newLayerNames.add(layerName); + + /* + Integer layerType = catalog.getLayerType(layerName); + if (layerType != null) { + newLayerNames.add(layerName); + + if (layerType.intValue() == MapLayerInfo.TYPE_VECTOR) { + FeatureTypeInfo ftype = catalog.getFeatureTypeInfo(layerName); + ftype = ((ftype != null) ? ftype + : catalog.getFeatureTypeInfo(layerName + .substring(layerName.indexOf(":") + 1, layerName.length()))); + + if (selectedEnvelope == null) { + ReferencedEnvelope ftEnvelope = null; + + try { + if (ftype.getBoundingBox() instanceof ReferencedEnvelope + && !ftype.getBoundingBox().isNull()) { + ftEnvelope = ftype.getBoundingBox(); + } else { + // TODO Add Action Errors + return; + } + } catch (IOException e) { + logger.warn(e.getMessage(), e); + return; + } + + selectedEnvelope = new GeneralEnvelope(new double[]{ + ftEnvelope.getMinX(), ftEnvelope.getMinY() + }, + new double[]{ftEnvelope.getMaxX(), ftEnvelope.getMaxY()}); + selectedEnvelope.setCoordinateReferenceSystem(ftEnvelope + .getCoordinateReferenceSystem()); + } else { + final CoordinateReferenceSystem dstCRS = selectedEnvelope + .getCoordinateReferenceSystem(); + + ReferencedEnvelope ftEnvelope = null; + + try { + if (ftype.getBoundingBox() instanceof ReferencedEnvelope) { + ftEnvelope = (ReferencedEnvelope) ftype.getBoundingBox(); + ftEnvelope.transform(dstCRS, true); + } else { + // TODO Add Action Errors + return; + } + } catch (TransformException e) { + logger.warn(e.getMessage(), e); + return; + } catch (FactoryException e) { + logger.warn(e.getMessage(), e); + return; + } catch (IOException e) { + logger.warn(e.getMessage(), e); + return; + } + + ReferencedEnvelope newEnvelope = new ReferencedEnvelope(dstCRS); + newEnvelope.init(selectedEnvelope.getLowerCorner().getOrdinate(0), + selectedEnvelope.getUpperCorner().getOrdinate(0), + selectedEnvelope.getLowerCorner().getOrdinate(1), + selectedEnvelope.getUpperCorner().getOrdinate(1)); + + newEnvelope.expandToInclude(ftEnvelope); + + selectedEnvelope = new GeneralEnvelope(new double[]{ + newEnvelope.getMinX(), newEnvelope.getMinY() + }, + new double[]{newEnvelope.getMaxX(), newEnvelope.getMaxY()}); + selectedEnvelope.setCoordinateReferenceSystem(dstCRS); + } + } + } else { + logger.warn("Cannot found layer " + layerName + " in " + baseMapTitle); + } + */ + } + + if (layerNames.length != newLayerNames.size()) { + StringBuilder layerBuilder = new StringBuilder(); + boolean bFirst = true; + for (String newlayerName : newLayerNames) { + if (!bFirst) { + layerBuilder.append(','); + } else bFirst = false; + layerBuilder.append(newlayerName); + } + // baseMapLayers.put(baseMapTitle, layerBuilder.toString()); + logger.info(baseMapTitle +":"+ layerBuilder.toString()); + } + + /* + if (selectedEnvelope != null) { + if (envelope != null) { + envelope.setCoordinateReferenceSystem(selectedEnvelope + .getCoordinateReferenceSystem()); + envelope.setEnvelope(selectedEnvelope); + baseMapEnvelopes.put(baseMapTitle, envelope); + } else { + baseMapEnvelopes.put(baseMapTitle, selectedEnvelope); + } + } + */ + } + } + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2EdbGeoJob.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2EdbGeoJob.java new file mode 100644 index 0000000..48edd57 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2EdbGeoJob.java @@ -0,0 +1,1352 @@ +package com.ximple.eofms.jobs; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FilenameFilter; +import java.io.IOException; +import java.math.BigDecimal; +import java.nio.BufferOverflowException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.channels.FileChannel; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.Types; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +import com.ximple.eofms.jobs.context.AbstractOracleJobContext; +import com.ximple.eofms.jobs.context.edbgeo.FeatureDgnConvertEdbGeoJobContext; +import com.ximple.eofms.jobs.context.edbgeo.GeneralDgnConvertEdbGeoJobContext; +import com.ximple.eofms.jobs.context.edbgeo.IndexDgnConvertEdbGeoJobContext; +import com.ximple.eofms.jobs.context.edbgeo.OracleConvertEdbGeoJobContext; +import com.ximple.eofms.util.BinConverter; +import com.ximple.eofms.util.ByteArrayCompressor; +import com.ximple.eofms.util.FileUtils; +import com.ximple.eofms.util.StringUtils; +import com.ximple.io.dgn7.ComplexElement; +import com.ximple.io.dgn7.Dgn7fileException; +import com.ximple.io.dgn7.Dgn7fileReader; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.ElementType; +import com.ximple.io.dgn7.IElementHandler; +import com.ximple.io.dgn7.Lock; +import com.ximple.util.PrintfFormat; +import oracle.jdbc.OracleConnection; +import oracle.jdbc.OracleResultSet; +import oracle.sql.ARRAY; +import oracle.sql.BLOB; +import org.apache.commons.collections.OrderedMap; +import org.apache.commons.collections.OrderedMapIterator; +import org.apache.commons.collections.map.LinkedMap; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.geotools.data.DataStore; +import org.geotools.data.Transaction; +import org.geotools.data.edbgeo.PostgisDataStoreFactory; +import org.geotools.data.jdbc.JDBCUtils; +import org.geotools.feature.SchemaException; +import org.geotools.jdbc.JDBCDataStore; +import org.opengis.feature.IllegalAttributeException; +import org.quartz.JobDataMap; +import org.quartz.JobDetail; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +public class OracleConvertDgn2EdbGeoJob extends AbstractOracleDatabaseJob { + final static Log logger = LogFactory.getLog(OracleConvertDgn2EdbGeoJob.class); + + private static final String EDBHOST = "EDBHOST"; + private static final String EDBDATBASE = "EDBDATBASE"; + private static final String EDBPORT = "EDBPORT"; + private static final String EDBSCHEMA = "EDBSCHEMA"; + private static final String EDBUSER = "EDBUSER"; + private static final String EDBPASS = "EDBPASS"; + private static final String USEWKB = "USEWKB"; + + private static final boolean useTpclidText = false; + + private static final int FETCHSIZE = 30; + private static final int COMMITSIZE = 100; + private static final String INDEXPATHNAME = "index"; + private static final String OTHERPATHNAME = "other"; + + protected static class Pair { + Object first; + Object second; + + public Pair(Object first, Object second) { + this.first = first; + this.second = second; + } + } + + protected static PostgisDataStoreFactory dataStoreFactory = new PostgisDataStoreFactory(); + + protected String _edbHost; + protected String _edbDatabase; + protected String _edbPort; + protected String _edbSchema; + protected String _edbUsername; + protected String _edbPassword; + protected String _edbUseWKB; + + protected Map<String, String> edbProperties; + protected JDBCDataStore targetDataStore; + // protected OracleConvertEdbGeoJobContext oracleJobContext; + + private long queryTime = 0; + private long queryTimeStart = 0; + + public Log getLogger() { + return logger; + } + + protected AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath, + boolean profileMode, + boolean useTransform) { + return new OracleConvertEdbGeoJobContext(getDataPath(), + getTargetDataStore(), targetSchemaName, filterPath, profileMode, useTransform); + } + + protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException { + super.extractJobConfiguration(jobDetail); + JobDataMap dataMap = jobDetail.getJobDataMap(); + _edbHost = dataMap.getString(EDBHOST); + _edbDatabase = dataMap.getString(EDBDATBASE); + _edbPort = dataMap.getString(EDBPORT); + _edbSchema = dataMap.getString(EDBSCHEMA); + _edbUsername = dataMap.getString(EDBUSER); + _edbPassword = dataMap.getString(EDBPASS); + _edbUseWKB = dataMap.getString(USEWKB); + + Log logger = getLogger(); + /* + logger.info("EDBHOST=" + _myHost); + logger.info("EDBDATBASE=" + _myDatabase); + logger.info("EDBPORT=" + _myPort); + logger.info("EDBSCHEMA=" + _mySchema); + logger.info("EDBUSER=" + _myUsername); + logger.info("EDBPASS=" + _myPassword); + logger.info("USEWKB=" + _myUseWKB); + */ + + if (_edbHost == null) { + logger.warn("EDBHOST is null"); + throw new JobExecutionException("Unknown EdbGeoSpatial host."); + } + if (_edbDatabase == null) { + logger.warn("PGDATABASE is null"); + throw new JobExecutionException("Unknown EdbGeoSpatial database."); + } + if (_edbPort == null) { + logger.warn("EDBPORT is null"); + throw new JobExecutionException("Unknown EdbGeoSpatial port."); + } + if (_edbSchema == null) { + logger.warn("EDBSCHEMA is null"); + throw new JobExecutionException("Unknown EdbGeoSpatial schema."); + } + if (_edbUsername == null) { + logger.warn("PGUSERNAME is null"); + throw new JobExecutionException("Unknown EdbGeoSpatial username."); + } + if (_edbPassword == null) { + logger.warn("PGPASSWORD is null"); + throw new JobExecutionException("Unknown EdbGeoSpatial password."); + } + + Map<String, String> remote = new TreeMap<String, String>(); + remote.put("dbtype", "edbgeo"); + remote.put("charset", "UTF-8"); + remote.put("host", _edbHost); + remote.put("port", _edbPort); + remote.put("database", _edbDatabase); + remote.put("user", _edbUsername); + remote.put("passwd", _edbPassword); + remote.put("namespace", null); + edbProperties = remote; + } + + public void execute(JobExecutionContext context) throws JobExecutionException { + // Every job has its own job detail + JobDetail jobDetail = context.getJobDetail(); + + // The name is defined in the job definition + String jobName = jobDetail.getKey().getName(); + + // Log the time the job started + logger.info(jobName + " fired at " + new Date()); + extractJobConfiguration(jobDetail); + createSourceDataStore(); + createTargetDataStore(); + if (getSourceDataStore() == null) { + logger.warn("Cannot connect source oracle database."); + throw new JobExecutionException("Cannot connect source oracle database."); + } + + if (getTargetDataStore() == null) { + logger.warn("Cannot connect source postgreSQL database."); + throw new JobExecutionException("Cannot connect source postgreSQL database."); + } + + if (isProfileMode()) { + queryTime = 0; + } + + long t1 = System.currentTimeMillis(); + String targetSchemaName; + try { + logger.info("-- step:clearOutputDatabase --"); + clearOutputDatabase(); + targetSchemaName = determineTargetSchemaName(); + + if (checkConvertFile()) { + logger.info("-- step:convertIndexDesignFile --"); + long tStep = System.currentTimeMillis(); + convertIndexDesignFile(context, targetSchemaName); + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-convertIndexDesignFile", tStep, tStepEnd); + } + + logger.info("-- step:convertOtherDesignFile --"); + tStep = System.currentTimeMillis(); + convertOtherDesignFile(context, targetSchemaName); + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-convertOtherDesignFile", tStep, tStepEnd); + } + + } + + if (checkConvertDB()) { + logger.info("-- step:convertOracleDB --"); + + OracleConvertEdbGeoJobContext jobContext = + (OracleConvertEdbGeoJobContext) prepareJobContext(targetSchemaName, _filterPath, + isProfileMode(), isTransformed()); + jobContext.setSourceDataStore(getSourceDataStore()); + // jobContext.setConvertElementIn(_convertElementIn); + jobContext.setElementLogging(checkElementLogging()); + jobContext.setExecutionContext(context); + + createHibernateSequence(jobContext); + fetchTPData(jobContext); + logger.info("TPC DIST:" + jobContext.getDistId() + ":" + + ((jobContext.getDistName() == null) ? "NULL" : jobContext.getDistName())); + + long tStep = System.currentTimeMillis(); + + if (isCopyConnectivityMode()) { + copyConnectivity(jobContext); + } + + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-Copy Connectivity", tStep, tStepEnd); + } + + for (String orgSchema : _orgSchema) { + logger.info("----- start schema:" + orgSchema + " -----"); + if (isProfileMode()) { + jobContext.resetProcessTime(); + jobContext.resetUpdateTime(); + } + tStep = System.currentTimeMillis(); + exetcuteConvert(jobContext, orgSchema, _dataPath); + + //close all open filewriter instance + jobContext.closeFeatureWriter(); + + if (isProfileMode()) { + logger.warn("Profile-Current Query Oracle Cost-" + + ((int) ((getQueryTime()) / 60000.0)) + " min - " + + (((int) ((getQueryTime()) % 60000.0)) / 1000) + " sec"); + long tStepEnd = System.currentTimeMillis(); + logger.warn("Profile-Current Process Cost-" + + ((int) ((getProcessTime()) / 60000.0)) + " min - " + + (((int) ((getProcessTime()) % 60000.0)) / 1000) + " sec"); + logger.warn("Profile-Current Update Cost-" + + ((int) ((getUpdateTime()) / 60000.0)) + " min - " + + (((int) ((getUpdateTime()) % 60000.0)) / 1000) + " sec"); + logger.warn("Profile-Current JobContext Process Cost-" + + ((int) ((jobContext.getProcessTime()) / 60000.0)) + " min - " + + (((int) ((jobContext.getProcessTime()) % 60000.0)) / 1000) + " sec"); + logger.warn("Profile-Current JobContext Update Cost-" + + ((int) ((jobContext.getUpdateTime()) / 60000.0)) + " min - " + + (((int) ((jobContext.getUpdateTime()) % 60000.0)) / 1000) + " sec"); + logTimeDiff("Profile-Convert[" + orgSchema + "]", tStep, tStepEnd); + + resetQueryTime(); + resetProcessTime(); + resetUpdateTime(); + } + } + + jobContext.closeOracleConnection(); + } + + if (checkConvertElementIn()) { + logger.info("-- step:convertFeatureDesignFile --"); + long tStep = System.currentTimeMillis(); + convertFeatureDesignFile(context, targetSchemaName); + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-convertFeatureDesignFile", tStep, tStepEnd); + } + } + + if (checkCreateDummy()) { + logger.info("-- step:createDummyFeatureFile --"); + createDummyFeatureFile(context); + } + + long t2 = System.currentTimeMillis(); + // public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss"; + // SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); + logTimeDiff("Total ", t1, t2); + + updateRepoStatusToReady(targetSchemaName); + + } catch (SQLException e) { + disconnect(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException("Database error. " + e.getMessage(), e); + } catch (IOException ex) { + disconnect(); + logger.warn(ex.getMessage(), ex); + throw new JobExecutionException("IO error. " + ex.getMessage(), ex); + } finally { + disconnect(); + } + logger.warn(jobName + " end at " + new Date()); + } + + private void logTimeDiff(String message, long tBefore, long tCurrent) { + logger.warn(message + ":use time = " + ((int) ((tCurrent - tBefore) / 60000.0)) + " min - " + + (((int) ((tCurrent - tBefore) % 60000.0)) / 1000) + " sec"); + } + + private void exetcuteConvert(OracleConvertEdbGeoJobContext jobContext, + String querySchema, String targetSchemaName) throws SQLException { + int order = 0; + OrderedMap map = getBlobStorageList(jobContext.getOracleConnection(), + querySchema, "SD$SPACENODES", null); + + logger.info("begin convert job:[" + map.size() + "]:testmode=" + _testMode); + + int total = map.size(); //spacenodes count + int step = total / 100; + int current = 0; + + if (total == 0) { + logger.warn("SELECT COUNT FROM " + querySchema + ".SD$SPACENODES is zero."); + return; + } + logger.warn("SELECT COUNT FROM " + querySchema + ".SD$SPACENODES is " + map.size()); + + //jobContext.startTransaction(); + jobContext.setCurrentSchema(querySchema); + jobContext.getExecutionContext().put("ConvertDgn2EdbGeoJobProgress", 0); + for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext(); ) { + it.next(); + + Pair pair = (Pair) it.getValue(); + String tableSrc = (String) pair.first; + + logger.info("begin convert:[" + order + "]-" + tableSrc); + queryIgsetElement(jobContext, querySchema, tableSrc); + + + order++; + + if (_testMode) { + if ((_testCount < 0) || (order >= _testCount)) + break; + } + + if ((order % COMMITSIZE) == 0) { + // OracleConnection connection = jobContext.getOracleConnection(); + // connection.commitTransaction(); + jobContext.commitTransaction(); + //jobContext.startTransaction(); + System.gc(); + System.runFinalization(); + } + + if (step != 0) { + int now = order % step; + if (now != current) { + current = now; + jobContext.getExecutionContext().put("ConvertDgn2EdbGeoSpatialJob", current); + + } + } else { + jobContext.getExecutionContext().put("ConvertDgn2EdbGeoSpatialJob", current); + current++; + } + } + jobContext.getExecutionContext().put("ConvertDgn2EdbGeoSpatialJob", 100); + + jobContext.commitTransaction(); + jobContext.resetFeatureContext(); + + if (isProfileMode()) { + + } + + logger.info("end convert job:[" + order + "]"); + System.gc(); + System.runFinalization(); + } + + protected OrderedMap getBlobStorageList(Connection connection, String schemaSrc, String tableSrc, + OrderedMap orderedMap) throws SQLException { + if (orderedMap == null) + orderedMap = new LinkedMap(99); + String fetchStmtFmt = "SELECT SNID, SPACETABLE FROM \"%s\".\"%s\""; + PrintfFormat spf = new PrintfFormat(fetchStmtFmt); + String fetchStmt = spf.sprintf(new Object[]{schemaSrc, tableSrc}); + Statement stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + ResultSet rs = null; + + stmt.setFetchSize(FETCHSIZE); + try { + rs = stmt.executeQuery(fetchStmt); + int size = rs.getMetaData().getColumnCount(); + + while (rs.next()) { + Object[] values = new Object[size]; + + for (int i = 0; i < size; i++) { + values[i] = rs.getObject(i + 1); + } + + Integer key = ((BigDecimal) values[0]).intValue(); + String name = (String) values[1]; + + Pair pair = (Pair) orderedMap.get(key); + if (pair == null) + orderedMap.put(key, new Pair(name, null)); + else + pair.first = name; + } + } catch (SQLException e) { + logger.error(e.toString(), e); + logger.error("stmt=" + fetchStmt); + throw e; + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + } + + return orderedMap; + } + + protected OrderedMap getRawFormatStorageList(OracleConnection connection, String schemaSrc, String tableSrc, + OrderedMap orderedMap) throws SQLException { + if (orderedMap == null) + orderedMap = new LinkedMap(99); + String fetchStmtFmt = "SELECT RNID, SPACETABLE FROM \"%s\".\"%s\""; + PrintfFormat spf = new PrintfFormat(fetchStmtFmt); + String fetchStmt = spf.sprintf(new Object[]{schemaSrc, tableSrc}); + Statement stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + + stmt.setFetchSize(FETCHSIZE); + ResultSet rs = stmt.executeQuery(fetchStmt); + try { + int size = rs.getMetaData().getColumnCount(); + while (rs.next()) { + Object[] values = new Object[size]; + + for (int i = 0; i < size; i++) { + values[i] = rs.getObject(i + 1); + } + + Integer key = ((BigDecimal) values[0]).intValue(); + String name = (String) values[1]; + + Pair pair = (Pair) orderedMap.get(key); + if (pair == null) + orderedMap.put(key, new Pair(null, name)); + else + pair.second = name; + } + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + } + return orderedMap; + } + + protected void queryIgsetElement(OracleConvertEdbGeoJobContext jobContext, + String srcschema, String srctable) throws SQLException { + Connection connection = jobContext.getOracleConnection(); + String fetchSrcStmtFmt = "SELECT IGDSELM FROM \"%s\".\"%s\" ORDER BY ROWID"; + //String fetchSrcStmtFmt = "SELECT IGDSELM FROM \"%s\".\"%s\" WHERE TAG_SFSC = 423 AND TAG_LUFID = 21612065 ORDER BY ROWID"; + PrintfFormat spf = new PrintfFormat(fetchSrcStmtFmt); + String fetchSrcStmt = spf.sprintf(new Object[]{srcschema, srctable}); + Statement stmtSrc = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + + stmtSrc.setFetchSize(FETCHSIZE); + ResultSet rsSrc = stmtSrc.executeQuery(fetchSrcStmt); + int igdsMetaType = rsSrc.getMetaData().getColumnType(1); + while (rsSrc.next()) { + if (isProfileMode()) { + markQueryTime(); + } + + byte[] raw = null; + if (igdsMetaType == Types.BLOB) { + BLOB blob = (BLOB) rsSrc.getBlob(1); + + try { + raw = getBytesFromBLOB(blob); + } catch (BufferOverflowException e) { + logger.warn("Wrong Element Structure-", e); + } finally { + // blob.close(); + } + } else { + raw = rsSrc.getBytes(1); + } + + try { + if (raw != null) { + Element element = fetchBinaryElement(raw); + if (isProfileMode()) { + accumulateQueryTime(); + } + jobContext.putFeatureCollection(element); + } else { + if (isProfileMode()) { + accumulateQueryTime(); + } + } + } catch (Dgn7fileException e) { + logger.warn("Dgn7Exception", e); + } + } + + JDBCUtils.close(rsSrc); + JDBCUtils.close(stmtSrc); + } + + protected void queryRawElement(OracleConvertEdbGeoJobContext jobContext, + String srcschema, String srctable) throws SQLException { + Connection connection = jobContext.getOracleConnection(); + String fetchDestStmtFmt = "SELECT ELEMENT FROM \"%s\".\"%s\" ORDER BY ROWID"; + PrintfFormat spf = new PrintfFormat(fetchDestStmtFmt); + String fetchDestStmt = spf.sprintf(new Object[]{srcschema, srctable}); + Statement stmtDest = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + + stmtDest.setFetchSize(FETCHSIZE); + ResultSet rsDest = stmtDest.executeQuery(fetchDestStmt); + + try { + while (rsDest.next()) { + ARRAY rawsValue = ((OracleResultSet) rsDest).getARRAY(1); + long[] rawData = rawsValue.getLongArray(); + byte[] comparessedValue; + + /* + if (dataMode == TransferTask.DataMode.Normal) + { + comparessedValue = BinConverter.unmarshalByteArray(rawData, true); + } else + { + comparessedValue = BinConverter.unmarshalCompactByteArray(rawData); + } + */ + comparessedValue = BinConverter.unmarshalByteArray(rawData, true); + + byte[] rawDest = ByteArrayCompressor.decompressByteArray(comparessedValue); + + try { + Element element = fetchBinaryElement(rawDest); + jobContext.putFeatureCollection(element); + } catch (Dgn7fileException e) { + logger.warn("Dgn7Exception:" + e.getMessage(), e); + } + } + } finally { + JDBCUtils.close(rsDest); + JDBCUtils.close(stmtDest); + } + } + + // Binary to Element + private Element fetchBinaryElement(byte[] raws) throws Dgn7fileException { + ByteBuffer buffer = ByteBuffer.wrap(raws); + buffer.order(ByteOrder.LITTLE_ENDIAN); + short signature = buffer.getShort(); + + // byte type = (byte) (buffer.get() & 0x7f); + byte type = (byte) ((signature >>> 8) & 0x007f); + + // silly Bentley say contentLength is in 2-byte words + // and ByteByffer uses raws. + // track the record location + int elementLength = (buffer.getShort() * 2) + 4; + ElementType recordType = ElementType.forID(type); + IElementHandler handler; + + handler = recordType.getElementHandler(); + + Element dgnElement = (Element) handler.read(buffer, signature, elementLength); + if (recordType.isComplexElement() && (elementLength < raws.length)) { + int offset = elementLength; + while (offset < (raws.length - 4)) { + buffer.position(offset); + signature = buffer.getShort(); + type = (byte) ((signature >>> 8) & 0x007f); + elementLength = (buffer.getShort() * 2) + 4; + if (raws.length < (offset + elementLength)) { + logger.debug("Length not match:" + offset + ":" + buffer.position() + ":" + buffer.limit()); + break; + } + recordType = ElementType.forID(type); + handler = recordType.getElementHandler(); + if (handler != null) { + Element subElement = (Element) handler.read(buffer, signature, elementLength); + ((ComplexElement) dgnElement).add(subElement); + offset += elementLength; + } else { + byte[] remain = new byte[buffer.remaining()]; + System.arraycopy(raws, offset, remain, 0, buffer.remaining()); + for (int i = 0; i < remain.length; i++) { + if (remain[i] != 0) { + logger.info("fetch element has some error. index=" + (offset + i) + ":value=" + remain[i]); + } + } + break; + } + } + } + + return dgnElement; + } + + /** + * �����ഫ�����ɪ��u�@ + * + * @param context �u�@�������� + * @throws org.quartz.JobExecutionException + * exception + */ + private void convertIndexDesignFile(JobExecutionContext context, String targetSchemaName) throws JobExecutionException { + File indexDir = new File(getDataPath(), INDEXPATHNAME); + if (!indexDir.exists()) { + logger.info("index dir=" + indexDir + " not exist."); + return; + } + + if (!indexDir.isDirectory()) { + logger.info("index dir=" + indexDir + " is not a directory."); + } + + List<File> dgnFiles = FileUtils.recurseDir(indexDir, new FileFilter() { + public boolean accept(File pathname) { + return pathname.isDirectory() || pathname.getName().toLowerCase().endsWith("dgn"); + } + }); + + for (File dgnFile : dgnFiles) { + if (dgnFile.isDirectory()) continue; + IndexDgnConvertEdbGeoJobContext convertContext = + new IndexDgnConvertEdbGeoJobContext(getDataPath(), getTargetDataStore(), targetSchemaName, + isProfileMode(), isTransformed()); + logger.info("--- start index dgnfile-" + dgnFile.toString() + " ---"); + FileInputStream fs = null; + FileChannel fc = null; + Dgn7fileReader reader = null; + try { + convertContext.clearOutputDatabase(); + convertContext.setExecutionContext(context); + String dgnPaths[] = StringUtils.splitToArray(dgnFile.toString(), File.separator); + convertContext.setFilename(dgnPaths[dgnPaths.length - 1]); + convertContext.startTransaction(); + + fs = new FileInputStream(dgnFile); + fc = fs.getChannel(); + reader = new Dgn7fileReader(fc, new Lock()); + convertContext.setReader(reader); + + scanIndexDgnElement(convertContext); + + convertContext.commitTransaction(); + convertContext.closeFeatureWriter(); + + System.gc(); + System.runFinalization(); + } catch (FileNotFoundException e) { + convertContext.rollbackTransaction(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } catch (Dgn7fileException e) { + convertContext.rollbackTransaction(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } catch (IOException e) { + convertContext.rollbackTransaction(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } catch (IllegalAttributeException e) { + convertContext.rollbackTransaction(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } catch (SchemaException e) { + convertContext.rollbackTransaction(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } finally { + convertContext.closeFeatureWriter(); + + if (reader != null) { + try { + reader.close(); + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } + } + + if (fs != null) { + try { + fs.close(); + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } + } + + if (isProfileMode()) { + logger.warn("Profile-Current convertContext Process Cost-" + + ((int) ((convertContext.getProcessTime()) / 60000.0)) + " min - " + + (((int) ((convertContext.getProcessTime()) % 60000.0)) / 1000) + " sec"); + logger.warn("Profile-Current convertContext Update Cost-" + + ((int) ((convertContext.getUpdateTime()) / 60000.0)) + " min - " + + (((int) ((convertContext.getUpdateTime()) % 60000.0)) / 1000) + " sec"); + } + } + } + } + + protected void scanIndexDgnElement(IndexDgnConvertEdbGeoJobContext convertContext) + throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { + Dgn7fileReader reader = convertContext.getReader(); + int count = 0; + Element lastComplex = null; + + while (reader.hasNext()) { + if (isProfileMode()) markProcessTime(); + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { + Element element = (Element) record.element(); + ElementType type = element.getElementType(); + + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { + processIndexElement(lastComplex, convertContext); + lastComplex = null; + } + + processIndexElement(element, convertContext); + } else if (element.isComponentElement()) { + if (lastComplex != null) { + ((ComplexElement) lastComplex).add(element); + } + } else if (type.isComplexElement()) { + if (lastComplex != null) { + processIndexElement(lastComplex, convertContext); + } + lastComplex = element; + } + } + count++; + } + + if (lastComplex != null) { + processIndexElement(lastComplex, convertContext); + } + logger.debug("ElementRecord Count=" + count); + } + + private void processIndexElement(Element element, IndexDgnConvertEdbGeoJobContext convertContext) + throws IllegalAttributeException, SchemaException { + //if (useTpclidText) { + // if (element instanceof TextElement) { + // convertContext.putFeatureCollection(element); + // } + //} else { + // if (element instanceof ShapeElement) { + convertContext.putFeatureCollection(element); + // } + //} + } + + + /** + * �����ഫ��L�]�p���ɪ��u�@ + * + * @param context jobContext + * @throws org.quartz.JobExecutionException + * exception + */ + private void convertOtherDesignFile(JobExecutionContext context, String targetSchemaName) throws JobExecutionException { + File otherDir = new File(getDataPath(), OTHERPATHNAME); + if (!otherDir.exists()) { + logger.info("other dir=" + otherDir + " not exist."); + return; + } + + if (!otherDir.isDirectory()) { + logger.info("other dir=" + otherDir + " is not a directory."); + } + + List<File> dgnFiles = FileUtils.recurseDir(otherDir, new FileFilter() { + public boolean accept(File pathname) { + return pathname.isDirectory() || pathname.getName().toLowerCase().endsWith("dgn"); + } + }); + + for (File dgnFile : dgnFiles) { + if (dgnFile.isDirectory()) continue; + + GeneralDgnConvertEdbGeoJobContext convertContext = + new GeneralDgnConvertEdbGeoJobContext(getDataPath(), getTargetDataStore(), targetSchemaName, + isProfileMode(), isTransformed()); + logger.info("--- start other dgnfile-" + dgnFile.toString() + " ---"); + FileInputStream fs = null; + FileChannel fc; + Dgn7fileReader reader = null; + try { + convertContext.setExecutionContext(context); + String dgnPaths[] = StringUtils.splitToArray(dgnFile.toString(), File.separator); + convertContext.setFilename(dgnPaths[dgnPaths.length - 1]); + convertContext.startTransaction(); + + fs = new FileInputStream(dgnFile); + fc = fs.getChannel(); + reader = new Dgn7fileReader(fc, new Lock()); + convertContext.setReader(reader); + + scanOtherDgnElement(convertContext); + + convertContext.commitTransaction(); + convertContext.closeFeatureWriter(); + + System.gc(); + System.runFinalization(); + } catch (FileNotFoundException e) { + convertContext.rollbackTransaction(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } catch (Dgn7fileException e) { + convertContext.rollbackTransaction(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } catch (IOException e) { + convertContext.rollbackTransaction(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } catch (IllegalAttributeException e) { + convertContext.rollbackTransaction(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } catch (SchemaException e) { + convertContext.rollbackTransaction(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } finally { + convertContext.closeFeatureWriter(); + + if (reader != null) { + try { + reader.close(); + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } + } + + if (fs != null) { + try { + fs.close(); + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } + } + + if (isProfileMode()) { + logger.warn("Profile-Current convertContext Process Cost-" + + ((int) ((convertContext.getProcessTime()) / 60000.0)) + " min - " + + (((int) ((convertContext.getProcessTime()) % 60000.0)) / 1000) + " sec"); + logger.warn("Profile-Current convertContext Update Cost-" + + ((int) ((convertContext.getUpdateTime()) / 60000.0)) + " min - " + + (((int) ((convertContext.getUpdateTime()) % 60000.0)) / 1000) + " sec"); + } + } + } + } + + public void scanOtherDgnElement(GeneralDgnConvertEdbGeoJobContext convertContext) + throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { + Dgn7fileReader reader = convertContext.getReader(); + int count = 0; + Element lastComplex = null; + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { + Element element = (Element) record.element(); + ElementType type = element.getElementType(); + + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { + processOtherElement(lastComplex, convertContext); + lastComplex = null; + } + + processOtherElement(element, convertContext); + } else if (element.isComponentElement()) { + if (lastComplex != null) { + ((ComplexElement) lastComplex).add(element); + } + } else if (type.isComplexElement()) { + if (lastComplex != null) { + processOtherElement(lastComplex, convertContext); + } + lastComplex = element; + } + } + count++; + } + + if (lastComplex != null) { + processOtherElement(lastComplex, convertContext); + } + logger.debug("ElementRecord Count=" + count); + } + + private void processOtherElement(Element element, GeneralDgnConvertEdbGeoJobContext convertContext) + throws IllegalAttributeException, SchemaException { + convertContext.putFeatureCollection(element); + } + + private void clearOutputDatabase() { + /* + File outDataPath = new File(getDataPath(), OracleConvertEdbGeoJobContext.SHPOUTPATH); + if (outDataPath.exists() && outDataPath.isDirectory()) + { + deleteFilesInPath(outDataPath); + } + outDataPath = new File(getDataPath(), IndexDgnConvertShpJobContext.SHPOUTPATH); + if (outDataPath.exists() && outDataPath.isDirectory()) + { + deleteFilesInPath(outDataPath); + } + outDataPath = new File(getDataPath(), GeneralDgnConvertShpJobContext.SHPOUTPATH); + if (outDataPath.exists() && outDataPath.isDirectory()) + { + deleteFilesInPath(outDataPath); + } + */ + } + + private void deleteFilesInPath(File outDataPath) { + deleteFilesInPath(outDataPath, true); + } + + private void deleteFilesInPath(File outDataPath, boolean removeSubDir) { + if (!outDataPath.isDirectory()) { + return; + } + File[] files = outDataPath.listFiles(); + for (File file : files) { + if (file.isFile()) { + if (!file.delete()) { + logger.info("Cannot delete file-" + file.toString()); + } + } else if (file.isDirectory()) { + deleteFilesInPath(file, removeSubDir); + if (removeSubDir) { + if (file.delete()) { + logger.info("Cannot delete dir-" + file.toString()); + } + } + } + } + } + + private void convertFeatureDesignFile(JobExecutionContext context, String targetSchemaName) throws JobExecutionException { + File elminDir = new File(getDataPath(), "elmin"); + if (!elminDir.exists()) { + logger.info("elmin dir=" + elminDir + " not exist."); + return; + } + + if (!elminDir.isDirectory()) { + logger.info("elmin dir=" + elminDir + " is not a directory."); + } + + File[] dgnFiles = elminDir.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { + return name.toLowerCase().endsWith(".dgn"); + } + }); + + for (File dgnFile : dgnFiles) { + FeatureDgnConvertEdbGeoJobContext convertContext = + new FeatureDgnConvertEdbGeoJobContext(getDataPath(), getTargetDataStore(), targetSchemaName, _filterPath, + isProfileMode(), isTransformed()); + logger.info("--- start dgnfile-" + dgnFile.toString() + " ---"); + try { + convertContext.setExecutionContext(context); + String dgnPaths[] = StringUtils.splitToArray(dgnFile.toString(), File.separator); + convertContext.setFilename(dgnPaths[dgnPaths.length - 1]); + convertContext.startTransaction(); + + FileInputStream fs = new FileInputStream(dgnFile); + FileChannel fc = fs.getChannel(); + Dgn7fileReader reader = new Dgn7fileReader(fc, new Lock()); + convertContext.setReader(reader); + + scanFeatureDgnElement(convertContext); + + convertContext.commitTransaction(); + convertContext.closeFeatureWriter(); + System.gc(); + System.runFinalization(); + } catch (FileNotFoundException e) { + convertContext.rollbackTransaction(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } catch (Dgn7fileException e) { + convertContext.rollbackTransaction(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } catch (IOException e) { + convertContext.rollbackTransaction(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } catch (IllegalAttributeException e) { + convertContext.rollbackTransaction(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } catch (SchemaException e) { + convertContext.rollbackTransaction(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } finally { + convertContext.closeFeatureWriter(); + } + } + } + + public void scanFeatureDgnElement(FeatureDgnConvertEdbGeoJobContext convertContext) + throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { + Dgn7fileReader reader = convertContext.getReader(); + int count = 0; + Element lastComplex = null; + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { + Element element = (Element) record.element(); + ElementType type = element.getElementType(); + + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { + processFeatureElement(lastComplex, convertContext); + lastComplex = null; + } + + processFeatureElement(element, convertContext); + } else if (element.isComponentElement()) { + if (lastComplex != null) { + ((ComplexElement) lastComplex).add(element); + } + } else if (type.isComplexElement()) { + if (lastComplex != null) { + processFeatureElement(lastComplex, convertContext); + } + lastComplex = element; + } + } + count++; + } + + if (lastComplex != null) { + processFeatureElement(lastComplex, convertContext); + } + logger.debug("ElementRecord Count=" + count); + } + + private void processFeatureElement(Element element, FeatureDgnConvertEdbGeoJobContext convertContext) + throws IllegalAttributeException, SchemaException { + convertContext.putFeatureCollection(element); + } + + private void createDummyFeatureFile(JobExecutionContext context) throws JobExecutionException { + /* + DummyFeatureConvertShpJobContext convertContext = new DummyFeatureConvertShpJobContext(getDataPath(), _filterPath); + try { + convertContext.startTransaction(); + convertContext.commitTransaction(); + convertContext.closeFeatureWriter(); + } catch (IOException e) + { + logger.warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } + */ + } + + public DataStore getTargetDataStore() { + return targetDataStore; + } + + protected void createTargetDataStore() throws JobExecutionException { + if (targetDataStore != null) { + targetDataStore.dispose(); + targetDataStore = null; + } + + /* + if (!isDriverFound()) + { + throw new JobExecutionException("Oracle JDBC Driver not found.-" + JDBC_DRIVER); + } + */ + + if (!edbProperties.containsKey(PostgisDataStoreFactory.MAXCONN.key)) { + edbProperties.put(PostgisDataStoreFactory.MAXCONN.key, "5"); + } + + if (!edbProperties.containsKey(PostgisDataStoreFactory.MINCONN.key)) { + edbProperties.put(PostgisDataStoreFactory.MINCONN.key, "1"); + } + + if (!edbProperties.containsKey(PostgisDataStoreFactory.WKBENABLED.key)) { + edbProperties.put(PostgisDataStoreFactory.WKBENABLED.key, "true"); + } + + if (!dataStoreFactory.canProcess(edbProperties)) { + getLogger().warn("cannot process properties-"); + throw new JobExecutionException("cannot process properties-"); + } + try { + targetDataStore = (JDBCDataStore) dataStoreFactory.createDataStore(edbProperties); + } catch (IOException e) { + getLogger().warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } + } + + protected void disconnect() { + super.disconnect(); + if (targetDataStore != null) { + targetDataStore.dispose(); + targetDataStore = null; + } + } + + private String determineTargetSchemaName() throws IOException { + if (targetDataStore == null) return null; + Connection connection = null; + Statement stmt = null; + ResultSet rs = null; + String targetSchema = null; + boolean needCreate = false; + try { + connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + rs = connection.getMetaData().getTables(null, _edbSchema, DataReposVersionManager.XGVERSIONTABLE_NAME, new String[]{"TABLE"}); + if (!rs.next()) needCreate = true; + rs.close(); + rs = null; + + stmt = connection.createStatement(); + stmt.execute("SET edb_redwood_date TO OFF"); + stmt.execute("SET edb_redwood_strings TO OFF"); + // stmt.execute("SET edb_stmt_level_tx TO OFF"); + stmt.close(); + + if (needCreate) + createXGeosVersionTable(connection, _edbSchema); + + StringBuilder sbSQL = new StringBuilder("SELECT "); + sbSQL.append("vsschema, vsstatus FROM "); + sbSQL.append(encodeSchemaTableName(_edbSchema, DataReposVersionManager.XGVERSIONTABLE_NAME)).append(' '); + sbSQL.append("ORDER BY vsid"); + stmt = connection.createStatement(); + rs = stmt.executeQuery(sbSQL.toString()); + ArrayList<Object[]> tmpSchemas = new ArrayList<Object[]>(); + int i = 0; + int current = -1; + while (rs.next()) { + Object[] values = new Object[2]; + values[0] = rs.getString("vsschema"); + values[1] = rs.getShort("vsstatus"); + tmpSchemas.add(values); + if ((((Short) values[1]) & DataReposVersionManager.VSSTATUS_USING) != 0) { + current = i; + } + i++; + } + + if (current == -1) { + Object[] values = tmpSchemas.get(0); + targetSchema = (String) values[0]; + } else if (current < (tmpSchemas.size() - 1)) { + Object[] values = tmpSchemas.get(current + 1); + targetSchema = (String) values[0]; + } else { + Object[] values = tmpSchemas.get(0); + targetSchema = (String) values[0]; + } + + sbSQL = new StringBuilder("UPDATE "); + sbSQL.append(encodeSchemaTableName(_edbSchema, DataReposVersionManager.XGVERSIONTABLE_NAME)).append(' '); + sbSQL.append(" SET vsstatus = "); + sbSQL.append(DataReposVersionManager.VSSTATUS_COVERT); + sbSQL.append(" WHERE vsschema = '"); + sbSQL.append(targetSchema).append("'"); + int count = stmt.executeUpdate(sbSQL.toString()); + if (count != 1) { + logger.info("update status for " + targetSchema + " update result count=" + + count); + } + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); + } + return targetSchema; + } + + public String encodeSchemaTableName(String schemaName, String tableName) { + return "\"" + schemaName + "\".\"" + tableName + "\""; + } + + private void createXGeosVersionTable(Connection connection, String pgSchema) throws SQLException { + Statement stmt = null; + StringBuilder sql = new StringBuilder("CREATE TABLE "); + sql.append(encodeSchemaTableName(pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME)); + sql.append(" ( vsid serial PRIMARY KEY, "); + sql.append(" vsschema character varying(64) NOT NULL, "); + sql.append(" vsstatus smallint NOT NULL, "); + sql.append(" vstimestamp timestamp with time zone ) "); + try { + stmt = connection.createStatement(); + stmt.executeUpdate(sql.toString()); + + sql = new StringBuilder("ALTER TABLE "); + sql.append(encodeSchemaTableName(pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME)); + sql.append(" OWNER TO ").append(_edbUsername); + stmt.executeUpdate(sql.toString()); + + sql = new StringBuilder("GRANT ALL ON TABLE "); + sql.append(encodeSchemaTableName(pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME)); + sql.append(" TO public"); + stmt.executeUpdate(sql.toString()); + + for (String schemaName : DataReposVersionManager.DEFAULTXGVERSIONSCHEMA_NAMES) { + sql = new StringBuilder("INSERT INTO "); + sql.append(encodeSchemaTableName(pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME)); + sql.append(" (vsschema, vsstatus) VALUES ('"); + sql.append(schemaName).append("', "); + sql.append(DataReposVersionManager.VSSTATUS_AVAILABLE).append(" )"); + stmt.executeUpdate(sql.toString()); + + createIfNotExistNewSchema(connection, schemaName); + } + + } finally { + if (stmt != null) stmt.close(); + } + } + + private void updateRepoStatusToReady(String targetSchema) { + if (targetDataStore == null) return; + Connection connection = null; + Statement stmt = null; + ResultSet rs = null; + boolean needCreate = false; + try { + StringBuilder sbSQL = new StringBuilder("UPDATE "); + sbSQL.append(encodeSchemaTableName(_edbSchema, DataReposVersionManager.XGVERSIONTABLE_NAME)).append(' '); + sbSQL.append(" SET vsstatus = "); + sbSQL.append(DataReposVersionManager.VSSTATUS_READY); + sbSQL.append(" , vstimestamp = CURRENT_TIMESTAMP WHERE vsschema = '"); + sbSQL.append(targetSchema).append("'"); + + connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + stmt = connection.createStatement(); + int count = stmt.executeUpdate(sbSQL.toString()); + if (count != 1) { + logger.info("update status for " + targetSchema + " update result count=" + + count); + } + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); + } + } + + private void createIfNotExistNewSchema(Connection connection, String s) throws SQLException { + Statement stmt = null; + ResultSet rs = null; + try { + /* + rs = connection.getMetaData().getSchemas(null, s); + if (rs.next()) return; + rs.close(); + rs = null; + */ + + StringBuilder sbSQL = new StringBuilder("CREATE SCHEMA "); + sbSQL.append(s).append(' '); + sbSQL.append("AUTHORIZATION ").append(_edbUsername); + stmt = connection.createStatement(); + stmt.executeUpdate(sbSQL.toString()); + + sbSQL = new StringBuilder("GRANT ALL ON SCHEMA "); + sbSQL.append(s).append(' '); + sbSQL.append("TO public"); + stmt.executeUpdate(sbSQL.toString()); + } catch (SQLException e) { + logger.info("create schema:" + s + " has exception."); + logger.info(e.getMessage(), e); + } finally { + if (rs != null) rs.close(); + if (stmt != null) stmt.close(); + } + } + + public final void accumulateQueryTime() { + queryTime += System.currentTimeMillis() - queryTimeStart; + } + + public long getQueryTime() { + return queryTime; + } + + public final void markQueryTime() { + queryTimeStart = System.currentTimeMillis(); + } + + public final void resetQueryTime() { + queryTime = 0; + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2MySQLJob.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2MySQLJob.java index da4142a..a6c4a1a 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2MySQLJob.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2MySQLJob.java @@ -6,14 +6,15 @@ import java.io.FilenameFilter; import java.io.IOException; import java.math.BigDecimal; +import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.channels.FileChannel; +import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.sql.Types; -import java.sql.Connection; import java.util.Date; import java.util.Map; import java.util.TreeMap; @@ -24,16 +25,14 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.geotools.data.DataStore; -import org.geotools.data.mysql.MySQLDataStore; import org.geotools.data.mysql.MySQLDataStoreFactory; -import org.geotools.feature.IllegalAttributeException; import org.geotools.feature.SchemaException; +import org.geotools.jdbc.JDBCDataStore; +import org.opengis.feature.IllegalAttributeException; import org.quartz.JobDataMap; import org.quartz.JobDetail; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; - -import com.vividsolutions.jts.geom.GeometryFactory; import oracle.jdbc.OracleConnection; import oracle.jdbc.OracleResultSet; @@ -41,10 +40,10 @@ import oracle.sql.BLOB; import com.ximple.eofms.jobs.context.AbstractOracleJobContext; -import com.ximple.eofms.jobs.context.mysql.OracleConvertMySQLJobContext; -import com.ximple.eofms.jobs.context.mysql.IndexDgnConvertMySQLJobContext; -import com.ximple.eofms.jobs.context.mysql.GeneralDgnConvertMySQLJobContext; import com.ximple.eofms.jobs.context.mysql.FeatureDgnConvertMySQLJobContext; +import com.ximple.eofms.jobs.context.mysql.GeneralDgnConvertMySQLJobContext; +import com.ximple.eofms.jobs.context.mysql.IndexDgnConvertMySQLJobContext; +import com.ximple.eofms.jobs.context.mysql.OracleConvertMySQLJobContext; import com.ximple.eofms.util.BinConverter; import com.ximple.eofms.util.ByteArrayCompressor; import com.ximple.eofms.util.StringUtils; @@ -58,8 +57,7 @@ import com.ximple.io.dgn7.TextElement; import com.ximple.util.PrintfFormat; -public class OracleConvertDgn2MySQLJob extends AbstractOracleDatabaseJob -{ +public class OracleConvertDgn2MySQLJob extends AbstractOracleDatabaseJob { final static Log logger = LogFactory.getLog(OracleConvertDgn2PostGISJob.class); private static final String MYHOST = "MYHOST"; @@ -73,13 +71,11 @@ private static final int FETCHSIZE = 30; private static final int COMMITSIZE = 20; - class Pair - { + class Pair { Object first; Object second; - public Pair(Object first, Object second) - { + public Pair(Object first, Object second) { this.first = first; this.second = second; } @@ -87,7 +83,6 @@ protected static MySQLDataStoreFactory dataStoreFactory = new MySQLDataStoreFactory(); - GeometryFactory _geomFactory = new GeometryFactory(); protected String _myHost; protected String _myDatabase; protected String _myPort; @@ -97,20 +92,19 @@ protected String _myUseWKB; protected Map<String, String> myProperties; - protected MySQLDataStore targetDataStore; + protected JDBCDataStore targetDataStore; - public Log getLogger() - { + public Log getLogger() { return logger; } - protected AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath) - { - return new OracleConvertMySQLJobContext(getDataPath(), getTargetDataStore(), filterPath); + protected AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath, boolean profileMode, + boolean useTransform) { + return new OracleConvertMySQLJobContext(getDataPath(), getTargetDataStore(), filterPath, profileMode, + useTransform); } - protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException - { + protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException { super.extractJobConfiguration(jobDetail); JobDataMap dataMap = jobDetail.getJobDataMap(); _myHost = dataMap.getString(MYHOST); @@ -132,33 +126,27 @@ logger.info("USEWKB=" + _myUseWKB); */ - if (_myHost == null) - { + if (_myHost == null) { logger.warn("MYHOST is null"); throw new JobExecutionException("Unknown PostGIS host."); } - if (_myDatabase == null) - { + if (_myDatabase == null) { logger.warn("PGDATABASE is null"); throw new JobExecutionException("Unknown PostGIS database."); } - if (_myPort == null) - { + if (_myPort == null) { logger.warn("MYPORT is null"); throw new JobExecutionException("Unknown PostGIS port."); } - if (_mySchema == null) - { + if (_mySchema == null) { logger.warn("MYSCHEMA is null"); throw new JobExecutionException("Unknown PostGIS schema."); } - if (_myUsername == null) - { + if (_myUsername == null) { logger.warn("PGUSERNAME is null"); throw new JobExecutionException("Unknown PostGIS username."); } - if (_myPassword == null) - { + if (_myPassword == null) { logger.warn("PGPASSWORD is null"); throw new JobExecutionException("Unknown PostGIS password."); } @@ -175,13 +163,12 @@ myProperties = remote; } - public void execute(JobExecutionContext context) throws JobExecutionException - { + public void execute(JobExecutionContext context) throws JobExecutionException { // Every job has its own job detail JobDetail jobDetail = context.getJobDetail(); // The name is defined in the job definition - String jobName = jobDetail.getName(); + String jobName = jobDetail.getKey().getName(); String targetSchemaName = null; // Log the time the job started @@ -189,36 +176,36 @@ extractJobConfiguration(jobDetail); createSourceDataStore(); createTargetDataStore(); - if (getSourceDataStore() == null) - { + if (getSourceDataStore() == null) { logger.warn("Cannot connect source oracle database."); throw new JobExecutionException("Cannot connect source oracle database."); } - if (getTargetDataStore() == null) - { + if (getTargetDataStore() == null) { logger.warn("Cannot connect source postgreSQL database."); throw new JobExecutionException("Cannot connect source postgreSQL database."); } long t1 = System.currentTimeMillis(); - try - { + try { logger.info("-- step:clearOutputDatabase --"); clearOutputDatabase(); boolean bFirst = isCopyConnectivityMode(); - if (checkConvertDB()) - { + if (checkConvertDB()) { logger.info("-- step:convertOracleDB --"); - for (String orgSchema : _orgSchema) - { + for (String orgSchema : _orgSchema) { OracleConvertMySQLJobContext jobContext = - (OracleConvertMySQLJobContext) prepareJobContext(targetSchemaName, _filterPath); + (OracleConvertMySQLJobContext) prepareJobContext(targetSchemaName, _filterPath, + isProfileMode(), isTransformed()); jobContext.setSourceDataStore(getSourceDataStore()); // jobContext.setConvertElementIn(_convertElementIn); jobContext.setElementLogging(checkElementLogging()); jobContext.setExecutionContext(context); + + fetchTPData(jobContext); + logger.info("TPC DIST:" + jobContext.getDistId() + ":" + + ((jobContext.getDistName() == null) ? "NULL" : jobContext.getDistName())); if (bFirst) copyConnectivity(jobContext); @@ -233,22 +220,19 @@ } } - if (checkConvertFile()) - { + if (checkConvertFile()) { logger.info("-- step:convertIndexDesignFile --"); convertIndexDesignFile(context); logger.info("-- step:convertOtherDesignFile --"); convertOtherDesignFile(context); } - if (checkConvertElementIn()) - { + if (checkConvertElementIn()) { logger.info("-- step:convertFeatureDesignFile --"); convertFeatureDesignFile(context); } - if (checkCreateDummy()) - { + if (checkCreateDummy()) { logger.info("-- step:createDummyFeatureFile --"); createDummyFeatureFile(context); } @@ -258,38 +242,21 @@ // public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss"; // SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); logger.warn("use time = " + ((t2 - t1) / 60000.0) + " min"); - } catch (SQLException e) - { + } catch (SQLException e) { logger.warn(e.getMessage(), e); throw new JobExecutionException("Database error. " + e.getMessage(), e); - } catch (IOException ex) - { + } catch (IOException ex) { logger.warn(ex.getMessage(), ex); throw new JobExecutionException("IO error. " + ex.getMessage(), ex); } logger.warn(jobName + " end at " + new Date()); } - /** - * Connectivity�ƻs�@�Ӫ����A�b�d�߹q�y��V�ɥΨӤ��OMS��Ʈw���q���s����(Connectivity) - * - * @param jobContext job context - * @throws SQLException sql exception - */ - private void copyConnectivity(OracleConvertMySQLJobContext jobContext) throws SQLException - { - Connection connection = jobContext.getOracleConnection(); - Statement stmt = connection.createStatement(); - stmt.execute(AbstractOracleJobContext.TRUNCATE_CONNECTIVITY_WEBCHECK); - stmt.execute(AbstractOracleJobContext.COPY_CONNECTIVITY_TO_WEBCHECK); - } - private void exetcuteConvert(OracleConvertMySQLJobContext jobContext, - String querySchema, String dataPath) throws SQLException - { + String querySchema, String dataPath) throws SQLException { int order = 0; OrderedMap map = getBlobStorageList(jobContext.getOracleConnection(), querySchema, "SD$SPACENODES" - , null); + , null); logger.info("begin convert job:[" + map.size() + "]:testmode=" + _testMode); @@ -300,8 +267,7 @@ //jobContext.startTransaction(); jobContext.setCurrentSchema(querySchema); jobContext.getExecutionContext().put("ConvertDgn2PostGISJobProgress", 0); - for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext();) - { + for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext();) { it.next(); Pair pair = (Pair) it.getValue(); @@ -312,14 +278,12 @@ order++; - if (_testMode) - { + if (_testMode) { if ((_testCount < 0) || (order >= _testCount)) break; } - if ((order % COMMITSIZE) == 0) - { + if ((order % COMMITSIZE) == 0) { // OracleConnection connection = jobContext.getOracleConnection(); // connection.commitTransaction(); jobContext.commitTransaction(); @@ -329,8 +293,7 @@ } int now = order % step; - if (now != current) - { + if (now != current) { current = now; jobContext.getExecutionContext().put("ConvertDgn2PostGISJobProgress", current); @@ -346,8 +309,7 @@ } protected OrderedMap getBlobStorageList(Connection connection, String schemaSrc, String tableSrc, - OrderedMap orderedMap) throws SQLException - { + OrderedMap orderedMap) throws SQLException { if (orderedMap == null) orderedMap = new LinkedMap(99); String fetchStmtFmt = "SELECT SNID, SPACETABLE FROM \"%s\".\"%s\""; @@ -358,16 +320,13 @@ stmt.setFetchSize(FETCHSIZE); - try - { + try { rs = stmt.executeQuery(fetchStmt); int size = rs.getMetaData().getColumnCount(); - while (rs.next()) - { + while (rs.next()) { Object[] values = new Object[size]; - for (int i = 0; i < size; i++) - { + for (int i = 0; i < size; i++) { values[i] = rs.getObject(i + 1); } @@ -380,13 +339,11 @@ else pair.first = name; } - } catch (SQLException e) - { + } catch (SQLException e) { logger.error(e.toString(), e); logger.error("stmt=" + fetchStmt); throw e; - } finally - { + } finally { if (rs != null) rs.close(); stmt.close(); } @@ -395,8 +352,7 @@ } protected OrderedMap getRawFormatStorageList(OracleConnection connection, String schemaSrc, String tableSrc, - OrderedMap orderedMap) throws SQLException - { + OrderedMap orderedMap) throws SQLException { if (orderedMap == null) orderedMap = new LinkedMap(99); String fetchStmtFmt = "SELECT RNID, SPACETABLE FROM \"%s\".\"%s\""; @@ -408,12 +364,10 @@ ResultSet rs = stmt.executeQuery(fetchStmt); int size = rs.getMetaData().getColumnCount(); - while (rs.next()) - { + while (rs.next()) { Object[] values = new Object[size]; - for (int i = 0; i < size; i++) - { + for (int i = 0; i < size; i++) { values[i] = rs.getObject(i + 1); } @@ -434,8 +388,7 @@ } protected void queryIgsetElement(OracleConvertMySQLJobContext jobContext, - String srcschema, String srctable) throws SQLException - { + String srcschema, String srctable) throws SQLException { Connection connection = jobContext.getOracleConnection(); String fetchSrcStmtFmt = "SELECT IGDSELM FROM \"%s\".\"%s\" ORDER BY ROWID"; PrintfFormat spf = new PrintfFormat(fetchSrcStmtFmt); @@ -446,27 +399,28 @@ ResultSet rsSrc = stmtSrc.executeQuery(fetchSrcStmt); int igdsMetaType = rsSrc.getMetaData().getColumnType(1); - while (rsSrc.next()) - { - byte[] raw; + while (rsSrc.next()) { + byte[] raw = null; - if (igdsMetaType == Types.BLOB) - { + if (igdsMetaType == Types.BLOB) { BLOB blob = (BLOB) rsSrc.getBlob(1); - - raw = getBytesFromBLOB(blob); - blob.close(); - } else - { + try { + raw = getBytesFromBLOB(blob); + } catch (BufferOverflowException e) { + logger.warn("Wrong Element Structure-", e); + } finally { + // blob.close(); + } + } else { raw = rsSrc.getBytes(1); } - try - { - Element element = fetchBinaryElement(raw); - jobContext.putFeatureCollection(element); - } catch (Dgn7fileException e) - { + try { + if (raw != null) { + Element element = fetchBinaryElement(raw); + jobContext.putFeatureCollection(element); + } + } catch (Dgn7fileException e) { logger.warn("Dgn7Exception", e); } } @@ -476,8 +430,7 @@ } protected void queryRawElement(OracleConvertMySQLJobContext jobContext, - String srcschema, String srctable) throws SQLException - { + String srcschema, String srctable) throws SQLException { Connection connection = jobContext.getOracleConnection(); String fetchDestStmtFmt = "SELECT ELEMENT FROM \"%s\".\"%s\" ORDER BY ROWID"; PrintfFormat spf = new PrintfFormat(fetchDestStmtFmt); @@ -488,8 +441,7 @@ ResultSet rsDest = stmtDest.executeQuery(fetchDestStmt); - while (rsDest.next()) - { + while (rsDest.next()) { ARRAY rawsValue = ((OracleResultSet) rsDest).getARRAY(1); long[] rawData = rawsValue.getLongArray(); byte[] comparessedValue; @@ -508,12 +460,10 @@ byte[] rawDest = ByteArrayCompressor.decompressByteArray(comparessedValue); - try - { + try { Element element = fetchBinaryElement(rawDest); jobContext.putFeatureCollection(element); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { logger.warn("Dgn7Exception:" + e.getMessage(), e); } } @@ -523,8 +473,7 @@ } // Binary to Element - private Element fetchBinaryElement(byte[] raws) throws Dgn7fileException - { + private Element fetchBinaryElement(byte[] raws) throws Dgn7fileException { ByteBuffer buffer = ByteBuffer.wrap(raws); buffer.order(ByteOrder.LITTLE_ENDIAN); short signature = buffer.getShort(); @@ -542,35 +491,28 @@ handler = recordType.getElementHandler(); Element dgnElement = (Element) handler.read(buffer, signature, elementLength); - if (recordType.isComplexElement() && (elementLength < raws.length)) - { + if (recordType.isComplexElement() && (elementLength < raws.length)) { int offset = elementLength; - while (offset < (raws.length - 4)) - { + while (offset < (raws.length - 4)) { buffer.position(offset); signature = buffer.getShort(); type = (byte) ((signature >>> 8) & 0x007f); elementLength = (buffer.getShort() * 2) + 4; - if (raws.length < (offset + elementLength)) - { + if (raws.length < (offset + elementLength)) { System.out.println("Length not match:" + offset + ":" + buffer.position() + ":" + buffer.limit()); break; } recordType = ElementType.forID(type); handler = recordType.getElementHandler(); - if (handler != null) - { + if (handler != null) { Element subElement = (Element) handler.read(buffer, signature, elementLength); ((ComplexElement) dgnElement).add(subElement); offset += elementLength; - } else - { + } else { byte[] remain = new byte[buffer.remaining()]; System.arraycopy(raws, offset, remain, 0, buffer.remaining()); - for (int i = 0; i < remain.length; i++) - { - if (remain[i] != 0) - { + for (int i = 0; i < remain.length; i++) { + if (remain[i] != 0) { logger.info("fetch element has some error. index=" + (offset + i) + ":value=" + remain[i]); System.out.println("fetch element has some error. index=" + (offset + i) + ":value=" + remain[i]); } @@ -584,41 +526,35 @@ } /** - * �����ഫ�����ɪ��u�@ + * �����ഫ�����ɪ��u�@ * - * @param context �u�@�������� + * @param context �u�@�������� * @throws org.quartz.JobExecutionException * exception */ - private void convertIndexDesignFile(JobExecutionContext context) throws JobExecutionException - { + private void convertIndexDesignFile(JobExecutionContext context) throws JobExecutionException { File indexDir = new File(getDataPath(), "index"); - if (!indexDir.exists()) - { + if (!indexDir.exists()) { logger.info("index dir=" + indexDir + " not exist."); return; } - if (!indexDir.isDirectory()) - { + if (!indexDir.isDirectory()) { logger.info("index dir=" + indexDir + " is not a directory."); } - File[] dgnFiles = indexDir.listFiles(new FilenameFilter() - { - public boolean accept(File dir, String name) - { + File[] dgnFiles = indexDir.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".dgn"); } }); - for (File dgnFile : dgnFiles) - { + for (File dgnFile : dgnFiles) { IndexDgnConvertMySQLJobContext convertContext = - new IndexDgnConvertMySQLJobContext(getDataPath(), getTargetDataStore()); + new IndexDgnConvertMySQLJobContext(getDataPath(), getTargetDataStore(), isProfileMode(), + isTransformed()); logger.debug("--- start dgnfile-" + dgnFile.toString() + " ---"); - try - { + try { convertContext.setExecutionContext(context); String dgnPaths[] = StringUtils.splitToArray(dgnFile.toString(), File.separator); convertContext.setFilename(dgnPaths[dgnPaths.length - 1]); @@ -635,28 +571,23 @@ convertContext.closeFeatureWriter(); System.gc(); System.runFinalization(); - } catch (FileNotFoundException e) - { + } catch (FileNotFoundException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (SchemaException e) - { + } catch (SchemaException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); @@ -665,99 +596,81 @@ } protected void scanIndexDgnElement(IndexDgnConvertMySQLJobContext convertContext) - throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException - { + throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); int count = 0; Element lastComplex = null; - while (reader.hasNext()) - { - Dgn7fileReader.Record record = reader.nextElement(); - if (record.element() != null) - { + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { Element element = (Element) record.element(); ElementType type = element.getElementType(); - if ((!type.isComplexElement()) && (!element.isComponentElement())) - { - if (lastComplex != null) - { - processIndexElement(lastComplex, convertContext); - lastComplex = null; - } + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { + processIndexElement(lastComplex, convertContext); + lastComplex = null; + } processIndexElement(element, convertContext); - } else if (element.isComponentElement()) - { - if (lastComplex != null) - { + } else if (element.isComponentElement()) { + if (lastComplex != null) { ((ComplexElement) lastComplex).add(element); } - } else if (type.isComplexElement()) - { - if (lastComplex != null) - { + } else if (type.isComplexElement()) { + if (lastComplex != null) { processIndexElement(lastComplex, convertContext); } - lastComplex = element; + lastComplex = element; } } count++; } - if (lastComplex != null) - { + if (lastComplex != null) { processIndexElement(lastComplex, convertContext); } logger.debug("ElementRecord Count=" + count); } private void processIndexElement(Element element, IndexDgnConvertMySQLJobContext convertContext) - throws IllegalAttributeException, SchemaException - { - if (element instanceof TextElement) - { + throws IllegalAttributeException, SchemaException { + if (element instanceof TextElement) { convertContext.putFeatureCollection(element); } } /** - * �����ഫ��L�]�p���ɪ��u�@ + * �����ഫ��L�]�p���ɪ��u�@ * * @param context jobContext * @throws org.quartz.JobExecutionException * exception */ - private void convertOtherDesignFile(JobExecutionContext context) throws JobExecutionException - { + private void convertOtherDesignFile(JobExecutionContext context) throws JobExecutionException { File otherDir = new File(getDataPath(), "other"); - if (!otherDir.exists()) - { + if (!otherDir.exists()) { logger.info("other dir=" + otherDir + " not exist."); return; } - if (!otherDir.isDirectory()) - { + if (!otherDir.isDirectory()) { logger.info("other dir=" + otherDir + " is not a directory."); } - File[] dgnFiles = otherDir.listFiles(new FilenameFilter() - { - public boolean accept(File dir, String name) - { + File[] dgnFiles = otherDir.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".dgn"); } }); - for (File dgnFile : dgnFiles) - { + for (File dgnFile : dgnFiles) { GeneralDgnConvertMySQLJobContext convertContext = - new GeneralDgnConvertMySQLJobContext(getDataPath(), getTargetDataStore()); + new GeneralDgnConvertMySQLJobContext(getDataPath(), getTargetDataStore(), isProfileMode(), + isTransformed()); logger.info("--- start dgnfile-" + dgnFile.toString() + " ---"); - try - { + try { convertContext.setExecutionContext(context); String dgnPaths[] = StringUtils.splitToArray(dgnFile.toString(), File.separator); convertContext.setFilename(dgnPaths[dgnPaths.length - 1]); @@ -774,28 +687,23 @@ convertContext.closeFeatureWriter(); System.gc(); System.runFinalization(); - } catch (FileNotFoundException e) - { + } catch (FileNotFoundException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (SchemaException e) - { + } catch (SchemaException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); @@ -804,63 +712,51 @@ } public void scanOtherDgnElement(GeneralDgnConvertMySQLJobContext convertContext) - throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException - { + throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); int count = 0; Element lastComplex = null; - while (reader.hasNext()) - { - Dgn7fileReader.Record record = reader.nextElement(); - if (record.element() != null) - { + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { Element element = (Element) record.element(); ElementType type = element.getElementType(); - if ((!type.isComplexElement()) && (!element.isComponentElement())) - { - if (lastComplex != null) - { - processOtherElement(lastComplex, convertContext); - lastComplex = null; - } + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { + processOtherElement(lastComplex, convertContext); + lastComplex = null; + } processOtherElement(element, convertContext); - } else if (element.isComponentElement()) - { - if (lastComplex != null) - { + } else if (element.isComponentElement()) { + if (lastComplex != null) { ((ComplexElement) lastComplex).add(element); } - } else if (type.isComplexElement()) - { - if (lastComplex != null) - { + } else if (type.isComplexElement()) { + if (lastComplex != null) { processOtherElement(lastComplex, convertContext); } - lastComplex = element; + lastComplex = element; } } count++; } - if (lastComplex != null) - { + if (lastComplex != null) { processOtherElement(lastComplex, convertContext); } logger.debug("ElementRecord Count=" + count); } private void processOtherElement(Element element, GeneralDgnConvertMySQLJobContext convertContext) - throws IllegalAttributeException, SchemaException - { + throws IllegalAttributeException, SchemaException { convertContext.putFeatureCollection(element); } - private void clearOutputDatabase() - { + private void clearOutputDatabase() { /* - File outDataPath = new File(getDataPath(), OracleConvertPostGISJobContext.SHPOUTPATH); + File outDataPath = new File(getDataPath(), OracleConvertEdbGeoJobContext.SHPOUTPATH); if (outDataPath.exists() && outDataPath.isDirectory()) { deleteFilesInPath(outDataPath); @@ -878,33 +774,24 @@ */ } - private void deleteFilesInPath(File outDataPath) - { + private void deleteFilesInPath(File outDataPath) { deleteFilesInPath(outDataPath, true); } - private void deleteFilesInPath(File outDataPath, boolean removeSubDir) - { - if (!outDataPath.isDirectory()) - { + private void deleteFilesInPath(File outDataPath, boolean removeSubDir) { + if (!outDataPath.isDirectory()) { return; } File[] files = outDataPath.listFiles(); - for (File file : files) - { - if (file.isFile()) - { - if (!file.delete()) - { + for (File file : files) { + if (file.isFile()) { + if (!file.delete()) { logger.info("Cannot delete file-" + file.toString()); } - } else if (file.isDirectory()) - { + } else if (file.isDirectory()) { deleteFilesInPath(file, removeSubDir); - if (removeSubDir) - { - if (file.delete()) - { + if (removeSubDir) { + if (file.delete()) { logger.info("Cannot delete dir-" + file.toString()); } } @@ -912,35 +799,29 @@ } } - private void convertFeatureDesignFile(JobExecutionContext context) throws JobExecutionException - { + private void convertFeatureDesignFile(JobExecutionContext context) throws JobExecutionException { File elminDir = new File(getDataPath(), "elmin"); - if (!elminDir.exists()) - { + if (!elminDir.exists()) { logger.info("elmin dir=" + elminDir + " not exist."); return; } - if (!elminDir.isDirectory()) - { + if (!elminDir.isDirectory()) { logger.info("elmin dir=" + elminDir + " is not a directory."); } - File[] dgnFiles = elminDir.listFiles(new FilenameFilter() - { - public boolean accept(File dir, String name) - { + File[] dgnFiles = elminDir.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".dgn"); } }); - for (File dgnFile : dgnFiles) - { + for (File dgnFile : dgnFiles) { FeatureDgnConvertMySQLJobContext convertContext = - new FeatureDgnConvertMySQLJobContext(getDataPath(), getTargetDataStore(), _filterPath); + new FeatureDgnConvertMySQLJobContext(getDataPath(), getTargetDataStore(), _filterPath, isProfileMode(), + isTransformed()); logger.info("--- start dgnfile-" + dgnFile.toString() + " ---"); - try - { + try { convertContext.setExecutionContext(context); String dgnPaths[] = StringUtils.splitToArray(dgnFile.toString(), File.separator); convertContext.setFilename(dgnPaths[dgnPaths.length - 1]); @@ -957,28 +838,23 @@ convertContext.closeFeatureWriter(); System.gc(); System.runFinalization(); - } catch (FileNotFoundException e) - { + } catch (FileNotFoundException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (SchemaException e) - { + } catch (SchemaException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); @@ -987,61 +863,49 @@ } public void scanFeatureDgnElement(FeatureDgnConvertMySQLJobContext convertContext) - throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException - { + throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); int count = 0; Element lastComplex = null; - while (reader.hasNext()) - { - Dgn7fileReader.Record record = reader.nextElement(); - if (record.element() != null) - { + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { Element element = (Element) record.element(); ElementType type = element.getElementType(); - if ((!type.isComplexElement()) && (!element.isComponentElement())) - { - if (lastComplex != null) - { - processFeatureElement(lastComplex, convertContext); - lastComplex = null; - } + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { + processFeatureElement(lastComplex, convertContext); + lastComplex = null; + } processFeatureElement(element, convertContext); - } else if (element.isComponentElement()) - { - if (lastComplex != null) - { + } else if (element.isComponentElement()) { + if (lastComplex != null) { ((ComplexElement) lastComplex).add(element); } - } else if (type.isComplexElement()) - { - if (lastComplex != null) - { + } else if (type.isComplexElement()) { + if (lastComplex != null) { processFeatureElement(lastComplex, convertContext); } - lastComplex = element; + lastComplex = element; } } count++; } - if (lastComplex != null) - { + if (lastComplex != null) { processFeatureElement(lastComplex, convertContext); } logger.debug("ElementRecord Count=" + count); } private void processFeatureElement(Element element, FeatureDgnConvertMySQLJobContext convertContext) - throws IllegalAttributeException, SchemaException - { + throws IllegalAttributeException, SchemaException { convertContext.putFeatureCollection(element); } - private void createDummyFeatureFile(JobExecutionContext context) throws JobExecutionException - { + private void createDummyFeatureFile(JobExecutionContext context) throws JobExecutionException { /* DummyFeatureConvertShpJobContext convertContext = new DummyFeatureConvertShpJobContext(getDataPath(), _filterPath); try { @@ -1056,15 +920,12 @@ */ } - public DataStore getTargetDataStore() - { + public DataStore getTargetDataStore() { return targetDataStore; } - protected void createTargetDataStore() throws JobExecutionException - { - if (targetDataStore != null) - { + protected void createTargetDataStore() throws JobExecutionException { + if (targetDataStore != null) { targetDataStore.dispose(); targetDataStore = null; } @@ -1076,33 +937,37 @@ } */ - if (!myProperties.containsKey("max connections" /*MySQLDataStoreFactory.MAXCONN.key */)) - { - myProperties.put("max connections", "2"); + if (!myProperties.containsKey(MySQLDataStoreFactory.MAXCONN.key)) { + myProperties.put(MySQLDataStoreFactory.MAXCONN.key, "2"); } - if (!myProperties.containsKey("min connections" /* MySQLDataStoreFactory.MINCONN.key */)) - { - myProperties.put("min connections", "1"); + if (!myProperties.containsKey(MySQLDataStoreFactory.MINCONN.key)) { + myProperties.put(MySQLDataStoreFactory.MINCONN.key, "1"); } - if (!myProperties.containsKey(MySQLDataStoreFactory.WKBENABLED.key)) - { + /* + if (!myProperties.containsKey(MySQLDataStoreFactory.WKBENABLED.key)) { myProperties.put(MySQLDataStoreFactory.WKBENABLED.key, "true"); } + */ - if (!dataStoreFactory.canProcess(myProperties)) - { + if (!dataStoreFactory.canProcess(myProperties)) { getLogger().warn("cannot process properties-"); throw new JobExecutionException("cannot process properties-"); } - try - { - targetDataStore = (MySQLDataStore) dataStoreFactory.createDataStore(myProperties); - } catch (IOException e) - { + try { + targetDataStore = dataStoreFactory.createDataStore(myProperties); + } catch (IOException e) { getLogger().warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); } } + + protected void disconnect() { + super.disconnect(); + if (targetDataStore != null) { + targetDataStore.dispose(); + targetDataStore = null; + } + } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2OraSDOJob.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2OraSDOJob.java index 0cbe537..910cde7 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2OraSDOJob.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2OraSDOJob.java @@ -6,14 +6,15 @@ import java.io.FilenameFilter; import java.io.IOException; import java.math.BigDecimal; +import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.channels.FileChannel; +import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.sql.Types; -import java.sql.Connection; import java.util.Date; import java.util.Map; import java.util.TreeMap; @@ -24,10 +25,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.geotools.data.DataStore; -import org.geotools.data.oracle.OracleDataStore; -import org.geotools.data.oracle.OracleDataStoreFactory; -import org.geotools.feature.IllegalAttributeException; +import org.geotools.data.jdbc.JDBCUtils; +import org.geotools.data.oracle.OracleNGDataStoreFactory; import org.geotools.feature.SchemaException; +import org.geotools.jdbc.JDBCDataStore; +import org.opengis.feature.IllegalAttributeException; import org.quartz.JobDataMap; import org.quartz.JobDetail; import org.quartz.JobExecutionContext; @@ -58,8 +60,7 @@ import com.ximple.io.dgn7.TextElement; import com.ximple.util.PrintfFormat; -public class OracleConvertDgn2OraSDOJob extends AbstractOracleDatabaseJob -{ +public class OracleConvertDgn2OraSDOJob extends AbstractOracleDatabaseJob { final static Log logger = LogFactory.getLog(OracleConvertDgn2OraSDOJob.class); private static final String SDOHOST = "SDOHOST"; @@ -73,21 +74,18 @@ private static final int FETCHSIZE = 30; private static final int COMMITSIZE = 20; - class Pair - { + class Pair { Object first; Object second; - public Pair(Object first, Object second) - { + public Pair(Object first, Object second) { this.first = first; this.second = second; } } - protected static OracleDataStoreFactory dataStoreFactory = new OracleDataStoreFactory(); + protected static OracleNGDataStoreFactory dataStoreFactory = new OracleNGDataStoreFactory(); - GeometryFactory _geomFactory = new GeometryFactory(); protected String _sdoHost; protected String _sdoDatabase; protected String _sdoPort; @@ -97,20 +95,19 @@ protected String _sdoUseWKB; protected Map<String, String> sdoProperties; - protected OracleDataStore targetDataStore; + protected JDBCDataStore targetDataStore; - public Log getLogger() - { + public Log getLogger() { return logger; } - protected AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath) - { - return new OracleConvertOraSDOJobContext(getDataPath(), getTargetDataStore(), filterPath); + protected AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath, + boolean profileMode, boolean useTransform) { + return new OracleConvertOraSDOJobContext(getDataPath(), getTargetDataStore(), filterPath, profileMode, + useTransform); } - protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException - { + protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException { super.extractJobConfiguration(jobDetail); JobDataMap dataMap = jobDetail.getJobDataMap(); _sdoHost = dataMap.getString(SDOHOST); @@ -132,56 +129,49 @@ logger.info("USEWKB=" + _myUseWKB); */ - if (_sdoHost == null) - { + if (_sdoHost == null) { logger.warn("SDOHOST is null"); throw new JobExecutionException("Unknown OraSDO host."); } - if (_sdoDatabase == null) - { + if (_sdoDatabase == null) { logger.warn("PGDATABASE is null"); throw new JobExecutionException("Unknown OraSDO database."); } - if (_sdoPort == null) - { + if (_sdoPort == null) { logger.warn("SDOPORT is null"); throw new JobExecutionException("Unknown OraSDO port."); } - if (_sdoSchema == null) - { + if (_sdoSchema == null) { logger.warn("SDOSCHEMA is null"); throw new JobExecutionException("Unknown OraSDO schema."); } - if (_sdoUsername == null) - { + if (_sdoUsername == null) { logger.warn("PGUSERNAME is null"); throw new JobExecutionException("Unknown OraSDO username."); } - if (_sdoPassword == null) - { + if (_sdoPassword == null) { logger.warn("PGPASSWORD is null"); throw new JobExecutionException("Unknown OraSDO password."); } Map<String, String> remote = new TreeMap<String, String>(); - remote.put("dbtype", "OraSDO"); - remote.put("charset", "UTF-8"); - remote.put("host", _sdoHost); - remote.put("port", _sdoPort); - remote.put("database", _sdoDatabase); - remote.put("user", _sdoUsername); - remote.put("passwd", _sdoPassword); - remote.put("namespace", null); + remote.put(OracleNGDataStoreFactory.DBTYPE.key, "oracle"); + // remote.put("charset", "UTF-8"); + remote.put(OracleNGDataStoreFactory.HOST.key, _sdoHost); + remote.put(OracleNGDataStoreFactory.PORT.key, _sdoPort); + remote.put(OracleNGDataStoreFactory.DATABASE.key, _sdoDatabase); + remote.put(OracleNGDataStoreFactory.USER.key, _sdoUsername); + remote.put(OracleNGDataStoreFactory.PASSWD.key, _sdoPassword); + // remote.put("namespace", null); sdoProperties = remote; } - public void execute(JobExecutionContext context) throws JobExecutionException - { + public void execute(JobExecutionContext context) throws JobExecutionException { // Every job has its own job detail JobDetail jobDetail = context.getJobDetail(); // The name is defined in the job definition - String jobName = jobDetail.getName(); + String jobName = jobDetail.getKey().getName(); String targetSchemaName = null; // Log the time the job started @@ -189,36 +179,36 @@ extractJobConfiguration(jobDetail); createSourceDataStore(); createTargetDataStore(); - if (getSourceDataStore() == null) - { + if (getSourceDataStore() == null) { logger.warn("Cannot connect source oracle database."); throw new JobExecutionException("Cannot connect source oracle database."); } - if (getTargetDataStore() == null) - { + if (getTargetDataStore() == null) { logger.warn("Cannot connect source postgreSQL database."); throw new JobExecutionException("Cannot connect source postgreSQL database."); } long t1 = System.currentTimeMillis(); - try - { + try { logger.info("-- step:clearOutputDatabase --"); clearOutputDatabase(); boolean bFirst = isCopyConnectivityMode(); - if (checkConvertDB()) - { + if (checkConvertDB()) { logger.info("-- step:convertOracleDB --"); - for (String orgSchema : _orgSchema) - { + for (String orgSchema : _orgSchema) { OracleConvertOraSDOJobContext jobContext = - (OracleConvertOraSDOJobContext) prepareJobContext(targetSchemaName, _filterPath); + (OracleConvertOraSDOJobContext) prepareJobContext(targetSchemaName, _filterPath, + isProfileMode(), isTransformed()); jobContext.setSourceDataStore(getSourceDataStore()); // jobContext.setConvertElementIn(_convertElementIn); jobContext.setElementLogging(checkElementLogging()); jobContext.setExecutionContext(context); + + fetchTPData(jobContext); + logger.info("TPC DIST:" + jobContext.getDistId() + ":" + + ((jobContext.getDistName() == null) ? "NULL" : jobContext.getDistName())); if (bFirst) copyConnectivity(jobContext); @@ -233,22 +223,19 @@ } } - if (checkConvertFile()) - { + if (checkConvertFile()) { logger.info("-- step:convertIndexDesignFile --"); convertIndexDesignFile(context); logger.info("-- step:convertOtherDesignFile --"); convertOtherDesignFile(context); } - if (checkConvertElementIn()) - { + if (checkConvertElementIn()) { logger.info("-- step:convertFeatureDesignFile --"); convertFeatureDesignFile(context); } - if (checkCreateDummy()) - { + if (checkCreateDummy()) { logger.info("-- step:createDummyFeatureFile --"); createDummyFeatureFile(context); } @@ -258,38 +245,21 @@ // public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss"; // SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); logger.warn("use time = " + ((t2 - t1) / 60000.0) + " min"); - } catch (SQLException e) - { + } catch (SQLException e) { logger.warn(e.getMessage(), e); throw new JobExecutionException("Database error. " + e.getMessage(), e); - } catch (IOException ex) - { + } catch (IOException ex) { logger.warn(ex.getMessage(), ex); throw new JobExecutionException("IO error. " + ex.getMessage(), ex); } logger.warn(jobName + " end at " + new Date()); } - /** - * Connectivity�ƻs�@�Ӫ����A�b�d�߹q�y��V�ɥΨӤ��OMS��Ʈw���q���s����(Connectivity) - * - * @param jobContext job context - * @throws SQLException sql exception - */ - private void copyConnectivity(OracleConvertOraSDOJobContext jobContext) throws SQLException - { - Connection connection = jobContext.getOracleConnection(); - Statement stmt = connection.createStatement(); - stmt.execute(AbstractOracleJobContext.TRUNCATE_CONNECTIVITY_WEBCHECK); - stmt.execute(AbstractOracleJobContext.COPY_CONNECTIVITY_TO_WEBCHECK); - } - private void exetcuteConvert(OracleConvertOraSDOJobContext jobContext, - String querySchema, String dataPath) throws SQLException - { + String querySchema, String dataPath) throws SQLException { int order = 0; OrderedMap map = getBlobStorageList(jobContext.getOracleConnection(), querySchema, "SD$SPACENODES" - , null); + , null); logger.info("begin convert job:[" + map.size() + "]:testmode=" + _testMode); @@ -300,8 +270,7 @@ //jobContext.startTransaction(); jobContext.setCurrentSchema(querySchema); jobContext.getExecutionContext().put("ConvertDgn2OraSDOJobProgress", 0); - for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext();) - { + for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext();) { it.next(); Pair pair = (Pair) it.getValue(); @@ -312,14 +281,12 @@ order++; - if (_testMode) - { + if (_testMode) { if ((_testCount < 0) || (order >= _testCount)) break; } - if ((order % COMMITSIZE) == 0) - { + if ((order % COMMITSIZE) == 0) { // OracleConnection connection = jobContext.getOracleConnection(); // connection.commitTransaction(); jobContext.commitTransaction(); @@ -329,8 +296,7 @@ } int now = order % step; - if (now != current) - { + if (now != current) { current = now; jobContext.getExecutionContext().put("ConvertDgn2OraSDOJobProgress", current); @@ -346,8 +312,7 @@ } protected OrderedMap getBlobStorageList(Connection connection, String schemaSrc, String tableSrc, - OrderedMap orderedMap) throws SQLException - { + OrderedMap orderedMap) throws SQLException { if (orderedMap == null) orderedMap = new LinkedMap(99); String fetchStmtFmt = "SELECT SNID, SPACETABLE FROM \"%s\".\"%s\""; @@ -358,16 +323,13 @@ stmt.setFetchSize(FETCHSIZE); - try - { + try { rs = stmt.executeQuery(fetchStmt); int size = rs.getMetaData().getColumnCount(); - while (rs.next()) - { + while (rs.next()) { Object[] values = new Object[size]; - for (int i = 0; i < size; i++) - { + for (int i = 0; i < size; i++) { values[i] = rs.getObject(i + 1); } @@ -380,13 +342,11 @@ else pair.first = name; } - } catch (SQLException e) - { + } catch (SQLException e) { logger.error(e.toString(), e); logger.error("stmt=" + fetchStmt); throw e; - } finally - { + } finally { if (rs != null) rs.close(); stmt.close(); } @@ -395,8 +355,7 @@ } protected OrderedMap getRawFormatStorageList(OracleConnection connection, String schemaSrc, String tableSrc, - OrderedMap orderedMap) throws SQLException - { + OrderedMap orderedMap) throws SQLException { if (orderedMap == null) orderedMap = new LinkedMap(99); String fetchStmtFmt = "SELECT RNID, SPACETABLE FROM \"%s\".\"%s\""; @@ -408,12 +367,10 @@ ResultSet rs = stmt.executeQuery(fetchStmt); int size = rs.getMetaData().getColumnCount(); - while (rs.next()) - { + while (rs.next()) { Object[] values = new Object[size]; - for (int i = 0; i < size; i++) - { + for (int i = 0; i < size; i++) { values[i] = rs.getObject(i + 1); } @@ -434,8 +391,7 @@ } protected void queryIgsetElement(OracleConvertOraSDOJobContext jobContext, - String srcschema, String srctable) throws SQLException - { + String srcschema, String srctable) throws SQLException { Connection connection = jobContext.getOracleConnection(); String fetchSrcStmtFmt = "SELECT IGDSELM FROM \"%s\".\"%s\" ORDER BY ROWID"; PrintfFormat spf = new PrintfFormat(fetchSrcStmtFmt); @@ -446,26 +402,28 @@ ResultSet rsSrc = stmtSrc.executeQuery(fetchSrcStmt); int igdsMetaType = rsSrc.getMetaData().getColumnType(1); - while (rsSrc.next()) - { - byte[] raw; - if (igdsMetaType == Types.BLOB) - { + while (rsSrc.next()) { + byte[] raw = null; + if (igdsMetaType == Types.BLOB) { BLOB blob = (BLOB) rsSrc.getBlob(1); - raw = getBytesFromBLOB(blob); - blob.close(); - } else - { + try { + raw = getBytesFromBLOB(blob); + } catch (BufferOverflowException e) { + logger.warn("Wrong Element Structure-", e); + } finally { + // blob.close(); + } + } else { raw = rsSrc.getBytes(1); } - try - { - Element element = fetchBinaryElement(raw); - jobContext.putFeatureCollection(element); - } catch (Dgn7fileException e) - { + try { + if (raw != null) { + Element element = fetchBinaryElement(raw); + jobContext.putFeatureCollection(element); + } + } catch (Dgn7fileException e) { logger.warn("Dgn7Exception", e); } } @@ -475,8 +433,7 @@ } protected void queryRawElement(OracleConvertOraSDOJobContext jobContext, - String srcschema, String srctable) throws SQLException - { + String srcschema, String srctable) throws SQLException { Connection connection = jobContext.getOracleConnection(); String fetchDestStmtFmt = "SELECT ELEMENT FROM \"%s\".\"%s\" ORDER BY ROWID"; PrintfFormat spf = new PrintfFormat(fetchDestStmtFmt); @@ -487,8 +444,7 @@ ResultSet rsDest = stmtDest.executeQuery(fetchDestStmt); - while (rsDest.next()) - { + while (rsDest.next()) { ARRAY rawsValue = ((OracleResultSet) rsDest).getARRAY(1); long[] rawData = rawsValue.getLongArray(); byte[] comparessedValue; @@ -507,12 +463,10 @@ byte[] rawDest = ByteArrayCompressor.decompressByteArray(comparessedValue); - try - { + try { Element element = fetchBinaryElement(rawDest); jobContext.putFeatureCollection(element); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { logger.warn("Dgn7Exception:" + e.getMessage(), e); } } @@ -522,8 +476,7 @@ } // Binary to Element - private Element fetchBinaryElement(byte[] raws) throws Dgn7fileException - { + private Element fetchBinaryElement(byte[] raws) throws Dgn7fileException { ByteBuffer buffer = ByteBuffer.wrap(raws); buffer.order(ByteOrder.LITTLE_ENDIAN); short signature = buffer.getShort(); @@ -541,35 +494,28 @@ handler = recordType.getElementHandler(); Element dgnElement = (Element) handler.read(buffer, signature, elementLength); - if (recordType.isComplexElement() && (elementLength < raws.length)) - { + if (recordType.isComplexElement() && (elementLength < raws.length)) { int offset = elementLength; - while (offset < (raws.length - 4)) - { + while (offset < (raws.length - 4)) { buffer.position(offset); signature = buffer.getShort(); type = (byte) ((signature >>> 8) & 0x007f); elementLength = (buffer.getShort() * 2) + 4; - if (raws.length < (offset + elementLength)) - { + if (raws.length < (offset + elementLength)) { System.out.println("Length not match:" + offset + ":" + buffer.position() + ":" + buffer.limit()); break; } recordType = ElementType.forID(type); handler = recordType.getElementHandler(); - if (handler != null) - { + if (handler != null) { Element subElement = (Element) handler.read(buffer, signature, elementLength); ((ComplexElement) dgnElement).add(subElement); offset += elementLength; - } else - { + } else { byte[] remain = new byte[buffer.remaining()]; System.arraycopy(raws, offset, remain, 0, buffer.remaining()); - for (int i = 0; i < remain.length; i++) - { - if (remain[i] != 0) - { + for (int i = 0; i < remain.length; i++) { + if (remain[i] != 0) { logger.info("fetch element has some error. index=" + (offset + i) + ":value=" + remain[i]); System.out.println("fetch element has some error. index=" + (offset + i) + ":value=" + remain[i]); } @@ -583,41 +529,35 @@ } /** - * �����ഫ�����ɪ��u�@ + * �����ഫ�����ɪ��u�@ * - * @param context �u�@�������� + * @param context �u�@�������� * @throws org.quartz.JobExecutionException * exception */ - private void convertIndexDesignFile(JobExecutionContext context) throws JobExecutionException - { + private void convertIndexDesignFile(JobExecutionContext context) throws JobExecutionException { File indexDir = new File(getDataPath(), "index"); - if (!indexDir.exists()) - { + if (!indexDir.exists()) { logger.info("index dir=" + indexDir + " not exist."); return; } - if (!indexDir.isDirectory()) - { + if (!indexDir.isDirectory()) { logger.info("index dir=" + indexDir + " is not a directory."); } - File[] dgnFiles = indexDir.listFiles(new FilenameFilter() - { - public boolean accept(File dir, String name) - { + File[] dgnFiles = indexDir.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".dgn"); } }); - for (File dgnFile : dgnFiles) - { + for (File dgnFile : dgnFiles) { IndexDgnConvertOraSDOJobContext convertContext = - new IndexDgnConvertOraSDOJobContext(getDataPath(), getTargetDataStore()); + new IndexDgnConvertOraSDOJobContext(getDataPath(), getTargetDataStore(), isProfileMode(), + isTransformed()); logger.debug("--- start dgnfile-" + dgnFile.toString() + " ---"); - try - { + try { convertContext.setExecutionContext(context); String dgnPaths[] = StringUtils.splitToArray(dgnFile.toString(), File.separator); convertContext.setFilename(dgnPaths[dgnPaths.length - 1]); @@ -634,28 +574,23 @@ convertContext.closeFeatureWriter(); System.gc(); System.runFinalization(); - } catch (FileNotFoundException e) - { + } catch (FileNotFoundException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (SchemaException e) - { + } catch (SchemaException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); @@ -664,99 +599,81 @@ } protected void scanIndexDgnElement(IndexDgnConvertOraSDOJobContext convertContext) - throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException - { + throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); int count = 0; Element lastComplex = null; - while (reader.hasNext()) - { - Dgn7fileReader.Record record = reader.nextElement(); - if (record.element() != null) - { + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { Element element = (Element) record.element(); ElementType type = element.getElementType(); - if ((!type.isComplexElement()) && (!element.isComponentElement())) - { - if (lastComplex != null) - { - processIndexElement(lastComplex, convertContext); - lastComplex = null; - } + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { + processIndexElement(lastComplex, convertContext); + lastComplex = null; + } processIndexElement(element, convertContext); - } else if (element.isComponentElement()) - { - if (lastComplex != null) - { + } else if (element.isComponentElement()) { + if (lastComplex != null) { ((ComplexElement) lastComplex).add(element); } - } else if (type.isComplexElement()) - { - if (lastComplex != null) - { + } else if (type.isComplexElement()) { + if (lastComplex != null) { processIndexElement(lastComplex, convertContext); } - lastComplex = element; + lastComplex = element; } } count++; } - if (lastComplex != null) - { + if (lastComplex != null) { processIndexElement(lastComplex, convertContext); } logger.debug("ElementRecord Count=" + count); } private void processIndexElement(Element element, IndexDgnConvertOraSDOJobContext convertContext) - throws IllegalAttributeException, SchemaException - { - if (element instanceof TextElement) - { + throws IllegalAttributeException, SchemaException { + if (element instanceof TextElement) { convertContext.putFeatureCollection(element); } } /** - * �����ഫ��L�]�p���ɪ��u�@ + * �����ഫ��L�]�p���ɪ��u�@ * * @param context jobContext * @throws org.quartz.JobExecutionException * exception */ - private void convertOtherDesignFile(JobExecutionContext context) throws JobExecutionException - { + private void convertOtherDesignFile(JobExecutionContext context) throws JobExecutionException { File otherDir = new File(getDataPath(), "other"); - if (!otherDir.exists()) - { + if (!otherDir.exists()) { logger.info("other dir=" + otherDir + " not exist."); return; } - if (!otherDir.isDirectory()) - { + if (!otherDir.isDirectory()) { logger.info("other dir=" + otherDir + " is not a directory."); } - File[] dgnFiles = otherDir.listFiles(new FilenameFilter() - { - public boolean accept(File dir, String name) - { + File[] dgnFiles = otherDir.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".dgn"); } }); - for (File dgnFile : dgnFiles) - { + for (File dgnFile : dgnFiles) { GeneralDgnConvertOraSDOJobContext convertContext = - new GeneralDgnConvertOraSDOJobContext(getDataPath(), getTargetDataStore()); + new GeneralDgnConvertOraSDOJobContext(getDataPath(), getTargetDataStore(), isProfileMode(), + isTransformed()); logger.info("--- start dgnfile-" + dgnFile.toString() + " ---"); - try - { + try { convertContext.setExecutionContext(context); String dgnPaths[] = StringUtils.splitToArray(dgnFile.toString(), File.separator); convertContext.setFilename(dgnPaths[dgnPaths.length - 1]); @@ -773,28 +690,23 @@ convertContext.closeFeatureWriter(); System.gc(); System.runFinalization(); - } catch (FileNotFoundException e) - { + } catch (FileNotFoundException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (SchemaException e) - { + } catch (SchemaException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); @@ -803,61 +715,49 @@ } public void scanOtherDgnElement(GeneralDgnConvertOraSDOJobContext convertContext) - throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException - { + throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); int count = 0; Element lastComplex = null; - while (reader.hasNext()) - { - Dgn7fileReader.Record record = reader.nextElement(); - if (record.element() != null) - { + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { Element element = (Element) record.element(); ElementType type = element.getElementType(); - if ((!type.isComplexElement()) && (!element.isComponentElement())) - { - if (lastComplex != null) - { - processOtherElement(lastComplex, convertContext); - lastComplex = null; - } + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { + processOtherElement(lastComplex, convertContext); + lastComplex = null; + } processOtherElement(element, convertContext); - } else if (element.isComponentElement()) - { - if (lastComplex != null) - { + } else if (element.isComponentElement()) { + if (lastComplex != null) { ((ComplexElement) lastComplex).add(element); } - } else if (type.isComplexElement()) - { - if (lastComplex != null) - { + } else if (type.isComplexElement()) { + if (lastComplex != null) { processOtherElement(lastComplex, convertContext); } - lastComplex = element; + lastComplex = element; } } count++; } - if (lastComplex != null) - { + if (lastComplex != null) { processOtherElement(lastComplex, convertContext); } logger.debug("ElementRecord Count=" + count); } private void processOtherElement(Element element, GeneralDgnConvertOraSDOJobContext convertContext) - throws IllegalAttributeException, SchemaException - { + throws IllegalAttributeException, SchemaException { convertContext.putFeatureCollection(element); } - private void clearOutputDatabase() - { + private void clearOutputDatabase() { /* File outDataPath = new File(getDataPath(), OracleConvertOraSDOJobContext.SHPOUTPATH); if (outDataPath.exists() && outDataPath.isDirectory()) @@ -877,33 +777,24 @@ */ } - private void deleteFilesInPath(File outDataPath) - { + private void deleteFilesInPath(File outDataPath) { deleteFilesInPath(outDataPath, true); } - private void deleteFilesInPath(File outDataPath, boolean removeSubDir) - { - if (!outDataPath.isDirectory()) - { + private void deleteFilesInPath(File outDataPath, boolean removeSubDir) { + if (!outDataPath.isDirectory()) { return; } File[] files = outDataPath.listFiles(); - for (File file : files) - { - if (file.isFile()) - { - if (!file.delete()) - { + for (File file : files) { + if (file.isFile()) { + if (!file.delete()) { logger.info("Cannot delete file-" + file.toString()); } - } else if (file.isDirectory()) - { + } else if (file.isDirectory()) { deleteFilesInPath(file, removeSubDir); - if (removeSubDir) - { - if (file.delete()) - { + if (removeSubDir) { + if (file.delete()) { logger.info("Cannot delete dir-" + file.toString()); } } @@ -911,35 +802,29 @@ } } - private void convertFeatureDesignFile(JobExecutionContext context) throws JobExecutionException - { + private void convertFeatureDesignFile(JobExecutionContext context) throws JobExecutionException { File elminDir = new File(getDataPath(), "elmin"); - if (!elminDir.exists()) - { + if (!elminDir.exists()) { logger.info("elmin dir=" + elminDir + " not exist."); return; } - if (!elminDir.isDirectory()) - { + if (!elminDir.isDirectory()) { logger.info("elmin dir=" + elminDir + " is not a directory."); } - File[] dgnFiles = elminDir.listFiles(new FilenameFilter() - { - public boolean accept(File dir, String name) - { + File[] dgnFiles = elminDir.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".dgn"); } }); - for (File dgnFile : dgnFiles) - { + for (File dgnFile : dgnFiles) { FeatureDgnConvertOraSDOJobContext convertContext = - new FeatureDgnConvertOraSDOJobContext(getDataPath(), getTargetDataStore(), _filterPath); + new FeatureDgnConvertOraSDOJobContext(getDataPath(), getTargetDataStore(), _filterPath, isProfileMode(), + isTransformed()); logger.info("--- start dgnfile-" + dgnFile.toString() + " ---"); - try - { + try { convertContext.setExecutionContext(context); String dgnPaths[] = StringUtils.splitToArray(dgnFile.toString(), File.separator); convertContext.setFilename(dgnPaths[dgnPaths.length - 1]); @@ -956,28 +841,23 @@ convertContext.closeFeatureWriter(); System.gc(); System.runFinalization(); - } catch (FileNotFoundException e) - { + } catch (FileNotFoundException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (SchemaException e) - { + } catch (SchemaException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); @@ -986,61 +866,49 @@ } public void scanFeatureDgnElement(FeatureDgnConvertOraSDOJobContext convertContext) - throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException - { + throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); int count = 0; Element lastComplex = null; - while (reader.hasNext()) - { - Dgn7fileReader.Record record = reader.nextElement(); - if (record.element() != null) - { + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { Element element = (Element) record.element(); ElementType type = element.getElementType(); - if ((!type.isComplexElement()) && (!element.isComponentElement())) - { - if (lastComplex != null) - { - processFeatureElement(lastComplex, convertContext); - lastComplex = null; - } + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { + processFeatureElement(lastComplex, convertContext); + lastComplex = null; + } processFeatureElement(element, convertContext); - } else if (element.isComponentElement()) - { - if (lastComplex != null) - { + } else if (element.isComponentElement()) { + if (lastComplex != null) { ((ComplexElement) lastComplex).add(element); } - } else if (type.isComplexElement()) - { - if (lastComplex != null) - { + } else if (type.isComplexElement()) { + if (lastComplex != null) { processFeatureElement(lastComplex, convertContext); } - lastComplex = element; + lastComplex = element; } } count++; } - if (lastComplex != null) - { + if (lastComplex != null) { processFeatureElement(lastComplex, convertContext); } logger.debug("ElementRecord Count=" + count); } private void processFeatureElement(Element element, FeatureDgnConvertOraSDOJobContext convertContext) - throws IllegalAttributeException, SchemaException - { + throws IllegalAttributeException, SchemaException { convertContext.putFeatureCollection(element); } - private void createDummyFeatureFile(JobExecutionContext context) throws JobExecutionException - { + private void createDummyFeatureFile(JobExecutionContext context) throws JobExecutionException { /* DummyFeatureConvertShpJobContext convertContext = new DummyFeatureConvertShpJobContext(getDataPath(), _filterPath); try { @@ -1055,15 +923,12 @@ */ } - public DataStore getTargetDataStore() - { + public DataStore getTargetDataStore() { return targetDataStore; } - protected void createTargetDataStore() throws JobExecutionException - { - if (targetDataStore != null) - { + protected void createTargetDataStore() throws JobExecutionException { + if (targetDataStore != null) { targetDataStore.dispose(); targetDataStore = null; } @@ -1075,14 +940,12 @@ } */ - if (!sdoProperties.containsKey(OracleDataStoreFactory.MAXCONN.key)) - { - sdoProperties.put(OracleDataStoreFactory.MAXCONN.key, "2"); + if (!sdoProperties.containsKey(OracleNGDataStoreFactory.MAXCONN.key)) { + sdoProperties.put(OracleNGDataStoreFactory.MAXCONN.key, "2"); } - if (!sdoProperties.containsKey(OracleDataStoreFactory.MINCONN.key)) - { - sdoProperties.put(OracleDataStoreFactory.MINCONN.key, "1"); + if (!sdoProperties.containsKey(OracleNGDataStoreFactory.MINCONN.key)) { + sdoProperties.put(OracleNGDataStoreFactory.MINCONN.key, "1"); } /* @@ -1092,18 +955,23 @@ } */ - if (!dataStoreFactory.canProcess(sdoProperties)) - { + if (!dataStoreFactory.canProcess(sdoProperties)) { getLogger().warn("cannot process properties-"); throw new JobExecutionException("cannot process properties-"); } - try - { - targetDataStore = (OracleDataStore) dataStoreFactory.createDataStore(sdoProperties); - } catch (IOException e) - { + try { + targetDataStore = dataStoreFactory.createDataStore(sdoProperties); + } catch (IOException e) { getLogger().warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); } } + + protected void disconnect() { + super.disconnect(); + if (targetDataStore != null) { + targetDataStore.dispose(); + targetDataStore = null; + } + } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2PostGISJob.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2PostGISJob.java index f19cf00..9bbfe1c 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2PostGISJob.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2PostGISJob.java @@ -1,41 +1,52 @@ package com.ximple.eofms.jobs; import java.io.File; +import java.io.FileFilter; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FilenameFilter; import java.io.IOException; +import java.io.PushbackReader; +import java.io.StringReader; import java.math.BigDecimal; +import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.channels.FileChannel; import java.sql.Connection; +import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.sql.Types; +import java.util.ArrayList; import java.util.Date; +import java.util.List; import java.util.Map; import java.util.TreeMap; -import java.util.ArrayList; +import com.ximple.eofms.util.*; import org.apache.commons.collections.OrderedMap; import org.apache.commons.collections.OrderedMapIterator; import org.apache.commons.collections.map.LinkedMap; +import org.apache.commons.dbcp.DelegatingConnection; +import org.apache.commons.dbcp.PoolingConnection; +import org.apache.commons.dbcp.PoolingDataSource; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.geotools.data.DataStore; import org.geotools.data.Transaction; -import org.geotools.data.postgis.PostgisDataStore; -import org.geotools.data.postgis.PostgisDataStoreFactory; -import org.geotools.feature.IllegalAttributeException; +import org.geotools.data.jdbc.JDBCUtils; +import org.geotools.data.postgis.PostgisNGDataStoreFactory; import org.geotools.feature.SchemaException; +import org.geotools.jdbc.JDBCDataStore; +import org.opengis.feature.IllegalAttributeException; +import org.postgresql.PGConnection; +import org.postgresql.copy.CopyManager; import org.quartz.JobDataMap; import org.quartz.JobDetail; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; - -import com.vividsolutions.jts.geom.GeometryFactory; import oracle.jdbc.OracleConnection; import oracle.jdbc.OracleResultSet; @@ -47,9 +58,6 @@ import com.ximple.eofms.jobs.context.postgis.GeneralDgnConvertPostGISJobContext; import com.ximple.eofms.jobs.context.postgis.IndexDgnConvertPostGISJobContext; import com.ximple.eofms.jobs.context.postgis.OracleConvertPostGISJobContext; -import com.ximple.eofms.util.BinConverter; -import com.ximple.eofms.util.ByteArrayCompressor; -import com.ximple.eofms.util.StringUtils; import com.ximple.io.dgn7.ComplexElement; import com.ximple.io.dgn7.Dgn7fileException; import com.ximple.io.dgn7.Dgn7fileReader; @@ -57,16 +65,13 @@ import com.ximple.io.dgn7.ElementType; import com.ximple.io.dgn7.IElementHandler; import com.ximple.io.dgn7.Lock; -import com.ximple.io.dgn7.TextElement; -import com.ximple.io.dgn7.ShapeElement; import com.ximple.util.PrintfFormat; -public class OracleConvertDgn2PostGISJob extends AbstractOracleDatabaseJob -{ +public class OracleConvertDgn2PostGISJob extends AbstractOracleDatabaseJob { final static Log logger = LogFactory.getLog(OracleConvertDgn2PostGISJob.class); private static final String PGHOST = "PGHOST"; - private static final String PGDDATBASE = "PGDDATBASE"; + private static final String PGDATBASE = "PGDATBASE"; private static final String PGPORT = "PGPORT"; private static final String PGSCHEMA = "PGSCHEMA"; private static final String PGUSER = "PGUSER"; @@ -77,22 +82,34 @@ private static final int FETCHSIZE = 30; private static final int COMMITSIZE = 100; + private static final String INDEXPATHNAME = "index"; + private static final String OTHERPATHNAME = "other"; + public static final String FORWARDFLOW_MARK = "shape://ccarrow"; + public static final String BACKFLOW_MARK = "shape://rccarrow"; + public static final String UNFLOW_MARK = "shape://backslash"; + public static final String NONFLOW_MARK = "shape://slash"; - protected static class Pair - { + private static String FETCH_CONNFDR = "SELECT FSC, UFID, FDR1, DIR FROM BASEDB.CONNECTIVITY ORDER BY FSC"; + private static String FETCH_COLORTAB = "SELECT TAG_SFSC, TAG_LUFID, COLOR FROM OCSDB.COLOR WHERE TAG_BCOMPID = 0 ORDER BY TAG_SFSC"; + + private static String CREATE_OWNERTABLE = "CREATE TABLE s (tid smallint not null, oid int not null, owner smallint not null)"; + private static String CREATE_COLORTABLE = "CREATE TABLE s (tid smallint not null, oid int not null, dyncolor varchar(10) not null)"; + + public static final String FDYNCOLOR_SUFFIX = "_fdyncolor"; + public static final String FOWNER_SUFFIX = "_fowner"; + + protected static class Pair { Object first; Object second; - public Pair(Object first, Object second) - { + public Pair(Object first, Object second) { this.first = first; this.second = second; } } - protected static PostgisDataStoreFactory dataStoreFactory = new PostgisDataStoreFactory(); + protected static PostgisNGDataStoreFactory dataStoreFactory = new PostgisNGDataStoreFactory(); - GeometryFactory _geomFactory = new GeometryFactory(); protected String _pgHost; protected String _pgDatabase; protected String _pgPort; @@ -102,25 +119,28 @@ protected String _pgUseWKB; protected Map<String, String> pgProperties; - protected PostgisDataStore targetDataStore; - // protected OracleConvertPostGISJobContext oracleJobContext; + protected JDBCDataStore targetDataStore; + // protected OracleConvertEdbGeoJobContext oracleJobContext; - public Log getLogger() - { + private long queryTime = 0; + private long queryTimeStart = 0; + + public Log getLogger() { return logger; } - protected AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath) - { - return new OracleConvertPostGISJobContext(getDataPath(), getTargetDataStore(), targetSchemaName, filterPath); + protected AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath, + boolean profileMode, + boolean useTransform) { + return new OracleConvertPostGISJobContext(getDataPath(), + getTargetDataStore(), targetSchemaName, filterPath, profileMode, useTransform); } - protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException - { + protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException { super.extractJobConfiguration(jobDetail); JobDataMap dataMap = jobDetail.getJobDataMap(); _pgHost = dataMap.getString(PGHOST); - _pgDatabase = dataMap.getString(PGDDATBASE); + _pgDatabase = dataMap.getString(PGDATBASE); _pgPort = dataMap.getString(PGPORT); _pgSchema = dataMap.getString(PGSCHEMA); _pgUsername = dataMap.getString(PGUSER); @@ -130,7 +150,7 @@ Log logger = getLogger(); /* logger.info("PGHOST=" + _myHost); - logger.info("PGDDATBASE=" + _myDatabase); + logger.info("PGDATBASE=" + _myDatabase); logger.info("PGPORT=" + _myPort); logger.info("PGSCHEMA=" + _mySchema); logger.info("PGUSER=" + _myUsername); @@ -138,206 +158,241 @@ logger.info("USEWKB=" + _myUseWKB); */ - if (_pgHost == null) - { + if (_pgHost == null) { logger.warn("PGHOST is null"); throw new JobExecutionException("Unknown PostGIS host."); } - if (_pgDatabase == null) - { + if (_pgDatabase == null) { logger.warn("PGDATABASE is null"); throw new JobExecutionException("Unknown PostGIS database."); } - if (_pgPort == null) - { + if (_pgPort == null) { logger.warn("PGPORT is null"); throw new JobExecutionException("Unknown PostGIS port."); } - if (_pgSchema == null) - { + if (_pgSchema == null) { logger.warn("PGSCHEMA is null"); throw new JobExecutionException("Unknown PostGIS schema."); } - if (_pgUsername == null) - { + if (_pgUsername == null) { logger.warn("PGUSERNAME is null"); throw new JobExecutionException("Unknown PostGIS username."); } - if (_pgPassword == null) - { + if (_pgPassword == null) { logger.warn("PGPASSWORD is null"); throw new JobExecutionException("Unknown PostGIS password."); } Map<String, String> remote = new TreeMap<String, String>(); - remote.put("dbtype", "postgis"); - remote.put("charset", "UTF-8"); - remote.put("host", _pgHost); - remote.put("port", _pgPort); - remote.put("database", _pgDatabase); - remote.put("user", _pgUsername); - remote.put("passwd", _pgPassword); - remote.put("namespace", null); + remote.put(PostgisNGDataStoreFactory.DBTYPE.key, "postgis"); + // remote.put("charset", "UTF-8"); + remote.put(PostgisNGDataStoreFactory.HOST.key, _pgHost); + remote.put(PostgisNGDataStoreFactory.PORT.key, _pgPort); + remote.put(PostgisNGDataStoreFactory.DATABASE.key, _pgDatabase); + remote.put(PostgisNGDataStoreFactory.USER.key, _pgUsername); + remote.put(PostgisNGDataStoreFactory.PASSWD.key, _pgPassword); + // remote.put( "namespace", null); pgProperties = remote; } - public void execute(JobExecutionContext context) throws JobExecutionException - { + public void execute(JobExecutionContext context) throws JobExecutionException { // Every job has its own job detail JobDetail jobDetail = context.getJobDetail(); // The name is defined in the job definition - String jobName = jobDetail.getName(); + String jobName = jobDetail.getKey().getName(); // Log the time the job started logger.info(jobName + " fired at " + new Date()); extractJobConfiguration(jobDetail); + + if (isIgnoreDBETL()) { + return; + } + createSourceDataStore(); createTargetDataStore(); - if (getSourceDataStore() == null) - { + if (getSourceDataStore() == null) { logger.warn("Cannot connect source oracle database."); throw new JobExecutionException("Cannot connect source oracle database."); } - if (getTargetDataStore() == null) - { + if (getTargetDataStore() == null) { logger.warn("Cannot connect source postgreSQL database."); throw new JobExecutionException("Cannot connect source postgreSQL database."); } + if (isProfileMode()) { + queryTime = 0; + } + long t1 = System.currentTimeMillis(); - String targetSchemaName = null; - try - { + String targetSchemaName, targetThemeTable; + try { logger.info("-- step:clearOutputDatabase --"); clearOutputDatabase(); targetSchemaName = determineTargetSchemaName(); + targetThemeTable = determineTargetThemeTableName(); - if (checkConvertDB()) - { + if (checkConvertFile()) { + logger.info("-- step:convertIndexDesignFile --"); + long tStep = System.currentTimeMillis(); + convertIndexDesignFile(context, targetSchemaName); + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-convertIndexDesignFile", tStep, tStepEnd); + } + + logger.info("-- step:convertOtherDesignFile --"); + tStep = System.currentTimeMillis(); + convertOtherDesignFile(context, targetSchemaName); + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-convertOtherDesignFile", tStep, tStepEnd); + } + } + + OracleConvertPostGISJobContext jobContext = null; + if (checkConvertDB()) { logger.info("-- step:convertOracleDB --"); - OracleConvertPostGISJobContext jobContext = - (OracleConvertPostGISJobContext) prepareJobContext(targetSchemaName, _filterPath); + jobContext = (OracleConvertPostGISJobContext) prepareJobContext(targetSchemaName, _filterPath, + isProfileMode(), isTransformed()); jobContext.setSourceDataStore(getSourceDataStore()); // jobContext.setConvertElementIn(_convertElementIn); jobContext.setElementLogging(checkElementLogging()); jobContext.setExecutionContext(context); - if (isCopyConnectivityMode()) + + createHibernateSequence(jobContext); + + long tStep = System.currentTimeMillis(); + + fetchTPData(jobContext); + logger.info("TPC DIST:" + jobContext.getDistId() + ":" + + ((jobContext.getDistName() == null) ? "NULL" : jobContext.getDistName())); + + if (isCopyConnectivityMode()) { copyConnectivity(jobContext); + } + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-Copy Connectivity", tStep, tStepEnd); + } - for (String orgSchema : _orgSchema) - { + for (String orgSchema : _orgSchema) { logger.info("----- start schema:" + orgSchema + " -----"); + if (isProfileMode()) { + jobContext.resetProcessTime(); + jobContext.resetUpdateTime(); + } + tStep = System.currentTimeMillis(); exetcuteConvert(jobContext, orgSchema, _dataPath); //close all open filewriter instance jobContext.closeFeatureWriter(); + + if (isProfileMode()) { + logger.warn("Profile-Current Query Oracle Cost-" + + ((int) ((getQueryTime()) / 60000.0)) + " min - " + + (((int) ((getQueryTime()) % 60000.0)) / 1000) + " sec"); + long tStepEnd = System.currentTimeMillis(); + logger.warn("Profile-Current Process Cost-" + + ((int) ((getProcessTime()) / 60000.0)) + " min - " + + (((int) ((getProcessTime()) % 60000.0)) / 1000) + " sec"); + logger.warn("Profile-Current Update Cost-" + + ((int) ((getUpdateTime()) / 60000.0)) + " min - " + + (((int) ((getUpdateTime()) % 60000.0)) / 1000) + " sec"); + logger.warn("Profile-Current JobContext Process Cost-" + + ((int) ((jobContext.getProcessTime()) / 60000.0)) + " min - " + + (((int) ((jobContext.getProcessTime()) % 60000.0)) / 1000) + " sec"); + logger.warn("Profile-Current JobContext Update Cost-" + + ((int) ((jobContext.getUpdateTime()) / 60000.0)) + " min - " + + (((int) ((jobContext.getUpdateTime()) % 60000.0)) / 1000) + " sec"); + logTimeDiff("Profile-Convert[" + orgSchema + "]", tStep, tStepEnd); + + resetQueryTime(); + resetProcessTime(); + resetUpdateTime(); + } + } + + jobContext.closeOracleConnection(); + } + + if (checkConvertElementIn()) { + logger.info("-- step:convertFeatureDesignFile --"); + long tStep = System.currentTimeMillis(); + convertFeatureDesignFile(context, targetSchemaName); + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-convertFeatureDesignFile", tStep, tStepEnd); } } - if (checkConvertFile()) - { - logger.info("-- step:convertIndexDesignFile --"); - convertIndexDesignFile(context, targetSchemaName); - logger.info("-- step:convertOtherDesignFile --"); - convertOtherDesignFile(context, targetSchemaName); - } - - if (checkConvertElementIn()) - { - logger.info("-- step:convertFeatureDesignFile --"); - convertFeatureDesignFile(context, targetSchemaName); - } - - if (checkCreateDummy()) - { + if (checkCreateDummy()) { logger.info("-- step:createDummyFeatureFile --"); createDummyFeatureFile(context); } - disconnect(); + updateRepoStatusToReady(targetSchemaName); + + if (checkConvertPWThemes()) { + jobContext = (OracleConvertPostGISJobContext) prepareJobContext(targetSchemaName, _filterPath, + isProfileMode(), isTransformed()); + jobContext.setSourceDataStore(getSourceDataStore()); + jobContext.setElementLogging(checkElementLogging()); + jobContext.setExecutionContext(context); + + long tStep = System.currentTimeMillis(); + if (!convertPowerOwnerThemeWithCopyAPI(jobContext, targetThemeTable)) { + convertPowerOwnerTheme(jobContext, targetThemeTable); + } + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-convertFeatureDesignFile", tStep, tStepEnd); + } + tStep = System.currentTimeMillis(); + if (!convertDynamicColorThemeWithCopyAPI(jobContext, targetThemeTable)) + convertDynamicColorTheme(jobContext, targetThemeTable); + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-convertFeatureDesignFile", tStep, tStepEnd); + } + jobContext.closeOracleConnection(); + } + + updatePWThemeStatusToReady(targetThemeTable); + long t2 = System.currentTimeMillis(); // public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss"; // SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); - logger.warn("use time = " + ((int) ((t2 - t1) / 60000.0)) + " min - " + - (((int) ((t2 - t1) % 60000.0)) / 1000) + " sec"); - } catch (SQLException e) - { + logTimeDiff("Total ", t1, t2); + + } catch (SQLException e) { + disconnect(); logger.warn(e.getMessage(), e); throw new JobExecutionException("Database error. " + e.getMessage(), e); - } catch (IOException ex) - { + } catch (IOException ex) { + disconnect(); logger.warn(ex.getMessage(), ex); throw new JobExecutionException("IO error. " + ex.getMessage(), ex); + } finally { + disconnect(); } - updateRepoStatusToReady(targetSchemaName); logger.warn(jobName + " end at " + new Date()); } - /** - * Connectivity�ƻs�@�Ӫ����A�b�d�߹q�y��V�ɥΨӤ��OMS��Ʈw���q���s����(Connectivity) - * - * @param jobContext job context - * @throws SQLException sql exception - */ - private void copyConnectivity(OracleConvertPostGISJobContext jobContext) throws SQLException - { - Connection connection = jobContext.getOracleConnection(); - ResultSet rsMeta = connection.getMetaData().getTables(null, "BASEDB", - AbstractOracleJobContext.CONNECTIVITY_WEBCHECK_NAME + "%", - new String[]{"TABLE"}); - - boolean found = false; - try - { - while (rsMeta.next()) - { - String tablename = rsMeta.getString(3); - if (AbstractOracleJobContext.CONNECTIVITY_WEBCHECK_NAME.equalsIgnoreCase(tablename)) - { - found = true; - break; - } - } - // } catch (SQLException e) - } finally - { - if (rsMeta != null) - { - rsMeta.close(); - rsMeta = null; - } - } - Statement stmt = connection.createStatement(); - if (found) - { - stmt.execute(AbstractOracleJobContext.TRUNCATE_CONNECTIVITY_WEBCHECK); - } else { - logger.info("Create CONNECTIVITY_WEBCHECK table."); - stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK); - stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_1); - stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_2); - stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_3); - stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_4); - stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_5); - stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_6); - stmt.execute(AbstractOracleJobContext.ALTER_CONNECTIVITY_WEBCHECK_1); - stmt.execute(AbstractOracleJobContext.ALTER_CONNECTIVITY_WEBCHECK_2); - } - - stmt.execute(AbstractOracleJobContext.COPY_CONNECTIVITY_TO_WEBCHECK); - stmt.close(); + private void logTimeDiff(String message, long tBefore, long tCurrent) { + logger.warn(message + ":use time = " + ((int) ((tCurrent - tBefore) / 60000.0)) + " min - " + + (((int) ((tCurrent - tBefore) % 60000.0)) / 1000) + " sec"); } private void exetcuteConvert(OracleConvertPostGISJobContext jobContext, - String querySchema, String targetSchemaName) throws SQLException - { + String querySchema, String targetSchemaName) throws SQLException { int order = 0; OrderedMap map = getBlobStorageList(jobContext.getOracleConnection(), - querySchema, "SD$SPACENODES", null); + querySchema, "SD$SPACENODES", null); logger.info("begin convert job:[" + map.size() + "]:testmode=" + _testMode); @@ -345,11 +400,16 @@ int step = total / 100; int current = 0; + if (total == 0) { + logger.warn("SELECT COUNT FROM " + querySchema + ".SD$SPACENODES is zero."); + return; + } + logger.warn("SELECT COUNT FROM " + querySchema + ".SD$SPACENODES is " + map.size()); + //jobContext.startTransaction(); jobContext.setCurrentSchema(querySchema); jobContext.getExecutionContext().put("ConvertDgn2PostGISJobProgress", 0); - for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext();) - { + for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext(); ) { it.next(); Pair pair = (Pair) it.getValue(); @@ -360,14 +420,12 @@ order++; - if (_testMode) - { + if (_testMode) { if ((_testCount < 0) || (order >= _testCount)) break; } - if ((order % COMMITSIZE) == 0) - { + if ((order % COMMITSIZE) == 0) { // OracleConnection connection = jobContext.getOracleConnection(); // connection.commitTransaction(); jobContext.commitTransaction(); @@ -376,26 +434,34 @@ System.runFinalization(); } - int now = order % step; - if (now != current) - { - current = now; - jobContext.getExecutionContext().put("ConvertDgn2PostGISJobProgress", current); + if (step != 0) { + int now = order % step; + if (now != current) { + current = now; + jobContext.getExecutionContext().put("ConvertDgn2PostGISJobProgress", current); + } + } else { + jobContext.getExecutionContext().put("ConvertDgn2PostGISJobProgress", current); + current++; } } jobContext.getExecutionContext().put("ConvertDgn2PostGISJobProgress", 100); jobContext.commitTransaction(); jobContext.resetFeatureContext(); + + if (isProfileMode()) { + + } + logger.info("end convert job:[" + order + "]"); System.gc(); System.runFinalization(); } protected OrderedMap getBlobStorageList(Connection connection, String schemaSrc, String tableSrc, - OrderedMap orderedMap) throws SQLException - { + OrderedMap orderedMap) throws SQLException { if (orderedMap == null) orderedMap = new LinkedMap(99); String fetchStmtFmt = "SELECT SNID, SPACETABLE FROM \"%s\".\"%s\""; @@ -405,17 +471,14 @@ ResultSet rs = null; stmt.setFetchSize(FETCHSIZE); - try - { + try { rs = stmt.executeQuery(fetchStmt); int size = rs.getMetaData().getColumnCount(); - while (rs.next()) - { + while (rs.next()) { Object[] values = new Object[size]; - for (int i = 0; i < size; i++) - { + for (int i = 0; i < size; i++) { values[i] = rs.getObject(i + 1); } @@ -428,23 +491,20 @@ else pair.first = name; } - } catch (SQLException e) - { + } catch (SQLException e) { logger.error(e.toString(), e); logger.error("stmt=" + fetchStmt); throw e; - } finally - { - if (rs != null) rs.close(); - stmt.close(); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); } return orderedMap; } protected OrderedMap getRawFormatStorageList(OracleConnection connection, String schemaSrc, String tableSrc, - OrderedMap orderedMap) throws SQLException - { + OrderedMap orderedMap) throws SQLException { if (orderedMap == null) orderedMap = new LinkedMap(99); String fetchStmtFmt = "SELECT RNID, SPACETABLE FROM \"%s\".\"%s\""; @@ -454,15 +514,12 @@ stmt.setFetchSize(FETCHSIZE); ResultSet rs = stmt.executeQuery(fetchStmt); - try - { + try { int size = rs.getMetaData().getColumnCount(); - while (rs.next()) - { + while (rs.next()) { Object[] values = new Object[size]; - for (int i = 0; i < size; i++) - { + for (int i = 0; i < size; i++) { values[i] = rs.getObject(i + 1); } @@ -475,19 +532,18 @@ else pair.second = name; } - } finally - { - rs.close(); - stmt.close(); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); } return orderedMap; } protected void queryIgsetElement(OracleConvertPostGISJobContext jobContext, - String srcschema, String srctable) throws SQLException - { + String srcschema, String srctable) throws SQLException { Connection connection = jobContext.getOracleConnection(); String fetchSrcStmtFmt = "SELECT IGDSELM FROM \"%s\".\"%s\" ORDER BY ROWID"; + //String fetchSrcStmtFmt = "SELECT IGDSELM FROM \"%s\".\"%s\" WHERE TAG_SFSC = 423 AND TAG_LUFID = 21612065 ORDER BY ROWID"; PrintfFormat spf = new PrintfFormat(fetchSrcStmtFmt); String fetchSrcStmt = spf.sprintf(new Object[]{srcschema, srctable}); Statement stmtSrc = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); @@ -495,37 +551,49 @@ stmtSrc.setFetchSize(FETCHSIZE); ResultSet rsSrc = stmtSrc.executeQuery(fetchSrcStmt); int igdsMetaType = rsSrc.getMetaData().getColumnType(1); - while (rsSrc.next()) - { - byte[] raw; - if (igdsMetaType == Types.BLOB) - { + while (rsSrc.next()) { + if (isProfileMode()) { + markQueryTime(); + } + + byte[] raw = null; + if (igdsMetaType == Types.BLOB) { BLOB blob = (BLOB) rsSrc.getBlob(1); - raw = getBytesFromBLOB(blob); - blob.close(); - } else - { + try { + raw = getBytesFromBLOB(blob); + } catch (BufferOverflowException e) { + logger.warn("Wrong Element Structure-", e); + } finally { + // blob.close(); + } + } else { raw = rsSrc.getBytes(1); } - try - { - Element element = fetchBinaryElement(raw); - jobContext.putFeatureCollection(element); - } catch (Dgn7fileException e) - { + try { + if (raw != null) { + Element element = fetchBinaryElement(raw); + if (isProfileMode()) { + accumulateQueryTime(); + } + jobContext.putFeatureCollection(element); + } else { + if (isProfileMode()) { + accumulateQueryTime(); + } + } + } catch (Dgn7fileException e) { logger.warn("Dgn7Exception", e); } } - rsSrc.close(); - stmtSrc.close(); + JDBCUtils.close(rsSrc); + JDBCUtils.close(stmtSrc); } protected void queryRawElement(OracleConvertPostGISJobContext jobContext, - String srcschema, String srctable) throws SQLException - { + String srcschema, String srctable) throws SQLException { Connection connection = jobContext.getOracleConnection(); String fetchDestStmtFmt = "SELECT ELEMENT FROM \"%s\".\"%s\" ORDER BY ROWID"; PrintfFormat spf = new PrintfFormat(fetchDestStmtFmt); @@ -535,10 +603,8 @@ stmtDest.setFetchSize(FETCHSIZE); ResultSet rsDest = stmtDest.executeQuery(fetchDestStmt); - try - { - while (rsDest.next()) - { + try { + while (rsDest.next()) { ARRAY rawsValue = ((OracleResultSet) rsDest).getARRAY(1); long[] rawData = rawsValue.getLongArray(); byte[] comparessedValue; @@ -556,26 +622,21 @@ byte[] rawDest = ByteArrayCompressor.decompressByteArray(comparessedValue); - - try - { + try { Element element = fetchBinaryElement(rawDest); jobContext.putFeatureCollection(element); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { logger.warn("Dgn7Exception:" + e.getMessage(), e); } } - } finally - { - rsDest.close(); - stmtDest.close(); + } finally { + JDBCUtils.close(rsDest); + JDBCUtils.close(stmtDest); } } // Binary to Element - private Element fetchBinaryElement(byte[] raws) throws Dgn7fileException - { + private Element fetchBinaryElement(byte[] raws) throws Dgn7fileException { ByteBuffer buffer = ByteBuffer.wrap(raws); buffer.order(ByteOrder.LITTLE_ENDIAN); short signature = buffer.getShort(); @@ -593,37 +654,29 @@ handler = recordType.getElementHandler(); Element dgnElement = (Element) handler.read(buffer, signature, elementLength); - if (recordType.isComplexElement() && (elementLength < raws.length)) - { + if (recordType.isComplexElement() && (elementLength < raws.length)) { int offset = elementLength; - while (offset < (raws.length - 4)) - { + while (offset < (raws.length - 4)) { buffer.position(offset); signature = buffer.getShort(); type = (byte) ((signature >>> 8) & 0x007f); elementLength = (buffer.getShort() * 2) + 4; - if (raws.length < (offset + elementLength)) - { - System.out.println("Length not match:" + offset + ":" + buffer.position() + ":" + buffer.limit()); + if (raws.length < (offset + elementLength)) { + logger.debug("Length not match:" + offset + ":" + buffer.position() + ":" + buffer.limit()); break; } recordType = ElementType.forID(type); handler = recordType.getElementHandler(); - if (handler != null) - { + if (handler != null) { Element subElement = (Element) handler.read(buffer, signature, elementLength); ((ComplexElement) dgnElement).add(subElement); offset += elementLength; - } else - { + } else { byte[] remain = new byte[buffer.remaining()]; System.arraycopy(raws, offset, remain, 0, buffer.remaining()); - for (int i = 0; i < remain.length; i++) - { - if (remain[i] != 0) - { + for (int i = 0; i < remain.length; i++) { + if (remain[i] != 0) { logger.info("fetch element has some error. index=" + (offset + i) + ":value=" + remain[i]); - System.out.println("fetch element has some error. index=" + (offset + i) + ":value=" + remain[i]); } } break; @@ -635,120 +688,134 @@ } /** - * �����ഫ�����ɪ��u�@ + * �����ഫ�����ɪ��u�@ * - * @param context �u�@�������� + * @param context �u�@�������� * @throws org.quartz.JobExecutionException * exception */ - private void convertIndexDesignFile(JobExecutionContext context, String targetSchemaName) throws JobExecutionException - { - File indexDir = new File(getDataPath(), "index"); - if (!indexDir.exists()) - { + private void convertIndexDesignFile(JobExecutionContext context, String targetSchemaName) throws JobExecutionException { + File indexDir = new File(getDataPath(), INDEXPATHNAME); + if (!indexDir.exists()) { logger.info("index dir=" + indexDir + " not exist."); return; } - if (!indexDir.isDirectory()) - { + if (!indexDir.isDirectory()) { logger.info("index dir=" + indexDir + " is not a directory."); } - File[] dgnFiles = indexDir.listFiles(new FilenameFilter() - { - public boolean accept(File dir, String name) - { - return name.toLowerCase().endsWith(".dgn"); + List<File> dgnFiles = FileUtils.recurseDir(indexDir, new FileFilter() { + public boolean accept(File pathname) { + return pathname.isDirectory() || pathname.getName().toLowerCase().endsWith("dgn"); } }); - for (File dgnFile : dgnFiles) - { + for (File dgnFile : dgnFiles) { + if (dgnFile.isDirectory()) continue; IndexDgnConvertPostGISJobContext convertContext = - new IndexDgnConvertPostGISJobContext(getDataPath(), getTargetDataStore(), targetSchemaName); - logger.debug("--- start dgnfile-" + dgnFile.toString() + " ---"); - try - { + new IndexDgnConvertPostGISJobContext(getDataPath(), getTargetDataStore(), targetSchemaName, + isProfileMode(), isTransformed()); + logger.info("--- start index dgnfile-" + dgnFile.toString() + " ---"); + FileInputStream fs = null; + FileChannel fc = null; + Dgn7fileReader reader = null; + try { convertContext.clearOutputDatabase(); convertContext.setExecutionContext(context); String dgnPaths[] = StringUtils.splitToArray(dgnFile.toString(), File.separator); convertContext.setFilename(dgnPaths[dgnPaths.length - 1]); convertContext.startTransaction(); - FileInputStream fs = new FileInputStream(dgnFile); - FileChannel fc = fs.getChannel(); - Dgn7fileReader reader = new Dgn7fileReader(fc, new Lock()); + fs = new FileInputStream(dgnFile); + fc = fs.getChannel(); + reader = new Dgn7fileReader(fc, new Lock()); convertContext.setReader(reader); scanIndexDgnElement(convertContext); convertContext.commitTransaction(); convertContext.closeFeatureWriter(); + System.gc(); System.runFinalization(); - } catch (FileNotFoundException e) - { + } catch (FileNotFoundException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (SchemaException e) - { + } catch (SchemaException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); + } finally { + convertContext.closeFeatureWriter(); + + if (reader != null) { + try { + reader.close(); + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } + } + + if (fs != null) { + try { + fs.close(); + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } + } + + if (isProfileMode()) { + logger.warn("Profile-Current convertContext Process Cost-" + + ((int) ((convertContext.getProcessTime()) / 60000.0)) + " min - " + + (((int) ((convertContext.getProcessTime()) % 60000.0)) / 1000) + " sec"); + logger.warn("Profile-Current convertContext Update Cost-" + + ((int) ((convertContext.getUpdateTime()) / 60000.0)) + " min - " + + (((int) ((convertContext.getUpdateTime()) % 60000.0)) / 1000) + " sec"); + } } } } protected void scanIndexDgnElement(IndexDgnConvertPostGISJobContext convertContext) - throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException - { + throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); int count = 0; Element lastComplex = null; - while (reader.hasNext()) - { - Dgn7fileReader.Record record = reader.nextElement(); - if (record.element() != null) - { + + while (reader.hasNext()) { + if (isProfileMode()) markProcessTime(); + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { Element element = (Element) record.element(); ElementType type = element.getElementType(); - if ((!type.isComplexElement()) && (!element.isComponentElement())) - { - if (lastComplex != null) - { + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { processIndexElement(lastComplex, convertContext); lastComplex = null; } processIndexElement(element, convertContext); - } else if (element.isComponentElement()) - { - if (lastComplex != null) - { + } else if (element.isComponentElement()) { + if (lastComplex != null) { ((ComplexElement) lastComplex).add(element); } - } else if (type.isComplexElement()) - { - if (lastComplex != null) - { + } else if (type.isComplexElement()) { + if (lastComplex != null) { processIndexElement(lastComplex, convertContext); } lastComplex = element; @@ -757,145 +824,153 @@ count++; } - if (lastComplex != null) - { + if (lastComplex != null) { processIndexElement(lastComplex, convertContext); } logger.debug("ElementRecord Count=" + count); } private void processIndexElement(Element element, IndexDgnConvertPostGISJobContext convertContext) - throws IllegalAttributeException, SchemaException - { - if (useTpclidText) - { - if (element instanceof TextElement) - { - convertContext.putFeatureCollection(element); - } - } else { - if (element instanceof ShapeElement) - { - convertContext.putFeatureCollection(element); - } - } + throws IllegalAttributeException, SchemaException { + //if (useTpclidText) { + // if (element instanceof TextElement) { + // convertContext.putFeatureCollection(element); + // } + //} else { + // if (element instanceof ShapeElement) { + convertContext.putFeatureCollection(element); + // } + //} } /** - * �����ഫ��L�]�p���ɪ��u�@ + * �����ഫ��L�]�p���ɪ��u�@ * * @param context jobContext * @throws org.quartz.JobExecutionException * exception */ - private void convertOtherDesignFile(JobExecutionContext context, String targetSchemaName) throws JobExecutionException - { - File otherDir = new File(getDataPath(), "other"); - if (!otherDir.exists()) - { + private void convertOtherDesignFile(JobExecutionContext context, String targetSchemaName) throws JobExecutionException { + File otherDir = new File(getDataPath(), OTHERPATHNAME); + if (!otherDir.exists()) { logger.info("other dir=" + otherDir + " not exist."); return; } - if (!otherDir.isDirectory()) - { + if (!otherDir.isDirectory()) { logger.info("other dir=" + otherDir + " is not a directory."); } - File[] dgnFiles = otherDir.listFiles(new FilenameFilter() - { - public boolean accept(File dir, String name) - { - return name.toLowerCase().endsWith(".dgn"); + List<File> dgnFiles = FileUtils.recurseDir(otherDir, new FileFilter() { + public boolean accept(File pathname) { + return pathname.isDirectory() || pathname.getName().toLowerCase().endsWith("dgn"); } }); - for (File dgnFile : dgnFiles) - { + for (File dgnFile : dgnFiles) { + if (dgnFile.isDirectory()) continue; + GeneralDgnConvertPostGISJobContext convertContext = - new GeneralDgnConvertPostGISJobContext(getDataPath(), getTargetDataStore(), targetSchemaName); - logger.info("--- start dgnfile-" + dgnFile.toString() + " ---"); - try - { + new GeneralDgnConvertPostGISJobContext(getDataPath(), getTargetDataStore(), targetSchemaName, + isProfileMode(), isTransformed()); + logger.info("--- start other dgnfile-" + dgnFile.toString() + " ---"); + FileInputStream fs = null; + FileChannel fc; + Dgn7fileReader reader = null; + try { convertContext.setExecutionContext(context); String dgnPaths[] = StringUtils.splitToArray(dgnFile.toString(), File.separator); convertContext.setFilename(dgnPaths[dgnPaths.length - 1]); convertContext.startTransaction(); - FileInputStream fs = new FileInputStream(dgnFile); - FileChannel fc = fs.getChannel(); - Dgn7fileReader reader = new Dgn7fileReader(fc, new Lock()); + fs = new FileInputStream(dgnFile); + fc = fs.getChannel(); + reader = new Dgn7fileReader(fc, new Lock()); convertContext.setReader(reader); scanOtherDgnElement(convertContext); convertContext.commitTransaction(); convertContext.closeFeatureWriter(); + System.gc(); System.runFinalization(); - } catch (FileNotFoundException e) - { + } catch (FileNotFoundException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (SchemaException e) - { + } catch (SchemaException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); + } finally { + convertContext.closeFeatureWriter(); + + if (reader != null) { + try { + reader.close(); + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } + } + + if (fs != null) { + try { + fs.close(); + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } + } + + if (isProfileMode()) { + logger.warn("Profile-Current convertContext Process Cost-" + + ((int) ((convertContext.getProcessTime()) / 60000.0)) + " min - " + + (((int) ((convertContext.getProcessTime()) % 60000.0)) / 1000) + " sec"); + logger.warn("Profile-Current convertContext Update Cost-" + + ((int) ((convertContext.getUpdateTime()) / 60000.0)) + " min - " + + (((int) ((convertContext.getUpdateTime()) % 60000.0)) / 1000) + " sec"); + } } } } public void scanOtherDgnElement(GeneralDgnConvertPostGISJobContext convertContext) - throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException - { + throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); int count = 0; Element lastComplex = null; - while (reader.hasNext()) - { - Dgn7fileReader.Record record = reader.nextElement(); - if (record.element() != null) - { + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { Element element = (Element) record.element(); ElementType type = element.getElementType(); - if ((!type.isComplexElement()) && (!element.isComponentElement())) - { - if (lastComplex != null) - { + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { processOtherElement(lastComplex, convertContext); lastComplex = null; } processOtherElement(element, convertContext); - } else if (element.isComponentElement()) - { - if (lastComplex != null) - { + } else if (element.isComponentElement()) { + if (lastComplex != null) { ((ComplexElement) lastComplex).add(element); } - } else if (type.isComplexElement()) - { - if (lastComplex != null) - { + } else if (type.isComplexElement()) { + if (lastComplex != null) { processOtherElement(lastComplex, convertContext); } lastComplex = element; @@ -904,23 +979,20 @@ count++; } - if (lastComplex != null) - { + if (lastComplex != null) { processOtherElement(lastComplex, convertContext); } logger.debug("ElementRecord Count=" + count); } private void processOtherElement(Element element, GeneralDgnConvertPostGISJobContext convertContext) - throws IllegalAttributeException, SchemaException - { + throws IllegalAttributeException, SchemaException { convertContext.putFeatureCollection(element); } - private void clearOutputDatabase() - { + private void clearOutputDatabase() { /* - File outDataPath = new File(getDataPath(), OracleConvertPostGISJobContext.SHPOUTPATH); + File outDataPath = new File(getDataPath(), OracleConvertEdbGeoJobContext.SHPOUTPATH); if (outDataPath.exists() && outDataPath.isDirectory()) { deleteFilesInPath(outDataPath); @@ -938,33 +1010,24 @@ */ } - private void deleteFilesInPath(File outDataPath) - { + private void deleteFilesInPath(File outDataPath) { deleteFilesInPath(outDataPath, true); } - private void deleteFilesInPath(File outDataPath, boolean removeSubDir) - { - if (!outDataPath.isDirectory()) - { + private void deleteFilesInPath(File outDataPath, boolean removeSubDir) { + if (!outDataPath.isDirectory()) { return; } File[] files = outDataPath.listFiles(); - for (File file : files) - { - if (file.isFile()) - { - if (!file.delete()) - { + for (File file : files) { + if (file.isFile()) { + if (!file.delete()) { logger.info("Cannot delete file-" + file.toString()); } - } else if (file.isDirectory()) - { + } else if (file.isDirectory()) { deleteFilesInPath(file, removeSubDir); - if (removeSubDir) - { - if (file.delete()) - { + if (removeSubDir) { + if (file.delete()) { logger.info("Cannot delete dir-" + file.toString()); } } @@ -972,35 +1035,29 @@ } } - private void convertFeatureDesignFile(JobExecutionContext context, String targetSchemaName) throws JobExecutionException - { + private void convertFeatureDesignFile(JobExecutionContext context, String targetSchemaName) throws JobExecutionException { File elminDir = new File(getDataPath(), "elmin"); - if (!elminDir.exists()) - { + if (!elminDir.exists()) { logger.info("elmin dir=" + elminDir + " not exist."); return; } - if (!elminDir.isDirectory()) - { + if (!elminDir.isDirectory()) { logger.info("elmin dir=" + elminDir + " is not a directory."); } - File[] dgnFiles = elminDir.listFiles(new FilenameFilter() - { - public boolean accept(File dir, String name) - { + File[] dgnFiles = elminDir.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".dgn"); } }); - for (File dgnFile : dgnFiles) - { + for (File dgnFile : dgnFiles) { FeatureDgnConvertPostGISJobContext convertContext = - new FeatureDgnConvertPostGISJobContext(getDataPath(), getTargetDataStore(), targetSchemaName, _filterPath); + new FeatureDgnConvertPostGISJobContext(getDataPath(), getTargetDataStore(), targetSchemaName, _filterPath, + isProfileMode(), isTransformed()); logger.info("--- start dgnfile-" + dgnFile.toString() + " ---"); - try - { + try { convertContext.setExecutionContext(context); String dgnPaths[] = StringUtils.splitToArray(dgnFile.toString(), File.separator); convertContext.setFilename(dgnPaths[dgnPaths.length - 1]); @@ -1017,68 +1074,56 @@ convertContext.closeFeatureWriter(); System.gc(); System.runFinalization(); - } catch (FileNotFoundException e) - { + } catch (FileNotFoundException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (SchemaException e) - { + } catch (SchemaException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); + } finally { + convertContext.closeFeatureWriter(); } } } public void scanFeatureDgnElement(FeatureDgnConvertPostGISJobContext convertContext) - throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException - { + throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); int count = 0; Element lastComplex = null; - while (reader.hasNext()) - { - Dgn7fileReader.Record record = reader.nextElement(); - if (record.element() != null) - { + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { Element element = (Element) record.element(); ElementType type = element.getElementType(); - if ((!type.isComplexElement()) && (!element.isComponentElement())) - { - if (lastComplex != null) - { + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { processFeatureElement(lastComplex, convertContext); lastComplex = null; } processFeatureElement(element, convertContext); - } else if (element.isComponentElement()) - { - if (lastComplex != null) - { + } else if (element.isComponentElement()) { + if (lastComplex != null) { ((ComplexElement) lastComplex).add(element); } - } else if (type.isComplexElement()) - { - if (lastComplex != null) - { + } else if (type.isComplexElement()) { + if (lastComplex != null) { processFeatureElement(lastComplex, convertContext); } lastComplex = element; @@ -1087,21 +1132,18 @@ count++; } - if (lastComplex != null) - { + if (lastComplex != null) { processFeatureElement(lastComplex, convertContext); } logger.debug("ElementRecord Count=" + count); } private void processFeatureElement(Element element, FeatureDgnConvertPostGISJobContext convertContext) - throws IllegalAttributeException, SchemaException - { + throws IllegalAttributeException, SchemaException { convertContext.putFeatureCollection(element); } - private void createDummyFeatureFile(JobExecutionContext context) throws JobExecutionException - { + private void createDummyFeatureFile(JobExecutionContext context) throws JobExecutionException { /* DummyFeatureConvertShpJobContext convertContext = new DummyFeatureConvertShpJobContext(getDataPath(), _filterPath); try { @@ -1116,15 +1158,12 @@ */ } - public DataStore getTargetDataStore() - { + public DataStore getTargetDataStore() { return targetDataStore; } - protected void createTargetDataStore() throws JobExecutionException - { - if (targetDataStore != null) - { + protected void createTargetDataStore() throws JobExecutionException { + if (targetDataStore != null) { targetDataStore.dispose(); targetDataStore = null; } @@ -1136,53 +1175,55 @@ } */ - if (!pgProperties.containsKey(PostgisDataStoreFactory.MAXCONN.key)) - { - pgProperties.put(PostgisDataStoreFactory.MAXCONN.key, "10"); + if (!pgProperties.containsKey(PostgisNGDataStoreFactory.MAXCONN.key)) { + pgProperties.put(PostgisNGDataStoreFactory.MAXCONN.key, "5"); } - if (!pgProperties.containsKey(PostgisDataStoreFactory.MINCONN.key)) - { - pgProperties.put(PostgisDataStoreFactory.MINCONN.key, "1"); + if (!pgProperties.containsKey(PostgisNGDataStoreFactory.MINCONN.key)) { + pgProperties.put(PostgisNGDataStoreFactory.MINCONN.key, "1"); } - if (!pgProperties.containsKey(PostgisDataStoreFactory.WKBENABLED.key)) - { - pgProperties.put(PostgisDataStoreFactory.WKBENABLED.key, "true"); + /* + if (!pgProperties.containsKey(PostgisNGDataStoreFactory.WKBENABLED.key)) { + pgProperties.put(PostgisNGDataStoreFactory.WKBENABLED.key, "true"); } + */ - if (!dataStoreFactory.canProcess(pgProperties)) - { + if (!dataStoreFactory.canProcess(pgProperties)) { getLogger().warn("cannot process properties-"); throw new JobExecutionException("cannot process properties-"); } - try - { - targetDataStore = (PostgisDataStore) dataStoreFactory.createDataStore(pgProperties); - } catch (IOException e) - { + try { + targetDataStore = dataStoreFactory.createDataStore(pgProperties); + } catch (IOException e) { getLogger().warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); } } - private String determineTargetSchemaName() throws IOException - { + protected void disconnect() { + super.disconnect(); + if (targetDataStore != null) { + targetDataStore.dispose(); + targetDataStore = null; + } + } + + private String determineTargetSchemaName() throws IOException { if (targetDataStore == null) return null; Connection connection = null; Statement stmt = null; ResultSet rs = null; String targetSchema = null; boolean needCreate = false; - try - { + try { connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); - rs = connection.getMetaData().getTables(null, _pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME, new String[] {"TABLE"}); + // Create XGVERSIONTABLE_NAME + rs = connection.getMetaData().getTables(null, _pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME, new String[]{"TABLE"}); if (!rs.next()) needCreate = true; if (needCreate) createXGeosVersionTable(connection, _pgSchema); rs.close(); - rs = null; StringBuilder sbSQL = new StringBuilder("SELECT "); sbSQL.append("vsschema, vsstatus FROM "); @@ -1193,25 +1234,21 @@ ArrayList<Object[]> tmpSchemas = new ArrayList<Object[]>(); int i = 0; int current = -1; - while (rs.next()) - { + while (rs.next()) { Object[] values = new Object[2]; values[0] = rs.getString("vsschema"); values[1] = rs.getShort("vsstatus"); tmpSchemas.add(values); - if ((((Short)values[1]) & DataReposVersionManager.VSSTATUS_USING) != 0) - { + if ((((Short) values[1]) & DataReposVersionManager.VSSTATUS_USING) != 0) { current = i; } i++; } - if (current == -1) - { + if (current == -1) { Object[] values = tmpSchemas.get(0); targetSchema = (String) values[0]; - } else if (current < (tmpSchemas.size() - 1)) - { + } else if (current < (tmpSchemas.size() - 1)) { Object[] values = tmpSchemas.get(current + 1); targetSchema = (String) values[0]; } else { @@ -1226,28 +1263,98 @@ sbSQL.append(" WHERE vsschema = '"); sbSQL.append(targetSchema).append("'"); int count = stmt.executeUpdate(sbSQL.toString()); - if (count != 1) - { + if (count != 1) { logger.info("update status for " + targetSchema + " update result count=" - + count); + + count); } } catch (SQLException e) { logger.warn(e.getMessage(), e); } finally { - if (rs != null) try { rs.close(); } catch (SQLException e) {}; - if (stmt != null) try { stmt.close(); } catch (SQLException e) {}; - if (connection != null) try { connection.close(); } catch (SQLException e) {}; + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); } return targetSchema; } - public String encodeSchemaTableName(String schemaName, String tableName) - { + private String determineTargetThemeTableName() throws IOException { + if (targetDataStore == null) return null; + Connection connection = null; + Statement stmt = null; + ResultSet rs = null; + String targetTable = null; + boolean needCreate = false; + try { + connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + // Create XPTVERSIONTABLE_NAME + needCreate = false; + rs = connection.getMetaData().getTables(null, _pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME, new String[]{"TABLE"}); + if (!rs.next()) needCreate = true; + if (needCreate) + createXPWThemeVersionTable(connection, _pgSchema); + rs.close(); + + rs = null; + + StringBuilder sbSQL = new StringBuilder("SELECT "); + sbSQL.append("vptname, vptstatus FROM "); + sbSQL.append(encodeSchemaTableName(_pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME)).append(' '); + sbSQL.append("ORDER BY vptid"); + stmt = connection.createStatement(); + rs = stmt.executeQuery(sbSQL.toString()); + ArrayList<Object[]> tmpTablenames = new ArrayList<Object[]>(); + int i = 0; + int current = -1; + while (rs.next()) { + Object[] values = new Object[2]; + values[0] = rs.getString("vptname"); + values[1] = rs.getShort("vptstatus"); + tmpTablenames.add(values); + if ((((Short) values[1]) & DataReposVersionManager.VSSTATUS_USING) != 0) { + current = i; + } + i++; + } + + if (current == -1) { + Object[] values = tmpTablenames.get(0); + targetTable = (String) values[0]; + } else if (current < (tmpTablenames.size() - 1)) { + Object[] values = tmpTablenames.get(current + 1); + targetTable = (String) values[0]; + } else { + Object[] values = tmpTablenames.get(0); + targetTable = (String) values[0]; + } + + sbSQL = new StringBuilder("UPDATE "); + sbSQL.append(encodeSchemaTableName(_pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME)).append(' '); + sbSQL.append(" SET vptstatus = "); + sbSQL.append(DataReposVersionManager.VSSTATUS_COVERT); + sbSQL.append(" WHERE vptname = '"); + sbSQL.append(targetTable).append("'"); + int count = stmt.executeUpdate(sbSQL.toString()); + if (count != 1) { + logger.info("update status for " + targetTable + " update result count=" + + count); + } + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); + } + return targetTable; + } + + public String encodeSchemaTableName(String schemaName, String tableName) { + if (schemaName == null) + return "\"" + tableName + "\""; return "\"" + schemaName + "\".\"" + tableName + "\""; } - private void createXGeosVersionTable(Connection connection, String pgSchema) throws SQLException - { + private void createXGeosVersionTable(Connection connection, String pgSchema) throws SQLException { Statement stmt = null; StringBuilder sql = new StringBuilder("CREATE TABLE "); sql.append(encodeSchemaTableName(pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME)); @@ -1255,14 +1362,13 @@ sql.append(" vsschema character varying(64) NOT NULL, "); sql.append(" vsstatus smallint NOT NULL, "); sql.append(" vstimestamp timestamp with time zone ) "); - try - { + try { stmt = connection.createStatement(); stmt.executeUpdate(sql.toString()); sql = new StringBuilder("ALTER TABLE "); sql.append(encodeSchemaTableName(pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME)); - sql.append(" OWNER TO spatialdb"); + sql.append(" OWNER TO ").append(_pgUsername); stmt.executeUpdate(sql.toString()); sql = new StringBuilder("GRANT ALL ON TABLE "); @@ -1270,8 +1376,7 @@ sql.append(" TO public"); stmt.executeUpdate(sql.toString()); - for (String schemaName : DataReposVersionManager.DEFAULTXGVERSIONSCHEMA_NAMES) - { + for (String schemaName : DataReposVersionManager.DEFAULTXGVERSIONSCHEMA_NAMES) { sql = new StringBuilder("INSERT INTO "); sql.append(encodeSchemaTableName(pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME)); sql.append(" (vsschema, vsstatus) VALUES ('"); @@ -1287,48 +1392,110 @@ } } - private void updateRepoStatusToReady(String targetSchema) - { + private void createXPWThemeVersionTable(Connection connection, String pgSchema) throws SQLException { + Statement stmt = null; + StringBuilder sql = new StringBuilder("CREATE TABLE "); + sql.append(encodeSchemaTableName(pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME)); + sql.append(" ( vptid serial PRIMARY KEY, "); + sql.append(" vptname character varying(64) NOT NULL, "); + sql.append(" vptstatus smallint NOT NULL, "); + sql.append(" vpttimestamp timestamp with time zone ) "); + try { + stmt = connection.createStatement(); + stmt.executeUpdate(sql.toString()); + + sql = new StringBuilder("ALTER TABLE "); + sql.append(encodeSchemaTableName(pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME)); + sql.append(" OWNER TO ").append(_pgUsername); + stmt.executeUpdate(sql.toString()); + + sql = new StringBuilder("GRANT ALL ON TABLE "); + sql.append(encodeSchemaTableName(pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME)); + sql.append(" TO public"); + stmt.executeUpdate(sql.toString()); + + for (String schemaName : DataReposVersionManager.DEFAULTXPTVERSIONTABLE_NAMES) { + sql = new StringBuilder("INSERT INTO "); + sql.append(encodeSchemaTableName(pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME)); + sql.append(" (vptname, vptstatus) VALUES ('"); + sql.append(schemaName).append("', "); + sql.append(DataReposVersionManager.VSSTATUS_AVAILABLE).append(" )"); + stmt.executeUpdate(sql.toString()); + } + + } finally { + if (stmt != null) stmt.close(); + } + } + + private void updateRepoStatusToReady(String targetSchema) { if (targetDataStore == null) return; Connection connection = null; Statement stmt = null; ResultSet rs = null; boolean needCreate = false; - try - { + try { StringBuilder sbSQL = new StringBuilder("UPDATE "); sbSQL.append(encodeSchemaTableName(_pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME)).append(' '); sbSQL.append(" SET vsstatus = "); sbSQL.append(DataReposVersionManager.VSSTATUS_READY); - sbSQL.append(" WHERE vsschema = '"); + sbSQL.append(" , vstimestamp = CURRENT_TIMESTAMP WHERE vsschema = '"); sbSQL.append(targetSchema).append("'"); connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); stmt = connection.createStatement(); int count = stmt.executeUpdate(sbSQL.toString()); - if (count != 1) - { + if (count != 1) { logger.info("update status for " + targetSchema + " update result count=" - + count); + + count); } } catch (SQLException e) { logger.warn(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.warn(e.getMessage(), e); } finally { - if (rs != null) try { rs.close(); } catch (SQLException e) {}; - if (stmt != null) try { stmt.close(); } catch (SQLException e) {}; - if (connection != null) try { connection.close(); } catch (SQLException e) {}; + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); } } - private void createIfNotExistNewSchema(Connection connection, String s) throws SQLException - { + private void updatePWThemeStatusToReady(String targetSchema) { + if (targetDataStore == null) return; + Connection connection = null; Statement stmt = null; ResultSet rs = null; - try - { + boolean needCreate = false; + try { + StringBuilder sbSQL = new StringBuilder("UPDATE "); + sbSQL.append(encodeSchemaTableName(_pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME)).append(' '); + sbSQL.append(" SET vptstatus = "); + sbSQL.append(DataReposVersionManager.VSSTATUS_READY); + sbSQL.append(" , vpttimestamp = CURRENT_TIMESTAMP WHERE vptname = '"); + sbSQL.append(targetSchema).append("'"); + + connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + stmt = connection.createStatement(); + int count = stmt.executeUpdate(sbSQL.toString()); + if (count != 1) { + logger.info("update status for " + targetSchema + " update result count=" + + count); + } + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); + } + } + + private void createIfNotExistNewSchema(Connection connection, String s) throws SQLException { + Statement stmt = null; + ResultSet rs = null; + try { /* rs = connection.getMetaData().getSchemas(null, s); if (rs.next()) return; @@ -1338,7 +1505,7 @@ StringBuilder sbSQL = new StringBuilder("CREATE SCHEMA "); sbSQL.append(s).append(' '); - sbSQL.append("AUTHORIZATION spatialdb"); + sbSQL.append("AUTHORIZATION ").append(_pgUsername); stmt = connection.createStatement(); stmt.executeUpdate(sbSQL.toString()); @@ -1346,8 +1513,7 @@ sbSQL.append(s).append(' '); sbSQL.append("TO public"); stmt.executeUpdate(sbSQL.toString()); - } catch (SQLException e) - { + } catch (SQLException e) { logger.info("create schema:" + s + " has exception."); logger.info(e.getMessage(), e); } finally { @@ -1355,4 +1521,382 @@ if (stmt != null) stmt.close(); } } + + public final void accumulateQueryTime() { + queryTime += System.currentTimeMillis() - queryTimeStart; + } + + public long getQueryTime() { + return queryTime; + } + + public final void markQueryTime() { + queryTimeStart = System.currentTimeMillis(); + } + + public final void resetQueryTime() { + queryTime = 0; + } + + private void convertDynamicColorTheme(AbstractOracleJobContext context, String targetTableBaseName) throws IOException { + if (context == null) { + getLogger().info("jobContext is null in convertDynamicColorTheme"); + return; + } + Connection connection = context.getOracleConnection(); + Connection connectionPG = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + + boolean found = false; + ResultSet rs = null; + Statement stmt = null; + PreparedStatement pstmt = null; + try { + + DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); + String targetTableName = targetTableBaseName + FDYNCOLOR_SUFFIX; + logger.info("target table:" + targetTableName); + stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + rs = stmt.executeQuery(FETCH_COLORTAB); + rs.setFetchSize(50); + + createOrClearTargetTable(connectionPG, targetTableName, + "(tid smallint not null, oid int not null, dyncolor varchar(10) not null)"); + + pstmt = connectionPG.prepareStatement("INSERT INTO " + + encodeSchemaTableName(_pgSchema, targetTableName) + + " (tid, oid, dyncolor) VALUES (?, ?, ?)" ); + + final int MAX_BATCHSIZE = 50; + int count = 0; + while (rs.next()) { + int cid = rs.getInt(1); + long oid = rs.getLong(2); + int colorId = rs.getInt(3); + String colorText = colorTable.getColorCode(colorId); + + pstmt.setShort(1, (short) cid); + pstmt.setInt(2, (int) oid); + pstmt.setString(3, colorText); + pstmt.addBatch(); + + if (count % MAX_BATCHSIZE == 0) { + pstmt.executeBatch(); + } + ++count; + } + + pstmt.executeBatch(); + createTargetTableIndex(connectionPG, targetTableName); + + logger.info("Execute Update Count=" + count); + } catch (SQLException e) { + logger.info(e.getMessage(), e); + throw new IOException(e.getMessage(), e); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(pstmt); + JDBCUtils.close(connectionPG, Transaction.AUTO_COMMIT, null); + } + } + + private void convertPowerOwnerTheme(AbstractOracleJobContext context, String targetTableBaseName) throws IOException { + if (context == null) { + getLogger().info("jobContext is null in convertPowerOwnerTheme"); + return; + } + Connection connection = context.getOracleConnection(); + Connection connectionPG = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + + boolean found = false; + ResultSet rs = null; + Statement stmt = null; + PreparedStatement pstmt = null; + try { + connectionPG.setAutoCommit(false); + String targetTableName = targetTableBaseName + FOWNER_SUFFIX; + logger.info("target table:" + targetTableName); + stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + rs = stmt.executeQuery(FETCH_CONNFDR); + rs.setFetchSize(50); + + createOrClearTargetTable(connectionPG, targetTableName, + "(tid smallint not null, oid int not null, fowner smallint not null, flow varchar(20) not null)"); + + pstmt = connectionPG.prepareStatement("INSERT INTO " + + encodeSchemaTableName(_pgSchema, targetTableName) + + " (tid, oid, fowner, flow) VALUES (?, ?, ?, ?)" ); + + final int MAX_BATCHSIZE = 50; + int count = 0; + while (rs.next()) { + int cid = rs.getInt(1); + long oid = rs.getLong(2); + int ownerId = rs.getInt(3); + short dirId = (short) rs.getInt(4); + pstmt.setShort(1, (short) cid); + pstmt.setInt(2, (int) oid); + pstmt.setShort(3, (short) ownerId); + ConnectivityDirectionEnum dir = ConnectivityDirectionEnum.convertShort(dirId); + if ((ConnectivityDirectionEnum.ForwardflowON == dir) || + (ConnectivityDirectionEnum.ForwardFixflowON == dir)) { + pstmt.setString(4, "shape://ccarrow"); + + } else if ((ConnectivityDirectionEnum.BackflowON == dir) || + (ConnectivityDirectionEnum.BackFixflowON == dir)) { + pstmt.setString(4, "shape://rccarrow"); + } else { + pstmt.setString(4, "shape://backslash"); + } + pstmt.addBatch(); + + if (count % MAX_BATCHSIZE == 0) { + pstmt.executeBatch(); + } + ++count; + } + + pstmt.executeBatch(); + createTargetTableIndex(connectionPG, targetTableName); + + logger.info("Execute Update Count=" + count); + } catch (SQLException e) { + logger.info(e.getMessage(), e); + throw new IOException(e.getMessage(), e); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(pstmt); + JDBCUtils.close(connectionPG, Transaction.AUTO_COMMIT, null); + } + } + + private void createOrClearTargetTable(Connection connection, String tableName, String sql) throws SQLException { + Statement stmt = connection.createStatement(); + ResultSet rs = null; + try { + rs = connection.getMetaData().getTables(null, _pgSchema, tableName, new String[]{"TABLE"}); + if (rs.next()) { + stmt.execute("DROP TABLE " + encodeSchemaTableName(_pgSchema, tableName) + "CASCADE"); + } + + stmt.executeUpdate("CREATE TABLE " + encodeSchemaTableName(_pgSchema, tableName) + " " + sql); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + } + } + + private void createTargetTableIndex(Connection connection, String tableName) throws SQLException { + Statement stmt = connection.createStatement(); + ResultSet rs = null; + try { + rs = connection.getMetaData().getTables(null, _pgSchema, tableName, new String[]{"TABLE"}); + if (rs.next()) { + stmt.execute("ALTER TABLE " + encodeSchemaTableName(_pgSchema, tableName) + + " ADD PRIMARY KEY (tid, oid)"); + } + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + } + } + + private boolean convertDynamicColorThemeWithCopyAPI(AbstractOracleJobContext context, String targetTableBaseName) + throws IOException { + if (context == null) { + getLogger().info("jobContext is null in convertDynamicColorThemeWithCopyAPI"); + return false; + } + Connection connection = context.getOracleConnection(); + Connection connectionPG = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + while (connectionPG instanceof DelegatingConnection) { + connectionPG = ((DelegatingConnection) connectionPG).getDelegate(); + } + + if (!(connectionPG instanceof PGConnection)) { + return false; + } + + final int MAX_BATCHSIZE = 250; + ResultSet rs = null; + Statement stmt = null; + try { + // connectionPG.setAutoCommit(false); + DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); + String targetTableName = targetTableBaseName + FDYNCOLOR_SUFFIX; + String targetTempName = "tmp_" + targetTableName; + logger.info("target table:" + targetTableName); + stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + rs = stmt.executeQuery(FETCH_COLORTAB); + rs.setFetchSize(MAX_BATCHSIZE); + + createOrClearTempTargetTable(connectionPG, targetTempName, + "(tid smallint not null, oid int not null, dyncolor varchar(10) not null)"); + StringBuilder sb = new StringBuilder(); + + CopyManager cpMgr = ((PGConnection) connectionPG).getCopyAPI(); + PushbackReader reader = new PushbackReader(new StringReader(""), 10240); + + int count = 0; + while (rs.next()) { + int cid = rs.getInt(1); + long oid = rs.getLong(2); + int colorId = rs.getInt(3); + String colorText = colorTable.getColorCode(colorId); + if (cid > Short.MAX_VALUE) { + logger.info("Wrong Color Table:" + cid + "-" + oid); + continue; + } + sb.append(cid).append(','); + sb.append(oid).append(','); + sb.append(colorText).append("\n"); + + if (count % MAX_BATCHSIZE == 0) { + reader.unread(sb.toString().toCharArray()); + cpMgr.copyIn("COPY " + targetTempName + " FROM STDIN WITH CSV", reader); + sb.delete(0, sb.length()); + } + ++count; + } + + reader.unread(sb.toString().toCharArray()); + cpMgr.copyIn("COPY " + targetTempName + " FROM STDIN WITH CSV", reader); + createTargetTableIndexAndDropTemp(connectionPG, targetTableName, targetTempName); + + logger.info("Execute Copy Count=" + count); + } catch (SQLException e) { + logger.info(e.getMessage(), e); + throw new IOException(e.getMessage(), e); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(connectionPG, Transaction.AUTO_COMMIT, null); + } + return true; + } + + private boolean convertPowerOwnerThemeWithCopyAPI(AbstractOracleJobContext context, String targetTableBaseName) + throws IOException { + if (context == null) { + getLogger().info("jobContext is null in convertPowerOwnerThemeWithCopyAPI"); + return false; + } + Connection connection = context.getOracleConnection(); + Connection connectionPG = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + while (connectionPG instanceof DelegatingConnection) { + connectionPG = ((DelegatingConnection) connectionPG).getDelegate(); + } + + if (!(connectionPG instanceof PGConnection)) { + return false; + } + + final int MAX_BATCHSIZE = 250; + ResultSet rs = null; + Statement stmt = null; + try { + // connectionPG.setAutoCommit(false); + String targetTableName = targetTableBaseName + FOWNER_SUFFIX; + String targetTempName = "tmp_" + targetTableName; + logger.info("target table:" + targetTableName); + stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + rs = stmt.executeQuery(FETCH_CONNFDR); + rs.setFetchSize(MAX_BATCHSIZE); + + createOrClearTempTargetTable(connectionPG, targetTempName, + "(tid smallint not null, oid int not null, fowner smallint not null, flow varchar(20) not null)"); + + StringBuilder sb = new StringBuilder(); + + CopyManager cpMgr = ((PGConnection) connectionPG).getCopyAPI(); + PushbackReader reader = new PushbackReader(new StringReader(""), 10240); + + int count = 0; + while (rs.next()) { + int cid = rs.getInt(1); + long oid = rs.getLong(2); + int ownerId = rs.getInt(3); + short dirId = (short) rs.getInt(4); + String flowMark = null; + ConnectivityDirectionEnum dir = ConnectivityDirectionEnum.convertShort(dirId); + if ((ConnectivityDirectionEnum.ForwardflowON == dir) || + (ConnectivityDirectionEnum.ForwardFixflowON == dir)) { + flowMark = FORWARDFLOW_MARK; + + } else if ((ConnectivityDirectionEnum.BackflowON == dir) || + (ConnectivityDirectionEnum.BackFixflowON == dir)) { + flowMark = BACKFLOW_MARK; + } else if (ConnectivityDirectionEnum.Nondeterminate == dir) { + flowMark = NONFLOW_MARK; + } else { + flowMark = UNFLOW_MARK; + } + + if (cid > Short.MAX_VALUE) { + logger.info("Wrong Connectivity Table:" + cid + "-" + oid); + continue; + } + + sb.append(cid).append(','); + sb.append(oid).append(','); + sb.append(ownerId).append(','); + sb.append(flowMark).append('\n'); + + if (count % MAX_BATCHSIZE == 0) { + reader.unread(sb.toString().toCharArray()); + cpMgr.copyIn("COPY " + targetTempName + " FROM STDIN WITH CSV", reader); + sb.delete(0, sb.length()); + } + ++count; + } + + reader.unread(sb.toString().toCharArray()); + cpMgr.copyIn("COPY " + targetTempName + " FROM STDIN WITH CSV", reader); + createTargetTableIndexAndDropTemp(connectionPG, targetTableName, targetTempName); + + logger.info("Execute Copy Count=" + count); + } catch (SQLException e) { + logger.info(e.getMessage(), e); + throw new IOException(e.getMessage(), e); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(connectionPG, Transaction.AUTO_COMMIT, null); + } + return true; + } + + private void createOrClearTempTargetTable(Connection connection, String tableName, String sql) throws SQLException { + Statement stmt = connection.createStatement(); + ResultSet rs = null; + try { + rs = connection.getMetaData().getTables(null, null, tableName, new String[]{"TABLE"}); + if (rs.next()) { + stmt.execute("DROP TABLE " + encodeSchemaTableName(null, tableName) + "CASCADE"); + } + + stmt.executeUpdate("CREATE TEMP TABLE " + encodeSchemaTableName(null, tableName) + " " + sql); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + } + } + + private void createTargetTableIndexAndDropTemp(Connection connection, String tableName, String tempTable) throws SQLException { + Statement stmt = connection.createStatement(); + ResultSet rs = null; + try { + stmt.execute("CREATE TABLE " + tableName +" AS SELECT * FROM " + tempTable); + rs = connection.getMetaData().getTables(null, _pgSchema, tableName, new String[]{"TABLE"}); + if (rs.next()) { + stmt.execute("ALTER TABLE " + encodeSchemaTableName(_pgSchema, tableName) + + " ADD PRIMARY KEY (tid, oid)"); + } + stmt.execute("DROP TABLE " + tempTable); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + } + } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2ShpJob.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2ShpJob.java index 1feb7f8..a01d871 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2ShpJob.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2ShpJob.java @@ -6,14 +6,15 @@ import java.io.FilenameFilter; import java.io.IOException; import java.math.BigDecimal; +import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.channels.FileChannel; +import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.sql.Types; -import java.sql.Connection; import java.util.Date; import org.apache.commons.collections.OrderedMap; @@ -21,8 +22,8 @@ import org.apache.commons.collections.map.LinkedMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.geotools.feature.IllegalAttributeException; import org.geotools.feature.SchemaException; +import org.opengis.feature.IllegalAttributeException; import org.quartz.JobDetail; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; @@ -55,49 +56,41 @@ /** * */ -public class OracleConvertDgn2ShpJob extends AbstractOracleDatabaseJob -{ +public class OracleConvertDgn2ShpJob extends AbstractOracleDatabaseJob { final static Log logger = LogFactory.getLog(OracleConvertDgn2ShpJob.class); private static final int FETCHSIZE = 30; private static final int COMMITSIZE = 20; - class Pair - { + class Pair { Object first; Object second; - public Pair(Object first, Object second) - { + public Pair(Object first, Object second) { this.first = first; this.second = second; } } - GeometryFactory _geomFactory = new GeometryFactory(); - - public Log getLogger() - { + public Log getLogger() { return logger; } - protected AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath) - { - return new OracleConvertShapefilesJobContext(filterPath); + protected AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath, + boolean profileMode, boolean useTransform) { + return new OracleConvertShapefilesJobContext(filterPath, profileMode, useTransform); } - protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException - { + protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException { super.extractJobConfiguration(jobDetail); } - public void execute(JobExecutionContext context) throws JobExecutionException - { + public void execute(JobExecutionContext context) throws JobExecutionException { // Every job has its own job detail JobDetail jobDetail = context.getJobDetail(); // The name is defined in the job definition - String jobName = jobDetail.getName(); + String jobName = jobDetail.getKey().getName(); String targetSchemaName = null; @@ -105,31 +98,31 @@ logger.info(jobName + " fired at " + new Date()); extractJobConfiguration(jobDetail); createSourceDataStore(); - if (getSourceDataStore() == null) - { + if (getSourceDataStore() == null) { throw new JobExecutionException("Cannot connect source oracle database."); } - try - { + try { logger.info("-- step:clearOutputDirectory --"); clearOutputDirectory(); boolean bFirst = isCopyConnectivityMode(); - if (checkConvertDB()) - { + if (checkConvertDB()) { logger.info("-- step:convertOracleDB --"); - for (String orgSchema : _orgSchema) - { - OracleConvertShapefilesJobContext jobContext = (OracleConvertShapefilesJobContext) prepareJobContext(targetSchemaName, _filterPath); + for (String orgSchema : _orgSchema) { + OracleConvertShapefilesJobContext jobContext = (OracleConvertShapefilesJobContext) + prepareJobContext(targetSchemaName, _filterPath, isProfileMode(), isTransformed()); jobContext.setSourceDataStore(getSourceDataStore()); jobContext.setDataPath(_dataPath); jobContext.setConvertElementIn(_convertElementIn); jobContext.setElementLogging(checkElementLogging()); jobContext.setExecutionContext(context); - if (bFirst) - { + fetchTPData(jobContext); + logger.info("TPC DIST:" + jobContext.getDistId() + ":" + + ((jobContext.getDistName() == null) ? "NULL" : jobContext.getDistName())); + + if (bFirst) { copyConnectivity(jobContext); bFirst = false; } @@ -142,59 +135,39 @@ } } - if (checkConvertFile()) - { + if (checkConvertFile()) { logger.info("-- step:convertIndexDesignFile --"); convertIndexDesignFile(context); logger.info("-- step:convertOtherDesignFile --"); convertOtherDesignFile(context); } - if (checkConvertElementIn()) - { + if (checkConvertElementIn()) { logger.info("-- step:convertFeatureDesignFile --"); convertFeatureDesignFile(context); } - if (checkCreateDummy()) - { + if (checkCreateDummy()) { logger.info("-- step:createDummyFeatureFile --"); createDummyFeatureFile(context); } disconnect(); - } catch (SQLException e) - { + } catch (SQLException e) { logger.warn(e.getMessage(), e); throw new JobExecutionException("Database error. " + e.getMessage(), e); - } catch (IOException ex) - { + } catch (IOException ex) { logger.warn(ex.getMessage(), ex); throw new JobExecutionException("IO error. " + ex.getMessage(), ex); } logger.warn(jobName + " end at " + new Date()); } - /** - * Connectivity�ƻs�@�Ӫ����A�b�d�߹q�y��V�ɥΨӤ��OMS��Ʈw���q���s����(Connectivity) - * - * @param jobContext job context - * @throws SQLException sql exception - */ - private void copyConnectivity(OracleConvertShapefilesJobContext jobContext) throws SQLException - { - Connection connection = jobContext.getOracleConnection(); - Statement stmt = connection.createStatement(); - stmt.execute(OracleConvertShapefilesJobContext.TRUNCATE_CONNECTIVITY_WEBCHECK); - stmt.execute(OracleConvertShapefilesJobContext.COPY_CONNECTIVITY_TO_WEBCHECK); - } - private void exetcuteConvert(OracleConvertShapefilesJobContext jobContext, - String querySchema, String dataPath) throws SQLException - { + String querySchema, String dataPath) throws SQLException { int order = 0; OrderedMap map = getBlobStorageList(jobContext.getOracleConnection(), querySchema, "SD$SPACENODES" - , null); + , null); logger.info("begin convert job:[" + map.size() + "]:testmode=" + _testMode); @@ -205,8 +178,7 @@ //jobContext.startTransaction(); jobContext.setCurrentSchema(querySchema); jobContext.getExecutionContext().put("ConvertDgn2ShpJobProgress", 0); - for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext();) - { + for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext();) { it.next(); Pair pair = (Pair) it.getValue(); @@ -217,14 +189,12 @@ order++; - if (_testMode) - { + if (_testMode) { if ((_testCount < 0) || (order >= _testCount)) break; } - if ((order % COMMITSIZE) == 0) - { + if ((order % COMMITSIZE) == 0) { // OracleConnection connection = jobContext.getOracleConnection(); // connection.commitTransaction(); jobContext.commitTransaction(); @@ -234,8 +204,7 @@ } int now = order % step; - if (now != current) - { + if (now != current) { current = now; jobContext.getExecutionContext().put("ConvertDgn2ShpJobProgress", current); @@ -251,8 +220,7 @@ } protected OrderedMap getBlobStorageList(Connection connection, String schemaSrc, String tableSrc, - OrderedMap orderedMap) throws SQLException - { + OrderedMap orderedMap) throws SQLException { if (orderedMap == null) orderedMap = new LinkedMap(99); String fetchStmtFmt = "SELECT SNID, SPACETABLE FROM \"%s\".\"%s\""; @@ -263,17 +231,14 @@ stmt.setFetchSize(FETCHSIZE); - try - { + try { rs = stmt.executeQuery(fetchStmt); int size = rs.getMetaData().getColumnCount(); - while (rs.next()) - { + while (rs.next()) { Object[] values = new Object[size]; - for (int i = 0; i < size; i++) - { + for (int i = 0; i < size; i++) { values[i] = rs.getObject(i + 1); } @@ -286,13 +251,11 @@ else pair.first = name; } - } catch (SQLException e) - { + } catch (SQLException e) { logger.error(e.toString(), e); logger.error("stmt=" + fetchStmt); throw e; - } finally - { + } finally { if (rs != null) rs.close(); stmt.close(); } @@ -301,8 +264,7 @@ } protected OrderedMap getRawFormatStorageList(OracleConnection connection, String schemaSrc, String tableSrc, - OrderedMap orderedMap) throws SQLException - { + OrderedMap orderedMap) throws SQLException { if (orderedMap == null) orderedMap = new LinkedMap(99); String fetchStmtFmt = "SELECT RNID, SPACETABLE FROM \"%s\".\"%s\""; @@ -314,12 +276,10 @@ ResultSet rs = stmt.executeQuery(fetchStmt); int size = rs.getMetaData().getColumnCount(); - while (rs.next()) - { + while (rs.next()) { Object[] values = new Object[size]; - for (int i = 0; i < size; i++) - { + for (int i = 0; i < size; i++) { values[i] = rs.getObject(i + 1); } @@ -340,8 +300,7 @@ } protected void queryIgsetElement(OracleConvertShapefilesJobContext jobContext, - String srcschema, String srctable) throws SQLException - { + String srcschema, String srctable) throws SQLException { Connection connection = jobContext.getOracleConnection(); String fetchSrcStmtFmt = "SELECT IGDSELM FROM \"%s\".\"%s\" ORDER BY ROWID"; PrintfFormat spf = new PrintfFormat(fetchSrcStmtFmt); @@ -352,27 +311,29 @@ ResultSet rsSrc = stmtSrc.executeQuery(fetchSrcStmt); int igdsMetaType = rsSrc.getMetaData().getColumnType(1); - while (rsSrc.next()) - { - byte[] raw; + while (rsSrc.next()) { + byte[] raw = null; - if (igdsMetaType == Types.BLOB) - { + if (igdsMetaType == Types.BLOB) { BLOB blob = (BLOB) rsSrc.getBlob(1); - raw = getBytesFromBLOB(blob); - blob.close(); - } else - { + try { + raw = getBytesFromBLOB(blob); + } catch (BufferOverflowException e) { + logger.warn("Wrong Element Structure-", e); + } finally { + // blob.close(); + } + } else { raw = rsSrc.getBytes(1); } - try - { - Element element = fetchBinaryElement(raw); - jobContext.putFeatureCollection(element); - } catch (Dgn7fileException e) - { + try { + if (raw != null) { + Element element = fetchBinaryElement(raw); + jobContext.putFeatureCollection(element); + } + } catch (Dgn7fileException e) { logger.warn("Dgn7Exception", e); } } @@ -382,8 +343,7 @@ } protected void queryRawElement(OracleConvertShapefilesJobContext jobContext, - String srcschema, String srctable) throws SQLException - { + String srcschema, String srctable) throws SQLException { Connection connection = jobContext.getOracleConnection(); String fetchDestStmtFmt = "SELECT ELEMENT FROM \"%s\".\"%s\" ORDER BY ROWID"; PrintfFormat spf = new PrintfFormat(fetchDestStmtFmt); @@ -394,8 +354,7 @@ ResultSet rsDest = stmtDest.executeQuery(fetchDestStmt); - while (rsDest.next()) - { + while (rsDest.next()) { ARRAY rawsValue = ((OracleResultSet) rsDest).getARRAY(1); long[] rawData = rawsValue.getLongArray(); byte[] comparessedValue; @@ -414,12 +373,10 @@ byte[] rawDest = ByteArrayCompressor.decompressByteArray(comparessedValue); - try - { + try { Element element = fetchBinaryElement(rawDest); jobContext.putFeatureCollection(element); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { logger.warn("Dgn7Exception:" + e.getMessage(), e); } } @@ -429,8 +386,7 @@ } // Binary to Element - private Element fetchBinaryElement(byte[] raws) throws Dgn7fileException - { + private Element fetchBinaryElement(byte[] raws) throws Dgn7fileException { ByteBuffer buffer = ByteBuffer.wrap(raws); buffer.order(ByteOrder.LITTLE_ENDIAN); short signature = buffer.getShort(); @@ -448,35 +404,28 @@ handler = recordType.getElementHandler(); Element dgnElement = (Element) handler.read(buffer, signature, elementLength); - if (recordType.isComplexElement() && (elementLength < raws.length)) - { + if (recordType.isComplexElement() && (elementLength < raws.length)) { int offset = elementLength; - while (offset < (raws.length - 4)) - { + while (offset < (raws.length - 4)) { buffer.position(offset); signature = buffer.getShort(); type = (byte) ((signature >>> 8) & 0x007f); elementLength = (buffer.getShort() * 2) + 4; - if (raws.length < (offset + elementLength)) - { + if (raws.length < (offset + elementLength)) { System.out.println("Length not match:" + offset + ":" + buffer.position() + ":" + buffer.limit()); break; } recordType = ElementType.forID(type); handler = recordType.getElementHandler(); - if (handler != null) - { + if (handler != null) { Element subElement = (Element) handler.read(buffer, signature, elementLength); ((ComplexElement) dgnElement).add(subElement); offset += elementLength; - } else - { + } else { byte[] remain = new byte[buffer.remaining()]; System.arraycopy(raws, offset, remain, 0, buffer.remaining()); - for (int i = 0; i < remain.length; i++) - { - if (remain[i] != 0) - { + for (int i = 0; i < remain.length; i++) { + if (remain[i] != 0) { logger.info("fetch element has some error. index=" + (offset + i) + ":value=" + remain[i]); System.out.println("fetch element has some error. index=" + (offset + i) + ":value=" + remain[i]); } @@ -490,40 +439,34 @@ } /** - * �����ഫ�����ɪ��u�@ + * �����ഫ�����ɪ��u�@ * - * @param context �u�@�������� + * @param context �u�@�������� * @throws org.quartz.JobExecutionException * exception */ - private void convertIndexDesignFile(JobExecutionContext context) throws JobExecutionException - { + private void convertIndexDesignFile(JobExecutionContext context) throws JobExecutionException { File indexDir = new File(getDataPath(), "index"); - if (!indexDir.exists()) - { + if (!indexDir.exists()) { logger.info("index dir=" + indexDir + " not exist."); return; } - if (!indexDir.isDirectory()) - { + if (!indexDir.isDirectory()) { logger.info("index dir=" + indexDir + " is not a directory."); } - File[] dgnFiles = indexDir.listFiles(new FilenameFilter() - { - public boolean accept(File dir, String name) - { + File[] dgnFiles = indexDir.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".dgn"); } }); - for (File dgnFile : dgnFiles) - { - IndexDgnConvertShpJobContext convertContext = new IndexDgnConvertShpJobContext(getDataPath()); + for (File dgnFile : dgnFiles) { + IndexDgnConvertShpJobContext convertContext = new IndexDgnConvertShpJobContext(getDataPath(), isProfileMode(), + isTransformed()); logger.debug("--- start dgnfile-" + dgnFile.toString() + " ---"); - try - { + try { convertContext.setExecutionContext(context); String dgnPaths[] = StringUtils.splitToArray(dgnFile.toString(), File.separator); convertContext.setFilename(dgnPaths[dgnPaths.length - 1]); @@ -540,28 +483,23 @@ convertContext.closeFeatureWriter(); System.gc(); System.runFinalization(); - } catch (FileNotFoundException e) - { + } catch (FileNotFoundException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (SchemaException e) - { + } catch (SchemaException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); @@ -570,98 +508,81 @@ } protected void scanIndexDgnElement(IndexDgnConvertShpJobContext convertContext) - throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException - { + throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); int count = 0; Element lastComplex = null; - while (reader.hasNext()) - { - Dgn7fileReader.Record record = reader.nextElement(); - if (record.element() != null) - { + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { Element element = (Element) record.element(); ElementType type = element.getElementType(); - if ((!type.isComplexElement()) && (!element.isComponentElement())) - { - if (lastComplex != null) - { - processIndexElement(lastComplex, convertContext); - lastComplex = null; - } + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { + processIndexElement(lastComplex, convertContext); + lastComplex = null; + } processIndexElement(element, convertContext); - } else if (element.isComponentElement()) - { - if (lastComplex != null) - { + } else if (element.isComponentElement()) { + if (lastComplex != null) { ((ComplexElement) lastComplex).add(element); } - } else if (type.isComplexElement()) - { - if (lastComplex != null) - { + } else if (type.isComplexElement()) { + if (lastComplex != null) { processIndexElement(lastComplex, convertContext); } - lastComplex = element; + lastComplex = element; } } count++; } - if (lastComplex != null) - { + if (lastComplex != null) { processIndexElement(lastComplex, convertContext); } logger.debug("ElementRecord Count=" + count); } - private void processIndexElement(Element element, IndexDgnConvertShpJobContext convertContext) throws IllegalAttributeException, SchemaException - { - if (element instanceof TextElement) - { + private void processIndexElement(Element element, IndexDgnConvertShpJobContext convertContext) throws IllegalAttributeException, SchemaException { + if (element instanceof TextElement) { convertContext.putFeatureCollection(element); } } /** - * �����ഫ��L�]�p���ɪ��u�@ + * �����ഫ��L�]�p���ɪ��u�@ * * @param context jobContext * @throws org.quartz.JobExecutionException * exception */ - private void convertOtherDesignFile(JobExecutionContext context) throws JobExecutionException - { + private void convertOtherDesignFile(JobExecutionContext context) throws JobExecutionException { File otherDir = new File(getDataPath(), "other"); - if (!otherDir.exists()) - { + if (!otherDir.exists()) { logger.info("other dir=" + otherDir + " not exist."); return; } - if (!otherDir.isDirectory()) - { + if (!otherDir.isDirectory()) { logger.info("other dir=" + otherDir + " is not a directory."); } - File[] dgnFiles = otherDir.listFiles(new FilenameFilter() - { - public boolean accept(File dir, String name) - { + File[] dgnFiles = otherDir.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".dgn"); } }); - for (File dgnFile : dgnFiles) - { - GeneralDgnConvertShpJobContext convertContext = new GeneralDgnConvertShpJobContext(getDataPath()); + for (File dgnFile : dgnFiles) { + GeneralDgnConvertShpJobContext convertContext = new GeneralDgnConvertShpJobContext(getDataPath(), + isProfileMode(), + isTransformed()); logger.info("--- start dgnfile-" + dgnFile.toString() + " ---"); - try - { + try { convertContext.setExecutionContext(context); String dgnPaths[] = StringUtils.splitToArray(dgnFile.toString(), File.separator); convertContext.setFilename(dgnPaths[dgnPaths.length - 1]); @@ -678,28 +599,23 @@ convertContext.closeFeatureWriter(); System.gc(); System.runFinalization(); - } catch (FileNotFoundException e) - { + } catch (FileNotFoundException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (SchemaException e) - { + } catch (SchemaException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); @@ -708,48 +624,38 @@ } public void scanOtherDgnElement(GeneralDgnConvertShpJobContext convertContext) - throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException - { + throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); int count = 0; Element lastComplex = null; - while (reader.hasNext()) - { - Dgn7fileReader.Record record = reader.nextElement(); - if (record.element() != null) - { + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { Element element = (Element) record.element(); ElementType type = element.getElementType(); - if ((!type.isComplexElement()) && (!element.isComponentElement())) - { - if (lastComplex != null) - { - processOtherElement(lastComplex, convertContext); - lastComplex = null; - } + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { + processOtherElement(lastComplex, convertContext); + lastComplex = null; + } processOtherElement(element, convertContext); - } else if (element.isComponentElement()) - { - if (lastComplex != null) - { + } else if (element.isComponentElement()) { + if (lastComplex != null) { ((ComplexElement) lastComplex).add(element); } - } else if (type.isComplexElement()) - { - if (lastComplex != null) - { + } else if (type.isComplexElement()) { + if (lastComplex != null) { processOtherElement(lastComplex, convertContext); } - lastComplex = element; + lastComplex = element; } } count++; } - if (lastComplex != null) - { + if (lastComplex != null) { processOtherElement(lastComplex, convertContext); } @@ -757,57 +663,43 @@ } private void processOtherElement(Element element, GeneralDgnConvertShpJobContext convertContext) - throws IllegalAttributeException, SchemaException - { + throws IllegalAttributeException, SchemaException { convertContext.putFeatureCollection(element); } - private void clearOutputDirectory() - { + private void clearOutputDirectory() { File outDataPath = new File(getDataPath(), OracleConvertShapefilesJobContext.SHPOUTPATH); - if (outDataPath.exists() && outDataPath.isDirectory()) - { + if (outDataPath.exists() && outDataPath.isDirectory()) { deleteFilesInPath(outDataPath); } outDataPath = new File(getDataPath(), IndexDgnConvertShpJobContext.SHPOUTPATH); - if (outDataPath.exists() && outDataPath.isDirectory()) - { + if (outDataPath.exists() && outDataPath.isDirectory()) { deleteFilesInPath(outDataPath); } outDataPath = new File(getDataPath(), GeneralDgnConvertShpJobContext.SHPOUTPATH); - if (outDataPath.exists() && outDataPath.isDirectory()) - { + if (outDataPath.exists() && outDataPath.isDirectory()) { deleteFilesInPath(outDataPath); } } - private void deleteFilesInPath(File outDataPath) - { + private void deleteFilesInPath(File outDataPath) { deleteFilesInPath(outDataPath, true); } - private void deleteFilesInPath(File outDataPath, boolean removeSubDir) - { - if (!outDataPath.isDirectory()) - { + private void deleteFilesInPath(File outDataPath, boolean removeSubDir) { + if (!outDataPath.isDirectory()) { return; } File[] files = outDataPath.listFiles(); - for (File file : files) - { - if (file.isFile()) - { - if (!file.delete()) - { + for (File file : files) { + if (file.isFile()) { + if (!file.delete()) { logger.info("Cannot delete file-" + file.toString()); } - } else if (file.isDirectory()) - { + } else if (file.isDirectory()) { deleteFilesInPath(file, removeSubDir); - if (removeSubDir) - { - if (file.delete()) - { + if (removeSubDir) { + if (file.delete()) { logger.info("Cannot delete dir-" + file.toString()); } } @@ -815,34 +707,29 @@ } } - private void convertFeatureDesignFile(JobExecutionContext context) throws JobExecutionException - { + private void convertFeatureDesignFile(JobExecutionContext context) throws JobExecutionException { File elminDir = new File(getDataPath(), "elmin"); - if (!elminDir.exists()) - { + if (!elminDir.exists()) { logger.info("elmin dir=" + elminDir + " not exist."); return; } - if (!elminDir.isDirectory()) - { + if (!elminDir.isDirectory()) { logger.info("elmin dir=" + elminDir + " is not a directory."); } - File[] dgnFiles = elminDir.listFiles(new FilenameFilter() - { - public boolean accept(File dir, String name) - { + File[] dgnFiles = elminDir.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".dgn"); } }); - for (File dgnFile : dgnFiles) - { - FeatureDgnConvertShpJobContext convertContext = new FeatureDgnConvertShpJobContext(getDataPath(), _filterPath); + for (File dgnFile : dgnFiles) { + FeatureDgnConvertShpJobContext convertContext = new FeatureDgnConvertShpJobContext(getDataPath(), _filterPath, + isProfileMode(), + isTransformed()); logger.info("--- start dgnfile-" + dgnFile.toString() + " ---"); - try - { + try { convertContext.setExecutionContext(context); String dgnPaths[] = StringUtils.splitToArray(dgnFile.toString(), File.separator); convertContext.setFilename(dgnPaths[dgnPaths.length - 1]); @@ -859,28 +746,23 @@ convertContext.closeFeatureWriter(); System.gc(); System.runFinalization(); - } catch (FileNotFoundException e) - { + } catch (FileNotFoundException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); - } catch (SchemaException e) - { + } catch (SchemaException e) { convertContext.rollbackTransaction(); logger.warn(e.getMessage(), e); throw new JobExecutionException(e.getMessage(), e); @@ -889,61 +771,49 @@ } public void scanFeatureDgnElement(FeatureDgnConvertShpJobContext convertContext) - throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException - { + throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); int count = 0; Element lastComplex = null; - while (reader.hasNext()) - { - Dgn7fileReader.Record record = reader.nextElement(); - if (record.element() != null) - { + while (reader.hasNext()) { + Element.FileRecord record = reader.nextElement(); + if (record.element() != null) { Element element = (Element) record.element(); ElementType type = element.getElementType(); - if ((!type.isComplexElement()) && (!element.isComponentElement())) - { - if (lastComplex != null) - { - processFeatureElement(lastComplex, convertContext); - lastComplex = null; - } + if ((!type.isComplexElement()) && (!element.isComponentElement())) { + if (lastComplex != null) { + processFeatureElement(lastComplex, convertContext); + lastComplex = null; + } processFeatureElement(element, convertContext); - } else if (element.isComponentElement()) - { - if (lastComplex != null) - { + } else if (element.isComponentElement()) { + if (lastComplex != null) { ((ComplexElement) lastComplex).add(element); } - } else if (type.isComplexElement()) - { - if (lastComplex != null) - { + } else if (type.isComplexElement()) { + if (lastComplex != null) { processFeatureElement(lastComplex, convertContext); } - lastComplex = element; + lastComplex = element; } } count++; } - if (lastComplex != null) - { + if (lastComplex != null) { processFeatureElement(lastComplex, convertContext); } logger.debug("ElementRecord Count=" + count); } private void processFeatureElement(Element element, FeatureDgnConvertShpJobContext convertContext) - throws IllegalAttributeException, SchemaException - { + throws IllegalAttributeException, SchemaException { convertContext.putFeatureCollection(element); } - private void createDummyFeatureFile(JobExecutionContext context) throws JobExecutionException - { + private void createDummyFeatureFile(JobExecutionContext context) throws JobExecutionException { /* DummyFeatureConvertShpJobContext convertContext = new DummyFeatureConvertShpJobContext(getDataPath(), _filterPath); try { diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleElementLogger.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleElementLogger.java index 8615537..542d36e 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleElementLogger.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleElementLogger.java @@ -25,18 +25,17 @@ import com.ximple.io.dgn7.ArcElement; import com.ximple.io.dgn7.ComplexChainElement; import com.ximple.io.dgn7.ComplexShapeElement; +import com.ximple.io.dgn7.Dgn7fileException; import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.EllipseElement; +import com.ximple.io.dgn7.IElementHandler; import com.ximple.io.dgn7.LineElement; import com.ximple.io.dgn7.LineStringElement; import com.ximple.io.dgn7.ShapeElement; import com.ximple.io.dgn7.TextElement; import com.ximple.io.dgn7.TextNodeElement; -import com.ximple.io.dgn7.IElementHandler; -import com.ximple.io.dgn7.Dgn7fileException; -public class OracleElementLogger -{ +public class OracleElementLogger { static Log logger = LogFactory.getLog(OracleElementLogger.class); private static final String DEFAULT_ELMOUTPATH = "elmout"; private static final String TAB_IGDSSEED = "SD$IGDSSET_SEED"; @@ -56,42 +55,34 @@ private String elmOutPath; private String prefix = null; - public OracleElementLogger(Connection connection) - { + public OracleElementLogger(Connection connection) { this.connection = connection; elmOutPath = DEFAULT_ELMOUTPATH; } - public OracleElementLogger(Connection connection, String elmOutPath) - { + public OracleElementLogger(Connection connection, String elmOutPath) { this.connection = connection; this.elmOutPath = elmOutPath; } - public OracleElementLogger(Connection connection, int maxCount) - { + public OracleElementLogger(Connection connection, int maxCount) { this.connection = connection; elmOutPath = DEFAULT_ELMOUTPATH; this.maxElmCount = maxCount; } - public OracleElementLogger(Connection connection, String elmOutPath, int maxCount) - { + public OracleElementLogger(Connection connection, String elmOutPath, int maxCount) { this.connection = connection; this.elmOutPath = elmOutPath; this.maxElmCount = maxCount; } - - public String getDataOutPath() - { - if (dataOut == null) - { + + public String getDataOutPath() { + if (dataOut == null) { File outPath = new File(getDataPath(), elmOutPath); - if (!outPath.exists()) - { + if (!outPath.exists()) { outPath.mkdir(); - } else if (!outPath.isDirectory()) - { + } else if (!outPath.isDirectory()) { outPath.mkdir(); } dataOut = outPath.toString(); @@ -99,48 +90,36 @@ return dataOut; } - public String getDataPath() - { + public String getDataPath() { return dataPath; } - public void setDataPath(String dataPath) - { + public void setDataPath(String dataPath) { this.dataPath = dataPath; } - public void logElement(Element element, String currentSchema) - { + public void logElement(Element element, String currentSchema) { if ((this.currentSchema == null) || - (!this.currentSchema.equalsIgnoreCase(currentSchema))) - { + (!this.currentSchema.equalsIgnoreCase(currentSchema))) { schemaChanged = true; this.currentSchema = currentSchema; - try - { + try { createNewStream(); - } catch (IOException e) - { + } catch (IOException e) { logger.warn(e.getMessage(), e); return; - } catch (SQLException e) - { + } catch (SQLException e) { logger.warn(e.getMessage(), e); return; } - } else - { - if (fch == null) - { - try - { + } else { + if (fch == null) { + try { createNewStream(); - } catch (IOException e) - { + } catch (IOException e) { logger.warn(e.getMessage(), e); return; - } catch (SQLException e) - { + } catch (SQLException e) { logger.warn(e.getMessage(), e); return; } @@ -148,151 +127,121 @@ } ArrayList<ByteBuffer> subBuffers = new ArrayList<ByteBuffer>(); - if (fch != null) - { + if (fch != null) { ByteBuffer buf = null; - if (element instanceof LineElement) - { + if (element instanceof LineElement) { int size = LineElement.ElementHandler.getInstance().getLength(element); buf = ByteBuffer.allocate(size * 2); LineElement.ElementHandler.getInstance().write(buf, element); - } else if (element instanceof ShapeElement) - { + } else if (element instanceof ShapeElement) { int size = ShapeElement.ElementHandler.getInstance().getLength(element); buf = ByteBuffer.allocate(size * 2); ShapeElement.ElementHandler.getInstance().write(buf, element); - } else if (element instanceof LineStringElement) - { + } else if (element instanceof LineStringElement) { int size = LineStringElement.ElementHandler.getInstance().getLength(element); buf = ByteBuffer.allocate(size * 2); LineStringElement.ElementHandler.getInstance().write(buf, element); - } else if (element instanceof ComplexChainElement) - { + } else if (element instanceof ComplexChainElement) { int size = ComplexChainElement.ElementHandler.getInstance().getLength(element); buf = ByteBuffer.allocate(size * 2); ComplexChainElement.ElementHandler.getInstance().write(buf, element); ComplexChainElement complexElement = (ComplexChainElement) element; ListIterator it = complexElement.listIterator(); - while (it.hasNext()) - { + while (it.hasNext()) { Element subElm = (Element) it.next(); - try - { + try { IElementHandler handler = subElm.getElementType().getElementHandler(); size = handler.getLength(subElm); ByteBuffer subBuf = ByteBuffer.allocate(size * 2); handler.write(subBuf, subElm); subBuffers.add(subBuf); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { logger.warn(e.getMessage(), e); } } - } else if (element instanceof ComplexShapeElement) - { + } else if (element instanceof ComplexShapeElement) { int size = ComplexShapeElement.ElementHandler.getInstance().getLength(element); buf = ByteBuffer.allocate(size * 2); ComplexShapeElement.ElementHandler.getInstance().write(buf, element); ComplexShapeElement complexElement = (ComplexShapeElement) element; ListIterator it = complexElement.listIterator(); - while (it.hasNext()) - { + while (it.hasNext()) { Element subElm = (Element) it.next(); - try - { + try { IElementHandler handler = subElm.getElementType().getElementHandler(); size = handler.getLength(subElm); ByteBuffer subBuf = ByteBuffer.allocate(size * 2); handler.write(subBuf, subElm); subBuffers.add(subBuf); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { logger.warn(e.getMessage(), e); } } - } else if (element instanceof ArcElement) - { + } else if (element instanceof ArcElement) { int size = ArcElement.ElementHandler.getInstance().getLength(element); buf = ByteBuffer.allocate(size * 2); ArcElement.ElementHandler.getInstance().write(buf, element); - } else if (element instanceof EllipseElement) - { + } else if (element instanceof EllipseElement) { int size = EllipseElement.ElementHandler.getInstance().getLength(element); buf = ByteBuffer.allocate(size * 2); EllipseElement.ElementHandler.getInstance().write(buf, element); - } else if (element instanceof TextElement) - { + } else if (element instanceof TextElement) { int size = TextElement.ElementHandler.getInstance().getLength(element); buf = ByteBuffer.allocate(size * 2); TextElement.ElementHandler.getInstance().write(buf, element); - } else if (element instanceof TextNodeElement) - { + } else if (element instanceof TextNodeElement) { int size = TextNodeElement.ElementHandler.getInstance().getLength(element); buf = ByteBuffer.allocate(size * 2); TextNodeElement.ElementHandler.getInstance().write(buf, element); TextNodeElement nodeElement = (TextNodeElement) element; ListIterator it = nodeElement.listIterator(); - while (it.hasNext()) - { + while (it.hasNext()) { Element subElm = (Element) it.next(); - try - { + try { IElementHandler handler = subElm.getElementType().getElementHandler(); size = handler.getLength(subElm); ByteBuffer subBuf = ByteBuffer.allocate(size * 2); handler.write(subBuf, subElm); subBuffers.add(subBuf); - } catch (Dgn7fileException e) - { + } catch (Dgn7fileException e) { logger.warn(e.getMessage(), e); } } } - if ((buf != null) && (fch != null)) - { - try - { + if ((buf != null) && (fch != null)) { + try { buf.position(0); int size = fch.write(buf); - if (size != buf.limit()) - { + if (size != buf.limit()) { long position = fch.position(); logger.info("Pos:" + position); } - } catch (IOException e) - { + } catch (IOException e) { logger.warn(e.getMessage(), e); } } } elmCount++; - if ((subBuffers.size() != 0) && (fch != null)) - { - for (ByteBuffer buf : subBuffers) - { - try - { + if ((subBuffers.size() != 0) && (fch != null)) { + for (ByteBuffer buf : subBuffers) { + try { buf.position(0); int size = fch.write(buf); - if (size != buf.limit()) - { + if (size != buf.limit()) { long position = fch.position(); logger.info("Pos:" + position); } - } catch (IOException e) - { + } catch (IOException e) { logger.warn(e.getMessage(), e); } } } } - private void createNewStream() throws IOException, SQLException - { - if (fos != null) - { + private void createNewStream() throws IOException, SQLException { + if (fos != null) { putEndOfFileElement(); fos.close(); fos = null; @@ -300,16 +249,13 @@ } String outLogName = currentSchema + ".dgn"; - if (prefix != null) - { + if (prefix != null) { outLogName = prefix + outLogName; } File logFile = new File(getDataOutPath(), outLogName); - while (logFile.exists()) - { + while (logFile.exists()) { outLogName = this.currentSchema + "-" + (++logCount) + ".dgn"; - if (prefix != null) - { + if (prefix != null) { outLogName = prefix + outLogName; } @@ -324,8 +270,7 @@ elmCount = 0; } - private void putEndOfFileElement() throws IOException - { + private void putEndOfFileElement() throws IOException { if (fch == null) return; ByteBuffer bf = ByteBuffer.allocate(4); @@ -333,18 +278,14 @@ fch.write(bf); } - private void prepareOutputElementStream() throws SQLException, IOException - { - if (connection == null) - { + private void prepareOutputElementStream() throws SQLException, IOException { + if (connection == null) { logger.warn("connection is null"); return; } - if (dgnFileHeader != null) - { - for (byte[] raw : dgnFileHeader) - { + if (dgnFileHeader != null) { + for (byte[] raw : dgnFileHeader) { putElementIntoStream(raw); } return; @@ -358,23 +299,19 @@ ResultSet rsSrc = stmtSrc.executeQuery(fetchSrcStmt); int igdsMetaType = rsSrc.getMetaData().getColumnType(1); - while (rsSrc.next()) - { + while (rsSrc.next()) { byte[] raw; - if (igdsMetaType == Types.BLOB) - { + if (igdsMetaType == Types.BLOB) { BLOB blob = (BLOB) rsSrc.getBlob(1); raw = getBytesFromBLOB(blob); - blob.close(); - } else - { + // blob.close(); + } else { raw = rsSrc.getBytes(1); } - if (raw != null) - { + if (raw != null) { dgnFileHeader.add(raw); putElementIntoStream(raw); } @@ -383,14 +320,12 @@ stmtSrc.close(); } - private void putElementIntoStream(byte[] raw) throws IOException - { + private void putElementIntoStream(byte[] raw) throws IOException { if (fch != null) fch.write(ByteBuffer.wrap(raw)); } - protected static byte[] getBytesFromBLOB(BLOB blob) throws SQLException - { + protected byte[] getBytesFromBLOB(BLOB blob) throws SQLException { byte[] raw = null; int optimalSize = blob.getChunkSize(); @@ -399,48 +334,44 @@ ByteBuffer buffer = null; // ByteBuffer.allocate(optimalSize); int len; - try - { - while ((len = (is.read(chunk))) != -1) - { - if (buffer != null) - { + try { + while ((len = (is.read(chunk))) != -1) { + if (buffer != null) { buffer.limit(buffer.limit() + len); - } else - { + } else { buffer = ByteBuffer.allocate(len); } buffer.put(chunk); } - is.close(); assert buffer != null; buffer.position(0); raw = buffer.array(); - } catch (IOException e) - { + } catch (IOException e) { logger.warn(e.getMessage(), e); Assert.shouldNeverReachHere(); + } finally { + try { + is.close(); + } catch (IOException e) { + logger.warn("InputStream cannot close", e); + } + ; } return raw; } - public void flashLogging() - { - if ((useElementCount) && (elmCount < maxElmCount)) - { + public void flashLogging() { + if ((useElementCount) && (elmCount < maxElmCount)) { return; } - if (fos != null) - { - try - { + if (fos != null) { + try { putEndOfFileElement(); fos.close(); - } catch (IOException e) - { + } catch (IOException e) { logger.warn(e.getMessage(), e); } fos = null; @@ -449,43 +380,35 @@ } } - public boolean isSchemaChanged() - { + public boolean isSchemaChanged() { return schemaChanged; } - public boolean isUseElementCount() - { + public boolean isUseElementCount() { return useElementCount; } - public void setUseElementCount(boolean useElementCount) - { + public void setUseElementCount(boolean useElementCount) { this.useElementCount = useElementCount; } - public int getElmCount() - { + public int getElmCount() { return elmCount; } - public int getMaxElmCount() - { + public int getMaxElmCount() { return maxElmCount; } - public void setMaxElmCount(int maxElmCount) - { + public void setMaxElmCount(int maxElmCount) { this.maxElmCount = maxElmCount; } - public String getLogPrefix() - { + public String getLogPrefix() { return prefix; } - public void setLogPrefix(String prefix) - { + public void setLogPrefix(String prefix) { this.prefix = prefix; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleIncrementDgn2PostGISJob.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleIncrementDgn2PostGISJob.java new file mode 100644 index 0000000..8570254 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleIncrementDgn2PostGISJob.java @@ -0,0 +1,552 @@ +package com.ximple.eofms.jobs; + +import java.io.IOException; +import java.nio.BufferOverflowException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.Types; +import java.util.ArrayList; +import java.util.Date; +import java.util.Map; +import java.util.TreeMap; +import java.util.logging.Logger; + +import com.ximple.eofms.jobs.context.AbstractOracleJobContext; +import com.ximple.eofms.jobs.context.postgis.OracleIncrementPostGISJobContext; +import com.ximple.io.dgn7.ComplexElement; +import com.ximple.io.dgn7.Dgn7fileException; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.ElementType; +import com.ximple.io.dgn7.FrammeAttributeData; +import com.ximple.io.dgn7.IElementHandler; +import com.ximple.util.PrintfFormat; +import oracle.sql.BLOB; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.geotools.data.DataStore; +import org.geotools.data.Transaction; +import org.geotools.data.jdbc.JDBCUtils; +import org.geotools.data.postgis.PostgisNGDataStoreFactory; +import org.geotools.jdbc.JDBCDataStore; +import org.quartz.JobDataMap; +import org.quartz.JobDetail; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +import static com.ximple.eofms.jobs.context.postgis.OracleIncrementPostGISJobContext.*; + +public class OracleIncrementDgn2PostGISJob extends AbstractOracleDatabaseJob { + final static Log logger = LogFactory.getLog(OracleIncrementDgn2PostGISJob.class); + + private static final String PGHOST = "PGHOST"; + private static final String PGDATBASE = "PGDATBASE"; + private static final String PGPORT = "PGPORT"; + private static final String PGSCHEMA = "PGSCHEMA"; + private static final String PGUSER = "PGUSER"; + private static final String PGPASS = "PGPASS"; + private static final String USEWKB = "USEWKB"; + + private static final int FETCHSIZE = 30; + private static final int COMMITSIZE = 100; + + protected static PostgisNGDataStoreFactory dataStoreFactory = new PostgisNGDataStoreFactory(); + + protected String _pgHost; + protected String _pgDatabase; + protected String _pgPort; + protected String _pgSchema; + protected String _pgUsername; + protected String _pgPassword; + protected String _pgUseWKB; + + protected Map<String, String> pgProperties; + protected JDBCDataStore targetDataStore; + + private long queryTime = 0; + private long queryTimeStart = 0; + + public final void accumulateQueryTime() { + queryTime += System.currentTimeMillis() - queryTimeStart; + } + + public long getQueryTime() { + return queryTime; + } + + public final void markQueryTime() { + queryTimeStart = System.currentTimeMillis(); + } + + public final void resetQueryTime() { + queryTime = 0; + } + + @Override + public Log getLogger() { + return logger; + } + + public DataStore getTargetDataStore() { + return targetDataStore; + } + + @Override + protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException { + super.extractJobConfiguration(jobDetail); + JobDataMap dataMap = jobDetail.getJobDataMap(); + _pgHost = dataMap.getString(PGHOST); + _pgDatabase = dataMap.getString(PGDATBASE); + _pgPort = dataMap.getString(PGPORT); + _pgSchema = dataMap.getString(PGSCHEMA); + _pgUsername = dataMap.getString(PGUSER); + _pgPassword = dataMap.getString(PGPASS); + _pgUseWKB = dataMap.getString(USEWKB); + + Log logger = getLogger(); + if (_pgHost == null) { + logger.warn("PGHOST is null"); + throw new JobExecutionException("Unknown PostGIS host."); + } + if (_pgDatabase == null) { + logger.warn("PGDATABASE is null"); + throw new JobExecutionException("Unknown PostGIS database."); + } + if (_pgPort == null) { + logger.warn("PGPORT is null"); + throw new JobExecutionException("Unknown PostGIS port."); + } + if (_pgSchema == null) { + logger.warn("PGSCHEMA is null"); + throw new JobExecutionException("Unknown PostGIS schema."); + } + if (_pgUsername == null) { + logger.warn("PGUSERNAME is null"); + throw new JobExecutionException("Unknown PostGIS username."); + } + if (_pgPassword == null) { + logger.warn("PGPASSWORD is null"); + throw new JobExecutionException("Unknown PostGIS password."); + } + + Map<String, String> remote = new TreeMap<String, String>(); + remote.put(PostgisNGDataStoreFactory.DBTYPE.key, "postgis"); + // remote.put("charset", "UTF-8"); + remote.put(PostgisNGDataStoreFactory.HOST.key, _pgHost); + remote.put(PostgisNGDataStoreFactory.PORT.key, _pgPort); + remote.put(PostgisNGDataStoreFactory.DATABASE.key, _pgDatabase); + remote.put(PostgisNGDataStoreFactory.USER.key, _pgUsername); + remote.put(PostgisNGDataStoreFactory.PASSWD.key, _pgPassword); + // remote.put( "namespace", null); + pgProperties = remote; + } + + @Override + protected AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath, boolean profileMode, boolean useTransform) { + return new OracleIncrementPostGISJobContext(getDataPath(), + getTargetDataStore(), targetSchemaName, filterPath, profileMode, useTransform); + } + + protected void createTargetDataStore() throws JobExecutionException { + if (targetDataStore != null) { + targetDataStore.dispose(); + targetDataStore = null; + } + + /* + if (!isDriverFound()) + { + throw new JobExecutionException("Oracle JDBC Driver not found.-" + JDBC_DRIVER); + } + */ + + if (!pgProperties.containsKey(PostgisNGDataStoreFactory.MAXCONN.key)) { + pgProperties.put(PostgisNGDataStoreFactory.MAXCONN.key, "5"); + } + + if (!pgProperties.containsKey(PostgisNGDataStoreFactory.MINCONN.key)) { + pgProperties.put(PostgisNGDataStoreFactory.MINCONN.key, "1"); + } + + /* + if (!pgProperties.containsKey(PostgisNGDataStoreFactory.WKBENABLED.key)) { + pgProperties.put(PostgisNGDataStoreFactory.WKBENABLED.key, "true"); + } + */ + + if (!dataStoreFactory.canProcess(pgProperties)) { + getLogger().warn("cannot process properties-"); + throw new JobExecutionException("cannot process properties-"); + } + try { + targetDataStore = dataStoreFactory.createDataStore(pgProperties); + } catch (IOException e) { + getLogger().warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } + } + + @Override + protected void disconnect() { + super.disconnect(); + if (targetDataStore != null) { + targetDataStore.dispose(); + targetDataStore = null; + } + } + + private void logTimeDiff(String message, long tBefore, long tCurrent) { + logger.warn(message + ":use time = " + ((int) ((tCurrent - tBefore) / 60000.0)) + " min - " + + (((int) ((tCurrent - tBefore) % 60000.0)) / 1000) + " sec"); + } + + @Override + public void execute(JobExecutionContext context) throws JobExecutionException { + // Every job has its own job detail + JobDetail jobDetail = context.getJobDetail(); + + // The name is defined in the job definition + String jobName = jobDetail.getKey().getName(); + + // Log the time the job started + logger.info(jobName + " fired at " + new Date()); + + createSourceDataStore(); + createTargetDataStore(); + if (getSourceDataStore() == null) { + logger.warn("Cannot connect source oracle database."); + throw new JobExecutionException("Cannot connect source oracle database."); + } + + if (getTargetDataStore() == null) { + logger.warn("Cannot connect source postgreSQL database."); + throw new JobExecutionException("Cannot connect source postgreSQL database."); + } + + if (isProfileMode()) { + queryTime = 0; + } + + long t1 = System.currentTimeMillis(); + String targetSchemaName, targetThemeTable; + + try { + logger.info("-- step:incrementConvertOracleDB --"); + targetSchemaName = determineCurrentTargetSchemaName(); + if (targetSchemaName == null) return; + + OracleIncrementPostGISJobContext jobContext = null; + + jobContext = (OracleIncrementPostGISJobContext) prepareJobContext(targetSchemaName, _filterPath, + isProfileMode(), isTransformed()); + jobContext.setSourceDataStore(getSourceDataStore()); + jobContext.setElementLogging(checkElementLogging()); + jobContext.setExecutionContext(context); + + long tStep = System.currentTimeMillis(); + fetchTPData(jobContext); + logger.info("TPC DIST:" + jobContext.getDistId() + ":" + + ((jobContext.getDistName() == null) ? "NULL" : jobContext.getDistName())); + + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-Copy Connectivity", tStep, tStepEnd); + } + + if (isProfileMode()) { + jobContext.resetProcessTime(); + jobContext.resetUpdateTime(); + } + tStep = System.currentTimeMillis(); + exetcuteIncrementConvert(jobContext, _dataPath); + + //close all open filewriter instance + jobContext.closeFeatureWriter(); + + if (isProfileMode()) { + logger.warn("Profile-Current Query Oracle Cost-" + + ((int) ((getQueryTime()) / 60000.0)) + " min - " + + (((int) ((getQueryTime()) % 60000.0)) / 1000) + " sec"); + long tStepEnd = System.currentTimeMillis(); + logger.warn("Profile-Current Process Cost-" + + ((int) ((getProcessTime()) / 60000.0)) + " min - " + + (((int) ((getProcessTime()) % 60000.0)) / 1000) + " sec"); + logger.warn("Profile-Current Update Cost-" + + ((int) ((getUpdateTime()) / 60000.0)) + " min - " + + (((int) ((getUpdateTime()) % 60000.0)) / 1000) + " sec"); + logger.warn("Profile-Current JobContext Process Cost-" + + ((int) ((jobContext.getProcessTime()) / 60000.0)) + " min - " + + (((int) ((jobContext.getProcessTime()) % 60000.0)) / 1000) + " sec"); + logger.warn("Profile-Current JobContext Update Cost-" + + ((int) ((jobContext.getUpdateTime()) / 60000.0)) + " min - " + + (((int) ((jobContext.getUpdateTime()) % 60000.0)) / 1000) + " sec"); + logTimeDiff("Profile-Convert[ Increment ]", tStep, tStepEnd); + + resetQueryTime(); + resetProcessTime(); + resetUpdateTime(); + } + + jobContext.closeOracleConnection(); + + long t2 = System.currentTimeMillis(); + // public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss"; + // SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); + logTimeDiff("Total ", t1, t2); + + } catch (SQLException e) { + disconnect(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException("Database error. " + e.getMessage(), e); + } catch (IOException ex) { + disconnect(); + logger.warn(ex.getMessage(), ex); + throw new JobExecutionException("IO error. " + ex.getMessage(), ex); + } finally { + disconnect(); + } + logger.warn(jobName + " end at " + new Date()); + } + + private String determineCurrentTargetSchemaName() throws IOException { + if (targetDataStore == null) return null; + Connection connection = null; + Statement stmt = null; + ResultSet rs = null; + String targetSchema = null; + boolean needCreate = false; + try { + connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + // Create XGVERSIONTABLE_NAME + rs = connection.getMetaData().getTables(null, _pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME, new String[]{"TABLE"}); + if (!rs.next()) needCreate = true; + rs.close(); + if (needCreate) return null; + + StringBuilder sbSQL = new StringBuilder("SELECT "); + sbSQL.append("vsschema, vsstatus FROM "); + sbSQL.append(encodeSchemaTableName(_pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME)).append(' '); + sbSQL.append("ORDER BY vsid"); + stmt = connection.createStatement(); + rs = stmt.executeQuery(sbSQL.toString()); + ArrayList<Object[]> tmpSchemas = new ArrayList<Object[]>(); + int i = 0; + int current = -1; + while (rs.next()) { + Object[] values = new Object[2]; + values[0] = rs.getString("vsschema"); + values[1] = rs.getShort("vsstatus"); + tmpSchemas.add(values); + if ((((Short) values[1]) & DataReposVersionManager.VSSTATUS_USING) != 0) { + current = i; + } + i++; + } + + if (current != -1) { + Object[] values = tmpSchemas.get(current); + targetSchema = (String) values[0]; + } + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); + } + return targetSchema; + } + + public String encodeSchemaTableName(String schemaName, String tableName) { + if (schemaName == null) + return "\"" + tableName + "\""; + return "\"" + schemaName + "\".\"" + tableName + "\""; + } + + /** + * CREATE TABLE CMMS_POSTDB.GEO_EXCHANGE + * ( + * ID NUMBER NOT NULL, + * TAG_LUFID NUMBER(10) NOT NULL, + * TAG_SFSC NUMBER(5) NOT NULL, + * TAG_BCOMPID NUMBER(3) NOT NULL, + * TAG_SOCCID NUMBER(5) NOT NULL, + * STATUS NUMBER(3) NOT NULL, + * IGDSELM BLOB, + * UPDATETIME DATE DEFAULT sysdate NOT NULL, + * TASKID NUMBER(10) NOT NULL, + * ISEXCHANGE NUMBER DEFAULT 0 NOT NULL + * ) + * + * STATUS 欄位 :0:新增 2:編輯 3:刪除設備 4:刪除元件 + * ISEXCHANGE 欄位:0 未同步 1已同步 或者已同步就刪除 + * + * + * @param jobContext + * @param targetSchemaName + * @throws SQLException + */ + private void exetcuteIncrementConvert(OracleIncrementPostGISJobContext jobContext, String targetSchemaName) throws SQLException { + + Connection connection = jobContext.getOracleConnection(); + if (connection == null) { + logger.warn("Cannot Get Oracle Connection for DMMS."); + return; + } + + // SELECT COUNT(*) FROM CMMS_POSTDB.GEO_EXCHANGE WHERE ISEXCHANGE <> 0 + int exchangeCount = fetchExchangeCount(connection); + try { + processIncrementElement(jobContext); + // jobContext.setCurrentSchema(querySchema); + } finally { + } + + } + + private int fetchExchangeCount(Connection connection) throws SQLException { + // SELECT COUNT(*) FROM CMMS_POSTDB.GEO_EXCHANGE WHERE ISEXCHANGE <> 0 + Statement stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + ResultSet rs = null; + StringBuilder sbSQL = new StringBuilder(); + sbSQL.append("SELECT COUNT(*) FROM \"CMMS_POSTDB\".\"GEO_EXCHANGE\" WHERE ISEXCHANGE <> 0"); + + int size = -1; + try { + stmt = connection.createStatement(); + rs = stmt.executeQuery(sbSQL.toString()); + if (rs.next()) { + size = (int) rs.getLong(1); + } + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + } + + return size; + } + + static class IncrementRecord { + Element element; + }; + + private void processIncrementElement(OracleIncrementPostGISJobContext jobContext) throws SQLException { + Connection connection = jobContext.getOracleConnection(); + + // SELECT TAG_LUFID, TAG_SFSC, TAG_BCOMPID, TAG_SOCCID, STATUS, IGDSELM + // FROM CMMS_POSTDB.GEO_EXCHANGE ORDER BY UPDATETIME WHERE ISEXCHANGE <> 0 + String fetchSrcStmtFmt = "SELECT TAG_LUFID, TAG_SFSC, TAG_BCOMPID, TAG_SOCCID, STATUS, TASKID IGDSELM " + + "FROM \"%s\".\"%s\" ORDER BY UPDATETIME WHERE ISEXCHANGE <> 0"; + //String fetchSrcStmtFmt = "SELECT IGDSELM FROM \"%s\".\"%s\" WHERE TAG_SFSC = 423 AND TAG_LUFID = 21612065 ORDER BY ROWID"; + PrintfFormat spf = new PrintfFormat(fetchSrcStmtFmt); + String fetchSrcStmt = spf.sprintf(new Object[]{"CMMS_POSTDB", "GEO_EXCHANGE"}); + Statement stmtSrc = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + + stmtSrc.setFetchSize(FETCHSIZE); + ResultSet rsSrc = stmtSrc.executeQuery(fetchSrcStmt); + int igdsMetaType = rsSrc.getMetaData().getColumnType(1); + while (rsSrc.next()) { + if (isProfileMode()) { + markQueryTime(); + } + ElementTransactionContext xContext = new ElementTransactionContext(); + xContext.oid = rsSrc.getInt(1); + xContext.cid = (short) rsSrc.getInt(2); + xContext.compid = (short) rsSrc.getInt(3); + xContext.occid = (short) rsSrc.getInt(4); + xContext.transcationType = rsSrc.getInt(5); + xContext.taskid = rsSrc.getInt(6); + + try { + if (xContext.transcationType > 2) { + byte[] raw = null; + if (igdsMetaType == Types.BLOB) { + BLOB blob = (BLOB) rsSrc.getBlob(7); + + try { + raw = getBytesFromBLOB(blob); + } catch (BufferOverflowException e) { + logger.warn("Wrong Element Structure-", e); + } finally { + // blob.close(); + } + } else { + raw = rsSrc.getBytes(7); + } + if (raw != null) { + Element element = fetchBinaryElement(raw); + if (isProfileMode()) { + accumulateQueryTime(); + } + xContext.element = element; + } else { + if (isProfileMode()) { + accumulateQueryTime(); + } + } + } + jobContext.putFeatureCollection(xContext); + } catch (Dgn7fileException e) { + logger.warn("Dgn7Exception", e); + } + } + + JDBCUtils.close(rsSrc); + JDBCUtils.close(stmtSrc); + } + + // Binary to Element + private Element fetchBinaryElement(byte[] raws) throws Dgn7fileException { + ByteBuffer buffer = ByteBuffer.wrap(raws); + buffer.order(ByteOrder.LITTLE_ENDIAN); + short signature = buffer.getShort(); + + // byte type = (byte) (buffer.get() & 0x7f); + byte type = (byte) ((signature >>> 8) & 0x007f); + + // silly Bentley say contentLength is in 2-byte words + // and ByteByffer uses raws. + // track the record location + int elementLength = (buffer.getShort() * 2) + 4; + ElementType recordType = ElementType.forID(type); + IElementHandler handler; + + handler = recordType.getElementHandler(); + + Element dgnElement = (Element) handler.read(buffer, signature, elementLength); + if (recordType.isComplexElement() && (elementLength < raws.length)) { + int offset = elementLength; + while (offset < (raws.length - 4)) { + buffer.position(offset); + signature = buffer.getShort(); + type = (byte) ((signature >>> 8) & 0x007f); + elementLength = (buffer.getShort() * 2) + 4; + if (raws.length < (offset + elementLength)) { + logger.debug("Length not match:" + offset + ":" + buffer.position() + ":" + buffer.limit()); + break; + } + recordType = ElementType.forID(type); + handler = recordType.getElementHandler(); + if (handler != null) { + Element subElement = (Element) handler.read(buffer, signature, elementLength); + ((ComplexElement) dgnElement).add(subElement); + offset += elementLength; + } else { + byte[] remain = new byte[buffer.remaining()]; + System.arraycopy(raws, offset, remain, 0, buffer.remaining()); + for (int i = 0; i < remain.length; i++) { + if (remain[i] != 0) { + logger.info("fetch element has some error. index=" + (offset + i) + ":value=" + remain[i]); + } + } + break; + } + } + } + + return dgnElement; + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleTransformColorOwner2CSVJob.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleTransformColorOwner2CSVJob.java new file mode 100644 index 0000000..c54723d --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleTransformColorOwner2CSVJob.java @@ -0,0 +1,488 @@ +package com.ximple.eofms.jobs; + +import java.io.FileWriter; +import java.io.IOException; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +import au.com.bytecode.opencsv.CSVWriter; +import au.com.bytecode.opencsv.ResultSetHelper; +import au.com.bytecode.opencsv.ResultSetHelperService; +import com.ximple.eofms.jobs.context.AbstractOracleJobContext; +import com.ximple.eofms.jobs.context.postgis.OracleConvertPostGISJobContext; +import com.ximple.eofms.util.ConnectivityDirectionEnum; +import com.ximple.eofms.util.DefaultColorTable; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.geotools.data.DataStore; +import org.geotools.data.Transaction; +import org.geotools.data.jdbc.JDBCUtils; +import org.geotools.data.postgis.PostgisNGDataStoreFactory; +import org.geotools.jdbc.JDBCDataStore; +import org.quartz.JobDataMap; +import org.quartz.JobDetail; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +public class OracleTransformColorOwner2CSVJob extends AbstractOracleDatabaseJob { + final static Log logger = LogFactory.getLog(OracleTransformColorOwner2CSVJob.class); + + public static String FETCH_TPDATA = "SELECT TPID, TPNAME FROM BASEDB.TPDATA"; + public static String FETCH_CONNFDR = "SELECT FSC, UFID, FDR1, DIR FROM BASEDB.CONNECTIVITY ORDER BY FSC"; + public static String FETCH_FDRCOLOR = "SELECT FRREDERID, COLOR FROM BASEDB.FEEDER"; + public static String FETCH_COLORTAB = "SELECT TAG_SFSC, TAG_LUFID, COLOR FROM OCSDB.COLOR ORDER BY TAG_SFSC"; + + private static final String PGHOST = "PGHOST"; + private static final String PGDATBASE = "PGDATBASE"; + private static final String PGPORT = "PGPORT"; + private static final String PGSCHEMA = "PGSCHEMA"; + private static final String PGUSER = "PGUSER"; + private static final String PGPASS = "PGPASS"; + private static final String USEWKB = "USEWKB"; + + private static final boolean useTpclidText = false; + + private static final int FETCHSIZE = 100; + private static final int COMMITSIZE = 100; + + protected static class Pair { + Object first; + Object second; + + public Pair(Object first, Object second) { + this.first = first; + this.second = second; + } + } + + protected static PostgisNGDataStoreFactory dataStoreFactory = new PostgisNGDataStoreFactory(); + + protected String _pgHost; + protected String _pgDatabase; + protected String _pgPort; + protected String _pgSchema; + protected String _pgUsername; + protected String _pgPassword; + protected String _pgUseWKB; + + protected Map<String, String> pgProperties; + protected JDBCDataStore targetDataStore; + + private long queryTime = 0; + private long queryTimeStart = 0; + + protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException { + super.extractJobConfiguration(jobDetail); + JobDataMap dataMap = jobDetail.getJobDataMap(); + _pgHost = dataMap.getString(PGHOST); + _pgDatabase = dataMap.getString(PGDATBASE); + _pgPort = dataMap.getString(PGPORT); + _pgSchema = dataMap.getString(PGSCHEMA); + _pgUsername = dataMap.getString(PGUSER); + _pgPassword = dataMap.getString(PGPASS); + _pgUseWKB = dataMap.getString(USEWKB); + + Log logger = getLogger(); + /* + logger.info("PGHOST=" + _myHost); + logger.info("PGDATBASE=" + _myDatabase); + logger.info("PGPORT=" + _myPort); + logger.info("PGSCHEMA=" + _mySchema); + logger.info("PGUSER=" + _myUsername); + logger.info("PGPASS=" + _myPassword); + logger.info("USEWKB=" + _myUseWKB); + */ + + if (_pgHost == null) { + logger.warn("PGHOST is null"); + throw new JobExecutionException("Unknown PostGIS host."); + } + if (_pgDatabase == null) { + logger.warn("PGDATABASE is null"); + throw new JobExecutionException("Unknown PostGIS database."); + } + if (_pgPort == null) { + logger.warn("PGPORT is null"); + throw new JobExecutionException("Unknown PostGIS port."); + } + if (_pgSchema == null) { + logger.warn("PGSCHEMA is null"); + throw new JobExecutionException("Unknown PostGIS schema."); + } + if (_pgUsername == null) { + logger.warn("PGUSERNAME is null"); + throw new JobExecutionException("Unknown PostGIS username."); + } + if (_pgPassword == null) { + logger.warn("PGPASSWORD is null"); + throw new JobExecutionException("Unknown PostGIS password."); + } + + Map<String, String> remote = new TreeMap<String, String>(); + remote.put(PostgisNGDataStoreFactory.DBTYPE.key, "postgis"); + // remote.put("charset", "UTF-8"); + remote.put(PostgisNGDataStoreFactory.HOST.key, _pgHost); + remote.put(PostgisNGDataStoreFactory.PORT.key, _pgPort); + remote.put(PostgisNGDataStoreFactory.DATABASE.key, _pgDatabase); + remote.put(PostgisNGDataStoreFactory.USER.key, _pgUsername); + remote.put(PostgisNGDataStoreFactory.PASSWD.key, _pgPassword); + // remote.put( "namespace", null); + pgProperties = remote; + } + + @Override + public Log getLogger() { + return logger; + } + + @Override + public void execute(JobExecutionContext context) throws JobExecutionException { + // Every job has its own job detail + JobDetail jobDetail = context.getJobDetail(); + + // The name is defined in the job definition + String jobName = jobDetail.getKey().getName(); + + // Log the time the job started + logger.info(jobName + " fired at " + new Date()); + extractJobConfiguration(jobDetail); + + createSourceDataStore(); + createTargetDataStore(); + if (getSourceDataStore() == null) { + logger.warn("Cannot connect source oracle database."); + throw new JobExecutionException("Cannot connect source oracle database."); + } + + if (getTargetDataStore() == null) { + logger.warn("Cannot connect source postgreSQL database."); + throw new JobExecutionException("Cannot connect source postgreSQL database."); + } + + if (isProfileMode()) { + queryTime = 0; + } + + long t1 = System.currentTimeMillis(); + String targetSchemaName; + try { + logger.info("-- step:clearOutputDatabase --"); + clearOutputDatabase(); + + logger.info("-- step:transformOracleDMMSDB --"); + targetSchemaName = determineTargetSchemaName(); + + OracleConvertPostGISJobContext jobContext = + (OracleConvertPostGISJobContext) prepareJobContext(targetSchemaName, _filterPath, + isProfileMode(), isTransformed()); + jobContext.setSourceDataStore(getSourceDataStore()); + jobContext.setExecutionContext(context); + + long tStep = System.currentTimeMillis(); + + fetchTPData(jobContext); + logger.info("TPC DIST:" + jobContext.getDistId() + ":" + + ((jobContext.getDistName() == null) ? "NULL" : jobContext.getDistName())); + + mergeConnectivityOwner(jobContext); + + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-Merge Connectivity Owner", tStep, tStepEnd); + } + + tStep = System.currentTimeMillis(); + mergeDynamicColor(jobContext); + + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-Merge ColorTable", tStep, tStepEnd); + } + + jobContext.closeOracleConnection(); + + long t2 = System.currentTimeMillis(); + // public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss"; + // SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); + logTimeDiff("Total ", t1, t2); + + } catch (SQLException e) { + disconnect(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException("Database error. " + e.getMessage(), e); + } catch (IOException ex) { + disconnect(); + logger.warn(ex.getMessage(), ex); + throw new JobExecutionException("IO error. " + ex.getMessage(), ex); + } finally { + disconnect(); + } + logger.warn(jobName + " end at " + new Date()); + } + + /** + * Connectivity (Connectivity) + * + * @param jobContext job context + * @throws java.sql.SQLException sql exception + */ + protected void mergeConnectivityOwner(AbstractOracleJobContext jobContext) throws SQLException, IOException { + Connection connection = jobContext.getOracleConnection(); + + boolean found = false; + ResultSet rs = null; + Statement stmt = null; + try { + String targetSchemaName = determineTargetSchemaName(); + logger.info("target schema:" + targetSchemaName); + stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + rs = stmt.executeQuery(FETCH_CONNFDR); + rs.setFetchSize(FETCHSIZE); + + ResultSetHelper resultService = new ResultSetHelperService(); + final String[] header = new String[] { "tid", "oid", "owner", "flow" }; + CSVWriter writer = new CSVWriter(new FileWriter("featureowner.csv"), ','); + writer.writeNext(header); + while (rs.next()) { + short dirId = (short) rs.getInt(4); + String[] values = resultService.getColumnValues(rs); + ConnectivityDirectionEnum dir = ConnectivityDirectionEnum.convertShort(dirId); + if ((ConnectivityDirectionEnum.ForwardflowON == dir) || + (ConnectivityDirectionEnum.ForwardFixflowON == dir)) { + values[3] = "shape://ccarrow"; + + } else if ((ConnectivityDirectionEnum.BackflowON == dir) || + (ConnectivityDirectionEnum.BackFixflowON == dir)) { + values[3] = "shape://rccarrow"; + } else { + values[3] = "shape://backslash"; + } + writer.writeNext(values); + } + writer.flush(); + writer.close(); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + } + } + + private void mergeDynamicColor(OracleConvertPostGISJobContext jobContext) throws SQLException, IOException { + Connection connection = jobContext.getOracleConnection(); + + boolean found = false; + ResultSet rs = null; + Statement stmt = null; + try { + String targetSchemaName = determineTargetSchemaName(); + logger.info("target schema:" + targetSchemaName); + stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + rs = stmt.executeQuery(FETCH_COLORTAB); + rs.setFetchSize(FETCHSIZE); + + ResultSetHelper resultService = new ResultSetHelperService(); + DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); + + final String[] header = new String[] { "tid", "oid", "dyncolor" }; + CSVWriter writer = new CSVWriter(new FileWriter("featurecolor.csv"), ','); + // writer.writeAll(rs, true); + writer.writeNext(header); + while (rs.next()) { + int colorId = rs.getInt(3); + String[] values = resultService.getColumnValues(rs); + String colorText = colorTable.getColorCode(colorId); + values[2] = colorText; + writer.writeNext(values); + } + writer.flush(); + writer.close(); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + } + } + + private void batchExecuteSQL(ArrayList<String> sqlStmts) throws IOException { + if (targetDataStore == null) return; + Connection connection = null; + Statement stmt = null; + // ResultSet rs = null; + int[] results = null; + try { + connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + connection.setAutoCommit(false); + stmt = connection.createStatement(); + for (String sqlStmt : sqlStmts) { + stmt.addBatch(sqlStmt); + } + results = stmt.executeBatch(); + connection.commit(); + } catch (SQLException e) { + if (results != null) { + } + logger.warn(e.getMessage(), e); + } finally { + // JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); + } + } + + + private List<String> fetchTargetTableList(String targetSchemaName, int cid) throws IOException { + ArrayList<String> result = new ArrayList<String>(); + if (targetDataStore == null) return null; + Connection connection = null; + Statement stmt = null; + ResultSet rs = null; + try { + connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + String[] types = {"TABLE"}; + rs = connection.getMetaData().getTables(null, targetSchemaName, "fsc-" + cid +"%", types); + while (rs.next()) { + String tableName = rs.getString("TABLE_NAME"); + logger.info("table:" + tableName); + result.add(tableName); + } + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); + } + + return result; //To change body of created methods use File | Settings | File Templates. + } + + + @Override + protected AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath, boolean profileMode, boolean useTransform) { + return new OracleConvertPostGISJobContext(getDataPath(), + getTargetDataStore(), targetSchemaName, filterPath, profileMode, useTransform); + } + + private void logTimeDiff(String message, long tBefore, long tCurrent) { + logger.warn(message + ":use time = " + ((int) ((tCurrent - tBefore) / 60000.0)) + " min - " + + (((int) ((tCurrent - tBefore) % 60000.0)) / 1000) + " sec"); + } + + public DataStore getTargetDataStore() { + return targetDataStore; + } + + protected void createTargetDataStore() throws JobExecutionException { + if (targetDataStore != null) { + targetDataStore.dispose(); + targetDataStore = null; + } + + if (!pgProperties.containsKey(PostgisNGDataStoreFactory.MAXCONN.key)) { + pgProperties.put(PostgisNGDataStoreFactory.MAXCONN.key, "5"); + } + + if (!pgProperties.containsKey(PostgisNGDataStoreFactory.MINCONN.key)) { + pgProperties.put(PostgisNGDataStoreFactory.MINCONN.key, "1"); + } + + if (!dataStoreFactory.canProcess(pgProperties)) { + getLogger().warn("cannot process properties-"); + throw new JobExecutionException("cannot process properties-"); + } + try { + targetDataStore = dataStoreFactory.createDataStore(pgProperties); + } catch (IOException e) { + getLogger().warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } + } + + protected void disconnect() { + super.disconnect(); + if (targetDataStore != null) { + targetDataStore.dispose(); + targetDataStore = null; + } + } + + private String determineTargetSchemaName() throws IOException { + if (targetDataStore == null) return null; + Connection connection = null; + Statement stmt = null; + ResultSet rs = null; + String targetSchema = null; + boolean needCreate = false; + try { + connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + rs = connection.getMetaData().getTables(null, _pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME, new String[]{"TABLE"}); + if (!rs.next()) needCreate = true; + if (needCreate) { + throw new IOException("cannot found " + DataReposVersionManager.XGVERSIONTABLE_NAME); + } + rs.close(); + rs = null; + + StringBuilder sbSQL = new StringBuilder("SELECT "); + sbSQL.append("vsschema, vsstatus FROM "); + sbSQL.append(encodeSchemaTableName(_pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME)).append(' '); + sbSQL.append("ORDER BY vsid"); + stmt = connection.createStatement(); + rs = stmt.executeQuery(sbSQL.toString()); + ArrayList<Object[]> tmpSchemas = new ArrayList<Object[]>(); + int i = 0; + int current = -1; + while (rs.next()) { + Object[] values = new Object[2]; + values[0] = rs.getString("vsschema"); + values[1] = rs.getShort("vsstatus"); + tmpSchemas.add(values); + if ((((Short) values[1]) & DataReposVersionManager.VSSTATUS_USING) != 0) { + current = i; + } + i++; + } + + if (current != -1) { + Object[] values = tmpSchemas.get(current); + targetSchema = (String) values[0]; + } + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); + } + return targetSchema; + } + + public String encodeSchemaTableName(String schemaName, String tableName) { + return "\"" + schemaName + "\".\"" + tableName + "\""; + } + + public final void accumulateQueryTime() { + queryTime += System.currentTimeMillis() - queryTimeStart; + } + + public long getQueryTime() { + return queryTime; + } + + public final void markQueryTime() { + queryTimeStart = System.currentTimeMillis(); + } + + public final void resetQueryTime() { + queryTime = 0; + } + + private void clearOutputDatabase() { + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleTransformColorOwnerJob.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleTransformColorOwnerJob.java new file mode 100644 index 0000000..a564b58 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleTransformColorOwnerJob.java @@ -0,0 +1,580 @@ +package com.ximple.eofms.jobs; + +import java.io.IOException; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +import com.ximple.eofms.jobs.context.AbstractOracleJobContext; +import com.ximple.eofms.jobs.context.postgis.OracleConvertPostGISJobContext; +import com.ximple.eofms.util.DefaultColorTable; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.geotools.data.DataStore; +import org.geotools.data.Transaction; +import org.geotools.data.jdbc.JDBCUtils; +import org.geotools.data.postgis.PostgisNGDataStoreFactory; +import org.geotools.jdbc.JDBCDataStore; +import org.quartz.JobDataMap; +import org.quartz.JobDetail; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +/** + * + */ +@Deprecated +public class OracleTransformColorOwnerJob extends AbstractOracleDatabaseJob { + final static Log logger = LogFactory.getLog(OracleTransformColorOwnerJob.class); + + public static String FETCH_TPDATA = "SELECT TPID, TPNAME FROM BASEDB.TPDATA"; + public static String FETCH_CONNFDR = "SELECT FSC, UFID, FDR1 FROM BASEDB.CONNECTIVITY ORDER BY FSC"; + public static String FETCH_FDRCOLOR = "SELECT FRREDERID, COLOR FROM BASEDB.FEEDER"; + public static String FETCH_COLORTAB = "SELECT TAG_SFSC, TAG_LUFID, COLOR FROM OCSDB.COLOR ORDER BY TAG_SFSC"; + + private static final String PGHOST = "PGHOST"; + private static final String PGDATBASE = "PGDATBASE"; + private static final String PGPORT = "PGPORT"; + private static final String PGSCHEMA = "PGSCHEMA"; + private static final String PGUSER = "PGUSER"; + private static final String PGPASS = "PGPASS"; + private static final String USEWKB = "USEWKB"; + + private static final boolean useTpclidText = false; + + private static final int FETCHSIZE = 30; + private static final int COMMITSIZE = 100; + + protected static class Pair { + Object first; + Object second; + + public Pair(Object first, Object second) { + this.first = first; + this.second = second; + } + } + + protected static PostgisNGDataStoreFactory dataStoreFactory = new PostgisNGDataStoreFactory(); + + protected String _pgHost; + protected String _pgDatabase; + protected String _pgPort; + protected String _pgSchema; + protected String _pgUsername; + protected String _pgPassword; + protected String _pgUseWKB; + + protected Map<String, String> pgProperties; + protected JDBCDataStore targetDataStore; + + private long queryTime = 0; + private long queryTimeStart = 0; + + protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException { + super.extractJobConfiguration(jobDetail); + JobDataMap dataMap = jobDetail.getJobDataMap(); + _pgHost = dataMap.getString(PGHOST); + _pgDatabase = dataMap.getString(PGDATBASE); + _pgPort = dataMap.getString(PGPORT); + _pgSchema = dataMap.getString(PGSCHEMA); + _pgUsername = dataMap.getString(PGUSER); + _pgPassword = dataMap.getString(PGPASS); + _pgUseWKB = dataMap.getString(USEWKB); + + Log logger = getLogger(); + /* + logger.info("PGHOST=" + _myHost); + logger.info("PGDATBASE=" + _myDatabase); + logger.info("PGPORT=" + _myPort); + logger.info("PGSCHEMA=" + _mySchema); + logger.info("PGUSER=" + _myUsername); + logger.info("PGPASS=" + _myPassword); + logger.info("USEWKB=" + _myUseWKB); + */ + + if (_pgHost == null) { + logger.warn("PGHOST is null"); + throw new JobExecutionException("Unknown PostGIS host."); + } + if (_pgDatabase == null) { + logger.warn("PGDATABASE is null"); + throw new JobExecutionException("Unknown PostGIS database."); + } + if (_pgPort == null) { + logger.warn("PGPORT is null"); + throw new JobExecutionException("Unknown PostGIS port."); + } + if (_pgSchema == null) { + logger.warn("PGSCHEMA is null"); + throw new JobExecutionException("Unknown PostGIS schema."); + } + if (_pgUsername == null) { + logger.warn("PGUSERNAME is null"); + throw new JobExecutionException("Unknown PostGIS username."); + } + if (_pgPassword == null) { + logger.warn("PGPASSWORD is null"); + throw new JobExecutionException("Unknown PostGIS password."); + } + + Map<String, String> remote = new TreeMap<String, String>(); + remote.put(PostgisNGDataStoreFactory.DBTYPE.key, "postgis"); + // remote.put("charset", "UTF-8"); + remote.put(PostgisNGDataStoreFactory.HOST.key, _pgHost); + remote.put(PostgisNGDataStoreFactory.PORT.key, _pgPort); + remote.put(PostgisNGDataStoreFactory.DATABASE.key, _pgDatabase); + remote.put(PostgisNGDataStoreFactory.USER.key, _pgUsername); + remote.put(PostgisNGDataStoreFactory.PASSWD.key, _pgPassword); + // remote.put( "namespace", null); + pgProperties = remote; + } + + @Override + public Log getLogger() { + return logger; + } + + @Override + public void execute(JobExecutionContext context) throws JobExecutionException { + // Every job has its own job detail + JobDetail jobDetail = context.getJobDetail(); + + // The name is defined in the job definition + String jobName = jobDetail.getKey().getName(); + + // Log the time the job started + logger.info(jobName + " fired at " + new Date()); + extractJobConfiguration(jobDetail); + + createSourceDataStore(); + createTargetDataStore(); + if (getSourceDataStore() == null) { + logger.warn("Cannot connect source oracle database."); + throw new JobExecutionException("Cannot connect source oracle database."); + } + + if (getTargetDataStore() == null) { + logger.warn("Cannot connect source postgreSQL database."); + throw new JobExecutionException("Cannot connect source postgreSQL database."); + } + + if (isProfileMode()) { + queryTime = 0; + } + + long t1 = System.currentTimeMillis(); + String targetSchemaName; + try { + logger.info("-- step:clearOutputDatabase --"); + clearOutputDatabase(); + + logger.info("-- step:transformOracleDMMSDB --"); + targetSchemaName = determineTargetSchemaName(); + + OracleConvertPostGISJobContext jobContext = + (OracleConvertPostGISJobContext) prepareJobContext(targetSchemaName, _filterPath, + isProfileMode(), isTransformed()); + jobContext.setSourceDataStore(getSourceDataStore()); + jobContext.setExecutionContext(context); + + long tStep = System.currentTimeMillis(); + + fetchTPData(jobContext); + logger.info("TPC DIST:" + jobContext.getDistId() + ":" + + ((jobContext.getDistName() == null) ? "NULL" : jobContext.getDistName())); + + mergeConnectivityOwner(jobContext); + + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-Merge Connectivity Owner", tStep, tStepEnd); + } + + tStep = System.currentTimeMillis(); + mergeDynamicColor(jobContext); + + if (isProfileMode()) { + long tStepEnd = System.currentTimeMillis(); + logTimeDiff("Profile-Merge ColorTable", tStep, tStepEnd); + } + + jobContext.closeOracleConnection(); + + long t2 = System.currentTimeMillis(); + // public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss"; + // SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); + logTimeDiff("Total ", t1, t2); + + } catch (SQLException e) { + disconnect(); + logger.warn(e.getMessage(), e); + throw new JobExecutionException("Database error. " + e.getMessage(), e); + } catch (IOException ex) { + disconnect(); + logger.warn(ex.getMessage(), ex); + throw new JobExecutionException("IO error. " + ex.getMessage(), ex); + } finally { + disconnect(); + } + logger.warn(jobName + " end at " + new Date()); + } + + /** + * Connectivity (Connectivity) + * + * @param jobContext job context + * @throws java.sql.SQLException sql exception + */ + protected void mergeConnectivityOwner(AbstractOracleJobContext jobContext) throws SQLException, IOException { + Connection connection = jobContext.getOracleConnection(); + + boolean found = false; + ResultSet rs = null; + Statement stmt = null; + try { + String targetSchemaName = determineTargetSchemaName(); + logger.info("target schema:" + targetSchemaName); + stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + rs = stmt.executeQuery(FETCH_CONNFDR); + rs.setFetchSize(50); + int lastClass = -1; + boolean changeType = false; + List<String> tables = null; + ArrayList<String> sqlBatchStmts = new ArrayList<String>(); + final int MAX_BATCHSIZE = 50; + int count = 0; + while (rs.next()) { + int cid = rs.getInt(1); + long oid = rs.getLong(2); + int ownerId = rs.getInt(3); + if (lastClass != cid) { + logger.info("change type to :" + cid); + } + changeType = (lastClass != cid); + if (changeType) { + tables = fetchTargetTableList(targetSchemaName, cid); + if (tables == null) + logger.info("tables is null." + cid); + } + if (tables != null) { + for (String t : tables) { + String sqlStmt = generatrTargetOwnerSql(targetSchemaName, t, cid, oid, ownerId); + sqlBatchStmts.add(sqlStmt); + } + } + + if (MAX_BATCHSIZE < sqlBatchStmts.size()) { + batchExecuteSQL(sqlBatchStmts); + count += sqlBatchStmts.size(); + sqlBatchStmts.clear(); + } + lastClass = cid; + } + + if (!sqlBatchStmts.isEmpty()) { + batchExecuteSQL(sqlBatchStmts); + count += sqlBatchStmts.size(); + } + logger.info("Execute Update Count=" + count); + // } catch (SQLException e) + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + } + } + + private String generatrTargetOwnerSql(String schemaName, String t, int cid, long oid, int ownerId) { + StringBuilder sb = new StringBuilder("UPDATE "); + sb.append(schemaName).append(".\"").append(t).append("\""); + sb.append(" SET fowner = ").append(ownerId); + sb.append(" WHERE tid=").append(cid); + sb.append(" AND oid=").append(oid); + return sb.toString(); + } + + private void updateTargetOwner(Connection connection, + String schemaName, String t, int cid, long oid, int ownerId) + throws SQLException, IOException { + if (connection == null) return; + Statement stmt = null; + ResultSet rs = null; + try { + stmt = connection.createStatement(); + stmt.executeUpdate("UPDATE " + schemaName + "." + t + " SET fowner = " + ownerId + " WHERE oid=" + oid); + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + } + } + + private void mergeDynamicColor(OracleConvertPostGISJobContext jobContext) throws SQLException, IOException { + Connection connection = jobContext.getOracleConnection(); + + boolean found = false; + ResultSet rs = null; + Statement stmt = null; + try { + String targetSchemaName = determineTargetSchemaName(); + logger.info("target schema:" + targetSchemaName); + stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + rs = stmt.executeQuery(FETCH_COLORTAB); + rs.setFetchSize(50); + int lastClass = -1; + boolean changeType = false; + List<String> tables = null; + ArrayList<String> sqlBatchStmts = new ArrayList<String>(); + final int MAX_BATCHSIZE = 50; + int count = 0; + while (rs.next()) { + int cid = rs.getInt(1); + long oid = rs.getLong(2); + int colorId = rs.getInt(3); + if (lastClass != cid) { + logger.info("change type to :" + cid); + } + changeType = (lastClass != cid); + if (changeType) { + tables = fetchTargetTableList(targetSchemaName, cid); + if (tables == null) + logger.info("tables is null." + cid); + } + if (tables != null) { + for (String t : tables) { + String sqlStmt = generatrTargetDynamicColorSql(targetSchemaName, t, cid, oid, colorId); + sqlBatchStmts.add(sqlStmt); + } + } + if (MAX_BATCHSIZE < sqlBatchStmts.size()) { + batchExecuteSQL(sqlBatchStmts); + count += sqlBatchStmts.size(); + sqlBatchStmts.clear(); + } + lastClass = cid; + } + if (!sqlBatchStmts.isEmpty()) { + batchExecuteSQL(sqlBatchStmts); + count += sqlBatchStmts.size(); + } + logger.info("Execute Update Count=" + count); + // } catch (SQLException e) + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + } + } + + private String generatrTargetDynamicColorSql(String schemaName, String t, int cid, long oid, int colorId) { + DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); + String colorText = colorTable.getColorCode(colorId); + StringBuilder sb = new StringBuilder("UPDATE "); + sb.append(schemaName).append(".\"").append(t).append("\""); + sb.append(" SET dyncolor = '").append(colorText).append("'"); + sb.append(" WHERE tid=").append(cid); + sb.append(" AND oid=").append(oid); + return sb.toString(); + } + + private void updateTargetDynamicColor(Connection connection, String schemaName, + String t, int cid, long oid, int colorId) { + if (connection == null) return; + DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); + Statement stmt = null; + ResultSet rs = null; + try { + stmt = connection.createStatement(); + String colorText = colorTable.getColorCode(colorId); + stmt.executeUpdate("UPDATE " + schemaName + "." + t + " SET dyncolor = '" + colorText + "' WHERE oid=" + oid); + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + } + } + + private void batchExecuteSQL(ArrayList<String> sqlStmts) throws IOException { + if (targetDataStore == null) return; + Connection connection = null; + Statement stmt = null; + // ResultSet rs = null; + int[] results = null; + try { + connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + connection.setAutoCommit(false); + stmt = connection.createStatement(); + for (String sqlStmt : sqlStmts) { + stmt.addBatch(sqlStmt); + } + results = stmt.executeBatch(); + connection.commit(); + } catch (SQLException e) { + if (results != null) { + } + logger.warn(e.getMessage(), e); + } finally { + // JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); + } + } + + + private List<String> fetchTargetTableList(String targetSchemaName, int cid) throws IOException { + ArrayList<String> result = new ArrayList<String>(); + if (targetDataStore == null) return null; + Connection connection = null; + Statement stmt = null; + ResultSet rs = null; + try { + connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + String[] types = {"TABLE"}; + rs = connection.getMetaData().getTables(null, targetSchemaName, "fsc-" + cid +"%", types); + while (rs.next()) { + String tableName = rs.getString("TABLE_NAME"); + logger.info("table:" + tableName); + result.add(tableName); + } + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); + } + + return result; //To change body of created methods use File | Settings | File Templates. + } + + + @Override + protected AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath, boolean profileMode, boolean useTransform) { + return new OracleConvertPostGISJobContext(getDataPath(), + getTargetDataStore(), targetSchemaName, filterPath, profileMode, useTransform); + } + + private void logTimeDiff(String message, long tBefore, long tCurrent) { + logger.warn(message + ":use time = " + ((int) ((tCurrent - tBefore) / 60000.0)) + " min - " + + (((int) ((tCurrent - tBefore) % 60000.0)) / 1000) + " sec"); + } + + public DataStore getTargetDataStore() { + return targetDataStore; + } + + protected void createTargetDataStore() throws JobExecutionException { + if (targetDataStore != null) { + targetDataStore.dispose(); + targetDataStore = null; + } + + if (!pgProperties.containsKey(PostgisNGDataStoreFactory.MAXCONN.key)) { + pgProperties.put(PostgisNGDataStoreFactory.MAXCONN.key, "5"); + } + + if (!pgProperties.containsKey(PostgisNGDataStoreFactory.MINCONN.key)) { + pgProperties.put(PostgisNGDataStoreFactory.MINCONN.key, "1"); + } + + if (!dataStoreFactory.canProcess(pgProperties)) { + getLogger().warn("cannot process properties-"); + throw new JobExecutionException("cannot process properties-"); + } + try { + targetDataStore = dataStoreFactory.createDataStore(pgProperties); + } catch (IOException e) { + getLogger().warn(e.getMessage(), e); + throw new JobExecutionException(e.getMessage(), e); + } + } + + protected void disconnect() { + super.disconnect(); + if (targetDataStore != null) { + targetDataStore.dispose(); + targetDataStore = null; + } + } + + private String determineTargetSchemaName() throws IOException { + if (targetDataStore == null) return null; + Connection connection = null; + Statement stmt = null; + ResultSet rs = null; + String targetSchema = null; + boolean needCreate = false; + try { + connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT); + rs = connection.getMetaData().getTables(null, _pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME, new String[]{"TABLE"}); + if (!rs.next()) needCreate = true; + if (needCreate) { + throw new IOException("cannot found " + DataReposVersionManager.XGVERSIONTABLE_NAME); + } + rs.close(); + rs = null; + + StringBuilder sbSQL = new StringBuilder("SELECT "); + sbSQL.append("vsschema, vsstatus FROM "); + sbSQL.append(encodeSchemaTableName(_pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME)).append(' '); + sbSQL.append("ORDER BY vsid"); + stmt = connection.createStatement(); + rs = stmt.executeQuery(sbSQL.toString()); + ArrayList<Object[]> tmpSchemas = new ArrayList<Object[]>(); + int i = 0; + int current = -1; + while (rs.next()) { + Object[] values = new Object[2]; + values[0] = rs.getString("vsschema"); + values[1] = rs.getShort("vsstatus"); + tmpSchemas.add(values); + if ((((Short) values[1]) & DataReposVersionManager.VSSTATUS_USING) != 0) { + current = i; + } + i++; + } + + if (current != -1) { + Object[] values = tmpSchemas.get(current); + targetSchema = (String) values[0]; + } + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(rs); + JDBCUtils.close(stmt); + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); + } + return targetSchema; + } + + public String encodeSchemaTableName(String schemaName, String tableName) { + return "\"" + schemaName + "\".\"" + tableName + "\""; + } + + public final void accumulateQueryTime() { + queryTime += System.currentTimeMillis() - queryTimeStart; + } + + public long getQueryTime() { + return queryTime; + } + + public final void markQueryTime() { + queryTimeStart = System.currentTimeMillis(); + } + + public final void resetQueryTime() { + queryTime = 0; + } + + private void clearOutputDatabase() { + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleUpgradeBlob2UDTJob.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleUpgradeBlob2UDTJob.java index 1888be3..2e95dd7 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleUpgradeBlob2UDTJob.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleUpgradeBlob2UDTJob.java @@ -1,7 +1,7 @@ package com.ximple.eofms.jobs; -import java.sql.SQLException; import java.sql.Connection; +import java.sql.SQLException; import java.util.Date; import org.apache.commons.logging.Log; @@ -10,63 +10,56 @@ import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; -import oracle.jdbc.OracleConnection; import oracle.jdbc.OracleDatabaseMetaData; import oracle.jdbc.OracleStatement; import com.ximple.eofms.jobs.context.AbstractOracleJobContext; import com.ximple.eofms.jobs.context.OracleUpgradeJobContext; -public class OracleUpgradeBlob2UDTJob extends AbstractOracleDatabaseJob -{ +public class OracleUpgradeBlob2UDTJob extends AbstractOracleDatabaseJob { static Log logger = LogFactory.getLog(OracleUpgradeBlob2UDTJob.class); - public void execute(JobExecutionContext context) throws JobExecutionException - { + public void execute(JobExecutionContext context) throws JobExecutionException { // Every job has its own job detail JobDetail jobDetail = context.getJobDetail(); // The name is defined in the job definition - String jobName = jobDetail.getName(); + String jobName = jobDetail.getKey().getName(); String targetSchemaName = null; // Log the time the job started logger.info(jobName + " fired at " + new Date()); extractJobConfiguration(jobDetail); createSourceDataStore(); - if (getSourceDataStore() == null) - { + if (getSourceDataStore() == null) { throw new JobExecutionException("Cannot connect source oracle database."); } - AbstractOracleJobContext jobContext = prepareJobContext(targetSchemaName, _filterPath); + AbstractOracleJobContext jobContext = prepareJobContext(targetSchemaName, _filterPath, isProfileMode(), + isTransformed()); jobContext.setSourceDataStore(getSourceDataStore()); - try - { - for (String orgSchema : _orgSchema) - { + try { + for (String orgSchema : _orgSchema) { exetcuteConvert(jobContext, orgSchema, _dataPath); } - } catch (SQLException e) - { + } catch (SQLException e) { throw new JobExecutionException("Database error.", e); } } - public Log getLogger() - { + public Log getLogger() { return logger; } - protected AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath) - { - return new OracleUpgradeJobContext(); + protected AbstractOracleJobContext prepareJobContext(String targetSchemaName, String filterPath, + boolean profileMode, + boolean useTransform) { + return new OracleUpgradeJobContext(profileMode, useTransform); } private void exetcuteConvert(AbstractOracleJobContext jobContext, - String orgSchema, String dataPath) throws SQLException - { + String orgSchema, String dataPath) throws SQLException { Connection connection = jobContext.getOracleConnection(); OracleDatabaseMetaData metaData = (OracleDatabaseMetaData) connection.getMetaData(); OracleStatement statement = (OracleStatement) connection.createStatement(); diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractDgnFileJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractDgnFileJobContext.java index 8448eaf..42837f8 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractDgnFileJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractDgnFileJobContext.java @@ -2,82 +2,136 @@ import java.util.Map; +import com.ximple.eofms.filter.ElementDispatcher; +import org.apache.commons.digester3.Digester; +import org.apache.commons.digester3.binder.DigesterLoader; +import org.apache.commons.digester3.xmlrules.FromXmlRulesModule; import org.apache.commons.logging.Log; import org.quartz.JobExecutionContext; import com.ximple.io.dgn7.Dgn7fileReader; -public abstract class AbstractDgnFileJobContext -{ +public abstract class AbstractDgnFileJobContext { + +// ------------------------------ FIELDS ------------------------------ + /** * Encoding of URL path. */ protected static final String ENCODING = "UTF-8"; - private JobExecutionContext executionContext = null; - protected String _dataPath = null; protected Map properties = null; + + private JobExecutionContext executionContext = null; private Dgn7fileReader reader = null; private String filename = null; private boolean _elementLogging; + private boolean _profileMode = false; + private boolean _useTransform = true; - public AbstractDgnFileJobContext(String dataPath) - { + private long _processTime; + private long _updateTime; + private long _processTimeStart; + private long _updateTimeStart; + + private short distId; + +// --------------------------- CONSTRUCTORS --------------------------- + + public AbstractDgnFileJobContext(String dataPath, boolean profileMode, + boolean useTransform) { _dataPath = dataPath; + _profileMode = profileMode; + _useTransform = useTransform; } - public String getDataPath() - { - return _dataPath; - } +// --------------------- GETTER / SETTER METHODS --------------------- - public JobExecutionContext getExecutionContext() - { + public JobExecutionContext getExecutionContext() { return executionContext; } - public void setExecutionContext(JobExecutionContext context) - { + public void setExecutionContext(JobExecutionContext context) { executionContext = context; } - public abstract void startTransaction(); - - public abstract void commitTransaction(); - - public abstract void rollbackTransaction(); - - public Dgn7fileReader getReader() - { - return this.reader; - } - - public void setReader(Dgn7fileReader reader) - { - this.reader = reader; - } - - public String getFilename() - { + public String getFilename() { return filename; } - public void setFilename(String filename) - { + public void setFilename(String filename) { this.filename = filename; } - public boolean getElementLogging() - { + public Dgn7fileReader getReader() { + return this.reader; + } + + public void setReader(Dgn7fileReader reader) { + this.reader = reader; + } + + public boolean isProfileMode() { + return _profileMode; + } + + public boolean isTransformed() { + return _useTransform; + } + + public short getDistId() { + return distId; + } + + public void setDistId(short distId) { + this.distId = distId; + } + + // -------------------------- OTHER METHODS -------------------------- + + public final void accumulateProcessTime() { + _processTime += System.currentTimeMillis() - _processTimeStart; + } + + public final void accumulateUpdateTime() { + _updateTime += System.currentTimeMillis() - _updateTimeStart; + } + + public abstract void commitTransaction(); + + public String getDataPath() { + return _dataPath; + } + + public boolean getElementLogging() { return _elementLogging; } - public void setElementLogging(boolean elementLogging) - { + public abstract Log getLogger(); + + public long getProcessTime() { + return _processTime; + } + + public long getUpdateTime() { + return _updateTime; + } + + public final void markProcessTime() { + _processTimeStart = System.currentTimeMillis(); + } + + public final void markUpdateTime() { + _updateTimeStart = System.currentTimeMillis(); + } + + public abstract void rollbackTransaction(); + + public void setElementLogging(boolean elementLogging) { this._elementLogging = elementLogging; } - public abstract Log getLogger(); + public abstract void startTransaction(); } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractOracleJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractOracleJobContext.java index 6e8b0e2..0b72ea5 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractOracleJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractOracleJobContext.java @@ -1,18 +1,16 @@ package com.ximple.eofms.jobs.context; import java.io.IOException; -import java.util.Properties; import java.sql.Connection; +import java.util.Properties; import org.apache.commons.logging.Log; import org.geotools.data.DataStore; import org.geotools.data.Transaction; -import org.geotools.data.oracle.OracleDataStore; +import org.geotools.data.jdbc.JDBCUtils; +import org.geotools.jdbc.JDBCDataStore; -import oracle.jdbc.OracleConnection; - -public abstract class AbstractOracleJobContext -{ +public abstract class AbstractOracleJobContext { /** * Table Prefiex */ @@ -23,155 +21,156 @@ */ protected static final String UDT_RAWS = "CREATE OR REPLACE TYPE \"" + UDT_SCHEMA + "\".\"RAWS\" AS VARRAY (1048576) OF NUMBER(38)"; protected static final String UDT_OFMID = "CREATE OR REPLACE TYPE \"" + UDT_SCHEMA + "\".\"OFMID\" AS OBJECT (" - + "\"CLSID\" NUMBER(5), \"OID\" NUMBER(10), \"STATUS\" NUMBER(5), \"COMPID\" NUMBER(3), " - + "\"RULEID\" NUMBER(3), \"OCCID\" NUMBER(3))"; + + "\"CLSID\" NUMBER(5), \"OID\" NUMBER(10), \"STATUS\" NUMBER(5), \"COMPID\" NUMBER(3), " + + "\"RULEID\" NUMBER(3), \"OCCID\" NUMBER(3))"; protected static final String UDT_RAWSNAME = "RAWS"; protected static final String UDT_OFMIDNAME = "OFMID"; /** * Utility SQL */ - protected static final String TAB_DROP = "DROP TABLE %s.%s CASCADE CONSTRAINTS"; + protected static final String TAB_CASCADEDROP = "DROP TABLE %s.%s CASCADE CONSTRAINTS"; + protected static final String TAB_DROP = "DROP TABLE %s.%s"; protected static final String TAB_DELETE = "DELETE FROM %s.%s"; /** * Table Schema */ protected static final String TAB_RANGENODEINDEX_1 = "CREATE TABLE \"%s\".\"%s\"\n" - + " ( \"RNID\" INTEGER NOT NULL ENABLE,\n" - + " \"RPID\" INTEGER NOT NULL ENABLE,\n" - + " \"RNG_LOWX\" BINARY_DOUBLE NOT NULL ENABLE,\n" - + " \"RNG_LOWY\" BINARY_DOUBLE NOT NULL ENABLE,\n" - + " \"RNG_HIGHX\" BINARY_DOUBLE NOT NULL ENABLE,\n" - + " \"RNG_HIGHY\" BINARY_DOUBLE NOT NULL ENABLE,\n" - + " \"EXTENTS\" MDSYS.SDO_GEOMETRY,\n" - + " \"RNDESCR\" VARCHAR2(255), \n" - + " PRIMARY KEY ( \"RNID\" ) ENABLE )"; + + " ( \"RNID\" INTEGER NOT NULL ENABLE,\n" + + " \"RPID\" INTEGER NOT NULL ENABLE,\n" + + " \"RNG_LOWX\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"RNG_LOWY\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"RNG_HIGHX\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"RNG_HIGHY\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"EXTENTS\" MDSYS.SDO_GEOMETRY,\n" + + " \"RNDESCR\" VARCHAR2(255), \n" + + " PRIMARY KEY ( \"RNID\" ) ENABLE )"; protected static final String TAB_RANGENODEINDEX = "CREATE TABLE \"%s\".\"%s\"\n" - + " ( \"RNID\" INTEGER NOT NULL ENABLE,\n" - + " \"RPID\" INTEGER NOT NULL ENABLE,\n" - + " \"RNG_LOWX\" FLOAT NOT NULL ENABLE,\n" - + " \"RNG_LOWY\" FLOAT NOT NULL ENABLE,\n" - + " \"RNG_HIGHX\" FLOAT NOT NULL ENABLE,\n" - + " \"RNG_HIGHY\" FLOAT NOT NULL ENABLE,\n" - + " \"RNDESCR\" VARCHAR2(255), \n" - + " PRIMARY KEY ( \"RNID\" ) ENABLE )"; + + " ( \"RNID\" INTEGER NOT NULL ENABLE,\n" + + " \"RPID\" INTEGER NOT NULL ENABLE,\n" + + " \"RNG_LOWX\" FLOAT NOT NULL ENABLE,\n" + + " \"RNG_LOWY\" FLOAT NOT NULL ENABLE,\n" + + " \"RNG_HIGHX\" FLOAT NOT NULL ENABLE,\n" + + " \"RNG_HIGHY\" FLOAT NOT NULL ENABLE,\n" + + " \"RNDESCR\" VARCHAR2(255), \n" + + " PRIMARY KEY ( \"RNID\" ) ENABLE )"; protected static final String TAB_RANGENODESTORAGE = "CREATE TABLE \"%s\".\"%s\"\n" - + " ( \"RNID\" INTEGER NOT NULL ENABLE,\n" - + " \"LAYERID\" NUMBER(5,0) NOT NULL ENABLE,\n" - + " \"LASTUPDATE\" DATE NOT NULL ENABLE,\n" - + " \"SPACETABLE\" VARCHAR2(255)\n" + " )"; + + " ( \"RNID\" INTEGER NOT NULL ENABLE,\n" + + " \"LAYERID\" NUMBER(5,0) NOT NULL ENABLE,\n" + + " \"LASTUPDATE\" DATE NOT NULL ENABLE,\n" + + " \"SPACETABLE\" VARCHAR2(255)\n" + " )"; protected static final String TAB_ELEMENTINDEX_1 = "CREATE TABLE %s.%s (\n" - + " \"ELMNO\" INTEGER NOT NULL ENABLE,\n" - + " \"TYPE\" NUMBER(5) NOT NULL ENABLE,\n" - + " \"XLOW\" BINARY_DOUBLE NOT NULL ENABLE,\n" - + " \"YLOW\" BINARY_DOUBLE NOT NULL ENABLE,\n" - + " \"ZLOW\" BINARY_DOUBLE NOT NULL ENABLE,\n" - + " \"XHIGH\" BINARY_DOUBLE NOT NULL ENABLE,\n" - + " \"YHIGH\" BINARY_DOUBLE NOT NULL ENABLE,\n" - + " \"ZHIGH\" BINARY_DOUBLE NOT NULL ENABLE,\n" - + " \"TAG_LUFID\" NUMBER(10) NOT NULL ENABLE,\n" - + " \"TAG_SFSC\" NUMBER(5) NOT NULL ENABLE,\n" - + " \"TAG_SSTAT\" NUMBER(5) NOT NULL ENABLE,\n" - + " \"TAG_BCOMPID\" NUMBER(3) NOT NULL ENABLE,\n" - + " \"TAG_BRULENO\" NUMBER(3) NOT NULL ENABLE,\n" - + " \"TAG_SOCCID\" NUMBER(5) NOT NULL ENABLE,\n" - + " \"SPACENAME\" VARCHAR2(255) NOT NULL ENABLE,\n" - + " PRIMARY KEY (\"ELMNO\") ENABLE\n" - + " )"; + + " \"ELMNO\" INTEGER NOT NULL ENABLE,\n" + + " \"TYPE\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"XLOW\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"YLOW\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"ZLOW\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"XHIGH\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"YHIGH\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"ZHIGH\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"TAG_LUFID\" NUMBER(10) NOT NULL ENABLE,\n" + + " \"TAG_SFSC\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"TAG_SSTAT\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"TAG_BCOMPID\" NUMBER(3) NOT NULL ENABLE,\n" + + " \"TAG_BRULENO\" NUMBER(3) NOT NULL ENABLE,\n" + + " \"TAG_SOCCID\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"SPACENAME\" VARCHAR2(255) NOT NULL ENABLE,\n" + + " PRIMARY KEY (\"ELMNO\") ENABLE\n" + + " )"; protected static final String TAB_ELEMENTINDEX = "CREATE TABLE %s.%s (\n" - + " \"ELMNO\" INTEGER NOT NULL ENABLE,\n" - + " \"TYPE\" NUMBER(5) NOT NULL ENABLE,\n" - + " \"XLOW\" FLOAT NOT NULL ENABLE,\n" - + " \"YLOW\" FLOAT NOT NULL ENABLE,\n" - + " \"ZLOW\" FLOAT NOT NULL ENABLE,\n" - + " \"XHIGH\" FLOAT NOT NULL ENABLE,\n" - + " \"YHIGH\" FLOAT NOT NULL ENABLE,\n" - + " \"ZHIGH\" FLOAT NOT NULL ENABLE,\n" - + " \"TAG_LUFID\" NUMBER(10) NOT NULL ENABLE,\n" - + " \"TAG_SFSC\" NUMBER(5) NOT NULL ENABLE,\n" - + " \"TAG_SSTAT\" NUMBER(5) NOT NULL ENABLE,\n" - + " \"TAG_BCOMPID\" NUMBER(3) NOT NULL ENABLE,\n" - + " \"TAG_BRULENO\" NUMBER(3) NOT NULL ENABLE,\n" - + " \"TAG_SOCCID\" NUMBER(5) NOT NULL ENABLE,\n" - + " \"SPACENAME\" VARCHAR2(255) NOT NULL ENABLE,\n" - + " PRIMARY KEY (\"ELMNO\") ENABLE\n" - + " )"; + + " \"ELMNO\" INTEGER NOT NULL ENABLE,\n" + + " \"TYPE\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"XLOW\" FLOAT NOT NULL ENABLE,\n" + + " \"YLOW\" FLOAT NOT NULL ENABLE,\n" + + " \"ZLOW\" FLOAT NOT NULL ENABLE,\n" + + " \"XHIGH\" FLOAT NOT NULL ENABLE,\n" + + " \"YHIGH\" FLOAT NOT NULL ENABLE,\n" + + " \"ZHIGH\" FLOAT NOT NULL ENABLE,\n" + + " \"TAG_LUFID\" NUMBER(10) NOT NULL ENABLE,\n" + + " \"TAG_SFSC\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"TAG_SSTAT\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"TAG_BCOMPID\" NUMBER(3) NOT NULL ENABLE,\n" + + " \"TAG_BRULENO\" NUMBER(3) NOT NULL ENABLE,\n" + + " \"TAG_SOCCID\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"SPACENAME\" VARCHAR2(255) NOT NULL ENABLE,\n" + + " PRIMARY KEY (\"ELMNO\") ENABLE\n" + + " )"; protected static final String TAB_IGDSSEED = "CREATE TABLE %s.%s (\n" - + " \"ELMNO\" INTEGER NOT NULL ENABLE,\n" - + " \"SEEDELM\" \"" + UDT_SCHEMA - + "\".\"RAWS\" NOT NULL ENABLE\n" + " )"; + + " \"ELMNO\" INTEGER NOT NULL ENABLE,\n" + + " \"SEEDELM\" \"" + UDT_SCHEMA + + "\".\"RAWS\" NOT NULL ENABLE\n" + " )"; protected static final String TAB_STORAGE_1 = "CREATE TABLE %s.%s (\n" + - " \"ELMNO\" INTEGER NOT NULL ENABLE,\n" + - " \"XLOW\" BINARY_DOUBLE NOT NULL ENABLE,\n" + - " \"YLOW\" BINARY_DOUBLE NOT NULL ENABLE,\n" + - " \"XHIGH\" BINARY_DOUBLE NOT NULL ENABLE,\n" + - " \"YHIGH\" BINARY_DOUBLE NOT NULL ENABLE,\n" + - " \"EXTENTS\" MDSYS.SDO_GEOMETRY, \n" + - " \"PROPS\" INTEGER NOT NULL ENABLE,\n" + - " \"TAG_LUFID\" NUMBER(10) NOT NULL ENABLE,\n" + - " \"TAG_SFSC\" NUMBER(5) NOT NULL ENABLE,\n" + - " \"TAG_SSTAT\" NUMBER(5) NOT NULL ENABLE,\n" + - " \"TAG_BCOMPID\" NUMBER(3) NOT NULL ENABLE,\n" + - " \"TAG_BRULENO\" NUMBER(3) NOT NULL ENABLE,\n" + - " \"TAG_SOCCID\" NUMBER(5) NOT NULL ENABLE,\n" + - " \"LAYERID\" NUMBER(5) NOT NULL ENABLE,\n" + - " \"ELEMENT\" \"" + UDT_SCHEMA + "\".\"RAWS\" NOT NULL ENABLE, \n" + - " \"GEOM\" MDSYS.SDO_GEOMETRY \n" + - " )"; + " \"ELMNO\" INTEGER NOT NULL ENABLE,\n" + + " \"XLOW\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"YLOW\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"XHIGH\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"YHIGH\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"EXTENTS\" MDSYS.SDO_GEOMETRY, \n" + + " \"PROPS\" INTEGER NOT NULL ENABLE,\n" + + " \"TAG_LUFID\" NUMBER(10) NOT NULL ENABLE,\n" + + " \"TAG_SFSC\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"TAG_SSTAT\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"TAG_BCOMPID\" NUMBER(3) NOT NULL ENABLE,\n" + + " \"TAG_BRULENO\" NUMBER(3) NOT NULL ENABLE,\n" + + " \"TAG_SOCCID\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"LAYERID\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"ELEMENT\" \"" + UDT_SCHEMA + "\".\"RAWS\" NOT NULL ENABLE, \n" + + " \"GEOM\" MDSYS.SDO_GEOMETRY \n" + + " )"; protected static final String TAB_STORAGE = "CREATE TABLE %s.%s (\n" + - " \"ELMNO\" INTEGER NOT NULL ENABLE,\n" + - " \"XLOW\" FLOAT NOT NULL ENABLE,\n" + - " \"YLOW\" FLOAT NOT NULL ENABLE,\n" + - " \"XHIGH\" FLOAT NOT NULL ENABLE,\n" + - " \"YHIGH\" FLOAT NOT NULL ENABLE,\n" + - " \"PROPS\" INTEGER NOT NULL ENABLE,\n" + - " \"TAG_LUFID\" NUMBER(10) NOT NULL ENABLE,\n" + - " \"TAG_SFSC\" NUMBER(5) NOT NULL ENABLE,\n" + - " \"TAG_SSTAT\" NUMBER(5) NOT NULL ENABLE,\n" + - " \"TAG_BCOMPID\" NUMBER(3) NOT NULL ENABLE,\n" + - " \"TAG_BRULENO\" NUMBER(3) NOT NULL ENABLE,\n" + - " \"TAG_SOCCID\" NUMBER(5) NOT NULL ENABLE,\n" + - " \"LAYERID\" NUMBER(5) NOT NULL ENABLE,\n" + - " \"ELEMENT\" \"" + UDT_SCHEMA + "\".\"RAWS\" NOT NULL ENABLE \n" + - " )"; + " \"ELMNO\" INTEGER NOT NULL ENABLE,\n" + + " \"XLOW\" FLOAT NOT NULL ENABLE,\n" + + " \"YLOW\" FLOAT NOT NULL ENABLE,\n" + + " \"XHIGH\" FLOAT NOT NULL ENABLE,\n" + + " \"YHIGH\" FLOAT NOT NULL ENABLE,\n" + + " \"PROPS\" INTEGER NOT NULL ENABLE,\n" + + " \"TAG_LUFID\" NUMBER(10) NOT NULL ENABLE,\n" + + " \"TAG_SFSC\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"TAG_SSTAT\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"TAG_BCOMPID\" NUMBER(3) NOT NULL ENABLE,\n" + + " \"TAG_BRULENO\" NUMBER(3) NOT NULL ENABLE,\n" + + " \"TAG_SOCCID\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"LAYERID\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"ELEMENT\" \"" + UDT_SCHEMA + "\".\"RAWS\" NOT NULL ENABLE \n" + + " )"; protected static final String TAB_STORAGE2 = "CREATE TABLE %s.%s (\n" + - " \"ELMNO\" INTEGER NOT NULL ENABLE,\n" + - " \"XLOW\" BINARY_DOUBLE NOT NULL ENABLE,\n" + - " \"YLOW\" BINARY_DOUBLE NOT NULL ENABLE,\n" + - " \"XHIGH\" BINARY_DOUBLE NOT NULL ENABLE,\n" + - " \"YHIGH\" BINARY_DOUBLE NOT NULL ENABLE,\n" + - " \"EXTENTS\" MDSYS.SDO_GEOMETRY, \n" + - " \"PROPS\" INTEGER NOT NULL ENABLE,\n" + - " \"ID\" " + UDT_SCHEMA + ".OFMID NOT NULL ENABLE,\n" + - " \"LAYERID\" NUMBER(5) NOT NULL ENABLE,\n" + - " \"ELEMENT\" \"" + UDT_SCHEMA + "\".\"RAWS\" NOT NULL ENABLE \n" + - " )"; + " \"ELMNO\" INTEGER NOT NULL ENABLE,\n" + + " \"XLOW\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"YLOW\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"XHIGH\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"YHIGH\" BINARY_DOUBLE NOT NULL ENABLE,\n" + + " \"EXTENTS\" MDSYS.SDO_GEOMETRY, \n" + + " \"PROPS\" INTEGER NOT NULL ENABLE,\n" + + " \"ID\" " + UDT_SCHEMA + ".OFMID NOT NULL ENABLE,\n" + + " \"LAYERID\" NUMBER(5) NOT NULL ENABLE,\n" + + " \"ELEMENT\" \"" + UDT_SCHEMA + "\".\"RAWS\" NOT NULL ENABLE \n" + + " )"; /** * Trigger */ protected static final String TRG_SPACENODE = "CREATE OR REPLACE TRIGGER \"%s\".\"%s\"\n" - + " AFTER DELETE OR INSERT OR UPDATE ON \"%s\".\"%s\"\n" + " BEGIN\n" - + " UPDATE SPACENODES SET LASTUPDATE = SYSDATE\n" + " WHERE SNID = \"%d\";\n" - + " END;"; + + " AFTER DELETE OR INSERT OR UPDATE ON \"%s\".\"%s\"\n" + " BEGIN\n" + + " UPDATE SPACENODES SET LASTUPDATE = SYSDATE\n" + " WHERE SNID = \"%d\";\n" + + " END;"; protected static final String TRG_ELMINDEX = - "CREATE OR REPLACE TRIGGER \"%s\".\"%s\"\n" - + " AFTER INSERT OR UPDATE OR DELETE ON \"%s\".\"%s\"\n" - + " REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW\n" - + " BEGIN\n" - + " IF INSERTING THEN\n" - + " INSERT INTO \"%s\".\"%s\" (ELMNO, TYPE, XLOW, YLOW, XHIGH, YHIGH,\n" - + " UFID, FSC, COMPID, OCCID, SPACENAME)\n" - + " VALUES (SD$ELEMENTNUMBER_SEQ.NEXTVAL, :new.ELMTYPE, :new.XLOW, :new.YLOW, :new.XHIGH, :new.YHIGH,\n" - + " :new.UFID, :new.FSC, :new.COMPID, :new.OCCID, '%s');\n" - + " ELSIF DELETING THEN\n" - + " DELETE FROM \"%s\".\"%s\"\n" - + " WHERE \"%s\".UFID = :old.UFID AND\n" - + " \"%s\".FSC = :old.FSC AND\n" - + " \"%s\".COMPID = :old.COMPID AND\n" - + " \"%s\".OCCID = :old.OCCID;\n" - + " ELSE\n" + " UPDATE \"%s\"\n" - + " SET XLOW = :new.XLOW, YLOW = :new.YLOW, XHIGH = :new.XHIGH, YHIGH = :new.YHIGH\n" - + " WHERE FSC = :new.FSC AND UFID = :new.UFID AND COMPID = :new.COMPID AND OCCID = :new.OCCID;\n" - + " END IF;\n" + " END;"; + "CREATE OR REPLACE TRIGGER \"%s\".\"%s\"\n" + + " AFTER INSERT OR UPDATE OR DELETE ON \"%s\".\"%s\"\n" + + " REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW\n" + + " BEGIN\n" + + " IF INSERTING THEN\n" + + " INSERT INTO \"%s\".\"%s\" (ELMNO, TYPE, XLOW, YLOW, XHIGH, YHIGH,\n" + + " UFID, FSC, COMPID, OCCID, SPACENAME)\n" + + " VALUES (SD$ELEMENTNUMBER_SEQ.NEXTVAL, :new.ELMTYPE, :new.XLOW, :new.YLOW, :new.XHIGH, :new.YHIGH,\n" + + " :new.UFID, :new.FSC, :new.COMPID, :new.OCCID, '%s');\n" + + " ELSIF DELETING THEN\n" + + " DELETE FROM \"%s\".\"%s\"\n" + + " WHERE \"%s\".UFID = :old.UFID AND\n" + + " \"%s\".FSC = :old.FSC AND\n" + + " \"%s\".COMPID = :old.COMPID AND\n" + + " \"%s\".OCCID = :old.OCCID;\n" + + " ELSE\n" + " UPDATE \"%s\"\n" + + " SET XLOW = :new.XLOW, YLOW = :new.YLOW, XHIGH = :new.XHIGH, YHIGH = :new.YHIGH\n" + + " WHERE FSC = :new.FSC AND UFID = :new.UFID AND COMPID = :new.COMPID AND OCCID = :new.OCCID;\n" + + " END IF;\n" + " END;"; /** * copy connectivity to connectivity_webcheck sql @@ -179,50 +178,65 @@ public static final String CONNECTIVITY_WEBCHECK_NAME = "CONNECTIVITY_WEBCHECK"; public static final String TRUNCATE_CONNECTIVITY_WEBCHECK = "TRUNCATE TABLE BASEDB.CONNECTIVITY_WEBCHECK"; public static final String CREATE_CONNECTIVITY_WEBCHECK = "CREATE TABLE BASEDB.CONNECTIVITY_WEBCHECK (\n" + - " \"FSC\" NUMBER(5) NOT NULL," + - " \"UFID\" NUMBER(10) NOT NULL," + - " \"N1\" NUMBER(10)," + - " \"N2\" NUMBER(10)," + - " \"FDR1\" NUMBER(5)," + - " \"FDR2\" NUMBER(5)," + - " \"DIR\" NUMBER(3)," + - " \"OHUG\" NUMBER(3)," + - " \"OSTATUS\" NUMBER(3)," + - " \"PHASE\" NUMBER(3)," + - " \"X\" NUMBER(10,3) NOT NULL," + - " \"Y\" NUMBER(10,3) NOT NULL" + - ")"; + " \"FSC\" NUMBER(5) NOT NULL," + + " \"UFID\" NUMBER(10) NOT NULL," + + " \"N1\" NUMBER(10)," + + " \"N2\" NUMBER(10)," + + " \"FDR1\" NUMBER(5)," + + " \"FDR2\" NUMBER(5)," + + " \"DIR\" NUMBER(3)," + + " \"OHUG\" NUMBER(3)," + + " \"OSTATUS\" NUMBER(3)," + + " \"PHASE\" NUMBER(3)," + + " \"X\" NUMBER(10,3) NOT NULL," + + " \"Y\" NUMBER(10,3) NOT NULL" + + ")"; public static final String COPY_CONNECTIVITY_TO_WEBCHECK = "INSERT /*+ APPEND */ INTO BASEDB.CONNECTIVITY_WEBCHECK\n" + - "(FSC, UFID, N1, N2, FDR1, FDR2, DIR, OHUG,OSTATUS, PHASE, X, Y)\n" + - "SELECT FSC, UFID, N1, N2, FDR1, FDR2, DIR, OHUG, OSTATUS, PHASE, X, Y FROM BASEDB.CONNECTIVITY "; + "(FSC, UFID, N1, N2, FDR1, FDR2, DIR, OHUG,OSTATUS, PHASE, X, Y)\n" + + "SELECT FSC, UFID, N1, N2, FDR1, FDR2, DIR, OHUG, OSTATUS, PHASE, X, Y FROM BASEDB.CONNECTIVITY "; public static final String CREATE_CONNECTIVITY_WEBCHECK_INDEX_1 = - "CREATE INDEX BASEDB.CONNECTIVITY_FDR1_WEB ON BASEDB.CONNECTIVITY_WEBCHECK (FDR1)"; + "CREATE INDEX BASEDB.CONNECTIVITY_FDR1_WEB ON BASEDB.CONNECTIVITY_WEBCHECK (FDR1)"; public static final String CREATE_CONNECTIVITY_WEBCHECK_INDEX_2 = - "CREATE INDEX BASEDB.CONNECTIVITY_FSCUFID_INDEX_WEB ON BASEDB.CONNECTIVITY_WEBCHECK (FSC, UFID)"; + "CREATE INDEX BASEDB.CONNECTIVITY_FSCUFID_INDEX_WEB ON BASEDB.CONNECTIVITY_WEBCHECK (FSC, UFID)"; public static final String CREATE_CONNECTIVITY_WEBCHECK_INDEX_3 = - "CREATE INDEX BASEDB.CONNECTIVITY_N1TON2_WEB ON BASEDB.CONNECTIVITY_WEBCHECK (N1, N2)"; + "CREATE INDEX BASEDB.CONNECTIVITY_N1TON2_WEB ON BASEDB.CONNECTIVITY_WEBCHECK (N1, N2)"; public static final String CREATE_CONNECTIVITY_WEBCHECK_INDEX_4 = - "CREATE INDEX BASEDB.CONNECTIVITY_N1_INDEX_WEB ON BASEDB.CONNECTIVITY_WEBCHECK (N1)"; + "CREATE INDEX BASEDB.CONNECTIVITY_N1_INDEX_WEB ON BASEDB.CONNECTIVITY_WEBCHECK (N1)"; public static final String CREATE_CONNECTIVITY_WEBCHECK_INDEX_5 = - "CREATE INDEX BASEDB.CONNECTIVITY_N2TON1_WEB ON BASEDB.CONNECTIVITY_WEBCHECK (N2, N1)"; + "CREATE INDEX BASEDB.CONNECTIVITY_N2TON1_WEB ON BASEDB.CONNECTIVITY_WEBCHECK (N2, N1)"; public static final String CREATE_CONNECTIVITY_WEBCHECK_INDEX_6 = - "CREATE INDEX BASEDB.CONNECTIVITY_N2_INDEX_WEB ON BASEDB.CONNECTIVITY_WEBCHECK (N2)"; + "CREATE INDEX BASEDB.CONNECTIVITY_N2_INDEX_WEB ON BASEDB.CONNECTIVITY_WEBCHECK (N2)"; public static final String ALTER_CONNECTIVITY_WEBCHECK_1 = - "ALTER TABLE BASEDB.CONNECTIVITY_WEBCHECK ADD (\n" + + "ALTER TABLE BASEDB.CONNECTIVITY_WEBCHECK ADD (\n" + " CONSTRAINT CONNECT_UNI_WEB UNIQUE (FSC,UFID))"; public static final String ALTER_CONNECTIVITY_WEBCHECK_2 = - "ALTER TABLE BASEDB.CONNECTIVITY_WEBCHECK ADD (\n" + + "ALTER TABLE BASEDB.CONNECTIVITY_WEBCHECK ADD (\n" + " CONSTRAINT CONN_N1N2_WEB UNIQUE (N1,N2))"; + + + public static final String GET_HIBERNATE_SEQUENCE= + "SELECT BASEDB.HIBERNATE_SEQUENCE.NEXTVAL FROM DUAL"; + + public static final String CREATE_HIBERNATE_SEQUENCE= + "CREATE SEQUENCE BASEDB.HIBERNATE_SEQUENCE\n" + + " START WITH 1\n" + + " MAXVALUE 999999999999999999999999999\n" + + " MINVALUE 1\n" + + " NOCYCLE\n" + + " CACHE 20\n" + + " NOORDER"; + + public static String FETCH_TPDATA = "SELECT TPID, TPNAME FROM BASEDB.TPDATA"; /** * @@ -236,66 +250,75 @@ * Encoding of URL path. */ protected static final String ENCODING = "UTF-8"; - protected OracleDataStore sourceDataStore; + protected JDBCDataStore sourceDataStore; protected String _dataPath; protected Properties properties; protected boolean _elementLogging; private Connection connection = null; + private boolean profileMode; + private boolean useTransform; - public OracleDataStore getSourceDataStore() - { + private short distId; + private String distName; + + private long _processTime; + private long _updateTime; + private long _processTimeStart; + private long _updateTimeStart; + + public AbstractOracleJobContext(boolean profileMode, boolean useTransform) { + this.profileMode = profileMode; + this.useTransform = useTransform; + } + + public JDBCDataStore getSourceDataStore() { return sourceDataStore; } - public void setSourceDataStore(DataStore sourceDataStore) - { - if ((sourceDataStore != null) && (sourceDataStore instanceof OracleDataStore)) - { - this.sourceDataStore = (OracleDataStore) sourceDataStore; - } else - { + public void setSourceDataStore(DataStore sourceDataStore) { + if ((sourceDataStore != null) && (sourceDataStore instanceof JDBCDataStore)) { + this.sourceDataStore = (JDBCDataStore) sourceDataStore; + } else { assert sourceDataStore != null; getLogger().warn("setSourceDataStore(datastore) need OracleDataStore but got " + - sourceDataStore.getClass().getName()); + sourceDataStore.getClass().getName()); } } - public Connection getOracleConnection() - { + public Connection getOracleConnection() { if (connection != null) return connection; - try - { - if (sourceDataStore != null) - { + try { + if (sourceDataStore != null) { connection = sourceDataStore.getConnection(Transaction.AUTO_COMMIT); } - - } catch (IOException e) - { + } catch (IOException e) { getLogger().warn(e.getMessage(), e); } return connection; } - public void setDataPath(String dataPath) - { + public void closeOracleConnection() { + if (connection == null) { + JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); + connection = null; + } + } + + public void setDataPath(String dataPath) { _dataPath = dataPath; } - public String getDataPath() - { + public String getDataPath() { return _dataPath; } - public boolean getElementLogging() - { + public boolean getElementLogging() { return _elementLogging; } - public void setElementLogging(boolean elementLogging) - { + public void setElementLogging(boolean elementLogging) { _elementLogging = elementLogging; } @@ -306,4 +329,60 @@ public abstract void rollbackTransaction(); protected abstract Log getLogger(); + + public final boolean isProfileMode() { + return profileMode; + } + + public boolean isTransformed() { + return useTransform; + } + + public final void accumulateProcessTime() { + _processTime += System.currentTimeMillis() - _processTimeStart; + } + + public final void accumulateUpdateTime() { + _updateTime += System.currentTimeMillis() - _updateTimeStart; + } + + public final long getProcessTime() { + return _processTime; + } + + public final long getUpdateTime() { + return _updateTime; + } + + public final void markProcessTime() { + _processTimeStart = System.currentTimeMillis(); + } + + public final void markUpdateTime() { + _updateTimeStart = System.currentTimeMillis(); + } + + public final void resetUpdateTime() { + _updateTime = 0; + } + + public final void resetProcessTime() { + _processTime = 0; + } + + public short getDistId() { + return distId; + } + + public void setDistId(short distId) { + this.distId = distId; + } + + public String getDistName() { + return distName; + } + + public void setDistName(String distName) { + this.distName = distName; + } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/OracleUpgradeJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/OracleUpgradeJobContext.java index 29e1acf..12722c3 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/OracleUpgradeJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/OracleUpgradeJobContext.java @@ -2,22 +2,21 @@ import org.apache.commons.logging.Log; -public class OracleUpgradeJobContext extends AbstractOracleJobContext -{ - public void startTransaction() - { +public class OracleUpgradeJobContext extends AbstractOracleJobContext { + public OracleUpgradeJobContext(boolean profileMode, boolean useTransform) { + super(profileMode, useTransform); } - public void commitTransaction() - { + public void startTransaction() { } - public void rollbackTransaction() - { + public void commitTransaction() { } - protected Log getLogger() - { + public void rollbackTransaction() { + } + + protected Log getLogger() { return null; //To change body of implemented methods use File | Settings | File Templates. } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/AbstractDgnToEdbGeoJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/AbstractDgnToEdbGeoJobContext.java new file mode 100644 index 0000000..011c4ab --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/AbstractDgnToEdbGeoJobContext.java @@ -0,0 +1,672 @@ +package com.ximple.eofms.jobs.context.edbgeo; + +import java.io.IOException; +import java.math.BigDecimal; +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.*; + +import com.vividsolutions.jts.geom.LinearRing; +import com.ximple.eofms.util.FeatureTypeBuilderUtil; +import org.geotools.data.DataSourceException; +import org.geotools.data.DataStore; +import org.geotools.data.SchemaNotFoundException; +import org.geotools.data.Transaction; +import org.geotools.data.jdbc.JDBCUtils; +import org.geotools.filter.LengthFunction; +import org.geotools.jdbc.JDBCDataStore; +import org.geotools.referencing.NamedIdentifier; +import org.geotools.referencing.crs.DefaultGeographicCRS; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import org.opengis.feature.type.AttributeDescriptor; +import org.opengis.feature.type.AttributeType; +import org.opengis.feature.type.GeometryDescriptor; +import org.opengis.feature.type.PropertyType; +import org.opengis.filter.BinaryComparisonOperator; +import org.opengis.filter.Filter; +import org.opengis.filter.PropertyIsLessThan; +import org.opengis.filter.PropertyIsLessThanOrEqualTo; +import org.opengis.filter.expression.Literal; +import org.opengis.referencing.crs.CoordinateReferenceSystem; + +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.GeometryCollection; +import com.vividsolutions.jts.geom.LineString; +import com.vividsolutions.jts.geom.MultiLineString; +import com.vividsolutions.jts.geom.MultiPoint; +import com.vividsolutions.jts.geom.MultiPolygon; +import com.vividsolutions.jts.geom.Point; +import com.vividsolutions.jts.geom.Polygon; +import com.vividsolutions.jts.io.WKBWriter; +import com.vividsolutions.jts.io.WKTWriter; + +import com.ximple.eofms.jobs.context.AbstractDgnFileJobContext; +import com.ximple.eofms.util.postjts.JtsBinaryWriter; + +public abstract class AbstractDgnToEdbGeoJobContext extends AbstractDgnFileJobContext { + private static Map<String, Class> GEOM_TYPE_MAP = new HashMap<String, Class>(); + private static Map<String, Class> GEOM3D_TYPE_MAP = new HashMap<String, Class>(); + + static { + GEOM_TYPE_MAP.put("GEOMETRY", Geometry.class); + GEOM_TYPE_MAP.put("POINT", Point.class); + GEOM_TYPE_MAP.put("LINESTRING", LineString.class); + GEOM_TYPE_MAP.put("POLYGON", Polygon.class); + GEOM_TYPE_MAP.put("MULTIPOINT", MultiPoint.class); + GEOM_TYPE_MAP.put("MULTILINESTRING", MultiLineString.class); + GEOM_TYPE_MAP.put("MULTIPOLYGON", MultiPolygon.class); + GEOM_TYPE_MAP.put("GEOMETRYCOLLECTION", GeometryCollection.class); + + GEOM3D_TYPE_MAP.put("POINTM", Point.class); + GEOM3D_TYPE_MAP.put("LINESTRINGM", LineString.class); + GEOM3D_TYPE_MAP.put("POLYGONM", Polygon.class); + GEOM3D_TYPE_MAP.put("MULTIPOINTM", MultiPoint.class); + GEOM3D_TYPE_MAP.put("MULTILINESTRINGM", MultiLineString.class); + GEOM3D_TYPE_MAP.put("MULTIPOLYGONM", MultiPolygon.class); + GEOM3D_TYPE_MAP.put("GEOMETRYCOLLECTIONM", GeometryCollection.class); + } + + private static Map<Class, String> CLASS_MAPPINGS = new HashMap<Class, String>(); + + static { + CLASS_MAPPINGS.put(String.class, "VARCHAR"); + + CLASS_MAPPINGS.put(Boolean.class, "BOOLEAN"); + + CLASS_MAPPINGS.put(Short.class, "SMALLINT"); + CLASS_MAPPINGS.put(Integer.class, "INTEGER"); + CLASS_MAPPINGS.put(Long.class, "BIGINT"); + + CLASS_MAPPINGS.put(Float.class, "REAL"); + CLASS_MAPPINGS.put(Double.class, "DOUBLE PRECISION"); + + CLASS_MAPPINGS.put(BigDecimal.class, "DECIMAL"); + + CLASS_MAPPINGS.put(java.sql.Date.class, "DATE"); + CLASS_MAPPINGS.put(java.util.Date.class, "DATE"); + CLASS_MAPPINGS.put(java.sql.Time.class, "TIME"); + CLASS_MAPPINGS.put(java.sql.Timestamp.class, "TIMESTAMP"); + } + + private static Map<Class, String> GEOM_CLASS_MAPPINGS = new HashMap<Class, String>(); + + //why don't we just stick this in with the non-geom class mappings? + static { + // init the inverse map + Set keys = GEOM_TYPE_MAP.keySet(); + + for (Object key : keys) { + String name = (String) key; + Class geomClass = GEOM_TYPE_MAP.get(name); + GEOM_CLASS_MAPPINGS.put(geomClass, name); + } + } + + /** + * Maximum string size for postgres + */ + private static final int MAX_ALLOWED_VALUE = 10485760; + + // protected static final int BATCHSIZE = 2048; + protected static final int BATCHSIZE = 256; + + /** + * Well Known Text writer (from JTS). + */ + protected static WKTWriter geometryWriter = new WKTWriter(); + protected static JtsBinaryWriter binaryWriter = new JtsBinaryWriter(); + + private JDBCDataStore targetDataStore; + // protected Connection connection; + protected String targetSchema = "public"; + + protected boolean schemaEnabled = true; + + public AbstractDgnToEdbGeoJobContext(String dataPath, DataStore targetDataStore, String targetSchema, + boolean profileMode, boolean useTransform) { + super(dataPath, profileMode, useTransform); + if ((targetDataStore != null) && (targetDataStore instanceof JDBCDataStore)) { + this.targetDataStore = (JDBCDataStore) targetDataStore; + } else { + getLogger().info("targetDataStore has wrong."); + } + // this.connection = connection; + setTargetSchema(targetSchema); + } + + public JDBCDataStore getTargetDataStore() { + return targetDataStore; + } + + public void setTargetDataStore(JDBCDataStore targetDataStore) { + this.targetDataStore = targetDataStore; + } + + public String getTargetSchema() { + return targetSchema; + } + + public void setTargetSchema(String schemaName) { + targetSchema = schemaName; + } + + public Connection getConnection() { + try { + return targetDataStore.getConnection(Transaction.AUTO_COMMIT); + + } catch (IOException e) + { + getLogger().warn(e.getMessage(), e); + return null; + } + // return connection; + } + + protected boolean isExistFeature(SimpleFeatureType featureType) { + try { + SimpleFeatureType existFeatureType = targetDataStore.getSchema(featureType.getTypeName()); + return existFeatureType != null; // && existFeatureType.equals(featureType); + } catch (SchemaNotFoundException e) { + return false; + } catch (IOException e) { + getLogger().info(e.getMessage(), e); + return false; + } + } + + protected void deleteTable(Connection conn, String tableName) throws SQLException { + Statement stmt = conn.createStatement(); + StringBuilder sb = new StringBuilder(); + sb.append("DELETE FROM \""); + sb.append(getTargetSchema()); + sb.append("\".\""); + sb.append(tableName); + sb.append('\"'); + stmt.execute(sb.toString()); + if (!conn.getAutoCommit()) + conn.commit(); + JDBCUtils.close(stmt); + } + + protected void dropTable(Connection conn, String tableName) throws SQLException { + Statement stmt = conn.createStatement(); + StringBuilder sb = new StringBuilder(); + sb.append("DROP TABLE \""); + sb.append(getTargetSchema()); + sb.append("\".\""); + sb.append(tableName); + sb.append("\""); + // sb.append(" CASCADE"); + stmt.execute(sb.toString()); + if (!conn.getAutoCommit()) + conn.commit(); + JDBCUtils.close(stmt); + } + + protected void dropGeometryColumn(Connection conn, String tableName, String geomField) throws SQLException { + Statement stmt = conn.createStatement(); + StringBuilder sb = new StringBuilder(); + sb.append("SELECT \"public\".DropGeometryColumn('','"); + sb.append(tableName); + sb.append("','"); + sb.append(geomField); + sb.append("')"); + stmt.execute(sb.toString()); + if (!conn.getAutoCommit()) + conn.commit(); + JDBCUtils.close(stmt); + } + + protected String dropGeometryColumn(String dbSchema, String tableName, String geomField) { + StringBuilder sb = new StringBuilder(); + sb.append("SELECT \"public\".DropGeometryColumn('"); + sb.append(dbSchema); + sb.append("','"); + sb.append(tableName); + sb.append("','"); + sb.append(geomField); + sb.append("')"); + getLogger().info("Execute-" + sb.toString()); + return sb.toString(); + } + + private String addGeometryColumn(String dbSchema, String tableName, GeometryDescriptor geometryDescriptor, int srid) { + StringBuilder sql; + String typeName = getGeometrySQLTypeName(((AttributeType) geometryDescriptor.getType()).getBinding()); + if (typeName == null) { + getLogger().warn("Error: " + geometryDescriptor.getLocalName() + " unknown type!!!"); + throw new RuntimeException("Error: " + geometryDescriptor.getLocalName() + " unknown type!!!"); + } + + sql = new StringBuilder("SELECT \"public\".AddGeometryColumn('"); + sql.append(dbSchema); + sql.append("','"); + sql.append(tableName); + sql.append("','"); + sql.append(geometryDescriptor.getLocalName()); + sql.append("','"); + sql.append(srid); + sql.append("','"); + sql.append(typeName); + sql.append("', 2);"); + + //prints statement for later reuse + return sql.toString(); + } + + public ArrayList<String> createNewSchemaTexts(Connection conn, SimpleFeatureType featureType) throws IOException { + String origintableName = featureType.getTypeName(); + String tableName = origintableName.toLowerCase(); + + ArrayList<String> result = new ArrayList<String>(); + + List<AttributeDescriptor> descriptors = featureType.getAttributeDescriptors(); + + boolean shouldDrop = tablePresent(getTargetSchema(), tableName, conn); + + if (shouldDrop) { + String sqlStr; + for (AttributeDescriptor descriptor : descriptors) { + if (!(descriptor instanceof GeometryDescriptor)) { + continue; + } + GeometryDescriptor geometryDescriptor = (GeometryDescriptor) descriptor; + sqlStr = dropGeometryColumn(getTargetSchema(), tableName, geometryDescriptor.getLocalName()); + getLogger().info(sqlStr); + result.add(sqlStr); + } + // sqlStr = "DROP TABLE " + encodeSchemaTableName(tableName) + " CASCADE;"; + sqlStr = "DROP TABLE " + encodeSchemaTableName(tableName) + " ;"; + getLogger().info(sqlStr); + result.add(sqlStr); + } + + StringBuilder sql = new StringBuilder("CREATE TABLE "); + sql.append(encodeSchemaTableName(tableName)); + sql.append(" ( gid serial PRIMARY KEY, "); + sql.append(makeNonGeomSqlCreate(descriptors)); + sql.append(");"); + + String sqlStr = sql.toString(); + getLogger().debug(sqlStr); + result.add(sqlStr); + + for (AttributeDescriptor descriptor : descriptors) { + if (!(descriptor instanceof GeometryDescriptor)) { + continue; + } + GeometryDescriptor geometryDescriptor = (GeometryDescriptor) descriptor; + + CoordinateReferenceSystem refSys = geometryDescriptor.getCoordinateReferenceSystem(); + int SRID = getSRID(refSys); + + sqlStr = addGeometryColumn(getTargetSchema(), tableName, geometryDescriptor, SRID); + getLogger().debug(sqlStr); + result.add(sqlStr); + + + String indexName = tableName.replace('-', '_'); + //also build a spatial index on each geometry column. + sql = new StringBuilder("CREATE INDEX \"spatial_"); + sql.append(indexName); + sql.append("_"); + sql.append(descriptor.getLocalName().toLowerCase()); + sql.append("\" ON "); + sql.append(encodeSchemaTableName(tableName)); + sql.append(" USING GIST ("); + sql.append(encodeSchemaColumnName(descriptor.getLocalName())); + sql.append(" );"); + // sql.append(" gist_geometry_ops);"); + + sqlStr = sql.toString(); + getLogger().debug(sqlStr); + + result.add(sqlStr); + } + return result; + } + + private int getSRID(CoordinateReferenceSystem refSys) { + int SRID; + if (refSys != null) { + try { + Set ident = refSys.getIdentifiers(); + if ((ident == null || ident.isEmpty()) && refSys == DefaultGeographicCRS.WGS84) { + SRID = 4326; + } else { + assert ident != null; + String code = ((NamedIdentifier) ident.toArray()[0]).getCode(); + SRID = Integer.parseInt(code); + } + } catch (Exception e) { + getLogger().warn("SRID could not be determined"); + SRID = -1; + } + } else { + SRID = -1; + } + return SRID; + } + + private boolean tablePresent(String schema, String table, Connection conn) throws IOException { + final int TABLE_NAME_COL = 3; + + ResultSet tables = null; + try { + DatabaseMetaData meta = conn.getMetaData(); + String[] tableType = {"TABLE"}; + tables = meta.getTables(null, schema, "%", tableType); + + while (tables.next()) { + String tableName = tables.getString(TABLE_NAME_COL); + + if (allowTable(tableName) && (tableName != null) + && (tableName.equalsIgnoreCase(table))) { + return (true); + } + } + + return false; + } catch (SQLException sqlException) { + String message = "Error querying database for list of tables:" + + sqlException.getMessage(); + throw new DataSourceException(message, sqlException); + } finally { + if (tables != null) + JDBCUtils.close(tables); + } + } + + protected boolean allowTable(String tablename) { + if (tablename.equals("geometry_columns")) { + return false; + } else if (tablename.startsWith("spatial_ref_sys")) { + return false; + } + + //others? + return true; + } + + + private StringBuilder makeNonGeomSqlCreate(List<AttributeDescriptor> descriptors) + throws IOException { + StringBuilder buf = new StringBuilder(""); + + for (AttributeDescriptor descriptor : descriptors) { + String typeName; + typeName = CLASS_MAPPINGS.get(((AttributeType) descriptor.getType()).getBinding()); + if (typeName == null) { + typeName = GEOM_CLASS_MAPPINGS.get(((AttributeType) descriptor.getType()).getBinding()); + if (typeName != null) continue; + } + + if (typeName != null) { + if (typeName.equals("VARCHAR")) { + int length = -1; + List<Filter> flist = ((PropertyType) descriptor.getType()).getRestrictions(); + for (Filter f : flist) { + if (f != null && f != Filter.EXCLUDE && f != Filter.INCLUDE && + (f instanceof PropertyIsLessThan || f instanceof PropertyIsLessThanOrEqualTo)) { + try { + BinaryComparisonOperator cf = (BinaryComparisonOperator) f; + if (cf.getExpression1() instanceof LengthFunction) { + length = Integer.parseInt(((Literal) cf.getExpression2()).getValue().toString()); + } else { + if (cf.getExpression2() instanceof LengthFunction) { + length = Integer.parseInt(((Literal) cf.getExpression1()).getValue().toString()); + } + } + } catch (NumberFormatException e) { + length = 256; + } + } else { + length = 256; + } + break; + } + if (length < 1) { + getLogger().warn("FeatureType did not specify string length; defaulted to 256"); + length = 256; + } else if (length > MAX_ALLOWED_VALUE) { + length = MAX_ALLOWED_VALUE; + } + typeName = typeName + "(" + length + ")"; + } + + if (!descriptor.isNillable()) { + typeName = typeName + " NOT NULL"; + } + + //TODO review!!! Is toString() always OK??? + Object defaultValue = descriptor.getDefaultValue(); + + if (defaultValue != null) { + typeName = typeName + " DEFAULT '" + + defaultValue.toString() + "'"; + } + + buf.append(" \"").append(descriptor.getLocalName()).append("\" ").append(typeName).append(","); + + } else { + String msg; + if (descriptor == null) { + msg = "AttributeType was null!"; + } else { + msg = "Type '" + ((AttributeType) descriptor.getType()).getBinding() + "' not supported!"; + } + throw (new IOException(msg)); + } + } + + return buf.deleteCharAt(buf.length() - 1); + } + + private String getGeometrySQLTypeName(Class type) { + String res = GEOM_CLASS_MAPPINGS.get(type); + + if (res == null) { + throw new RuntimeException("Unknown type name for class " + type + + " please update GEOMETRY_MAPPINGS"); + } + + return res; + } + + protected String getGeometryInsertText(Geometry geom, int srid) // throws IOException + { + if (geom == null) { + return "null"; + } + + /* + if (targetDataStore.isWKBEnabled()) { + //String wkb = WKBEncoder.encodeGeometryHex(geom); + String wkb = WKBWriter.bytesToHex(new WKBWriter().write(geom)); + + if (targetDataStore.isByteaWKB()) { + return "setSRID('" + wkb + "'::geometry," + srid + ")"; + } else { + return "GeomFromWKB('" + wkb + "', " + srid + ")"; + } + } + + String geoText = geometryWriter.write(geom); + return "GeometryFromText('" + geoText + "', " + srid + ")"; + */ + if (geom instanceof LinearRing) { + //postgis does not handle linear rings, convert to just a line string + geom = geom.getFactory().createLineString(((LinearRing) geom).getCoordinateSequence()); + } + return "ST_GeomFromText('" + geom.toText() + "', " + srid + ")"; + } + + protected String makeInsertSql(SimpleFeature feature, int srid) // throws IOException + { + SimpleFeatureType featureType = feature.getFeatureType(); + + String tableName = encodeSchemaTableName(featureType.getTypeName()); + List<AttributeDescriptor> descriptors = featureType.getAttributeDescriptors(); + + String attrValue; + + StringBuilder statementSQL = new StringBuilder("INSERT INTO " + tableName + " ("); + + // encode insertion for attributes, but remember to avoid auto-increment ones, + // they may be included in the feature type as well + for (AttributeDescriptor attributeType : descriptors) { + String attName = attributeType.getLocalName(); + + if (feature.getAttribute(attName) != null) { + String colName = encodeSchemaColumnName(attName); + statementSQL.append(colName).append(","); + } + } + + statementSQL.setCharAt(statementSQL.length() - 1, ')'); + statementSQL.append(" VALUES ("); + + List<Object> attributes = feature.getAttributes(); + + for (int i = 0; i < descriptors.size(); i++) { + attrValue = null; + + if (descriptors.get(i) instanceof GeometryDescriptor) { + // String geomName = descriptors[i].getLocalName(); + // int srid = ftInfo.getSRID(geomName); + Geometry geometry = (Geometry) attributes.get(i); + geometry.setSRID(FeatureTypeBuilderUtil.getDefaultFeatureSRID()); + + if (geometry == null) { + attrValue = "NULL"; + } else { + attrValue = getGeometryInsertText(geometry, srid); + } + } else { + if (attributes.get(i) != null) { + attrValue = addQuotes(attributes.get(i)); + } + } + + if (attrValue != null) { + statementSQL.append(attrValue).append(","); + } + } + + statementSQL.setCharAt(statementSQL.length() - 1, ')'); + + return (statementSQL.toString()); + } + + protected String makePrepareInsertSql(SimpleFeatureType featureType) { + String tableName = encodeSchemaTableName(featureType.getTypeName()); + List<AttributeDescriptor> attributeTypes = featureType.getAttributeDescriptors(); + + String attrValue; + + StringBuilder statementSQL = new StringBuilder("INSERT INTO " + tableName + " ("); + + // encode insertion for attributes, but remember to avoid auto-increment ones, + // they may be included in the feature type as well + for (AttributeDescriptor descriptor : attributeTypes) { + String attName = descriptor.getName().getLocalPart(); + + String colName = encodeSchemaColumnName(attName); + statementSQL.append(colName).append(","); + } + + statementSQL.setCharAt(statementSQL.length() - 1, ')'); + statementSQL.append(" VALUES ("); + + for (AttributeDescriptor attributeType : attributeTypes) { + statementSQL.append(" ? ,"); + } + + statementSQL.setCharAt(statementSQL.length() - 1, ')'); + + return (statementSQL.toString()); + } + + protected String addQuotes(Object value) { + String retString; + + if (value != null) { + if (value instanceof Number) { + retString = value.toString(); + } else { + retString = "'" + doubleQuote(value) + "'"; + } + } else { + retString = "null"; + } + + return retString; + } + + String doubleQuote(Object obj) { + return obj.toString().replaceAll("'", "''"); + } + + protected String encodeName(String tableName) { + return tableName; + } + + protected String encodeColumnName(String colName) { + return encodeName(colName); + } + + public String encodeSchemaTableName(String tableName) { + return schemaEnabled ? ("\"" + getTargetSchema() + "\".\"" + tableName + "\"") + : ("\"" + tableName + "\""); + } + + public String encodeSchemaColumnName(String columnName) { + return "\"" + columnName + "\""; + } + + protected void bindFeatureParameters(PreparedStatement pstmt, SimpleFeature feature) throws SQLException { + SimpleFeatureType featureType = feature.getFeatureType(); + + List<AttributeDescriptor> descriptors = featureType.getAttributeDescriptors(); + List<Object> attributes = feature.getAttributes(); + + for (int i = 0; i < descriptors.size(); i++) { + if (descriptors.get(i) instanceof GeometryDescriptor) { + pstmt.setBytes(i + 1, binaryWriter.writeBinary((Geometry) attributes.get(i))); + } else { + Class<?> bindingType = ((AttributeType) descriptors.get(i).getType()).getBinding(); + if (bindingType.equals(Short.class)) { + pstmt.setShort(i + 1, (Short) attributes.get(i)); + } else if (bindingType.equals(Integer.class)) { + pstmt.setInt(i + 1, (Integer) attributes.get(i)); + } else if (bindingType.equals(Long.class)) { + pstmt.setLong(i + 1, (Long) attributes.get(i)); + } else if (bindingType.equals(String.class)) { + pstmt.setString(i + 1, (String) attributes.get(i)); + } else if (bindingType.equals(Float.class)) { + pstmt.setFloat(i + 1, (Float) attributes.get(i)); + } else if (bindingType.equals(Double.class)) { + pstmt.setDouble(i + 1, (Double) attributes.get(i)); + } else if (bindingType.equals(Boolean.class)) { + pstmt.setBoolean(i + 1, (Boolean) attributes.get(i)); + } else if (bindingType.equals(BigDecimal.class)) { + pstmt.setBigDecimal(i + 1, (BigDecimal) attributes.get(i)); + } else if (bindingType.equals(java.sql.Date.class)) { + pstmt.setDate(i + 1, (java.sql.Date) attributes.get(i)); + } else if (bindingType.equals(java.sql.Time.class)) { + pstmt.setTime(i + 1, (java.sql.Time) attributes.get(i)); + } else if (bindingType.equals(java.sql.Timestamp.class)) { + pstmt.setTimestamp(i + 1, (java.sql.Timestamp) attributes.get(i)); + } else if (bindingType.equals(java.util.Date.class)) { + java.sql.Date sDate = new java.sql.Date(((java.util.Date) attributes.get(i)).getTime()); + pstmt.setDate(i + 1, sDate); + } + } + } + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/AbstractOracleToEdbGeoJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/AbstractOracleToEdbGeoJobContext.java new file mode 100644 index 0000000..b713ece --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/AbstractOracleToEdbGeoJobContext.java @@ -0,0 +1,699 @@ +package com.ximple.eofms.jobs.context.edbgeo; + +import java.io.IOException; +import java.math.BigDecimal; +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.*; + +import com.vividsolutions.jts.geom.LinearRing; +import com.ximple.eofms.util.FeatureTypeBuilderUtil; +import org.geotools.data.DataSourceException; +import org.geotools.data.DataStore; +import org.geotools.data.SchemaNotFoundException; +import org.geotools.filter.LengthFunction; +import org.geotools.jdbc.JDBCDataStore; +import org.geotools.referencing.NamedIdentifier; +import org.geotools.referencing.crs.DefaultGeographicCRS; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import org.opengis.feature.type.AttributeDescriptor; +import org.opengis.feature.type.AttributeType; +import org.opengis.feature.type.GeometryDescriptor; +import org.opengis.feature.type.PropertyType; +import org.opengis.filter.BinaryComparisonOperator; +import org.opengis.filter.Filter; +import org.opengis.filter.PropertyIsLessThan; +import org.opengis.filter.PropertyIsLessThanOrEqualTo; +import org.opengis.filter.expression.Literal; +import org.opengis.referencing.crs.CoordinateReferenceSystem; + +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.GeometryCollection; +import com.vividsolutions.jts.geom.LineString; +import com.vividsolutions.jts.geom.MultiLineString; +import com.vividsolutions.jts.geom.MultiPoint; +import com.vividsolutions.jts.geom.MultiPolygon; +import com.vividsolutions.jts.geom.Point; +import com.vividsolutions.jts.geom.Polygon; +import com.vividsolutions.jts.io.WKBWriter; +import com.vividsolutions.jts.io.WKTWriter; + +import com.ximple.eofms.jobs.context.AbstractOracleJobContext; +import com.ximple.eofms.util.postjts.JtsBinaryWriter; + +public abstract class AbstractOracleToEdbGeoJobContext extends AbstractOracleJobContext { + private static Map<String, Class> GEOM_TYPE_MAP = new HashMap<String, Class>(); + private static Map<String, Class> GEOM3D_TYPE_MAP = new HashMap<String, Class>(); + + static { + GEOM_TYPE_MAP.put("GEOMETRY", Geometry.class); + GEOM_TYPE_MAP.put("POINT", Point.class); + GEOM_TYPE_MAP.put("LINESTRING", LineString.class); + GEOM_TYPE_MAP.put("POLYGON", Polygon.class); + GEOM_TYPE_MAP.put("MULTIPOINT", MultiPoint.class); + GEOM_TYPE_MAP.put("MULTILINESTRING", MultiLineString.class); + GEOM_TYPE_MAP.put("MULTIPOLYGON", MultiPolygon.class); + GEOM_TYPE_MAP.put("GEOMETRYCOLLECTION", GeometryCollection.class); + + GEOM3D_TYPE_MAP.put("POINTM", Point.class); + GEOM3D_TYPE_MAP.put("LINESTRINGM", LineString.class); + GEOM3D_TYPE_MAP.put("POLYGONM", Polygon.class); + GEOM3D_TYPE_MAP.put("MULTIPOINTM", MultiPoint.class); + GEOM3D_TYPE_MAP.put("MULTILINESTRINGM", MultiLineString.class); + GEOM3D_TYPE_MAP.put("MULTIPOLYGONM", MultiPolygon.class); + GEOM3D_TYPE_MAP.put("GEOMETRYCOLLECTIONM", GeometryCollection.class); + } + + private static Map<Class, String> CLASS_MAPPINGS = new HashMap<Class, String>(); + + static { + CLASS_MAPPINGS.put(String.class, "VARCHAR"); + + CLASS_MAPPINGS.put(Boolean.class, "BOOLEAN"); + + CLASS_MAPPINGS.put(Short.class, "SMALLINT"); + CLASS_MAPPINGS.put(Integer.class, "INTEGER"); + CLASS_MAPPINGS.put(Long.class, "BIGINT"); + + CLASS_MAPPINGS.put(Float.class, "REAL"); + CLASS_MAPPINGS.put(Double.class, "DOUBLE PRECISION"); + + CLASS_MAPPINGS.put(BigDecimal.class, "DECIMAL"); + + CLASS_MAPPINGS.put(java.sql.Date.class, "DATE"); + CLASS_MAPPINGS.put(java.util.Date.class, "DATE"); + CLASS_MAPPINGS.put(java.sql.Time.class, "TIME"); + CLASS_MAPPINGS.put(java.sql.Timestamp.class, "TIMESTAMP"); + } + + private static Map<Class, String> GEOM_CLASS_MAPPINGS = new HashMap<Class, String>(); + + //why don't we just stick this in with the non-geom class mappings? + static { + // init the inverse map + Set keys = GEOM_TYPE_MAP.keySet(); + + for (Object key : keys) { + String name = (String) key; + Class geomClass = GEOM_TYPE_MAP.get(name); + GEOM_CLASS_MAPPINGS.put(geomClass, name); + } + } + + /** + * Maximum string size for postgres + */ + private static final int MAX_ALLOWED_VALUE = 10485760; + + // protected static final int BATCHSIZE = 512; + protected static final int BATCHSIZE = 128; + + /** + * Well Known Text writer (from JTS). + */ + protected static WKTWriter geometryWriter = new WKTWriter(); + protected static JtsBinaryWriter binaryWriter = new JtsBinaryWriter(); + + protected boolean schemaEnabled = true; + + private JDBCDataStore targetDataStore; + private String targetSchema = "public"; + + public AbstractOracleToEdbGeoJobContext(String dataPath, DataStore targetDataStore, String targetSchema, + boolean profileMode, boolean useTransform) { + super(profileMode, useTransform); + if ((targetDataStore != null) && (targetDataStore instanceof JDBCDataStore)) { + this.targetDataStore = (JDBCDataStore) targetDataStore; + } else { + getLogger().info("targetDataStore has wrong."); + } + setDataPath(dataPath); + setTargetSchema(targetSchema); + } + + public JDBCDataStore getTargetDataStore() { + return targetDataStore; + } + + public void setTargetDataStore(JDBCDataStore targetDataStore) { + this.targetDataStore = targetDataStore; + } + + public String getTargetSchema() { + return targetSchema; + } + + public void setTargetSchema(String schemaName) { + targetSchema = schemaName; + } + + public Connection getConnection() { + if (targetDataStore != null) { + try { + return targetDataStore.getDataSource().getConnection(); + } catch (SQLException e) { + getLogger().warn(e.getMessage(), e); + return null; + } + } + return null; + } + + protected boolean isExistFeature(SimpleFeatureType featureType) { + try { + SimpleFeatureType existFeatureType = targetDataStore.getSchema(featureType.getTypeName()); + return existFeatureType != null; // && existFeatureType.equals(featureType); + } catch (SchemaNotFoundException e) { + return false; + } catch (IOException e) { + getLogger().info(e.getMessage(), e); + return false; + } + } + + protected void deleteTable(Connection conn, String schemaName, String tableName) throws SQLException { + Statement stmt = conn.createStatement(); + StringBuilder sb = new StringBuilder(); + sb.append("DELETE FROM \""); + sb.append(schemaName); + sb.append("\".\""); + sb.append(tableName); + sb.append('\"'); + stmt.execute(sb.toString()); + stmt.close(); + conn.commit(); + } + + protected void dropTable(Connection conn, String schemaName, String tableName) throws SQLException { + Statement stmt = conn.createStatement(); + StringBuilder sb = new StringBuilder(); + sb.append("DROP TABLE \""); + sb.append(schemaName); + sb.append("\".\""); + sb.append(tableName); + sb.append("\""); + // sb.append(" CASCADE"); + stmt.execute(sb.toString()); + stmt.close(); + conn.commit(); + } + + protected void dropGeometryColumn(Connection conn, String dbSchema, String tableName, String geomField) throws SQLException { + Statement stmt = conn.createStatement(); + StringBuilder sb = new StringBuilder(); + sb.append("SELECT \"public\".DropGeometryColumn('"); + sb.append(dbSchema); + sb.append("','"); + sb.append(tableName); + sb.append("','"); + sb.append(geomField); + sb.append("')"); + stmt.execute(sb.toString()); + stmt.close(); + conn.commit(); + } + + protected String dropGeometryColumn(String dbSchema, String tableName, String geomField) { + StringBuilder sb = new StringBuilder(); + sb.append("SELECT \"public\".DropGeometryColumn('"); + sb.append(dbSchema); + sb.append("','"); + sb.append(tableName); + sb.append("','"); + sb.append(geomField); + sb.append("')"); + return sb.toString(); + } + + private String addGeometryColumn(String dbSchema, String tableName, GeometryDescriptor geometryDescriptor, int srid) { + StringBuilder sql; + String typeName = getGeometrySQLTypeName(((PropertyType)geometryDescriptor.getType()).getBinding()); + if (typeName == null) { + getLogger().warn("Error: " + geometryDescriptor.getLocalName() + " unknown type!!!"); + throw new RuntimeException("Error: " + geometryDescriptor.getLocalName() + " unknown type!!!"); + } + + sql = new StringBuilder("SELECT \"public\".AddGeometryColumn('"); + sql.append(dbSchema); + sql.append("','"); + sql.append(tableName); + sql.append("','"); + sql.append(geometryDescriptor.getLocalName()); + sql.append("','"); + sql.append(srid); + sql.append("','"); + sql.append(typeName); + sql.append("', 2);"); + + //prints statement for later reuse + return sql.toString(); + } + + public ArrayList<String> createNewSchemaTexts(Connection conn, SimpleFeatureType featureType) throws IOException { + String origintableName = featureType.getTypeName(); + String tableName = origintableName.toLowerCase(); + + ArrayList<String> result = new ArrayList<String>(); + + List<AttributeDescriptor> attributeType = featureType.getAttributeDescriptors(); + // String dbSchema = targetDataStore.getDatabaseSchemaName(); + + boolean shouldDrop = tablePresent(getTargetSchema(), tableName, conn); + if (shouldDrop) { + String sqlStr; + for (AttributeDescriptor descriptor : attributeType) { + if (!(descriptor instanceof GeometryDescriptor)) { + continue; + } + GeometryDescriptor geomAttribute = (GeometryDescriptor) descriptor; + sqlStr = dropGeometryColumn(getTargetSchema(), tableName, geomAttribute.getLocalName()); + getLogger().info(sqlStr); + result.add(sqlStr); + } + // sqlStr = "DROP TABLE " + encodeSchemaTableName(tableName) + " CASCADE;"; + sqlStr = "DROP TABLE " + encodeSchemaTableName(tableName) + " ;"; + getLogger().info(sqlStr); + result.add(sqlStr); + } + + StringBuilder sql = new StringBuilder("CREATE TABLE "); + sql.append(encodeSchemaTableName(tableName)); + sql.append(" ( gid serial PRIMARY KEY, "); + sql.append(makeNonGeomSqlCreate(attributeType)); + sql.append(");"); + + String sqlStr = sql.toString(); + getLogger().debug(sqlStr); + result.add(sqlStr); + + String indexName = tableName.replace('-', '_'); + + for (AttributeDescriptor descriptor : attributeType) { + if (!(descriptor instanceof GeometryDescriptor)) { + String fieldName = descriptor.getLocalName().toLowerCase(); + continue; + } + GeometryDescriptor geomDescriptor = (GeometryDescriptor) descriptor; + + CoordinateReferenceSystem refSys = geomDescriptor.getCoordinateReferenceSystem(); + int SRID = getSRID(refSys); + + sqlStr = addGeometryColumn(getTargetSchema(), tableName, geomDescriptor, SRID); + getLogger().debug(sqlStr); + result.add(sqlStr); + + //also build a spatial index on each geometry column. + sql = new StringBuilder("CREATE INDEX \""); + sql.append("spatial_"); + sql.append(indexName); + sql.append("_"); + sql.append(descriptor.getLocalName().toLowerCase()); + sql.append("\" ON "); + sql.append(encodeSchemaTableName(tableName)); + sql.append(" USING GIST ("); + sql.append(encodeSchemaColumnName(descriptor.getLocalName())); + sql.append(" );"); + // sql.append(" gist_geometry_ops);"); + + sqlStr = sql.toString(); + getLogger().debug(sqlStr); + result.add(sqlStr); + } + + if (origintableName.startsWith("fsc")) { + sql = new StringBuilder("CREATE INDEX \""); + sql.append("oid_"); + sql.append(indexName); + sql.append("\" ON "); + sql.append(encodeSchemaTableName(tableName)); + sql.append(" USING BTREE (\"tid\", \"oid\")"); + sqlStr = sql.toString(); + getLogger().debug(sqlStr); + result.add(sqlStr); + + sql = new StringBuilder("CREATE INDEX \""); + sql.append("lvwt_"); + sql.append(indexName); + sql.append("\" ON "); + sql.append(encodeSchemaTableName(tableName)); + sql.append(" USING BTREE (\"level\", \"symweight\")"); + sqlStr = sql.toString(); + getLogger().debug(sqlStr); + result.add(sqlStr); + } + + return result; + } + + private int getSRID(CoordinateReferenceSystem refSys) { + int SRID; + if (refSys != null) { + try { + Set ident = refSys.getIdentifiers(); + if ((ident == null || ident.isEmpty()) && refSys == DefaultGeographicCRS.WGS84) { + SRID = 4326; + } else { + String code = ((NamedIdentifier) ident.toArray()[0]).getCode(); + SRID = Integer.parseInt(code); + } + } catch (Exception e) { + getLogger().warn("SRID could not be determined"); + SRID = -1; + } + } else { + SRID = -1; + } + return SRID; + } + + private boolean tablePresent(String schema, String table, Connection conn) throws IOException { + final int TABLE_NAME_COL = 3; + + ResultSet tables = null; + try { + DatabaseMetaData meta = conn.getMetaData(); + String[] tableType = {"TABLE"}; + tables = meta.getTables(null, schema, "%", tableType); + + while (tables.next()) { + String tableName = tables.getString(TABLE_NAME_COL); + + if (allowTable(tableName) && (tableName != null) + && (tableName.equalsIgnoreCase(table))) { + return true; + } + } + + return false; + } catch (SQLException sqlException) { + // JDBCUtils.close(conn, Transaction.AUTO_COMMIT, sqlException); + String message = "Error querying database for list of tables:" + + sqlException.getMessage(); + throw new DataSourceException(message, sqlException); + } finally { + if (tables != null) try { + tables.close(); + } catch (SQLException e) { + } + // JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } + } + + protected boolean allowTable(String tablename) { + if (tablename.equals("geometry_columns")) { + return false; + } else if (tablename.startsWith("spatial_ref_sys")) { + return false; + } + + //others? + return true; + } + + + private StringBuffer makeNonGeomSqlCreate(List<AttributeDescriptor> descriptors) + throws IOException { + StringBuffer buf = new StringBuffer(""); + + for (AttributeDescriptor descriptor : descriptors) { + String typeName; + typeName = CLASS_MAPPINGS.get(((PropertyType) descriptor.getType()).getBinding()); + if (typeName == null) { + typeName = GEOM_CLASS_MAPPINGS.get(((PropertyType) descriptor.getType()).getBinding()); + if (typeName != null) continue; + } + + if (typeName != null) { + if (typeName.equals("VARCHAR")) { + int length = -1; + List<Filter> flist = ((PropertyType) descriptor.getType()).getRestrictions(); + for (Filter f : flist) { + if (f != null && f != Filter.EXCLUDE && f != Filter.INCLUDE && + (f instanceof PropertyIsLessThan || f instanceof PropertyIsLessThanOrEqualTo)) { + try { + BinaryComparisonOperator cf = (BinaryComparisonOperator) f; + if (cf.getExpression1() instanceof LengthFunction) { + length = Integer.parseInt(((Literal) cf.getExpression2()).getValue().toString()); + } else { + if (cf.getExpression2() instanceof LengthFunction) { + length = Integer.parseInt(((Literal) cf.getExpression1()).getValue().toString()); + } + } + } catch (NumberFormatException e) { + length = 512; + } + } else { + length = 512; + } + break; + } + + if (length < 1) { + getLogger().info("FeatureType did not specify string length; defaulted to 512"); + length = 512; + } else if (length > MAX_ALLOWED_VALUE) { + length = MAX_ALLOWED_VALUE; + } + typeName = typeName + "(" + length + ")"; + } + + if (!descriptor.isNillable()) { + typeName = typeName + " NOT NULL"; + } + + //TODO review!!! Is toString() always OK??? + Object defaultValue = descriptor.getDefaultValue(); + + if (defaultValue != null) { + typeName = typeName + " DEFAULT '" + + defaultValue.toString() + "'"; + } + + buf.append(" \"").append(descriptor.getLocalName()).append("\" ").append(typeName).append(","); + + } else { + String msg; + if (descriptor == null) { + msg = "AttributeType was null!"; + } else { + msg = "Type '" + ((PropertyType) descriptor.getType()).getBinding() + "' not supported!"; + } + throw (new IOException(msg)); + } + } + + return buf.deleteCharAt(buf.length() - 1); + } + + private String getGeometrySQLTypeName(Class type) { + String res = GEOM_CLASS_MAPPINGS.get(type); + + if (res == null) { + throw new RuntimeException("Unknown type name for class " + type + + " please update GEOMETRY_MAPPINGS"); + } + + return res; + } + + protected String getGeometryInsertText(Geometry geom, int srid) // throws IOException + { + if (geom == null) { + return "null"; + } + + /* + if (targetDataStore.isWKBEnabled()) { + //String wkb = WKBEncoder.encodeGeometryHex(geom); + String wkb = WKBWriter.bytesToHex(new WKBWriter().write(geom)); + + if (targetDataStore.isByteaWKB()) { + return "setSRID('" + wkb + "'::geometry," + srid + ")"; + } else { + return "GeomFromWKB('" + wkb + "', " + srid + ")"; + } + } + + String geoText = geometryWriter.write(geom); + return "GeometryFromText('" + geoText + "', " + srid + ")"; + */ + if (geom instanceof LinearRing) { + //postgis does not handle linear rings, convert to just a line string + geom = geom.getFactory().createLineString(((LinearRing) geom).getCoordinateSequence()); + } + return "ST_GeomFromText('" + geom.toText() + "', " + srid + ")"; + } + + protected String makeInsertSql(SimpleFeature feature, int srid) // throws IOException + { + SimpleFeatureType featureType = feature.getFeatureType(); + + String tableName = encodeSchemaTableName(featureType.getTypeName()); + List<AttributeDescriptor> descriptors = featureType.getAttributeDescriptors(); + + String attrValue; + + StringBuilder statementSQL = new StringBuilder(512); + statementSQL.append("INSERT INTO ").append(tableName).append(" ("); + + // encode insertion for attributes, but remember to avoid auto-increment ones, + // they may be included in the feature type as well + for (AttributeDescriptor attributeDescriptor : descriptors) { + String attName = attributeDescriptor.getLocalName(); + + if (feature.getAttribute(attName) != null) { + String colName = encodeSchemaColumnName(attName); + statementSQL.append(colName).append(","); + } + } + + statementSQL.setCharAt(statementSQL.length() - 1, ')'); + statementSQL.append(" VALUES ("); + + List<Object> attributes = feature.getAttributes(); + + for (int i = 0; i < descriptors.size(); i++) { + attrValue = null; + + if (descriptors.get(i) instanceof GeometryDescriptor) { + // String geomName = descriptors[i].getLocalName(); + // int srid = ftInfo.getSRID(geomName); + Geometry geometry = (Geometry) attributes.get(i); + + if (geometry == null) { + attrValue = "NULL"; + } else { + attrValue = getGeometryInsertText(geometry, srid); + } + } else { + if (attributes.get(i) != null) { + attrValue = addQuotes(attributes.get(i)); + } + } + + if (attrValue != null) { + statementSQL.append(attrValue).append(","); + } + } + + statementSQL.setCharAt(statementSQL.length() - 1, ')'); + + return (statementSQL.toString()); + } + + protected String makePrepareInsertSql(SimpleFeatureType featureType) { + String tableName = encodeSchemaTableName(featureType.getTypeName()); + List<AttributeDescriptor> descriptors = featureType.getAttributeDescriptors(); + + String attrValue; + + StringBuilder statementSQL = new StringBuilder("INSERT INTO " + tableName + " ("); + + // encode insertion for attributes, but remember to avoid auto-increment ones, + // they may be included in the feature type as well + for (AttributeDescriptor descriptor : descriptors) { + String attName = descriptor.getLocalName(); + + String colName = encodeSchemaColumnName(attName); + statementSQL.append(colName).append(","); + } + + statementSQL.setCharAt(statementSQL.length() - 1, ')'); + statementSQL.append(" VALUES ("); + + for (AttributeDescriptor descriptor : descriptors) { + statementSQL.append(" ? ,"); + } + + statementSQL.setCharAt(statementSQL.length() - 1, ')'); + + return (statementSQL.toString()); + } + + protected String addQuotes(Object value) { + String retString; + + if (value != null) { + if (value instanceof Number) { + retString = value.toString(); + } else { + retString = "'" + doubleQuote(value) + "'"; + } + } else { + retString = "null"; + } + + return retString; + } + + String doubleQuote(Object obj) { + return obj.toString().replaceAll("'", "''"); + } + + protected String encodeName(String tableName) { + return tableName; + } + + protected String encodeColumnName(String colName) { + return encodeName(colName); + } + + public String encodeSchemaTableName(String tableName) { + return schemaEnabled ? ("\"" + getTargetSchema() + "\".\"" + tableName + "\"") + : ("\"" + tableName + "\""); + } + + public String encodeSchemaColumnName(String columnName) { + return "\"" + columnName + "\""; + } + + protected void bindFeatureParameters(PreparedStatement pstmt, SimpleFeature feature) throws SQLException { + SimpleFeatureType featureType = feature.getFeatureType(); + + List<AttributeDescriptor> descriptors = featureType.getAttributeDescriptors(); + List<Object> attributes = feature.getAttributes(); + + for (int i = 0; i < descriptors.size(); i++) { + if (descriptors.get(i) instanceof GeometryDescriptor) { + // String wktTest = geometryWriter.write((Geometry) attributes.get(i)); + Geometry geom = (Geometry) attributes.get(i); + geom.setSRID(FeatureTypeBuilderUtil.getDefaultFeatureSRID()); + pstmt.setBytes(i + 1, binaryWriter.writeBinary((Geometry) attributes.get(i))); + } else { + Class<?> bindingType = ((AttributeType)descriptors.get(i).getType()).getBinding(); + if (bindingType.equals(Short.class)) { + pstmt.setShort(i + 1, (Short) attributes.get(i)); + } else if (bindingType.equals(Integer.class)) { + pstmt.setInt(i + 1, (Integer) attributes.get(i)); + } else if (bindingType.equals(Long.class)) { + pstmt.setLong(i + 1, (Long) attributes.get(i)); + } else if (bindingType.equals(String.class)) { + pstmt.setString(i + 1, (String) attributes.get(i)); + } else if (bindingType.equals(Float.class)) { + pstmt.setFloat(i + 1, (Float) attributes.get(i)); + } else if (bindingType.equals(Double.class)) { + pstmt.setDouble(i + 1, (Double) attributes.get(i)); + } else if (bindingType.equals(Boolean.class)) { + pstmt.setBoolean(i + 1, (Boolean) attributes.get(i)); + } else if (bindingType.equals(BigDecimal.class)) { + pstmt.setBigDecimal(i + 1, (BigDecimal) attributes.get(i)); + } else if (bindingType.equals(java.sql.Date.class)) { + pstmt.setDate(i + 1, (java.sql.Date) attributes.get(i)); + } else if (bindingType.equals(java.sql.Time.class)) { + pstmt.setTime(i + 1, (java.sql.Time) attributes.get(i)); + } else if (bindingType.equals(java.sql.Timestamp.class)) { + pstmt.setTimestamp(i + 1, (java.sql.Timestamp) attributes.get(i)); + } else if (bindingType.equals(java.util.Date.class)) { + java.sql.Date sDate = new java.sql.Date(((java.util.Date) attributes.get(i)).getTime()); + pstmt.setDate(i + 1, sDate); + } + } + + } + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/DummyFeatureConvertEdbGeoJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/DummyFeatureConvertEdbGeoJobContext.java new file mode 100644 index 0000000..4c8eba7 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/DummyFeatureConvertEdbGeoJobContext.java @@ -0,0 +1,234 @@ +package com.ximple.eofms.jobs.context.edbgeo; + +import java.io.File; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +import com.ximple.eofms.util.ElementDigesterUtils; +import org.apache.commons.digester3.Digester; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.transaction.memory.PessimisticMapWrapper; +import org.apache.commons.transaction.util.CommonsLoggingLogger; +import org.apache.commons.transaction.util.LoggerFacade; +import org.geotools.data.DataStore; +import org.geotools.data.FeatureWriter; +import org.geotools.data.Transaction; +import org.geotools.feature.SchemaException; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import org.xml.sax.SAXException; + +import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatcher; +import com.ximple.eofms.filter.TypeCompIdDispatchableFilter; +import com.ximple.eofms.filter.TypeCompLevelIdDispatchableFilter; +import com.ximple.eofms.filter.TypeIdDispatchableFilter; +import com.ximple.io.dgn7.ComplexElement; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.FrammeAttributeData; +import com.ximple.io.dgn7.UserAttributeData; + +public class DummyFeatureConvertEdbGeoJobContext extends AbstractDgnToEdbGeoJobContext { + static final Log logger = LogFactory.getLog(DummyFeatureConvertEdbGeoJobContext.class); + static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); + + private String dataOut = null; + + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); + private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); + + private PessimisticMapWrapper txFeaturesContext; + + private ElementDispatcher elementDispatcher; + private String _filterConfig; + private boolean withIndex = false; + + public DummyFeatureConvertEdbGeoJobContext(String dataPath, DataStore targetDataStore, String targetSchema, + String filterConfig, boolean profileMode, + boolean useTransform) { + super(dataPath, targetDataStore, targetSchema, profileMode, useTransform); + txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); + _filterConfig = filterConfig; + elementDispatcher = createElementDispatcher(); + } + + private ElementDispatcher createElementDispatcher() { + try { + URL filterURL = null; + if (_filterConfig != null) { + File config = new File(_filterConfig); + if (config.exists()) { + filterURL = config.toURI().toURL(); + } + } + if (filterURL == null) { + // config = new File("conf/DefaultConvertShpFilter.xml"); + filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); + // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); + } + assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); + return (ElementDispatcher) digester.parse(filterURL); + } catch (UnsupportedEncodingException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } catch (MalformedURLException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } catch (IOException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } catch (SAXException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } + } + + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { + assert elementDispatcher != null; + + if (element == null) { + logger.warn("Unknown Element:" + null); + return; + } + + // �P�_�O�_�ũM��� + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { + FrammeAttributeData linkage = + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + logger.warn("Unknown Element:" + element.getElementType().toString() + + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); + if (element instanceof ComplexElement) { + ComplexElement complex = (ComplexElement) element; + logger.warn("----Complex Element size=" + complex.size()); + } + + return; + } + + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); + } + ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); + arrayList.add(feature); + } + + public void startTransaction() { + assert elementDispatcher != null; + for (ElementDispatchableFilter filter : elementDispatcher.getRules()) { + if (filter instanceof TypeCompIdDispatchableFilter) { + ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); + } else if (filter instanceof TypeCompLevelIdDispatchableFilter) { + ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); + } else if (filter instanceof TypeIdDispatchableFilter) { + ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); + } + } + } + + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { + logger.debug("Transaction size = " + txFeaturesContext.size()); + //txFeaturesContext.commitTransaction(); + } else { + logger.debug("Transaction is empty."); + } + + if (!featuresContext.isEmpty()) { + updateDataStore(); + } + } + + public void rollbackTransaction() { + //txFeaturesContext.rollbackTransaction(); + if (!featuresContext.isEmpty()) { + updateDataStore(); + } + } + + private void updateDataStore() { + Iterator it = featuresContext.keySet().iterator(); + + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); + logger.debug("Begin Save EdbGeo:" + featureType.getTypeName()); + + FeatureWriter writer; + if (featuresWriterContext.containsKey(featureType.getTypeName())) { + writer = featuresWriterContext.get(featureType.getTypeName()); + } else { + if (!isExistFeature(featureType)) { + getTargetDataStore().createSchema(featureType); + writer = getTargetDataStore().getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT); + } else { + writer = getTargetDataStore().getFeatureWriterAppend(featureType.getTypeName(), Transaction.AUTO_COMMIT); + } + featuresWriterContext.put(featureType.getTypeName(), writer); + } + + ArrayList<SimpleFeature> features = featuresContext.get(featureType); + Iterator itFeature = features.iterator(); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); + } + //writer.close(); + logger.debug("End Save EdbGeo:" + featureType.getTypeName()); + } + featuresContext.clear(); + } catch (MalformedURLException e) { + logger.error(e.getMessage(), e); + } catch (IllegalAttributeException e) { + logger.error(e.getMessage(), e); + } catch (IOException e) { + logger.error(e.getMessage(), e); + } + } + + public void closeFeatureWriter() throws IOException { + + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { + featureWriter.close(); + } + + this.featuresWriterContext.clear(); + } + + 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 boolean isWithIndex() { + return withIndex; + } + + public void setWithIndex(boolean withIndex) { + this.withIndex = withIndex; + } + + public Log getLogger() { + return logger; + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/FeatureDgnConvertEdbGeoJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/FeatureDgnConvertEdbGeoJobContext.java new file mode 100644 index 0000000..cc87d2c --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/FeatureDgnConvertEdbGeoJobContext.java @@ -0,0 +1,224 @@ +package com.ximple.eofms.jobs.context.edbgeo; + +import java.io.File; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatcher; +import com.ximple.eofms.util.ElementDigesterUtils; +import com.ximple.io.dgn7.ComplexElement; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.FrammeAttributeData; +import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.digester3.Digester; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.transaction.memory.PessimisticMapWrapper; +import org.apache.commons.transaction.util.CommonsLoggingLogger; +import org.apache.commons.transaction.util.LoggerFacade; +import org.geotools.data.DataStore; +import org.geotools.data.FeatureWriter; +import org.geotools.data.Transaction; +import org.opengis.feature.IllegalAttributeException; +import org.geotools.feature.SchemaException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import org.xml.sax.SAXException; + +public class FeatureDgnConvertEdbGeoJobContext extends AbstractDgnToEdbGeoJobContext { + static final Log logger = LogFactory.getLog(FeatureDgnConvertEdbGeoJobContext.class); + static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); + + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); + private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); + + private PessimisticMapWrapper txFeaturesContext; + + private ElementDispatcher elementDispatcher; + private String _filterConfig; + private boolean withIndex = false; + + public FeatureDgnConvertEdbGeoJobContext(String dataPath, DataStore targetDataStore, String targetSchema, + String filterConfig, boolean profileMode, + boolean useTransform) { + super(dataPath, targetDataStore, targetSchema, profileMode, useTransform); + txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); + _filterConfig = filterConfig; + elementDispatcher = createElementDispatcher(); + } + + private ElementDispatcher createElementDispatcher() { + try { + URL filterURL = null; + if (_filterConfig != null) { + File config = new File(_filterConfig); + if (config.exists()) { + filterURL = config.toURI().toURL(); + } + } + if (filterURL == null) { + // config = new File("conf/DefaultConvertShpFilter.xml"); + filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); + // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); + } + assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); + return (ElementDispatcher) digester.parse(filterURL); + } catch (UnsupportedEncodingException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } catch (MalformedURLException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } catch (IOException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } catch (SAXException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } + } + + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { + assert elementDispatcher != null; + + if (element == null) { + logger.warn("Unknown Element:" + null); + return; + } + + // �P�_�O�_�ũM��� + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { + FrammeAttributeData linkage = + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + logger.warn("Unknown Element:" + element.getElementType().toString() + + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); + if (element instanceof ComplexElement) { + ComplexElement complex = (ComplexElement) element; + logger.warn("----Complex Element size=" + complex.size()); + } + + return; + } + + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); + } + ArrayList<SimpleFeature> arrayList = (ArrayList<SimpleFeature>) txFeaturesContext.get(feature.getFeatureType()); + arrayList.add(feature); + } + + public void startTransaction() { + } + + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { + logger.debug("Transaction size = " + txFeaturesContext.size()); + //txFeaturesContext.commitTransaction(); + } else { + logger.debug("Transaction is empty."); + } + + if (!featuresContext.isEmpty()) { + updateDataStore(); + } + } + + public void rollbackTransaction() { + //txFeaturesContext.rollbackTransaction(); + if (!featuresContext.isEmpty()) { + updateDataStore(); + } + } + + private void updateDataStore() { + Iterator it = featuresContext.keySet().iterator(); + + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); + logger.debug("Begin Save EdbGeo:" + featureType.getTypeName()); + + FeatureWriter writer; + if (featuresWriterContext.containsKey(featureType.getTypeName())) { + writer = featuresWriterContext.get(featureType.getTypeName()); + } else { + if (!isExistFeature(featureType)) { + getTargetDataStore().createSchema(featureType); + writer = getTargetDataStore().getFeatureWriter(featureType.getTypeName(), + Transaction.AUTO_COMMIT); + } else { + writer = getTargetDataStore().getFeatureWriterAppend(featureType.getTypeName(), + Transaction.AUTO_COMMIT); + } + featuresWriterContext.put(featureType.getTypeName(), writer); + } + + ArrayList<SimpleFeature> features = featuresContext.get(featureType); + Iterator itFeature = features.iterator(); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); + } + //writer.close(); + logger.debug("End Save EdbGeo:" + featureType.getTypeName()); + } + featuresContext.clear(); + } catch (MalformedURLException e) { + logger.error(e.getMessage(), e); + } catch (IllegalAttributeException e) { + logger.error(e.getMessage(), e); + } catch (IOException e) { + logger.error(e.getMessage(), e); + } + } + + public void closeFeatureWriter() { + this.featuresWriterContext.clear(); + + try { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { + featureWriter.close(); + } + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } + + this.featuresWriterContext.clear(); + } + + 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 boolean isWithIndex() { + return withIndex; + } + + public void setWithIndex(boolean withIndex) { + this.withIndex = withIndex; + } + + public Log getLogger() { + return logger; + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/GeneralDgnConvertEdbGeoJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/GeneralDgnConvertEdbGeoJobContext.java new file mode 100644 index 0000000..b7bf7f1 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/GeneralDgnConvertEdbGeoJobContext.java @@ -0,0 +1,575 @@ +package com.ximple.eofms.jobs.context.edbgeo; + +import java.io.IOException; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.TreeMap; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.transaction.util.CommonsLoggingLogger; +import org.apache.commons.transaction.util.LoggerFacade; +import org.geotools.data.DataStore; +import org.geotools.data.Transaction; +import org.geotools.data.jdbc.JDBCUtils; +import org.opengis.feature.IllegalAttributeException; +import org.geotools.feature.SchemaException; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.feature.type.FeatureTypeImpl; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import com.edb.util.PSQLException; + +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.GeometryFactory; + +import com.ximple.eofms.util.DefaultColorTable; +import com.ximple.eofms.util.FeatureTypeBuilderUtil; +import com.ximple.eofms.util.GeometryConverterDecorator; +import com.ximple.io.dgn7.ArcElement; +import com.ximple.io.dgn7.ComplexChainElement; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.EllipseElement; +import com.ximple.io.dgn7.FrammeAttributeData; +import com.ximple.io.dgn7.LineElement; +import com.ximple.io.dgn7.LineStringElement; +import com.ximple.io.dgn7.ShapeElement; +import com.ximple.io.dgn7.TextElement; +import com.ximple.io.dgn7.TextNodeElement; +import com.ximple.io.dgn7.UserAttributeData; + +public class GeneralDgnConvertEdbGeoJobContext extends AbstractDgnToEdbGeoJobContext { + static final Log logger = LogFactory.getLog(GeneralDgnConvertEdbGeoJobContext.class); + static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); + static final GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); + + private HashMap<SimpleFeatureType, ArrayList<SimpleFeature>> txFeaturesContext = new HashMap<SimpleFeatureType, ArrayList<SimpleFeature>>(); + + private TreeMap<String, SimpleFeatureType> featureTypes = new TreeMap<String, SimpleFeatureType>(); + + private String featureBaseName = null; + private boolean dropTableMode = true; + + private int accumulate = 0; + + public GeneralDgnConvertEdbGeoJobContext(String dataPath, DataStore targetDataStore, String targetSchema, + boolean profileMode, boolean useTransform) { + super(dataPath, targetDataStore, targetSchema, profileMode, useTransform); + } + + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { + SimpleFeatureType ft = lookupFeatureType(element); + if (ft != null) { + boolean canLog = true; + SimpleFeature feature = null; + try { + feature = createFeature(ft, element); + } catch (ArrayIndexOutOfBoundsException e) { + getLogger().warn(e.getMessage(), e); + canLog = false; + } catch (ClassCastException e) { + getLogger().warn(e.getMessage(), e); + } + + if (feature == null) { + if (!canLog) return; + + if (element instanceof TextElement) + logger.info("cannot craete feature." + element.toString() + "'" + + ((TextElement) element).getText() + "'"); + else if (element instanceof ShapeElement) + logger.info("cannot craete feature." + element.toString() + "'" + + ((ShapeElement) element).getVerticeSize() + "'" + + ((ShapeElement) element).getStartPoint()); + else if (element instanceof LineStringElement) + logger.info("cannot craete feature." + element.toString() + "'" + + ((LineStringElement) element).getVerticeSize() + "'" + + ((LineStringElement) element).getStartPoint()); + else if (element instanceof ArcElement) + logger.info("cannot craete feature." + element.toString() + "'" + + ((ArcElement) element).getOrigin().toString() + "'" + + ((ArcElement) element).getRotationAngle()); + + return; + } + + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); + } + ArrayList<SimpleFeature> arrayList = txFeaturesContext.get(feature.getFeatureType()); + if (feature.getDefaultGeometry() != null && !((Geometry)feature.getDefaultGeometry()).isEmpty()) { + arrayList.add(feature); + accumulate++; + } + } else { + logger.info("Unknown Element :" + element.getType() + ", lv=" + element.getLevelIndex()); + } + + if (accumulate > BATCHSIZE) { + commitTransaction(); + } + } + + // private Transaction transaction; + + public void startTransaction() { + } + + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { + logger.debug("Transaction size = " + txFeaturesContext.size()); + //txFeaturesContext.commitTransaction(); + } else { + logger.debug("Transaction is empty."); + } + + if (!txFeaturesContext.isEmpty()) { + updateDataStore(); + } + } + + public void rollbackTransaction() { + } + + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); + Iterator<SimpleFeatureType> it = txFeaturesContext.keySet().iterator(); + Connection conn = null; + try { + conn = getConnection(); + boolean autoCommit = conn.getAutoCommit(); + conn.setAutoCommit(false); + + while (it.hasNext()) { + SimpleFeatureType featureType = it.next(); + logger.debug("Begin Save into EdbGeo:" + featureType.getTypeName()); + + String bindingStmt = makePrepareInsertSql(featureType); + ArrayList<SimpleFeature> features = txFeaturesContext.get(featureType); + PreparedStatement pstmt = conn.prepareStatement(bindingStmt); + + for (SimpleFeature feature : features) { + // currentStmt = feature; + // Statement stmt = conn.createStatement(); + try { + // stmt.execute(feature); + bindFeatureParameters(pstmt, feature); + // pstmt.execute(); + pstmt.addBatch(); + } catch (PSQLException e) { + if (bindingStmt != null) { + logger.error("Execute:" + bindingStmt); + } + logger.error(e.getServerErrorMessage()); + logger.error(e.getMessage(), e); + } + } + + int[] numUpdates = pstmt.executeBatch(); + for (int i = 0; i < numUpdates.length; i++) { + if (numUpdates[i] == -2) + logger.warn("Execution " + i + ": unknown number of rows updated"); + } + conn.commit(); + + JDBCUtils.close(pstmt); + features.clear(); + logger.debug("End Save into EdbGeo:" + featureType.getTypeName()); + } + conn.setAutoCommit(autoCommit); + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + accumulate = 0; + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); + } + } + + public void closeFeatureWriter() { + txFeaturesContext.clear(); + /* + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) + { + featureWriter.close(); + } + + this.featuresWriterContext.clear(); + */ + } + + public SimpleFeatureType createPointFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalPointFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); + clearFeatureData(typeBuilder); + } + return featureTypes.get(featureName); + } + + public SimpleFeatureType createPolygonFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalPolygonFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); + clearFeatureData(typeBuilder); + } + return featureTypes.get(featureName); + } + + public SimpleFeatureType createLineFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalLineFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); + clearFeatureData(typeBuilder); + } + return featureTypes.get(featureName); + } + + public SimpleFeatureType createMultiLineFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalMultiLineFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); + clearFeatureData(typeBuilder); + } + return featureTypes.get(featureName); + } + + public SimpleFeatureType createArcFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalArcFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); + clearFeatureData(typeBuilder); + } + return featureTypes.get(featureName); + } + + public SimpleFeatureType createEllipseFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalEllipseFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); + clearFeatureData(typeBuilder); + } + return featureTypes.get(featureName); + } + + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { + DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); + + if (element instanceof TextElement) { + TextElement textElement = (TextElement) element; + convertDecorator.setConverter(textElement); + + Geometry geom = convertDecorator.toGeometry(geometryFactory); + double angle = textElement.getRotationAngle(); + String content = textElement.getText(); + content = content.replace('\u0000', ' '); + angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(textElement.getColorIndex()), + textElement.getFontIndex(), + textElement.getJustification(), + textElement.getTextHeight(), + textElement.getTextWidth(), + angle, + content + }, null); + } else { + logger.info("geometry is null." + element.toString()); + } + return null; + } else if (element instanceof TextNodeElement) { + TextNodeElement textNodeElement = (TextNodeElement) element; + convertDecorator.setConverter(textNodeElement); + + Geometry geom = convertDecorator.toGeometry(geometryFactory); + double angle = textNodeElement.getRotationAngle(); + angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); + String[] texts = textNodeElement.getTextArray(); + StringBuilder sb = new StringBuilder(); + for (String text : texts) { + if (sb.length() != 0) + sb.append("\n"); + String content = text.replace('\u0000', ' '); + sb.append(content); + } + + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(textNodeElement.getColorIndex()), + textNodeElement.getFontIndex(), + textNodeElement.getJustification(), + textNodeElement.getTextNodeHeight(), + textNodeElement.getTextNodeLength(), + angle, + sb.toString() + }, null); + } else { + logger.info("geometry is null." + element.toString()); + } + return null; + } else if (element instanceof ShapeElement) { + ShapeElement shapeElement = (ShapeElement) element; + convertDecorator.setConverter(shapeElement); + Geometry geom = convertDecorator.toGeometry(geometryFactory); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(shapeElement.getColorIndex()), + shapeElement.getWeight(), + shapeElement.getLineStyle() + }, null); + } else { + logger.info("geometry is null." + element.toString()); + } + return null; + } else if (element instanceof LineStringElement) { + LineStringElement linestring = (LineStringElement) element; + convertDecorator.setConverter(linestring); + Geometry geom = convertDecorator.toGeometry(geometryFactory); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(linestring.getColorIndex()), + linestring.getWeight(), + linestring.getLineStyle() + }, null); + } + return null; + } else if (element instanceof LineElement) { + LineElement line = (LineElement) element; + convertDecorator.setConverter(line); + Geometry geom = convertDecorator.toGeometry(geometryFactory); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(line.getColorIndex()), + line.getWeight(), + line.getLineStyle() + }, null); + } + return null; + } else if (element instanceof ArcElement) { + ArcElement arcElement = (ArcElement) element; + /* + logger.fatal("" + arcElement.getPrimary() + ":" + arcElement.getSecondary() + + "-" + arcElement.getStartAngle() + ":" + arcElement.getSweepAngle() + ":" + + arcElement.getRotationAngle() + ":" + arcElement.getOrigin()); + */ + convertDecorator.setConverter(arcElement); + Geometry geom = convertDecorator.toGeometry(geometryFactory); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(arcElement.getColorIndex()), + arcElement.getWeight(), + arcElement.getLineStyle() + }, null); + } + return null; + } else if (element instanceof EllipseElement) { + EllipseElement arcElement = (EllipseElement) element; + convertDecorator.setConverter(arcElement); + Geometry geom = convertDecorator.toGeometry(geometryFactory); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(arcElement.getColorIndex()), + arcElement.getWeight(), + arcElement.getLineStyle() + }, null); + } + return null; + } else if (element instanceof ComplexChainElement) { + ComplexChainElement complexChainElement = (ComplexChainElement) element; + convertDecorator.setConverter(complexChainElement); + Geometry geom = convertDecorator.toGeometry(geometryFactory); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(complexChainElement.getColorIndex()), + complexChainElement.getWeight(), + complexChainElement.getLineStyle() + }, null); + } + return null; + } + return null; + } + + private String getFeatureBaseName() { + if (featureBaseName == null) { + String dgnname = getFilename().toLowerCase(); + int i = dgnname.lastIndexOf("."); + if (i != -1) { + dgnname = dgnname.substring(0, i); + } + featureBaseName = dgnname; + } + return featureBaseName; + } + + private SimpleFeatureType lookupFeatureType(Element element) throws SchemaException, IllegalAttributeException { + String typeName; + if (element instanceof TextElement) { + typeName = getFeatureBaseName() + "_P"; + typeName = typeName.toLowerCase(); + if (!featureTypes.containsKey(typeName)) { + featureTypes.put(typeName, createPointFeatureElement(typeName)); + } + return featureTypes.get(typeName); + } else if (element instanceof TextNodeElement) { + typeName = getFeatureBaseName() + "_P"; + typeName = typeName.toLowerCase(); + if (!featureTypes.containsKey(typeName)) { + featureTypes.put(typeName, createPointFeatureElement(typeName)); + } + return featureTypes.get(typeName); + } else if (element instanceof LineStringElement) { + if (element instanceof ShapeElement) { + typeName = getFeatureBaseName() + "_R"; + typeName = typeName.toLowerCase(); + if (!featureTypes.containsKey(typeName)) { + featureTypes.put(typeName, createPolygonFeatureElement(typeName)); + } + return featureTypes.get(typeName); + } else { + typeName = getFeatureBaseName() + "_L"; + typeName = typeName.toLowerCase(); + if (!featureTypes.containsKey(typeName)) { + featureTypes.put(typeName, createLineFeatureElement(typeName)); + } + return featureTypes.get(typeName); + } + } else if (element instanceof LineElement) { + typeName = getFeatureBaseName() + "_L"; + typeName = typeName.toLowerCase(); + if (!featureTypes.containsKey(typeName)) { + featureTypes.put(typeName, createLineFeatureElement(typeName)); + } + return featureTypes.get(typeName); + } else if (element instanceof ComplexChainElement) { + typeName = getFeatureBaseName() + "_ML"; + typeName = typeName.toLowerCase(); + if (!featureTypes.containsKey(typeName)) { + featureTypes.put(typeName, createMultiLineFeatureElement(typeName)); + } + return featureTypes.get(typeName); + } else if (element instanceof ArcElement) { + typeName = getFeatureBaseName() + "_A"; + typeName = typeName.toLowerCase(); + if (!featureTypes.containsKey(typeName)) { + featureTypes.put(typeName, createArcFeatureElement(typeName)); + } + return featureTypes.get(typeName); + } else if (element instanceof EllipseElement) { + typeName = getFeatureBaseName() + "_R"; + typeName = typeName.toLowerCase(); + if (!featureTypes.containsKey(typeName)) { + featureTypes.put(typeName, createEllipseFeatureElement(typeName)); + } + return featureTypes.get(typeName); + } + + return null; + } + + 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 Log getLogger() { + return logger; + } + + public boolean isDropTableMode() { + return dropTableMode; + } + + public void setDropTableMode(boolean dropTableMode) { + this.dropTableMode = dropTableMode; + } + + protected void clearFeatureData(SimpleFeatureTypeBuilder typeBuilder) throws SchemaException { + if (isProfileMode()) markUpdateTime(); + + String featureName = typeBuilder.getName(); + Connection conn = null; + if (isExistFeature(typeBuilder.buildFeatureType())) { + try { + conn = getConnection(); + if (dropTableMode) { + dropGeometryColumn(conn, featureName, + ((FeatureTypeImpl)typeBuilder.buildFeatureType()).getGeometryDescriptor().getLocalName()); + dropTable(conn, featureName); + + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, typeBuilder.buildFeatureType()); + for (String stmtText : schemaTexts) { + Statement stmt = conn.createStatement(); + stmt.execute(stmtText); + JDBCUtils.close(stmt); + } + } else { + deleteTable(conn, featureName); + } + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } catch (IOException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + logger.warn(e.getMessage(), e); + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.warn(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); + } + } else { + try { + conn = getConnection(); + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, typeBuilder.buildFeatureType()); + for (String stmtText : schemaTexts) { + Statement stmt = conn.createStatement(); + stmt.execute(stmtText); + JDBCUtils.close(stmt); + } + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } catch (IOException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + logger.warn(e.getMessage(), e); + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.warn(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); + } + } + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/IndexDgnConvertEdbGeoJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/IndexDgnConvertEdbGeoJobContext.java new file mode 100644 index 0000000..f5c18d2 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/IndexDgnConvertEdbGeoJobContext.java @@ -0,0 +1,829 @@ +package com.ximple.eofms.jobs.context.edbgeo; + +import java.io.IOException; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.transaction.util.CommonsLoggingLogger; +import org.apache.commons.transaction.util.LoggerFacade; +import org.geotools.data.DataStore; +import org.geotools.data.Transaction; +import org.geotools.data.jdbc.JDBCUtils; +import org.opengis.feature.IllegalAttributeException; +import org.geotools.feature.SchemaException; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.feature.type.FeatureTypeImpl; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import com.edb.util.PSQLException; + +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.Envelope; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.GeometryFactory; +import com.vividsolutions.jts.geom.Polygon; + +import com.ximple.eofms.util.DefaultColorTable; +import com.ximple.eofms.util.FeatureTypeBuilderUtil; +import com.ximple.eofms.util.GeometryConverterDecorator; +import com.ximple.eofms.util.TPCLIDConverter; +import com.ximple.eofms.util.TWDDatumConverter; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.FrammeAttributeData; +import com.ximple.io.dgn7.ShapeElement; +import com.ximple.io.dgn7.TextElement; +import com.ximple.io.dgn7.UserAttributeData; + +public class IndexDgnConvertEdbGeoJobContext extends AbstractDgnToEdbGeoJobContext { + static final Log logger = LogFactory.getLog(IndexDgnConvertEdbGeoJobContext.class); + static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); + static final GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); + + private HashMap<SimpleFeatureType, ArrayList<SimpleFeature>> txFeaturesContext = + new HashMap<SimpleFeatureType, ArrayList<SimpleFeature>>(); + + private SimpleFeatureType featureType1 = null; + private SimpleFeatureType featureType2 = null; + private SimpleFeatureType featureType3 = null; + + private boolean dropTableMode = true; + private int accumulate = 0; + + public IndexDgnConvertEdbGeoJobContext(String dataPath, DataStore targetDataStore, String targetSchema, + boolean profileMode, boolean useTransform) { + super(dataPath, targetDataStore, targetSchema, profileMode, useTransform); + } + + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { + if ((!(element instanceof TextElement)) && (!(element instanceof ShapeElement))) { + return; + } + + if ((element instanceof TextElement)) { + putTextFeatureCollection((TextElement) element); + } + + if ((element instanceof ShapeElement)) { + putShapeFeatureCollection((ShapeElement) element); + } + } + + protected void putTextFeatureCollection(TextElement element) throws SchemaException, IllegalAttributeException { + SimpleFeature feature = createFeature(element); + if (feature == null) { + logger.info("cannot craete feature." + element.toString() + "'" + + element.getText() + "'"); + return; + } + + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); + } + ArrayList<SimpleFeature> arrayList = txFeaturesContext.get(feature.getFeatureType()); + arrayList.add(feature); + + feature = createFeature2(element); + if (feature == null) { + logger.info("cannot craete feature2." + element.toString() + "'" + + element.getText() + "'"); + return; + } + + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); + } + arrayList = txFeaturesContext.get(feature.getFeatureType()); + arrayList.add(feature); + + SimpleFeature[] features = createFeature3(element); + if (features == null) { + logger.info("cannot craete feature3." + element.toString() + "'" + + element.getText() + "'"); + return; + } + if (!txFeaturesContext.containsKey(features[0].getFeatureType())) { + txFeaturesContext.put(features[0].getFeatureType(), new ArrayList<SimpleFeature>()); + } + arrayList = txFeaturesContext.get(features[0].getFeatureType()); + arrayList.addAll(Arrays.asList(features)); + + accumulate++; + + if (accumulate > BATCHSIZE) { + commitTransaction(); + } + } + + protected void putShapeFeatureCollection(ShapeElement element) throws SchemaException, IllegalAttributeException { + SimpleFeature feature = createFeature(element); + if (feature == null) { + Polygon polygon = (Polygon) element.toGeometry(geometryFactory); + if (polygon == null) { + logger.info("cannot craete feature." + element.toString() + "'" + + "linear is null" + "'"); + } else { + Coordinate pt = polygon.getEnvelopeInternal().centre(); + String id = TPCLIDConverter.CoordinateToTpclId(pt); + logger.info("cannot craete feature." + element.toString() + "'" + + id + "'- from pt=" + pt); + } + return; + } + + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); + } + ArrayList<SimpleFeature> arrayList = txFeaturesContext.get(feature.getFeatureType()); + arrayList.add(feature); + + feature = createFeature2(element); + if (feature == null) { + Polygon polygon = (Polygon) element.toGeometry(geometryFactory); + if (polygon == null) { + logger.info("cannot craete feature2." + element.toString() + "'" + + "linear is null" + "'"); + } else { + Coordinate pt = polygon.getEnvelopeInternal().centre(); + String id = TPCLIDConverter.CoordinateToTpclId(pt); + logger.info("cannot craete feature2." + element.toString() + "'" + + id + "'- from pt=" + pt); + } + return; + } + + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); + } + arrayList = txFeaturesContext.get(feature.getFeatureType()); + arrayList.add(feature); + + SimpleFeature[] features = createFeature3(element); + if (features == null) { + Polygon polygon = (Polygon) element.toGeometry(geometryFactory); + if (polygon == null) { + logger.info("cannot craete feature3." + element.toString() + "'" + + "linear is null" + "'"); + } else { + Coordinate pt = polygon.getEnvelopeInternal().centre(); + String id = TPCLIDConverter.CoordinateToTpclId(pt); + logger.info("cannot craete feature3." + element.toString() + "'" + + id + "'- from pt=" + pt); + } + return; + } + if (!txFeaturesContext.containsKey(features[0].getFeatureType())) { + txFeaturesContext.put(features[0].getFeatureType(), new ArrayList<SimpleFeature>()); + } + arrayList = txFeaturesContext.get(features[0].getFeatureType()); + arrayList.addAll(Arrays.asList(features)); + + accumulate++; + + if (accumulate > BATCHSIZE) { + commitTransaction(); + } + } + + public void startTransaction() { + } + + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { + logger.debug("Transaction size = " + txFeaturesContext.size()); + } else { + logger.debug("Transaction is empty."); + } + + if (!txFeaturesContext.isEmpty()) { + updateDataStore(); + } + } + + public void rollbackTransaction() { + } + + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); + + Iterator<SimpleFeatureType> it = txFeaturesContext.keySet().iterator(); + Connection conn = null; + try { + conn = getConnection(); + boolean autoCommit = conn.getAutoCommit(); + conn.setAutoCommit(false); + + while (it.hasNext()) { + SimpleFeatureType featureType = it.next(); + logger.debug("Begin Save EdbGeo:" + featureType.getTypeName()); + + String bindingStmt = makePrepareInsertSql(featureType); + ArrayList<SimpleFeature> features = txFeaturesContext.get(featureType); + PreparedStatement pstmt = conn.prepareStatement(bindingStmt); + + for (SimpleFeature feature : features) { + // currentStmt = feature; + // Statement stmt = conn.createStatement(); + try { + // stmt.execute(feature); + bindFeatureParameters(pstmt, feature); + // pstmt.execute(); + pstmt.addBatch(); + } catch (PSQLException e) { + if (bindingStmt != null) { + logger.error("Execute:" + bindingStmt); + } + logger.error(e.getServerErrorMessage()); + logger.error(e.getMessage(), e); + /* + } finally { + stmt.close(); + */ + } + } + /* + if ((i % BATCHSIZE) != 0) + { + stmt.executeBatch(); + } + stmt.close(); + */ + int[] numUpdates = pstmt.executeBatch(); + for (int i = 0; i < numUpdates.length; i++) { + if (numUpdates[i] == -2) + logger.warn("Execution " + i + ": unknown number of rows updated"); + } + conn.commit(); + + pstmt.close(); + features.clear(); + + logger.debug("End Save EdbGeo:" + featureType.getTypeName()); + } + accumulate = 0; + conn.setAutoCommit(autoCommit); + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } catch (PSQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.error(e.getServerErrorMessage()); + logger.error(e.getMessage(), e); + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) this.accumulateUpdateTime(); + } + } + + public void closeFeatureWriter() { + txFeaturesContext.clear(); + /* + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) + { + featureWriter.close(); + } + + this.featuresWriterContext.clear(); + */ + } + + public void createFeatureElement(String featureName) throws SchemaException { + if (featureType1 == null) { + Connection conn = null; + SimpleFeatureTypeBuilder typeBuilder1 = FeatureTypeBuilderUtil.createNormalIndexFeatureTypeBuilder(featureName); + featureType1 = typeBuilder1.buildFeatureType(); + if (isExistFeature(featureType1)) { + try { + conn = getConnection(); + if (dropTableMode) { + try { + dropGeometryColumn(conn, featureName, + (featureType1).getGeometryDescriptor().getLocalName()); + } catch (PSQLException e) { + logger.debug(e.getMessage(), e); + } + try { + dropTable(conn, featureName); + } catch (PSQLException e) { + logger.debug(e.getMessage(), e); + } + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType1); + for (String stmtText : schemaTexts) { + Statement stmt = conn.createStatement(); + stmt.execute(stmtText); + JDBCUtils.close(stmt); + } + } else { + deleteTable(conn, featureName); + } + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } catch (IOException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + logger.warn(e.getMessage(), e); + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.warn(e.getMessage(), e); + } + } else { + try { + conn = getConnection(); + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType1); + for (String stmtText : schemaTexts) { + Statement stmt = conn.createStatement(); + stmt.execute(stmtText); + JDBCUtils.close(stmt); + } + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } catch (IOException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + logger.warn(e.getMessage(), e); + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.warn(e.getMessage(), e); + } + } + } + } + + public void createFeatureElement2(String featureName) throws SchemaException { + if (featureType2 == null) { + Connection conn = null; + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalIndexTextFeatureTypeBuilder(featureName); + featureType2 = typeBuilder.buildFeatureType(); + if (isExistFeature(featureType2)) { + try { + conn = getConnection(); + if (dropTableMode) { + dropGeometryColumn(conn, featureName, + (featureType2).getGeometryDescriptor().getLocalName()); + dropTable(conn, featureName); + + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType2); + for (String stmtText : schemaTexts) { + Statement stmt = conn.createStatement(); + stmt.execute(stmtText); + JDBCUtils.close(stmt); + } + } else { + deleteTable(conn, featureName); + } + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } catch (IOException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + logger.warn(e.getMessage(), e); + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.warn(e.getMessage(), e); + } + } else { + try { + conn = getConnection(); + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType2); + for (String stmtText : schemaTexts) { + Statement stmt = conn.createStatement(); + stmt.execute(stmtText); + JDBCUtils.close(stmt); + } + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } catch (IOException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + logger.warn(e.getMessage(), e); + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.warn(e.getMessage(), e); + } + } + } + } + + public void createFeatureElement3(String featureName) throws SchemaException { + if (featureType3 == null) { + Connection conn = null; + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalIndexFeatureTypeBuilder(featureName); + featureType3 = typeBuilder.buildFeatureType(); + if (isExistFeature(featureType3)) { + try { + conn = getConnection(); + if (dropTableMode) { + try { + dropGeometryColumn(conn, featureName, + (featureType3).getGeometryDescriptor().getLocalName()); + } catch (PSQLException e) { + logger.debug(e.getMessage(), e); + } + try { + dropTable(conn, featureName); + } catch (PSQLException e) { + logger.debug(e.getMessage(), e); + } + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType3); + for (String stmtText : schemaTexts) { + Statement stmt = conn.createStatement(); + stmt.execute(stmtText); + JDBCUtils.close(stmt); + } + } else { + deleteTable(conn, featureName); + } + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } catch (IOException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + logger.warn(e.getMessage(), e); + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.warn(e.getMessage(), e); + } + } else { + try { + conn = getConnection(); + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType3); + for (String stmtText : schemaTexts) { + Statement stmt = conn.createStatement(); + stmt.execute(stmtText); + JDBCUtils.close(stmt); + } + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } catch (IOException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + logger.warn(e.getMessage(), e); + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.warn(e.getMessage(), e); + } + } + } + } + + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { + DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); + if (element instanceof TextElement) { + TextElement textElement = (TextElement) element; + String tpclid = textElement.getText(); + + if(tpclid.trim().endsWith("")) + { + return null; + } + + Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); + Geometry geom; + if (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826) { + geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMaxX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMaxX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMinY())), + }), null); + } else { + geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMaxX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMaxX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMinY())), + }), null); + } + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + extent.getMinX(), + extent.getMinY(), + extent.getMaxX(), + extent.getMaxY(), + tpclid, + colorTable.getColorCode(textElement.getColorIndex()), + textElement.getWeight(), + textElement.getLineStyle() + }, null); + } else if (element instanceof ShapeElement) { + ShapeElement shapeElement = (ShapeElement) element; + Geometry geomShape = shapeElement.toGeometry(geometryFactory); + Polygon polygon = (Polygon) geomShape; + if (polygon.isRectangle()) { + Envelope bounds = polygon.getEnvelopeInternal(); + if (bounds.getWidth() == TPCLIDConverter.SX1200) { + Coordinate center = bounds.centre(); + String tpclid = TPCLIDConverter.CoordinateToTpclId(center); + if ((tpclid == null) || (tpclid.length() == 0)) { + logger.warn("Cannot convert coordinate to tpclid-[" + center.toString() + "]"); + return null; + } + if (tpclid.length() > 5) { + tpclid = tpclid.substring(0, 5); + } + Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); + Geometry geom = null; + try { + geom = (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826 ? + geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMaxX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMaxX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMinY())), + }), null) : + geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMaxX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMaxX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMinY())), + }), null)); + } catch (NullPointerException e) { + logger.warn("TPCLIDConverter has error at [" + tpclid + "]"); + logger.warn(e.getMessage(), e); + return null; + } + + return (geom == null ? null : + SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + extent.getMinX(), + extent.getMinY(), + extent.getMaxX(), + extent.getMaxY(), + tpclid, + colorTable.getColorCode(shapeElement.getColorIndex()), + shapeElement.getWeight(), + shapeElement.getLineStyle() + }, null)); + } + } + } + return null; + } + + public SimpleFeature createFeature2(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { + DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); + if (element instanceof TextElement) { + SimpleFeature feature = null; + TextElement txtElement = (TextElement) element; + double angle = txtElement.getRotationAngle(); + angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); + convertDecorator.setConverter(txtElement); + Geometry gobj = convertDecorator.toGeometry(geometryFactory); + if (gobj != null) + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + colorTable.getColorCode(txtElement.getColorIndex()), + txtElement.getWeight(), + txtElement.getLineStyle(), + txtElement.getJustification(), + txtElement.getTextHeight(), + txtElement.getTextWidth(), + angle, + txtElement.getText() + }, null); + return feature; + } else if (element instanceof ShapeElement) { + SimpleFeature feature = null; + ShapeElement shapeElement = (ShapeElement) element; + double angle = 0.0; + Geometry geomShape = shapeElement.toGeometry(geometryFactory); + Polygon polygon = (Polygon) geomShape; + if (polygon.isRectangle()) { + Envelope bounds = polygon.getEnvelopeInternal(); + if (bounds.getWidth() == TPCLIDConverter.SX1200) { + Coordinate center = bounds.centre(); + String tpclid = TPCLIDConverter.CoordinateToTpclId(center); + if (tpclid.length() > 5) { + tpclid = tpclid.substring(0, 5); + Coordinate pos = (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826 ? + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(center.x, center.y)) : + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(center.x, center.y))); + Geometry gobj = geometryFactory.createPoint(pos); + + if (gobj != null) + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + colorTable.getColorCode(shapeElement.getColorIndex()), + shapeElement.getWeight(), + shapeElement.getLineStyle(), + 0, + 15.0, + 15 * 5, + angle, + tpclid + }, null); + return feature; + } + + } + } + } + return null; + } + + public SimpleFeature[] createFeature3(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { + DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); + if (element instanceof TextElement) { + TextElement textElement = (TextElement) element; + String tpclid = textElement.getText(); + SimpleFeature[] result = new SimpleFeature[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; + + if (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826) { + geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + }), null); + } else { + geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + }), null); + } + Envelope innerExtent = geom.getEnvelopeInternal(); + + result[i] = SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + innerExtent.getMinX(), + innerExtent.getMinY(), + innerExtent.getMaxX(), + innerExtent.getMaxY(), + tpclid + mapSubId, + colorTable.getColorCode(textElement.getColorIndex()), + textElement.getWeight(), + textElement.getLineStyle() + }, null); + + } + return result; + } else if (element instanceof ShapeElement) { + ShapeElement shapeElement = (ShapeElement) element; + Geometry geomShape = shapeElement.toGeometry(geometryFactory); + Polygon polygon = (Polygon) geomShape; + if (polygon.isRectangle()) { + Envelope extent = polygon.getEnvelopeInternal(); + if (extent.getWidth() == TPCLIDConverter.SX1200) { + SimpleFeature[] result = new SimpleFeature[4]; + Coordinate center = extent.centre(); + String tpclid = TPCLIDConverter.CoordinateToTpclId(center); + if (tpclid.length() > 5) { + tpclid = tpclid.substring(0, 5); + } + 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 = (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826 ? + geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + }), null) : + geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + }), null)); + + Envelope innerExtent = geom.getEnvelopeInternal(); + + result[i] = SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + innerExtent.getMinX(), + innerExtent.getMinY(), + innerExtent.getMaxX(), + innerExtent.getMaxY(), + tpclid + mapSubId, + colorTable.getColorCode(shapeElement.getColorIndex()), + shapeElement.getWeight(), + shapeElement.getLineStyle() + }, null); + } + + return result; + } + } + } + + return null; + } + + private SimpleFeature createFeature(Element element) throws SchemaException, IllegalAttributeException { + if (featureType1 == null) { + String dgnname = getFilename().toLowerCase(); + int i = dgnname.lastIndexOf("."); + if (i != -1) { + dgnname = dgnname.substring(0, i); + } + createFeatureElement(dgnname.toLowerCase()); + } + return createFeature(featureType1, element); + } + + private SimpleFeature createFeature2(Element element) throws SchemaException, IllegalAttributeException { + if (featureType2 == null) { + String dgnname = getFilename().toLowerCase(); + int i = dgnname.lastIndexOf("."); + if (i != -1) { + dgnname = dgnname.substring(0, i); + } + dgnname = dgnname + "_p"; + createFeatureElement2(dgnname.toLowerCase()); + } + return createFeature2(featureType2, element); + } + + private SimpleFeature[] createFeature3(Element 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"; + createFeatureElement3(dgnname.toLowerCase()); + } + return createFeature3(featureType3, element); + } + + 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 Log getLogger() { + return logger; + } + + public boolean isDropTableMode() { + return dropTableMode; + } + + public void setDropTableMode(boolean dropTableMode) { + this.dropTableMode = dropTableMode; + } + + public void clearOutputDatabase() { + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/OracleConvertEdbGeoJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/OracleConvertEdbGeoJobContext.java new file mode 100644 index 0000000..a1f49e9 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/edbgeo/OracleConvertEdbGeoJobContext.java @@ -0,0 +1,383 @@ +package com.ximple.eofms.jobs.context.edbgeo; + +import java.io.File; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.sql.BatchUpdateException; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; + +import com.edb.util.PSQLException; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.util.Assert; +import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; +import com.ximple.eofms.filter.CreateFeatureTypeEventListener; +import com.ximple.eofms.filter.ElementDispatcher; +import com.ximple.eofms.filter.FeatureTypeEvent; +import com.ximple.eofms.jobs.OracleElementLogger; +import com.ximple.eofms.util.ElementDigesterUtils; +import com.ximple.io.dgn7.ComplexElement; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.FrammeAttributeData; +import org.apache.commons.digester3.Digester; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.transaction.util.CommonsLoggingLogger; +import org.apache.commons.transaction.util.LoggerFacade; +import org.geotools.data.DataStore; +import org.geotools.data.Transaction; +import org.geotools.data.edbgeo.PostgisDataStoreFactory; +import org.geotools.data.jdbc.JDBCUtils; +import org.geotools.feature.SchemaException; +import org.geotools.feature.type.FeatureTypeImpl; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import org.quartz.JobExecutionContext; +import org.xml.sax.SAXException; + +public class OracleConvertEdbGeoJobContext extends AbstractOracleToEdbGeoJobContext + implements CreateFeatureTypeEventListener { + static Log logger = LogFactory.getLog(OracleConvertEdbGeoJobContext.class); + static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); + + static PostgisDataStoreFactory dataStoreFactory = new PostgisDataStoreFactory(); + + private OracleElementLogger elmLogger = null; + + static { + try { + DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); + } catch (SQLException e) { + Assert.shouldNeverReachHere(e.getMessage()); + } + } + + private String _filterConfig; + + private ElementDispatcher elementDispatcher; + + private HashMap<SimpleFeatureType, ArrayList<SimpleFeature>> txFeaturesContext = new HashMap<SimpleFeatureType, ArrayList<SimpleFeature>>(); + + private JobExecutionContext executionContext; + + private String currentSchema = null; + private boolean schemaChanged = false; + private boolean dropTableMode = true; + private int accumulate = 0; + + public OracleConvertEdbGeoJobContext(String dataPath, DataStore pgDS, String targetSchema, String filterConfig, + boolean profileMode, boolean useTransform) { + super(dataPath, pgDS, targetSchema, profileMode, useTransform); + _filterConfig = filterConfig; + elementDispatcher = createElementDispatcher(); + elementDispatcher.addCreateFeatureTypeEventListener(this); + // txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); + } + + private ElementDispatcher createElementDispatcher() { + try { + URL filterURL = null; + if (_filterConfig != null) { + File config = new File(_filterConfig); + if (config.exists()) { + filterURL = config.toURI().toURL(); + } + } + if (filterURL == null) { + // config = new File("conf/DefaultConvertShpFilter.xml"); + filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); + // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); + } + assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); + return (ElementDispatcher) digester.parse(filterURL); + } catch (UnsupportedEncodingException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } catch (MalformedURLException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } catch (IOException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } catch (SAXException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } + } + + public void putFeatureCollection(Element element) { + assert elementDispatcher != null; + // 判斷是否符和條件 + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { + boolean isEmptySize = false; + FrammeAttributeData linkage = + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + logger.warn("Unknown Element:" + element.getElementType().toString() + + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); + + if (element instanceof ComplexElement) { + ComplexElement complex = (ComplexElement) element; + logger.warn("----Complex Element size=" + complex.size() + ":" + + (linkage == null ? "NULL" : (linkage.getUfid()))); + if (complex.size() == 0) + isEmptySize = true; + } + + if (getElementLogging() && (!isEmptySize)) { + getElementLogger().logElement(element, getCurrentSchema()); + } + return; + } + + if (((Geometry)feature.getDefaultGeometry()).isEmpty()) { + boolean isEmptySize = false; + FrammeAttributeData linkage = + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + logger.warn("Empty Geom Element:" + element.getElementType().toString() + + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); + + if (element instanceof ComplexElement) { + ComplexElement complex = (ComplexElement) element; + logger.warn("----Complex Element size=" + complex.size() + ":" + + (linkage == null ? "NULL" : (linkage.getUfid()))); + if (complex.size() == 0) + isEmptySize = true; + } + + if (getElementLogging() && (!isEmptySize)) { + getElementLogger().logElement(element, getCurrentSchema()); + } + return; + } + + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); + } + ArrayList<SimpleFeature> arrayList = txFeaturesContext.get(feature.getFeatureType()); + arrayList.add(feature); + accumulate++; + if (accumulate > BATCHSIZE) { + commitTransaction(); + } + } + + public void startTransaction() { + } + + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { + logger.debug("Transaction size = " + txFeaturesContext.size()); + //txFeaturesContext.commitTransaction(); + } else { + logger.debug("Transaction is empty."); + } + + if (!txFeaturesContext.isEmpty()) { + updateDataStore(); + } + + if (this.getElementLogger() != null) + this.getElementLogger().flashLogging(); + } + + public void rollbackTransaction() { + } + + public void resetFeatureContext() { + txFeaturesContext.clear(); + } + + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); + Iterator<SimpleFeatureType> it = txFeaturesContext.keySet().iterator(); + Connection conn = null; + try { + conn = getConnection(); + boolean autoCommit = conn.getAutoCommit(); + conn.setAutoCommit(false); + + while (it.hasNext()) { + SimpleFeatureType featureType = it.next(); + logger.debug("Begin Save into EdbGeo:" + featureType.getTypeName()); + + int batchCount = 0; + String bindingStmt = makePrepareInsertSql(featureType); + ArrayList<SimpleFeature> features = txFeaturesContext.get(featureType); + PreparedStatement pstmt = conn.prepareStatement(bindingStmt); + + for (SimpleFeature feature : features) { + try { + // stmt.execute(feature); + bindFeatureParameters(pstmt, feature); + // pstmt.executeUpdate(); + pstmt.addBatch(); + } catch (PSQLException e) { + if (bindingStmt != null) { + logger.error("Execute:" + bindingStmt); + } + logger.error(e.getServerErrorMessage()); + logger.error(e.getMessage(), e); + } catch (ClassCastException e) { + if (bindingStmt != null) { + logger.error("Execute:" + bindingStmt); + } + for (int i = 0; i < feature.getAttributeCount(); i++) { + logger.info("attr[" + i + "]-" + ((feature.getAttribute(i) == null) ? " NULL" : + feature.getAttribute(i).toString())); + } + logger.error(e.getMessage(), e); + } + batchCount++; + } + + int[] numUpdates = pstmt.executeBatch(); + for (int i = 0; i < numUpdates.length; i++) { + if (numUpdates[i] == -2) + logger.warn("Execution " + i + ": unknown number of rows updated"); + } + conn.commit(); + + pstmt.close(); + features.clear(); + logger.debug("End Save into EdbGeo:" + featureType.getTypeName()); + } + conn.setAutoCommit(autoCommit); + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + accumulate = 0; + } catch (BatchUpdateException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.error(e.getMessage(), e); + SQLException ex; + while ((ex = e.getNextException()) != null) { + // logger.warn(ex.getMessage(), ex); + logger.warn(ex.getMessage()); + } + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); + } + } + + public JobExecutionContext getExecutionContext() { + return executionContext; + } + + public void setExecutionContext(JobExecutionContext context) { + executionContext = context; + } + + /** + * �����]�Ƽg�J�� + * + * @throws IOException IO�o�Ϳ�~ + */ + public void closeFeatureWriter() throws IOException { + } + + protected OracleElementLogger getElementLogger() { + if (elmLogger == null) { + elmLogger = new OracleElementLogger(getOracleConnection()); + elmLogger.setDataPath(this.getDataPath()); + } + return elmLogger; + } + + public String getCurrentSchema() { + return currentSchema; + } + + public void setCurrentSchema(String querySchema) { + this.currentSchema = querySchema; + this.schemaChanged = true; + } + + protected Log getLogger() { + return logger; + } + + public boolean isDropTableMode() { + return dropTableMode; + } + + public void setDropTableMode(boolean dropTableMode) { + this.dropTableMode = dropTableMode; + } + + public void createFeatureTypeOccurred(FeatureTypeEvent evt) { + try { + createOrClearFeatureDataTable(evt.getFeatureType()); + } catch (SchemaException e) { + logger.warn(e.getMessage(), e); + } + } + + protected void createOrClearFeatureDataTable(SimpleFeatureType featureType) throws SchemaException { + String featureName = featureType.getTypeName(); + Connection conn = null; + if (isExistFeature(featureType)) { + try { + conn = getConnection(); + if (dropTableMode) { + dropGeometryColumn(conn, getTargetSchema(), featureName, + ((FeatureTypeImpl)featureType).getGeometryDescriptor().getName().getLocalPart()); + dropTable(conn, getTargetSchema(), featureName); + + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType); + for (String stmtText : schemaTexts) { + Statement stmt = conn.createStatement(); + stmt.execute(stmtText); + JDBCUtils.close(stmt); + } + } else { + deleteTable(conn, getTargetSchema(), featureName); + } + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } catch (IOException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + logger.warn(e.getMessage(), e); + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.warn(e.getMessage(), e); + } + } else { + String tempStmt = null; + try { + conn = getConnection(); + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType); + for (String stmtText : schemaTexts) { + Statement stmt = conn.createStatement(); + tempStmt = stmtText; + stmt.execute(stmtText); + stmt.close(); + } + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } catch (IOException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + logger.warn("RUN--" + tempStmt); + logger.warn(e.getMessage(), e); + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.warn("RUN--" + tempStmt); + logger.warn(e.getMessage(), e); + } + } + } + + public boolean isSchemaChanged() { + return schemaChanged; + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/AbstractDgnToMySQLJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/AbstractDgnToMySQLJobContext.java index 34b94ea..1dc6ee4 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/AbstractDgnToMySQLJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/AbstractDgnToMySQLJobContext.java @@ -4,42 +4,35 @@ import java.sql.Connection; import org.geotools.data.DataStore; -import org.geotools.data.Transaction; import org.geotools.data.SchemaNotFoundException; -import org.geotools.data.mysql.MySQLDataStore; -import org.geotools.feature.FeatureType; +import org.geotools.data.Transaction; import com.ximple.eofms.jobs.context.AbstractDgnFileJobContext; +import org.geotools.jdbc.JDBCDataStore; +import org.opengis.feature.simple.SimpleFeatureType; -public abstract class AbstractDgnToMySQLJobContext extends AbstractDgnFileJobContext -{ - protected MySQLDataStore targetDataStore; +public abstract class AbstractDgnToMySQLJobContext extends AbstractDgnFileJobContext { + protected JDBCDataStore targetDataStore; - public AbstractDgnToMySQLJobContext(String dataPath, DataStore targetDataStore) - { - super(dataPath); - this.targetDataStore = (MySQLDataStore) targetDataStore; + public AbstractDgnToMySQLJobContext(String dataPath, DataStore targetDataStore, boolean profileMode, + boolean useTransform) { + super(dataPath, profileMode, useTransform); + this.targetDataStore = (JDBCDataStore) targetDataStore; } - public MySQLDataStore getTargetDataStore() - { + public JDBCDataStore getTargetDataStore() { return targetDataStore; } - public void setTargetDataStore(MySQLDataStore targetDataStore) - { + public void setTargetDataStore(JDBCDataStore targetDataStore) { this.targetDataStore = targetDataStore; } - public Connection getConnection() - { - if (targetDataStore != null) - { - try - { + public Connection getConnection() { + if (targetDataStore != null) { + try { return targetDataStore.getConnection(Transaction.AUTO_COMMIT); - } catch (IOException e) - { + } catch (IOException e) { getLogger().warn(e.getMessage(), e); } } @@ -47,17 +40,13 @@ } - protected boolean isExistFeature(FeatureType featureType) - { - try - { - FeatureType existFeatureType = targetDataStore.getSchema(featureType.getTypeName()); + protected boolean isExistFeature(SimpleFeatureType featureType) { + try { + SimpleFeatureType existFeatureType = targetDataStore.getSchema(featureType.getTypeName()); return existFeatureType != null && existFeatureType.equals(featureType); - } catch (SchemaNotFoundException e) - { + } catch (SchemaNotFoundException e) { return false; - } catch (IOException e) - { + } catch (IOException e) { getLogger().info(e.getMessage(), e); return false; } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/AbstractOracleToMySQLJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/AbstractOracleToMySQLJobContext.java index 8fb18fc..d319071 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/AbstractOracleToMySQLJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/AbstractOracleToMySQLJobContext.java @@ -4,67 +4,56 @@ import java.sql.Connection; import org.geotools.data.DataStore; -import org.geotools.data.Transaction; import org.geotools.data.SchemaNotFoundException; -import org.geotools.data.mysql.MySQLDataStore; -import org.geotools.feature.FeatureType; +import org.geotools.data.Transaction; import com.ximple.eofms.jobs.context.AbstractOracleJobContext; +import org.geotools.jdbc.JDBCDataStore; +import org.opengis.feature.simple.SimpleFeatureType; -public abstract class AbstractOracleToMySQLJobContext extends AbstractOracleJobContext -{ - protected MySQLDataStore targetDataStore; +public abstract class AbstractOracleToMySQLJobContext extends AbstractOracleJobContext { + protected JDBCDataStore targetDataStore; - public AbstractOracleToMySQLJobContext(String dataPath, DataStore targetDataStore) - { - if ((targetDataStore != null) && (targetDataStore instanceof MySQLDataStore)) - { - this.targetDataStore = (MySQLDataStore) targetDataStore; - } else - { + public AbstractOracleToMySQLJobContext(String dataPath, DataStore targetDataStore, boolean profileMode, + boolean useTransform) { + super(profileMode, useTransform); + if ((targetDataStore != null) && (targetDataStore instanceof JDBCDataStore)) { + this.targetDataStore = (JDBCDataStore) targetDataStore; + } else { getLogger().info("targetDataStore has wrong."); } setDataPath(dataPath); } - public MySQLDataStore getTargetDataStore() - { + public JDBCDataStore getTargetDataStore() { return targetDataStore; } - public void setTargetDataStore(MySQLDataStore targetDataStore) - { + public void setTargetDataStore(JDBCDataStore targetDataStore) { this.targetDataStore = targetDataStore; } - public Connection getConnection() - { - if (targetDataStore != null) - { - try - { + public Connection getConnection() { + if (targetDataStore != null) { + try { return targetDataStore.getConnection(Transaction.AUTO_COMMIT); - } catch (IOException e) - { + } catch (IOException e) { getLogger().warn(e.getMessage(), e); } } return null; } - protected boolean isExistFeature(FeatureType featureType) - { - try - { - FeatureType existFeatureType = targetDataStore.getSchema(featureType.getTypeName()); + protected boolean isExistFeature(SimpleFeatureType featureType) { + try { + SimpleFeatureType existFeatureType = targetDataStore.getSchema(featureType.getTypeName()); return existFeatureType != null && existFeatureType.equals(featureType); - } catch (SchemaNotFoundException e) - { + } catch (SchemaNotFoundException e) { return false; - } catch (IOException e) - { + } catch (IOException e) { getLogger().info(e.getMessage(), e); return false; } } + } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/DummyFeatureConvertMySQlJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/DummyFeatureConvertMySQlJobContext.java index 26d3378..e7f322b 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/DummyFeatureConvertMySQlJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/DummyFeatureConvertMySQlJobContext.java @@ -1,55 +1,49 @@ package com.ximple.eofms.jobs.context.mysql; +import java.io.File; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.net.URL; -import java.net.MalformedURLException; -import java.io.File; -import java.io.UnsupportedEncodingException; -import java.io.IOException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.commons.transaction.util.LoggerFacade; -import org.apache.commons.transaction.util.CommonsLoggingLogger; -import org.apache.commons.transaction.memory.PessimisticMapWrapper; -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.xmlrules.DigesterLoader; -import org.geotools.feature.Feature; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; -import org.geotools.feature.FeatureType; -import org.geotools.feature.SimpleFeature; -import org.geotools.data.FeatureWriter; -import org.geotools.data.DataStore; -import org.geotools.data.Transaction; -import org.xml.sax.SAXException; - -import com.vividsolutions.jts.geom.GeometryFactory; - -import com.ximple.eofms.filter.ElementDispatcher; import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; import com.ximple.eofms.filter.ElementDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatcher; import com.ximple.eofms.filter.TypeCompIdDispatchableFilter; import com.ximple.eofms.filter.TypeCompLevelIdDispatchableFilter; import com.ximple.eofms.filter.TypeIdDispatchableFilter; +import com.ximple.eofms.util.ElementDigesterUtils; +import com.ximple.io.dgn7.ComplexElement; import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.io.dgn7.ComplexElement; import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.digester3.Digester; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.transaction.memory.PessimisticMapWrapper; +import org.apache.commons.transaction.util.CommonsLoggingLogger; +import org.apache.commons.transaction.util.LoggerFacade; +import org.geotools.data.DataStore; +import org.geotools.data.FeatureWriter; +import org.geotools.data.Transaction; +import org.geotools.feature.SchemaException; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import org.xml.sax.SAXException; -public class DummyFeatureConvertMySQlJobContext extends AbstractDgnToMySQLJobContext -{ +public class DummyFeatureConvertMySQlJobContext extends AbstractDgnToMySQLJobContext { static final Log logger = LogFactory.getLog(DummyFeatureConvertMySQlJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); static final String SHPOUTPATH = "shpout"; private String dataOut = null; - private HashMap<String, ArrayList<Feature>> featuresContext = new HashMap<String, ArrayList<Feature>>(); + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; @@ -58,78 +52,62 @@ private String _filterConfig; private boolean withIndex = false; - public DummyFeatureConvertMySQlJobContext(String dataPath, DataStore targetDataStore, String filterConfig) - { - super(dataPath, targetDataStore); + public DummyFeatureConvertMySQlJobContext(String dataPath, DataStore targetDataStore, String filterConfig, + boolean profileMode, boolean useTransform) { + super(dataPath, targetDataStore, profileMode, useTransform); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); _filterConfig = filterConfig; elementDispatcher = createElementDispatcher(); } - private ElementDispatcher createElementDispatcher() - { - try - { - URL rulesURL = ElementDispatcher.class.getResource("ElementDispatcherRules.xml"); - assert rulesURL != null; - Digester digester = DigesterLoader.createDigester(rulesURL); + private ElementDispatcher createElementDispatcher() { + try { URL filterURL = null; - if (_filterConfig != null) - { + if (_filterConfig != null) { File config = new File(_filterConfig); - if (config.exists()) - { + if (config.exists()) { filterURL = config.toURI().toURL(); } } - if (filterURL == null) - { + if (filterURL == null) { // config = new File("conf/DefaultConvertShpFilter.xml"); filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); } assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); return (ElementDispatcher) digester.parse(filterURL); - } catch (UnsupportedEncodingException e) - { + } catch (UnsupportedEncodingException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (SAXException e) - { + } catch (SAXException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); } } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { assert elementDispatcher != null; - if (element == null) - { + if (element == null) { logger.warn("Unknown Element:" + null); return; } - // �P�_�O�_�ũM���� - Feature feature = elementDispatcher.execute(element, true); - if (feature == null) - { + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { FrammeAttributeData linkage = AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); logger.warn("Unknown Element:" + element.getElementType().toString() + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + - (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); - if (element instanceof ComplexElement) - { + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); + if (element instanceof ComplexElement) { ComplexElement complex = (ComplexElement) element; logger.warn("----Complex Element size=" + complex.size()); } @@ -137,119 +115,95 @@ return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); } - public void startTransaction() - { + public void startTransaction() { assert elementDispatcher != null; - for (ElementDispatchableFilter filter : elementDispatcher.getRules()) - { - if (filter instanceof TypeCompIdDispatchableFilter) - { + for (ElementDispatchableFilter filter : elementDispatcher.getRules()) { + if (filter instanceof TypeCompIdDispatchableFilter) { ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); - } else if (filter instanceof TypeCompLevelIdDispatchableFilter) - { - ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); - } else if (filter instanceof TypeIdDispatchableFilter) - { - ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); + } else if (filter instanceof TypeCompLevelIdDispatchableFilter) { + ((TypeCompLevelIdDispatchableFilter) filter).getCreateStrategy(); + } else if (filter instanceof TypeIdDispatchableFilter) { + ((TypeIdDispatchableFilter) filter).getCreateStrategy(); } } } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); logger.debug("Begin Save OracleSDO:" + featureType.getTypeName()); FeatureWriter writer; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { - if (!isExistFeature(featureType)) - { + } else { + if (!isExistFeature(featureType)) { targetDataStore.createSchema(featureType); writer = targetDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT); - } else - { + } else { writer = targetDataStore.getFeatureWriterAppend(featureType.getTypeName(), Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } - ArrayList<Feature> features = featuresContext.get(featureType); + ArrayList<SimpleFeature> features = featuresContext.get(featureType); Iterator itFeature = features.iterator(); - while (itFeature.hasNext()) - { - Feature feature = (Feature) itFeature.next(); - ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); } //writer.close(); logger.debug("End Save OracleSDO:" + featureType.getTypeName()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public String getDataOutPath() - { - if (dataOut == null) - { + public String getDataOutPath() { + if (dataOut == null) { File outPath = new File(getDataPath(), SHPOUTPATH); - if (!outPath.exists()) - { + if (!outPath.exists()) { outPath.mkdir(); - } else if (!outPath.isDirectory()) - { + } else if (!outPath.isDirectory()) { outPath.mkdir(); } dataOut = outPath.toString(); @@ -257,27 +211,22 @@ return dataOut; } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } @@ -285,18 +234,15 @@ } - public boolean isWithIndex() - { + public boolean isWithIndex() { return withIndex; } - public void setWithIndex(boolean withIndex) - { + public void setWithIndex(boolean withIndex) { this.withIndex = withIndex; } - public Log getLogger() - { + public Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/FeatureDgnConvertMySQLJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/FeatureDgnConvertMySQLJobContext.java index 6be6908..fd28992 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/FeatureDgnConvertMySQLJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/FeatureDgnConvertMySQLJobContext.java @@ -1,48 +1,42 @@ package com.ximple.eofms.jobs.context.mysql; +import java.io.File; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.net.URL; -import java.net.MalformedURLException; -import java.io.File; -import java.io.UnsupportedEncodingException; -import java.io.IOException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.commons.transaction.util.LoggerFacade; -import org.apache.commons.transaction.util.CommonsLoggingLogger; -import org.apache.commons.transaction.memory.PessimisticMapWrapper; -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.xmlrules.DigesterLoader; -import org.geotools.feature.Feature; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; -import org.geotools.feature.FeatureType; -import org.geotools.feature.SimpleFeature; -import org.geotools.data.FeatureWriter; -import org.geotools.data.DataStore; -import org.geotools.data.Transaction; -import org.xml.sax.SAXException; - -import com.vividsolutions.jts.geom.GeometryFactory; - -import com.ximple.eofms.filter.ElementDispatcher; import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatcher; +import com.ximple.eofms.util.ElementDigesterUtils; +import com.ximple.io.dgn7.ComplexElement; import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.io.dgn7.ComplexElement; import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.digester3.Digester; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.transaction.memory.PessimisticMapWrapper; +import org.apache.commons.transaction.util.CommonsLoggingLogger; +import org.apache.commons.transaction.util.LoggerFacade; +import org.geotools.data.DataStore; +import org.geotools.data.FeatureWriter; +import org.geotools.data.Transaction; +import org.opengis.feature.IllegalAttributeException; +import org.geotools.feature.SchemaException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import org.xml.sax.SAXException; -public class FeatureDgnConvertMySQLJobContext extends AbstractDgnToMySQLJobContext -{ +public class FeatureDgnConvertMySQLJobContext extends AbstractDgnToMySQLJobContext { static final Log logger = LogFactory.getLog(FeatureDgnConvertMySQLJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); - private HashMap<String, ArrayList<Feature>> featuresContext = new HashMap<String, ArrayList<Feature>>(); + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; @@ -51,78 +45,63 @@ private String _filterConfig; private boolean withIndex = false; - public FeatureDgnConvertMySQLJobContext(String dataPath, DataStore targetDataStore, String filterConfig) - { - super(dataPath, targetDataStore); + public FeatureDgnConvertMySQLJobContext(String dataPath, DataStore targetDataStore, String filterConfig, + boolean profileMode, boolean useTransform) { + super(dataPath, targetDataStore, profileMode, useTransform); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); _filterConfig = filterConfig; elementDispatcher = createElementDispatcher(); } - private ElementDispatcher createElementDispatcher() - { - try - { - URL rulesURL = ElementDispatcher.class.getResource("ElementDispatcherRules.xml"); - assert rulesURL != null; - Digester digester = DigesterLoader.createDigester(rulesURL); + private ElementDispatcher createElementDispatcher() { + try { URL filterURL = null; - if (_filterConfig != null) - { + if (_filterConfig != null) { File config = new File(_filterConfig); - if (config.exists()) - { + if (config.exists()) { filterURL = config.toURI().toURL(); } } - if (filterURL == null) - { + if (filterURL == null) { // config = new File("conf/DefaultConvertShpFilter.xml"); filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); } assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); return (ElementDispatcher) digester.parse(filterURL); - } catch (UnsupportedEncodingException e) - { + } catch (UnsupportedEncodingException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (SAXException e) - { + } catch (SAXException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); } } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { assert elementDispatcher != null; - if (element == null) - { + if (element == null) { logger.warn("Unknown Element:" + null); return; } - // �P�_�O�_�ũM���� - Feature feature = elementDispatcher.execute(element, true); - if (feature == null) - { + // �P�_�O�_�ũM��� + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { FrammeAttributeData linkage = - AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); logger.warn("Unknown Element:" + element.getElementType().toString() + - ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + - (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); - if (element instanceof ComplexElement) - { + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); + if (element instanceof ComplexElement) { ComplexElement complex = (ComplexElement) element; logger.warn("----Complex Element size=" + complex.size()); } @@ -130,118 +109,97 @@ return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); } - public void startTransaction() - { + public void startTransaction() { } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); logger.debug("Begin Save OracleSDO:" + featureType.getTypeName()); FeatureWriter writer; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { - if (!isExistFeature(featureType)) - { + } else { + if (!isExistFeature(featureType)) { targetDataStore.createSchema(featureType); writer = targetDataStore.getFeatureWriter(featureType.getTypeName(), - Transaction.AUTO_COMMIT); - } else - { + Transaction.AUTO_COMMIT); + } else { writer = targetDataStore.getFeatureWriterAppend(featureType.getTypeName(), - Transaction.AUTO_COMMIT); + Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } - ArrayList<Feature> features = featuresContext.get(featureType); + ArrayList<SimpleFeature> features = featuresContext.get(featureType); Iterator itFeature = features.iterator(); - while (itFeature.hasNext()) - { - Feature feature = (Feature) itFeature.next(); - ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); } //writer.close(); logger.debug("End Save OracleSDO:" + featureType.getTypeName()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } @@ -249,18 +207,15 @@ } - public boolean isWithIndex() - { + public boolean isWithIndex() { return withIndex; } - public void setWithIndex(boolean withIndex) - { + public void setWithIndex(boolean withIndex) { this.withIndex = withIndex; } - public Log getLogger() - { + public Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/GeneralDgnConvertMySQLJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/GeneralDgnConvertMySQLJobContext.java index d759bd1..fd6e545 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/GeneralDgnConvertMySQLJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/GeneralDgnConvertMySQLJobContext.java @@ -1,252 +1,224 @@ package com.ximple.eofms.jobs.context.mysql; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.TreeMap; -import java.util.Iterator; -import java.util.List; -import java.net.MalformedURLException; import java.io.IOException; import java.math.BigDecimal; import java.math.RoundingMode; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.TreeMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.commons.transaction.util.LoggerFacade; -import org.apache.commons.transaction.util.CommonsLoggingLogger; import org.apache.commons.transaction.memory.PessimisticMapWrapper; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; -import org.geotools.feature.SimpleFeature; -import org.geotools.data.FeatureWriter; +import org.apache.commons.transaction.util.CommonsLoggingLogger; +import org.apache.commons.transaction.util.LoggerFacade; import org.geotools.data.DataStore; +import org.geotools.data.FeatureWriter; import org.geotools.data.Transaction; +import org.opengis.feature.IllegalAttributeException; +import org.geotools.feature.SchemaException; -import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.GeometryFactory; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; -import com.ximple.eofms.util.FeatureTypeBuilderUtil; import com.ximple.eofms.util.DefaultColorTable; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.TextElement; -import com.ximple.io.dgn7.ShapeElement; -import com.ximple.io.dgn7.LineStringElement; +import com.ximple.eofms.util.EPSG3825GeometryConverterDecorator; +import com.ximple.eofms.util.EPSG3826GeometryConverterDecorator; +import com.ximple.eofms.util.FeatureTypeBuilderUtil; +import com.ximple.eofms.util.GeometryConverterDecorator; import com.ximple.io.dgn7.ArcElement; -import com.ximple.io.dgn7.TextNodeElement; -import com.ximple.io.dgn7.LineElement; -import com.ximple.io.dgn7.EllipseElement; import com.ximple.io.dgn7.ComplexChainElement; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.EllipseElement; import com.ximple.io.dgn7.FrammeAttributeData; +import com.ximple.io.dgn7.LineElement; +import com.ximple.io.dgn7.LineStringElement; +import com.ximple.io.dgn7.ShapeElement; +import com.ximple.io.dgn7.TextElement; +import com.ximple.io.dgn7.TextNodeElement; import com.ximple.io.dgn7.UserAttributeData; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; -public class GeneralDgnConvertMySQLJobContext extends AbstractDgnToMySQLJobContext -{ +public class GeneralDgnConvertMySQLJobContext extends AbstractDgnToMySQLJobContext { static final Log logger = LogFactory.getLog(GeneralDgnConvertMySQLJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); + static final GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); private String dataOut = null; - private HashMap<String, ArrayList<Feature>> featuresContext = new HashMap<String, ArrayList<Feature>>(); + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; - private TreeMap<String, FeatureTypeBuilder> typeBuilders = new TreeMap<String, FeatureTypeBuilder>(); - private TreeMap<String, FeatureType> featureTypes = new TreeMap<String, FeatureType>(); + private TreeMap<String, SimpleFeatureType> featureTypes = new TreeMap<String, SimpleFeatureType>(); - private TWD97GeometryConverterDecorator convertDecorator = null; private String featureBaseName = null; private boolean withIndex = false; - public GeneralDgnConvertMySQLJobContext(String dataPath, DataStore targetDataStore) - { - super(dataPath, targetDataStore); + public GeneralDgnConvertMySQLJobContext(String dataPath, DataStore targetDataStore, boolean profileMode, + boolean useTransform) { + super(dataPath, targetDataStore, profileMode, useTransform); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); - convertDecorator = new TWD97GeometryConverterDecorator(); } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { - FeatureType ft = lookupFeatureType(element); - if (ft != null) - { - Feature feature = createFeature(ft, element); - if (feature == null) - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { + SimpleFeatureType ft = lookupFeatureType(element); + if (ft != null) { + SimpleFeature feature = createFeature(ft, element); + if (feature == null) { if (element instanceof TextElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((TextElement) element).getText() + "'"); + ((TextElement) element).getText() + "'"); else if (element instanceof ShapeElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((ShapeElement) element).getVerticeSize() + "'" + - ((ShapeElement) element).getStartPoint()); + ((ShapeElement) element).getVerticeSize() + "'" + + ((ShapeElement) element).getStartPoint()); else if (element instanceof LineStringElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((LineStringElement) element).getVerticeSize() + "'" + - ((LineStringElement) element).getStartPoint()); + ((LineStringElement) element).getVerticeSize() + "'" + + ((LineStringElement) element).getStartPoint()); else if (element instanceof ArcElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((ArcElement) element).getOrigin().toString() + "'" + - ((ArcElement) element).getRotationAngle()); + ((ArcElement) element).getOrigin().toString() + "'" + + ((ArcElement) element).getRotationAngle()); return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { - txFeaturesContext.put(feature.getFeatureType(), new ArrayList<Feature>()); + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); } - ArrayList<Feature> arrayList = (ArrayList<Feature>) txFeaturesContext.get(feature.getFeatureType()); + ArrayList<SimpleFeature> arrayList = (ArrayList<SimpleFeature>) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); - } else - { + } else { logger.info("Unknown Element :" + element.getType() + ", lv=" + element.getLevelIndex()); } } - public void startTransaction() - { + public void startTransaction() { } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); logger.debug("Begin Save into OracleSDO:" + featureType.getTypeName()); FeatureWriter writer; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { - if (!isExistFeature(featureType)) - { + } else { + if (!isExistFeature(featureType)) { targetDataStore.createSchema(featureType); writer = targetDataStore.getFeatureWriter(featureType.getTypeName(), - Transaction.AUTO_COMMIT); - } else - { + Transaction.AUTO_COMMIT); + } else { writer = targetDataStore.getFeatureWriterAppend(featureType.getTypeName(), - Transaction.AUTO_COMMIT); + Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } - ArrayList<Feature> features = featuresContext.get(featureType); + ArrayList<SimpleFeature> features = featuresContext.get(featureType); Iterator itFeature = features.iterator(); - while (itFeature.hasNext()) - { - Feature feature = (Feature) itFeature.next(); - ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); } //writer.close(); logger.debug("End Save into OracleSDO:" + featureType.getTypeName()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - public FeatureType createPointFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalPointFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); + public SimpleFeatureType createPointFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalPointFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public FeatureType createLineFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalLineFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); + public SimpleFeatureType createLineFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalLineFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public FeatureType createArcFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalArcFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); + public SimpleFeatureType createArcFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalArcFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public FeatureType createEllipseFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalEllipseFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); + public SimpleFeatureType createEllipseFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalEllipseFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public Feature createFeature(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); + if (element instanceof TextElement) { TextElement textElement = (TextElement) element; convertDecorator.setConverter(textElement); @@ -254,25 +226,22 @@ double angle = textElement.getRotationAngle(); String content = textElement.getText(); angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); - if (geom != null) - { - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(textElement.getColorIndex()), - textElement.getFontIndex(), - textElement.getJustification(), - textElement.getTextHeight(), - textElement.getTextWidth(), - angle, - content - }); - } else - { + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(textElement.getColorIndex()), + textElement.getFontIndex(), + textElement.getJustification(), + textElement.getTextHeight(), + textElement.getTextWidth(), + angle, + content + }, null); + } else { logger.info("geometry is null." + element.toString()); } return null; - } else if (element instanceof TextNodeElement) - { + } else if (element instanceof TextNodeElement) { TextNodeElement textNodeElement = (TextNodeElement) element; convertDecorator.setConverter(textNodeElement); @@ -281,76 +250,69 @@ angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); String[] texts = textNodeElement.getTextArray(); StringBuilder sb = new StringBuilder(); - for (String text : texts) - { + for (String text : texts) { if (sb.length() != 0) sb.append("\n"); sb.append(text); } - if (geom != null) - { - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(textNodeElement.getColorIndex()), - textNodeElement.getFontIndex(), - textNodeElement.getJustification(), - textNodeElement.getTextNodeHeight(), - textNodeElement.getTextNodeLength(), - angle, - sb.toString() - }); - } else - { + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(textNodeElement.getColorIndex()), + textNodeElement.getFontIndex(), + textNodeElement.getJustification(), + textNodeElement.getTextNodeHeight(), + textNodeElement.getTextNodeLength(), + angle, + sb.toString() + }, null); + } else { logger.info("geometry is null." + element.toString()); } return null; - } else if (element instanceof ShapeElement) - { + } else if (element instanceof ShapeElement) { ShapeElement shapeElement = (ShapeElement) element; convertDecorator.setConverter(shapeElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - { - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(shapeElement.getColorIndex()), - shapeElement.getWeight(), - shapeElement.getLineStyle() - }); - } else - { + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(shapeElement.getColorIndex()), + shapeElement.getWeight(), + shapeElement.getLineStyle() + }, null); + } else { logger.info("geometry is null." + element.toString()); } return null; - } else if (element instanceof LineStringElement) - { + } else if (element instanceof LineStringElement) { LineStringElement linestring = (LineStringElement) element; convertDecorator.setConverter(linestring); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(linestring.getColorIndex()), - linestring.getWeight(), - linestring.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(linestring.getColorIndex()), + linestring.getWeight(), + linestring.getLineStyle() + }, null); + } return null; - } else if (element instanceof LineElement) - { + } else if (element instanceof LineElement) { LineElement line = (LineElement) element; convertDecorator.setConverter(line); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(line.getColorIndex()), - line.getWeight(), - line.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(line.getColorIndex()), + line.getWeight(), + line.getLineStyle() + }, null); + } return null; - } else if (element instanceof ArcElement) - { + } else if (element instanceof ArcElement) { ArcElement arcElement = (ArcElement) element; /* logger.fatal("" + arcElement.getPrimary() + ":" + arcElement.getSecondary() + @@ -359,52 +321,50 @@ */ convertDecorator.setConverter(arcElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(arcElement.getColorIndex()), - arcElement.getWeight(), - arcElement.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(arcElement.getColorIndex()), + arcElement.getWeight(), + arcElement.getLineStyle() + }, null); + } return null; - } else if (element instanceof EllipseElement) - { + } else if (element instanceof EllipseElement) { EllipseElement arcElement = (EllipseElement) element; convertDecorator.setConverter(arcElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(arcElement.getColorIndex()), - arcElement.getWeight(), - arcElement.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(arcElement.getColorIndex()), + arcElement.getWeight(), + arcElement.getLineStyle() + }, null); + } return null; - } else if (element instanceof ComplexChainElement) - { + } else if (element instanceof ComplexChainElement) { ComplexChainElement complexChainElement = (ComplexChainElement) element; convertDecorator.setConverter(complexChainElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(complexChainElement.getColorIndex()), - complexChainElement.getWeight(), - complexChainElement.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(complexChainElement.getColorIndex()), + complexChainElement.getWeight(), + complexChainElement.getLineStyle() + }, null); + } return null; } return null; } - private String getFeatureBaseName() - { - if (featureBaseName == null) - { + private String getFeatureBaseName() { + if (featureBaseName == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } featureBaseName = dgnname; @@ -412,73 +372,55 @@ return featureBaseName; } - private FeatureType lookupFeatureType(Element element) throws SchemaException, IllegalAttributeException - { + private SimpleFeatureType lookupFeatureType(Element element) throws SchemaException, IllegalAttributeException { String typeName; - if (element instanceof TextElement) - { + if (element instanceof TextElement) { typeName = getFeatureBaseName() + "_P"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createPointFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof TextNodeElement) - { + } else if (element instanceof TextNodeElement) { typeName = getFeatureBaseName() + "_P"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createPointFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof LineStringElement) - { - if (element instanceof ShapeElement) - { + } else if (element instanceof LineStringElement) { + if (element instanceof ShapeElement) { typeName = getFeatureBaseName() + "_R"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createLineFeatureElement(typeName)); } return featureTypes.get(typeName); - } else - { + } else { typeName = getFeatureBaseName() + "_L"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createLineFeatureElement(typeName)); } return featureTypes.get(typeName); } - } else if (element instanceof LineElement) - { + } else if (element instanceof LineElement) { typeName = getFeatureBaseName() + "_L"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createLineFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof ComplexChainElement) - { + } else if (element instanceof ComplexChainElement) { typeName = getFeatureBaseName() + "_ML"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createLineFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof ArcElement) - { + } else if (element instanceof ArcElement) { typeName = getFeatureBaseName() + "_A"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createArcFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof EllipseElement) - { + } else if (element instanceof EllipseElement) { typeName = getFeatureBaseName() + "_R"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createEllipseFeatureElement(typeName)); } return featureTypes.get(typeName); @@ -487,16 +429,13 @@ return null; } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } @@ -504,18 +443,15 @@ } - public boolean isWithIndex() - { + public boolean isWithIndex() { return withIndex; } - public void setWithIndex(boolean withIndex) - { + public void setWithIndex(boolean withIndex) { this.withIndex = withIndex; } - public Log getLogger() - { + public Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/IndexDgnConvertMySQLJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/IndexDgnConvertMySQLJobContext.java index fe641c7..e3db39c 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/IndexDgnConvertMySQLJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/IndexDgnConvertMySQLJobContext.java @@ -1,313 +1,305 @@ package com.ximple.eofms.jobs.context.mysql; +import java.io.IOException; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.net.MalformedURLException; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.net.MalformedURLException; -import java.io.IOException; -import java.math.BigDecimal; -import java.math.RoundingMode; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.commons.transaction.util.LoggerFacade; -import org.apache.commons.transaction.util.CommonsLoggingLogger; import org.apache.commons.transaction.memory.PessimisticMapWrapper; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; -import org.geotools.feature.SimpleFeature; -import org.geotools.data.FeatureWriter; +import org.apache.commons.transaction.util.CommonsLoggingLogger; +import org.apache.commons.transaction.util.LoggerFacade; import org.geotools.data.DataStore; +import org.geotools.data.FeatureWriter; import org.geotools.data.Transaction; +import org.opengis.feature.IllegalAttributeException; +import org.geotools.feature.SchemaException; -import com.vividsolutions.jts.geom.GeometryFactory; +import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Envelope; import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.GeometryFactory; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; -import com.ximple.eofms.util.FeatureTypeBuilderUtil; import com.ximple.eofms.util.DefaultColorTable; +import com.ximple.eofms.util.EPSG3825GeometryConverterDecorator; +import com.ximple.eofms.util.EPSG3826GeometryConverterDecorator; +import com.ximple.eofms.util.FeatureTypeBuilderUtil; +import com.ximple.eofms.util.GeometryConverterDecorator; import com.ximple.eofms.util.TPCLIDConverter; import com.ximple.eofms.util.TWDDatumConverter; import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.TextElement; import com.ximple.io.dgn7.FrammeAttributeData; +import com.ximple.io.dgn7.TextElement; import com.ximple.io.dgn7.UserAttributeData; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; -public class IndexDgnConvertMySQLJobContext extends AbstractDgnToMySQLJobContext -{ +public class IndexDgnConvertMySQLJobContext extends AbstractDgnToMySQLJobContext { static final Log logger = LogFactory.getLog(IndexDgnConvertMySQLJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); - TWD97GeometryConverterDecorator convertDecorator = new TWD97GeometryConverterDecorator(); + static final GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); - private HashMap<String, ArrayList<Feature>> featuresContext = new HashMap<String, ArrayList<Feature>>(); + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; - private FeatureTypeBuilder typeBuilderPnt = null; - private FeatureTypeBuilder typeBuilderRect = null; - private FeatureType featureType = null; - private FeatureType featureType2 = null; - private FeatureType featureType3 = null; + private SimpleFeatureTypeBuilder typeBuilderPnt = null; + private SimpleFeatureTypeBuilder typeBuilderRect = null; + private SimpleFeatureType featureType = null; + private SimpleFeatureType featureType2 = null; + private SimpleFeatureType featureType3 = null; - public IndexDgnConvertMySQLJobContext(String dataPath, DataStore targetDataStore) - { - super(dataPath, targetDataStore); + public IndexDgnConvertMySQLJobContext(String dataPath, DataStore targetDataStore, boolean profileMode, + boolean useTransform) { + super(dataPath, targetDataStore, profileMode, useTransform); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { - if (!(element instanceof TextElement)) - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { + if (!(element instanceof TextElement)) { return; } - Feature feature = createFeature((TextElement) element); - if (feature == null) - { + SimpleFeature feature = createFeature((TextElement) element); + if (feature == null) { logger.info("cannot craete feature." + element.toString() + "'" + - ((TextElement) element).getText() + "'"); + ((TextElement) element).getText() + "'"); return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); feature = createFeature2((TextElement) element); - if (feature == null) - { + if (feature == null) { logger.info("cannot craete feature2." + element.toString() + "'" + - ((TextElement) element).getText() + "'"); + ((TextElement) element).getText() + "'"); return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); } - public void startTransaction() - { + public void startTransaction() { } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); logger.debug("Begin Save OracleSDO:" + featureType.getTypeName()); FeatureWriter writer; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { - if (!isExistFeature(featureType)) - { + } else { + if (!isExistFeature(featureType)) { targetDataStore.createSchema(featureType); writer = targetDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT); - } else - { + } else { writer = targetDataStore.getFeatureWriterAppend(featureType.getTypeName(), Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } - ArrayList<Feature> features = featuresContext.get(featureType); - for (Feature feature1 : features) - { - ((SimpleFeature) writer.next()).setAttributes(feature1.getAttributes(null)); + ArrayList<SimpleFeature> features = featuresContext.get(featureType); + for (SimpleFeature feature1 : features) { + ((SimpleFeature) writer.next()).setAttributes(feature1.getAttributes()); } //writer.close(); logger.debug("End Save OracleSDO:" + featureType.getTypeName()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - public FeatureType createFeatureElement(String featureName) throws SchemaException - { - if (typeBuilderRect == null) - { + public SimpleFeatureType createFeatureElement(String featureName) throws SchemaException { + if (typeBuilderRect == null) { typeBuilderRect = FeatureTypeBuilderUtil.createNormalIndexFeatureTypeBuilder(featureName); } - return typeBuilderRect.getFeatureType(); + return typeBuilderRect.buildFeatureType(); } - public FeatureType createFeatureElement2(String featureName) throws SchemaException - { - if (typeBuilderPnt == null) - { + public SimpleFeatureType createFeatureElement2(String featureName) throws SchemaException { + if (typeBuilderPnt == null) { typeBuilderPnt = FeatureTypeBuilderUtil.createNormalIndexTextFeatureTypeBuilder(featureName); } - return typeBuilderPnt.getFeatureType(); + return typeBuilderPnt.buildFeatureType(); } - public Feature createFeature(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { + if (element instanceof TextElement) { TextElement textElement = (TextElement) element; String tpclid = textElement.getText(); Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); - Geometry geom = geometryFactory.createLinearRing(new Coordinate[] + Geometry geom = (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826 ? + geometryFactory.createLinearRing(new Coordinate[] { - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMinX(), extent.getMinY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMaxX(), extent.getMinY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMaxX(), extent.getMaxY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMinX(), extent.getMaxY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMinX(), extent.getMinY())), - }); + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMaxX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMaxX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMinY())), + }) : + geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMaxX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMaxX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMinY())), + })); - return featureType.create(new Object[]{ - geom, - extent.getMinX(), - extent.getMinY(), - extent.getMaxX(), - extent.getMaxY(), - tpclid, - colorTable.getColorCode(textElement.getColorIndex()), - textElement.getWeight(), - textElement.getLineStyle() - }); + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + extent.getMinX(), + extent.getMinY(), + extent.getMaxX(), + extent.getMaxY(), + tpclid, + colorTable.getColorCode(textElement.getColorIndex()), + textElement.getWeight(), + textElement.getLineStyle() + }, null); } return null; } - public Feature createFeature2(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature createFeature2(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { + if (element instanceof TextElement) { TextElement txtElement = (TextElement) element; double angle = txtElement.getRotationAngle(); angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(txtElement); - Feature feature = featureType.create(new Object[]{ - convertDecorator.toGeometry(geometryFactory), - colorTable.getColorCode(txtElement.getColorIndex()), - txtElement.getWeight(), - txtElement.getLineStyle(), - txtElement.getJustification(), - txtElement.getTextHeight(), - txtElement.getTextWidth(), - angle, - txtElement.getText() - }); + Geometry geom = convertDecorator.toGeometry(geometryFactory); + SimpleFeature feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(txtElement.getColorIndex()), + txtElement.getWeight(), + txtElement.getLineStyle(), + txtElement.getJustification(), + txtElement.getTextHeight(), + txtElement.getTextWidth(), + angle, + txtElement.getText() + }, null); return feature; } return null; } - public Feature[] createFeature3(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature[] createFeature3(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { + if (element instanceof TextElement) { TextElement textElement = (TextElement) element; String tpclid = textElement.getText(); - Feature[] result = new Feature[4]; + SimpleFeature[] result = new SimpleFeature[4]; Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); - for (int i = 0; i < 4; i++) - { + 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[] + Geometry geom = (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826 ? + 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); + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + }), null) : + geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(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() - }); + result[i] = SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + extent.getMinX(), + extent.getMinY(), + extent.getMaxX(), + extent.getMaxY(), + tpclid + mapSubId, + colorTable.getColorCode(textElement.getColorIndex()), + textElement.getWeight(), + textElement.getLineStyle() + }, null); } return result; @@ -315,14 +307,11 @@ return null; } - private Feature createFeature(TextElement element) throws SchemaException, IllegalAttributeException - { - if (featureType == null) - { + private SimpleFeature createFeature(TextElement element) throws SchemaException, IllegalAttributeException { + if (featureType == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } featureType = createFeatureElement(dgnname); @@ -330,14 +319,11 @@ return createFeature(featureType, element); } - private Feature createFeature2(TextElement element) throws SchemaException, IllegalAttributeException - { - if (featureType2 == null) - { + private SimpleFeature createFeature2(TextElement element) throws SchemaException, IllegalAttributeException { + if (featureType2 == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } dgnname = dgnname + "P"; @@ -346,14 +332,11 @@ return createFeature2(featureType2, element); } - private Feature[] createFeature3(TextElement element) throws SchemaException, IllegalAttributeException - { - if (featureType3 == null) - { + private SimpleFeature[] createFeature3(TextElement element) throws SchemaException, IllegalAttributeException { + if (featureType3 == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } dgnname = dgnname + "_s"; @@ -362,24 +345,20 @@ return createFeature3(featureType3, element); } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } return null; } - public Log getLogger() - { + public Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/OracleConvertMySQLJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/OracleConvertMySQLJobContext.java index 7ea7bb5..b098d69 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/OracleConvertMySQLJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/mysql/OracleConvertMySQLJobContext.java @@ -11,8 +11,8 @@ import java.util.HashMap; import java.util.Iterator; -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.xmlrules.DigesterLoader; +import com.ximple.eofms.util.ElementDigesterUtils; +import org.apache.commons.digester3.Digester; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.transaction.memory.PessimisticMapWrapper; @@ -22,10 +22,9 @@ import org.geotools.data.FeatureWriter; import org.geotools.data.Transaction; import org.geotools.data.mysql.MySQLDataStoreFactory; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SimpleFeature; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; import org.quartz.JobExecutionContext; import org.xml.sax.SAXException; @@ -38,8 +37,7 @@ import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.FrammeAttributeData; -public class OracleConvertMySQLJobContext extends AbstractOracleToMySQLJobContext -{ +public class OracleConvertMySQLJobContext extends AbstractOracleToMySQLJobContext { static Log logger = LogFactory.getLog(OracleConvertMySQLJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); @@ -47,13 +45,10 @@ private OracleElementLogger elmLogger = null; - static - { - try - { + static { + try { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); - } catch (SQLException e) - { + } catch (SQLException e) { Assert.shouldNeverReachHere(e.getMessage()); } } @@ -73,112 +68,91 @@ private boolean schemaChanged = false; // private String _convertElementIn = null; - public OracleConvertMySQLJobContext(String dataPath, DataStore oraDS, String filterConfig) - { - super(dataPath, oraDS); + public OracleConvertMySQLJobContext(String dataPath, DataStore oraDS, String filterConfig, boolean profileMode, + boolean useTransform) { + super(dataPath, oraDS, profileMode, useTransform); _filterConfig = filterConfig; elementDispatcher = createElementDispatcher(); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); } - private ElementDispatcher createElementDispatcher() - { - try - { - URL rulesURL = ElementDispatcher.class.getResource("ElementDispatcherRules.xml"); - assert rulesURL != null; - Digester digester = DigesterLoader.createDigester(rulesURL); + private ElementDispatcher createElementDispatcher() { + try { URL filterURL = null; - if (_filterConfig != null) - { + if (_filterConfig != null) { File config = new File(_filterConfig); - if (config.exists()) - { + if (config.exists()) { filterURL = config.toURI().toURL(); } } - if (filterURL == null) - { + if (filterURL == null) { // config = new File("conf/DefaultConvertShpFilter.xml"); filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); } assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); return (ElementDispatcher) digester.parse(filterURL); - } catch (UnsupportedEncodingException e) - { + } catch (UnsupportedEncodingException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (SAXException e) - { + } catch (SAXException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); } } - public void putFeatureCollection(Element element) - { + public void putFeatureCollection(Element element) { assert elementDispatcher != null; - // �P�_�O�_�ũM���� - Feature feature = elementDispatcher.execute(element, true); - if (feature == null) - { + + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { boolean isEmptySize = false; FrammeAttributeData linkage = - AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); logger.warn("Unknown Element:" + element.getElementType().toString() + - ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + - (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); - if (element instanceof ComplexElement) - { + if (element instanceof ComplexElement) { ComplexElement complex = (ComplexElement) element; logger.warn("----Complex Element size=" + complex.size() + ":" + - (linkage == null ? "NULL" : (linkage.getUfid()))); + (linkage == null ? "NULL" : (linkage.getUfid()))); isEmptySize = true; } - if (getElementLogging() && (!isEmptySize)) - { + if (getElementLogging() && (!isEmptySize)) { getElementLogger().logElement(element, getCurrentSchema()); } return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); } - public void startTransaction() - { + public void startTransaction() { //txFeaturesContext.startTransaction(); } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } @@ -186,126 +160,104 @@ this.getElementLogger().flashLogging(); } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); FeatureWriter writer = null; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { + } else { DataStore postGisDataStore = null; postGisDataStore = dataStoreFactory.createDataStore(properties); boolean existTable = isExistFeature(featureType); - if (!existTable) - { + if (!existTable) { postGisDataStore.createSchema(featureType); writer = postGisDataStore.getFeatureWriter(featureType.getTypeName(), - Transaction.AUTO_COMMIT); - } else - { + Transaction.AUTO_COMMIT); + } else { writer = postGisDataStore.getFeatureWriterAppend(featureType.getTypeName(), - Transaction.AUTO_COMMIT); + Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } ArrayList features = (ArrayList) featuresContext.get(featureType); Iterator itFeature = features.iterator(); - while (itFeature.hasNext()) - { - Feature feature = (Feature) itFeature.next(); - ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); } //writer.close(); logger.debug("End Save OracleSDO:" + featureType.getTypeName()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); } } - public JobExecutionContext getExecutionContext() - { + public JobExecutionContext getExecutionContext() { return executionContext; } - public void setExecutionContext(JobExecutionContext context) - { + public void setExecutionContext(JobExecutionContext context) { executionContext = context; } /** - * �����]�Ƽg�J�� + * �����]�Ƽg�J�� * - * @throws IOException IO�o�Ϳ��~ + * @throws IOException IO�o�Ϳ�~ */ - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - protected OracleElementLogger getElementLogger() - { - if (elmLogger == null) - { + protected OracleElementLogger getElementLogger() { + if (elmLogger == null) { elmLogger = new OracleElementLogger(getOracleConnection()); elmLogger.setDataPath(this.getDataPath()); } return elmLogger; } - public boolean isSchemaChanged() - { + public boolean isSchemaChanged() { return schemaChanged; } - public String getCurrentSchema() - { + public String getCurrentSchema() { return currentSchema; } - public void setCurrentSchema(String querySchema) - { + public void setCurrentSchema(String querySchema) { this.currentSchema = querySchema; this.schemaChanged = true; } - protected Log getLogger() - { + protected Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/AbstractDgnToOraSDOJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/AbstractDgnToOraSDOJobContext.java index 2596fc8..cc0761d 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/AbstractDgnToOraSDOJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/AbstractDgnToOraSDOJobContext.java @@ -4,42 +4,35 @@ import java.sql.Connection; import org.geotools.data.DataStore; -import org.geotools.data.Transaction; import org.geotools.data.SchemaNotFoundException; -import org.geotools.data.oracle.OracleDataStore; -import org.geotools.feature.FeatureType; +import org.geotools.data.Transaction; import com.ximple.eofms.jobs.context.AbstractDgnFileJobContext; +import org.geotools.jdbc.JDBCDataStore; +import org.opengis.feature.simple.SimpleFeatureType; -public abstract class AbstractDgnToOraSDOJobContext extends AbstractDgnFileJobContext -{ - protected OracleDataStore targetDataStore; +public abstract class AbstractDgnToOraSDOJobContext extends AbstractDgnFileJobContext { + protected JDBCDataStore targetDataStore; - public AbstractDgnToOraSDOJobContext(String dataPath, DataStore targetDataStore) - { - super(dataPath); - this.targetDataStore = (OracleDataStore) targetDataStore; + public AbstractDgnToOraSDOJobContext(String dataPath, DataStore targetDataStore, boolean profileMode, + boolean useTransform) { + super(dataPath, profileMode, useTransform); + this.targetDataStore = (JDBCDataStore) targetDataStore; } - public OracleDataStore getTargetDataStore() - { + public JDBCDataStore getTargetDataStore() { return targetDataStore; } - public void setTargetDataStore(OracleDataStore targetDataStore) - { + public void setTargetDataStore(JDBCDataStore targetDataStore) { this.targetDataStore = targetDataStore; } - public Connection getConnection() - { - if (targetDataStore != null) - { - try - { + public Connection getConnection() { + if (targetDataStore != null) { + try { return targetDataStore.getConnection(Transaction.AUTO_COMMIT); - } catch (IOException e) - { + } catch (IOException e) { getLogger().warn(e.getMessage(), e); } } @@ -47,17 +40,13 @@ } - protected boolean isExistFeature(FeatureType featureType) - { - try - { - FeatureType existFeatureType = targetDataStore.getSchema(featureType.getTypeName()); + protected boolean isExistFeature(SimpleFeatureType featureType) { + try { + SimpleFeatureType existFeatureType = targetDataStore.getSchema(featureType.getTypeName()); return existFeatureType != null && existFeatureType.equals(featureType); - } catch (SchemaNotFoundException e) - { + } catch (SchemaNotFoundException e) { return false; - } catch (IOException e) - { + } catch (IOException e) { getLogger().info(e.getMessage(), e); return false; } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/AbstractOracleToOraSDOJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/AbstractOracleToOraSDOJobContext.java index d535cb6..9535bba 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/AbstractOracleToOraSDOJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/AbstractOracleToOraSDOJobContext.java @@ -4,49 +4,41 @@ import java.sql.Connection; import org.geotools.data.DataStore; -import org.geotools.data.Transaction; import org.geotools.data.SchemaNotFoundException; -import org.geotools.data.oracle.OracleDataStore; -import org.geotools.feature.FeatureType; +import org.geotools.data.Transaction; import com.ximple.eofms.jobs.context.AbstractOracleJobContext; -import com.ximple.eofms.jobs.context.mysql.OracleConvertMySQLJobContext; +import org.geotools.jdbc.JDBCDataStore; +import org.opengis.feature.simple.SimpleFeatureType; -public abstract class AbstractOracleToOraSDOJobContext extends AbstractOracleJobContext -{ - protected OracleDataStore targetDataStore; +public abstract class AbstractOracleToOraSDOJobContext extends AbstractOracleJobContext { + protected boolean profileMode = false; + protected JDBCDataStore targetDataStore; - public AbstractOracleToOraSDOJobContext(String dataPath, DataStore targetDataStore) - { - if ((targetDataStore != null) && (targetDataStore instanceof OracleDataStore)) - { - this.targetDataStore = (OracleDataStore) targetDataStore; - } else - { + public AbstractOracleToOraSDOJobContext(String dataPath, DataStore targetDataStore, boolean profileMode, + boolean useTransform) { + super(profileMode, useTransform); + if ((targetDataStore != null) && (targetDataStore instanceof JDBCDataStore)) { + this.targetDataStore = (JDBCDataStore) targetDataStore; + } else { getLogger().info("targetDataStore has wrong."); } setDataPath(dataPath); } - public OracleDataStore getTargetDataStore() - { + public JDBCDataStore getTargetDataStore() { return targetDataStore; } - public void setTargetDataStore(OracleDataStore targetDataStore) - { + public void setTargetDataStore(JDBCDataStore targetDataStore) { this.targetDataStore = targetDataStore; } - public Connection getConnection() - { - if (targetDataStore != null) - { - try - { + public Connection getConnection() { + if (targetDataStore != null) { + try { return targetDataStore.getConnection(Transaction.AUTO_COMMIT); - } catch (IOException e) - { + } catch (IOException e) { getLogger().warn(e.getMessage(), e); } } @@ -54,17 +46,13 @@ } - protected boolean isExistFeature(FeatureType featureType) - { - try - { - FeatureType existFeatureType = targetDataStore.getSchema(featureType.getTypeName()); + protected boolean isExistFeature(SimpleFeatureType featureType) { + try { + SimpleFeatureType existFeatureType = targetDataStore.getSchema(featureType.getTypeName()); return existFeatureType != null && existFeatureType.equals(featureType); - } catch (SchemaNotFoundException e) - { + } catch (SchemaNotFoundException e) { return false; - } catch (IOException e) - { + } catch (IOException e) { getLogger().info(e.getMessage(), e); return false; } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/DummyFeatureConvertOraSDOJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/DummyFeatureConvertOraSDOJobContext.java index dcf9d50..c3ef103 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/DummyFeatureConvertOraSDOJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/DummyFeatureConvertOraSDOJobContext.java @@ -10,8 +10,18 @@ import java.util.Iterator; import java.util.List; -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.xmlrules.DigesterLoader; +import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatcher; +import com.ximple.eofms.filter.TypeCompIdDispatchableFilter; +import com.ximple.eofms.filter.TypeCompLevelIdDispatchableFilter; +import com.ximple.eofms.filter.TypeIdDispatchableFilter; +import com.ximple.eofms.util.ElementDigesterUtils; +import com.ximple.io.dgn7.ComplexElement; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.FrammeAttributeData; +import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.digester3.Digester; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.transaction.memory.PessimisticMapWrapper; @@ -20,36 +30,20 @@ import org.geotools.data.DataStore; import org.geotools.data.FeatureWriter; import org.geotools.data.Transaction; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; +import org.opengis.feature.IllegalAttributeException; import org.geotools.feature.SchemaException; -import org.geotools.feature.SimpleFeature; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; import org.xml.sax.SAXException; -import com.vividsolutions.jts.geom.GeometryFactory; - -import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; -import com.ximple.eofms.filter.ElementDispatchableFilter; -import com.ximple.eofms.filter.ElementDispatcher; -import com.ximple.eofms.filter.TypeCompIdDispatchableFilter; -import com.ximple.eofms.filter.TypeCompLevelIdDispatchableFilter; -import com.ximple.eofms.filter.TypeIdDispatchableFilter; -import com.ximple.io.dgn7.ComplexElement; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.io.dgn7.UserAttributeData; - -public class DummyFeatureConvertOraSDOJobContext extends AbstractDgnToOraSDOJobContext -{ +public class DummyFeatureConvertOraSDOJobContext extends AbstractDgnToOraSDOJobContext { static final Log logger = LogFactory.getLog(DummyFeatureConvertOraSDOJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); static final String SHPOUTPATH = "shpout"; private String dataOut = null; - private HashMap<String, ArrayList<Feature>> featuresContext = new HashMap<String, ArrayList<Feature>>(); + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; @@ -58,78 +52,63 @@ private String _filterConfig; private boolean withIndex = false; - public DummyFeatureConvertOraSDOJobContext(String dataPath, DataStore targetDataStore, String filterConfig) - { - super(dataPath, targetDataStore); + public DummyFeatureConvertOraSDOJobContext(String dataPath, DataStore targetDataStore, String filterConfig, + boolean profileMode, boolean useTransform) { + super(dataPath, targetDataStore, profileMode, useTransform); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); _filterConfig = filterConfig; elementDispatcher = createElementDispatcher(); } - private ElementDispatcher createElementDispatcher() - { - try - { - URL rulesURL = ElementDispatcher.class.getResource("ElementDispatcherRules.xml"); - assert rulesURL != null; - Digester digester = DigesterLoader.createDigester(rulesURL); + private ElementDispatcher createElementDispatcher() { + try { URL filterURL = null; - if (_filterConfig != null) - { + if (_filterConfig != null) { File config = new File(_filterConfig); - if (config.exists()) - { + if (config.exists()) { filterURL = config.toURI().toURL(); } } - if (filterURL == null) - { + if (filterURL == null) { // config = new File("conf/DefaultConvertShpFilter.xml"); filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); } assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); return (ElementDispatcher) digester.parse(filterURL); - } catch (UnsupportedEncodingException e) - { + } catch (UnsupportedEncodingException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (SAXException e) - { + } catch (SAXException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); } } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { assert elementDispatcher != null; - if (element == null) - { + if (element == null) { logger.warn("Unknown Element:" + null); return; } - // �P�_�O�_�ũM���� - Feature feature = elementDispatcher.execute(element, true); - if (feature == null) - { + // �P�_�O�_�ũM��� + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { FrammeAttributeData linkage = - AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); logger.warn("Unknown Element:" + element.getElementType().toString() + - ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + - (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); - if (element instanceof ComplexElement) - { + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); + if (element instanceof ComplexElement) { ComplexElement complex = (ComplexElement) element; logger.warn("----Complex Element size=" + complex.size()); } @@ -137,119 +116,95 @@ return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); } - public void startTransaction() - { + public void startTransaction() { assert elementDispatcher != null; - for (ElementDispatchableFilter filter : elementDispatcher.getRules()) - { - if (filter instanceof TypeCompIdDispatchableFilter) - { + for (ElementDispatchableFilter filter : elementDispatcher.getRules()) { + if (filter instanceof TypeCompIdDispatchableFilter) { ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); - } else if (filter instanceof TypeCompLevelIdDispatchableFilter) - { + } else if (filter instanceof TypeCompLevelIdDispatchableFilter) { ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); - } else if (filter instanceof TypeIdDispatchableFilter) - { + } else if (filter instanceof TypeIdDispatchableFilter) { ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); } } } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); logger.debug("Begin Save OracleSDO:" + featureType.getTypeName()); FeatureWriter writer; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { - if (!isExistFeature(featureType)) - { + } else { + if (!isExistFeature(featureType)) { targetDataStore.createSchema(featureType); writer = targetDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT); - } else - { + } else { writer = targetDataStore.getFeatureWriterAppend(featureType.getTypeName(), Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } - ArrayList<Feature> features = featuresContext.get(featureType); + ArrayList<SimpleFeature> features = featuresContext.get(featureType); Iterator itFeature = features.iterator(); - while (itFeature.hasNext()) - { - Feature feature = (Feature) itFeature.next(); - ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); } //writer.close(); logger.debug("End Save OracleSDO:" + featureType.getTypeName()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public String getDataOutPath() - { - if (dataOut == null) - { + public String getDataOutPath() { + if (dataOut == null) { File outPath = new File(getDataPath(), SHPOUTPATH); - if (!outPath.exists()) - { + if (!outPath.exists()) { outPath.mkdir(); - } else if (!outPath.isDirectory()) - { + } else if (!outPath.isDirectory()) { outPath.mkdir(); } dataOut = outPath.toString(); @@ -257,27 +212,22 @@ return dataOut; } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } @@ -285,18 +235,15 @@ } - public boolean isWithIndex() - { + public boolean isWithIndex() { return withIndex; } - public void setWithIndex(boolean withIndex) - { + public void setWithIndex(boolean withIndex) { this.withIndex = withIndex; } - public Log getLogger() - { + public Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/FeatureDgnConvertOraSDOJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/FeatureDgnConvertOraSDOJobContext.java index 4ebf693..4887af4 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/FeatureDgnConvertOraSDOJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/FeatureDgnConvertOraSDOJobContext.java @@ -10,8 +10,14 @@ import java.util.Iterator; import java.util.List; -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.xmlrules.DigesterLoader; +import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatcher; +import com.ximple.eofms.util.ElementDigesterUtils; +import com.ximple.io.dgn7.ComplexElement; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.FrammeAttributeData; +import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.digester3.Digester; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.transaction.memory.PessimisticMapWrapper; @@ -20,29 +26,17 @@ import org.geotools.data.DataStore; import org.geotools.data.FeatureWriter; import org.geotools.data.Transaction; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; import org.geotools.feature.SchemaException; -import org.geotools.feature.SimpleFeature; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; import org.xml.sax.SAXException; -import com.vividsolutions.jts.geom.GeometryFactory; - -import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; -import com.ximple.eofms.filter.ElementDispatcher; -import com.ximple.io.dgn7.ComplexElement; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.io.dgn7.UserAttributeData; - -public class FeatureDgnConvertOraSDOJobContext extends AbstractDgnToOraSDOJobContext -{ +public class FeatureDgnConvertOraSDOJobContext extends AbstractDgnToOraSDOJobContext { static final Log logger = LogFactory.getLog(FeatureDgnConvertOraSDOJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); - private HashMap<String, ArrayList<Feature>> featuresContext = new HashMap<String, ArrayList<Feature>>(); + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; @@ -51,78 +45,62 @@ private String _filterConfig; private boolean withIndex = false; - public FeatureDgnConvertOraSDOJobContext(String dataPath, DataStore targetDataStore, String filterConfig) - { - super(dataPath, targetDataStore); + public FeatureDgnConvertOraSDOJobContext(String dataPath, DataStore targetDataStore, String filterConfig, + boolean profileMode, boolean useTransform) { + super(dataPath, targetDataStore, profileMode, useTransform); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); _filterConfig = filterConfig; elementDispatcher = createElementDispatcher(); } - private ElementDispatcher createElementDispatcher() - { - try - { - URL rulesURL = ElementDispatcher.class.getResource("ElementDispatcherRules.xml"); - assert rulesURL != null; - Digester digester = DigesterLoader.createDigester(rulesURL); + private ElementDispatcher createElementDispatcher() { + try { URL filterURL = null; - if (_filterConfig != null) - { + if (_filterConfig != null) { File config = new File(_filterConfig); - if (config.exists()) - { + if (config.exists()) { filterURL = config.toURI().toURL(); } } - if (filterURL == null) - { + if (filterURL == null) { // config = new File("conf/DefaultConvertShpFilter.xml"); filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); } assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); return (ElementDispatcher) digester.parse(filterURL); - } catch (UnsupportedEncodingException e) - { + } catch (UnsupportedEncodingException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (SAXException e) - { + } catch (SAXException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); } } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { assert elementDispatcher != null; - if (element == null) - { + if (element == null) { logger.warn("Unknown Element:" + null); return; } - // �P�_�O�_�ũM���� - Feature feature = elementDispatcher.execute(element, true); - if (feature == null) - { + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { FrammeAttributeData linkage = - AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); logger.warn("Unknown Element:" + element.getElementType().toString() + - ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + - (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); - if (element instanceof ComplexElement) - { + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); + if (element instanceof ComplexElement) { ComplexElement complex = (ComplexElement) element; logger.warn("----Complex Element size=" + complex.size()); } @@ -130,118 +108,97 @@ return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); } - public void startTransaction() - { + public void startTransaction() { } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); logger.debug("Begin Save OracleSDO:" + featureType.getTypeName()); FeatureWriter writer; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { - if (!isExistFeature(featureType)) - { + } else { + if (!isExistFeature(featureType)) { targetDataStore.createSchema(featureType); writer = targetDataStore.getFeatureWriter(featureType.getTypeName(), - Transaction.AUTO_COMMIT); - } else - { + Transaction.AUTO_COMMIT); + } else { writer = targetDataStore.getFeatureWriterAppend(featureType.getTypeName(), - Transaction.AUTO_COMMIT); + Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } - ArrayList<Feature> features = featuresContext.get(featureType); + ArrayList<SimpleFeature> features = featuresContext.get(featureType); Iterator itFeature = features.iterator(); - while (itFeature.hasNext()) - { - Feature feature = (Feature) itFeature.next(); - ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); } //writer.close(); logger.debug("End Save OracleSDO:" + featureType.getTypeName()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } @@ -249,18 +206,15 @@ } - public boolean isWithIndex() - { + public boolean isWithIndex() { return withIndex; } - public void setWithIndex(boolean withIndex) - { + public void setWithIndex(boolean withIndex) { this.withIndex = withIndex; } - public Log getLogger() - { + public Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/GeneralDgnConvertOraSDOJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/GeneralDgnConvertOraSDOJobContext.java index 3e8bd3a..aa49733 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/GeneralDgnConvertOraSDOJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/GeneralDgnConvertOraSDOJobContext.java @@ -18,19 +18,17 @@ import org.geotools.data.DataStore; import org.geotools.data.FeatureWriter; import org.geotools.data.Transaction; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.IllegalAttributeException; +import org.opengis.feature.IllegalAttributeException; import org.geotools.feature.SchemaException; -import org.geotools.feature.SimpleFeature; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; import com.ximple.eofms.util.DefaultColorTable; +import com.ximple.eofms.util.EPSG3825GeometryConverterDecorator; +import com.ximple.eofms.util.EPSG3826GeometryConverterDecorator; import com.ximple.eofms.util.FeatureTypeBuilderUtil; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; +import com.ximple.eofms.util.GeometryConverterDecorator; import com.ximple.io.dgn7.ArcElement; import com.ximple.io.dgn7.ComplexChainElement; import com.ximple.io.dgn7.Element; @@ -42,211 +40,185 @@ import com.ximple.io.dgn7.TextElement; import com.ximple.io.dgn7.TextNodeElement; import com.ximple.io.dgn7.UserAttributeData; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; -public class GeneralDgnConvertOraSDOJobContext extends AbstractDgnToOraSDOJobContext -{ +public class GeneralDgnConvertOraSDOJobContext extends AbstractDgnToOraSDOJobContext { static final Log logger = LogFactory.getLog(GeneralDgnConvertOraSDOJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); + static final GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); private String dataOut = null; - private HashMap<String, ArrayList<Feature>> featuresContext = new HashMap<String, ArrayList<Feature>>(); + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; - private TreeMap<String, FeatureTypeBuilder> typeBuilders = new TreeMap<String, FeatureTypeBuilder>(); - private TreeMap<String, FeatureType> featureTypes = new TreeMap<String, FeatureType>(); + private TreeMap<String, SimpleFeatureType> featureTypes = new TreeMap<String, SimpleFeatureType>(); - private TWD97GeometryConverterDecorator convertDecorator = null; private String featureBaseName = null; private boolean withIndex = false; - public GeneralDgnConvertOraSDOJobContext(String dataPath, DataStore targetDataStore) - { - super(dataPath, targetDataStore); + public GeneralDgnConvertOraSDOJobContext(String dataPath, DataStore targetDataStore, boolean profileMode, + boolean useTransform) { + super(dataPath, targetDataStore, profileMode, useTransform); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); - convertDecorator = new TWD97GeometryConverterDecorator(); } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { - FeatureType ft = lookupFeatureType(element); - if (ft != null) - { - Feature feature = createFeature(ft, element); - if (feature == null) - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { + SimpleFeatureType ft = lookupFeatureType(element); + if (ft != null) { + SimpleFeature feature = createFeature(ft, element); + if (feature == null) { if (element instanceof TextElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((TextElement) element).getText() + "'"); + ((TextElement) element).getText() + "'"); else if (element instanceof ShapeElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((ShapeElement) element).getVerticeSize() + "'" + - ((ShapeElement) element).getStartPoint()); + ((ShapeElement) element).getVerticeSize() + "'" + + ((ShapeElement) element).getStartPoint()); else if (element instanceof LineStringElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((LineStringElement) element).getVerticeSize() + "'" + - ((LineStringElement) element).getStartPoint()); + ((LineStringElement) element).getVerticeSize() + "'" + + ((LineStringElement) element).getStartPoint()); else if (element instanceof ArcElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((ArcElement) element).getOrigin().toString() + "'" + - ((ArcElement) element).getRotationAngle()); + ((ArcElement) element).getOrigin().toString() + "'" + + ((ArcElement) element).getRotationAngle()); return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { - txFeaturesContext.put(feature.getFeatureType(), new ArrayList<Feature>()); + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); } - ArrayList<Feature> arrayList = (ArrayList<Feature>) txFeaturesContext.get(feature.getFeatureType()); + ArrayList<SimpleFeature> arrayList = (ArrayList<SimpleFeature>) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); - } else - { + } else { logger.info("Unknown Element :" + element.getType() + ", lv=" + element.getLevelIndex()); } } - public void startTransaction() - { + public void startTransaction() { } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); logger.debug("Begin Save into OracleSDO:" + featureType.getTypeName()); FeatureWriter writer; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { - if (!isExistFeature(featureType)) - { + } else { + if (!isExistFeature(featureType)) { targetDataStore.createSchema(featureType); writer = targetDataStore.getFeatureWriter(featureType.getTypeName(), - Transaction.AUTO_COMMIT); - } else - { + Transaction.AUTO_COMMIT); + } else { writer = targetDataStore.getFeatureWriterAppend(featureType.getTypeName(), - Transaction.AUTO_COMMIT); + Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } - ArrayList<Feature> features = featuresContext.get(featureType); + ArrayList<SimpleFeature> features = featuresContext.get(featureType); Iterator itFeature = features.iterator(); - while (itFeature.hasNext()) - { - Feature feature = (Feature) itFeature.next(); - ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); } //writer.close(); logger.debug("End Save into OracleSDO:" + featureType.getTypeName()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - public FeatureType createPointFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalPointFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); + public SimpleFeatureType createPointFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalPointFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public FeatureType createLineFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalLineFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); + public SimpleFeatureType createLineFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalLineFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public FeatureType createArcFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalArcFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); + public SimpleFeatureType createArcFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalArcFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public FeatureType createEllipseFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalEllipseFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); + public SimpleFeatureType createEllipseFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalEllipseFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public Feature createFeature(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); + if (element instanceof TextElement) { TextElement textElement = (TextElement) element; convertDecorator.setConverter(textElement); @@ -254,25 +226,22 @@ double angle = textElement.getRotationAngle(); String content = textElement.getText(); angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); - if (geom != null) - { - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(textElement.getColorIndex()), - textElement.getFontIndex(), - textElement.getJustification(), - textElement.getTextHeight(), - textElement.getTextWidth(), - angle, - content - }); - } else - { + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(textElement.getColorIndex()), + textElement.getFontIndex(), + textElement.getJustification(), + textElement.getTextHeight(), + textElement.getTextWidth(), + angle, + content + }, null); + } else { logger.info("geometry is null." + element.toString()); } return null; - } else if (element instanceof TextNodeElement) - { + } else if (element instanceof TextNodeElement) { TextNodeElement textNodeElement = (TextNodeElement) element; convertDecorator.setConverter(textNodeElement); @@ -281,76 +250,69 @@ angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); String[] texts = textNodeElement.getTextArray(); StringBuilder sb = new StringBuilder(); - for (String text : texts) - { + for (String text : texts) { if (sb.length() != 0) sb.append("\n"); sb.append(text); } - if (geom != null) - { - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(textNodeElement.getColorIndex()), - textNodeElement.getFontIndex(), - textNodeElement.getJustification(), - textNodeElement.getTextNodeHeight(), - textNodeElement.getTextNodeLength(), - angle, - sb.toString() - }); - } else - { + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(textNodeElement.getColorIndex()), + textNodeElement.getFontIndex(), + textNodeElement.getJustification(), + textNodeElement.getTextNodeHeight(), + textNodeElement.getTextNodeLength(), + angle, + sb.toString() + }, null); + } else { logger.info("geometry is null." + element.toString()); } return null; - } else if (element instanceof ShapeElement) - { + } else if (element instanceof ShapeElement) { ShapeElement shapeElement = (ShapeElement) element; convertDecorator.setConverter(shapeElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - { - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(shapeElement.getColorIndex()), - shapeElement.getWeight(), - shapeElement.getLineStyle() - }); - } else - { + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(shapeElement.getColorIndex()), + shapeElement.getWeight(), + shapeElement.getLineStyle() + }, null); + } else { logger.info("geometry is null." + element.toString()); } return null; - } else if (element instanceof LineStringElement) - { + } else if (element instanceof LineStringElement) { LineStringElement linestring = (LineStringElement) element; convertDecorator.setConverter(linestring); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(linestring.getColorIndex()), - linestring.getWeight(), - linestring.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(linestring.getColorIndex()), + linestring.getWeight(), + linestring.getLineStyle() + }, null); + } return null; - } else if (element instanceof LineElement) - { + } else if (element instanceof LineElement) { LineElement line = (LineElement) element; convertDecorator.setConverter(line); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(line.getColorIndex()), - line.getWeight(), - line.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(line.getColorIndex()), + line.getWeight(), + line.getLineStyle() + }, null); + } return null; - } else if (element instanceof ArcElement) - { + } else if (element instanceof ArcElement) { ArcElement arcElement = (ArcElement) element; /* logger.fatal("" + arcElement.getPrimary() + ":" + arcElement.getSecondary() + @@ -359,52 +321,50 @@ */ convertDecorator.setConverter(arcElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(arcElement.getColorIndex()), - arcElement.getWeight(), - arcElement.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(arcElement.getColorIndex()), + arcElement.getWeight(), + arcElement.getLineStyle() + }, null); + } return null; - } else if (element instanceof EllipseElement) - { + } else if (element instanceof EllipseElement) { EllipseElement arcElement = (EllipseElement) element; convertDecorator.setConverter(arcElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(arcElement.getColorIndex()), - arcElement.getWeight(), - arcElement.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(arcElement.getColorIndex()), + arcElement.getWeight(), + arcElement.getLineStyle() + }, null); + } return null; - } else if (element instanceof ComplexChainElement) - { + } else if (element instanceof ComplexChainElement) { ComplexChainElement complexChainElement = (ComplexChainElement) element; convertDecorator.setConverter(complexChainElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(complexChainElement.getColorIndex()), - complexChainElement.getWeight(), - complexChainElement.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(complexChainElement.getColorIndex()), + complexChainElement.getWeight(), + complexChainElement.getLineStyle() + }, null); + } return null; } return null; } - private String getFeatureBaseName() - { - if (featureBaseName == null) - { + private String getFeatureBaseName() { + if (featureBaseName == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } featureBaseName = dgnname; @@ -412,73 +372,55 @@ return featureBaseName; } - private FeatureType lookupFeatureType(Element element) throws SchemaException, IllegalAttributeException - { + private SimpleFeatureType lookupFeatureType(Element element) throws SchemaException, IllegalAttributeException { String typeName; - if (element instanceof TextElement) - { + if (element instanceof TextElement) { typeName = getFeatureBaseName() + "P"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createPointFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof TextNodeElement) - { + } else if (element instanceof TextNodeElement) { typeName = getFeatureBaseName() + "P"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createPointFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof LineStringElement) - { - if (element instanceof ShapeElement) - { + } else if (element instanceof LineStringElement) { + if (element instanceof ShapeElement) { typeName = getFeatureBaseName() + "R"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createLineFeatureElement(typeName)); } return featureTypes.get(typeName); - } else - { + } else { typeName = getFeatureBaseName() + "L"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createLineFeatureElement(typeName)); } return featureTypes.get(typeName); } - } else if (element instanceof LineElement) - { + } else if (element instanceof LineElement) { typeName = getFeatureBaseName() + "L"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createLineFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof ComplexChainElement) - { + } else if (element instanceof ComplexChainElement) { typeName = getFeatureBaseName() + "L"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createLineFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof ArcElement) - { + } else if (element instanceof ArcElement) { typeName = getFeatureBaseName() + "A"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createArcFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof EllipseElement) - { + } else if (element instanceof EllipseElement) { typeName = getFeatureBaseName() + "R"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createEllipseFeatureElement(typeName)); } return featureTypes.get(typeName); @@ -487,16 +429,13 @@ return null; } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } @@ -504,18 +443,15 @@ } - public boolean isWithIndex() - { + public boolean isWithIndex() { return withIndex; } - public void setWithIndex(boolean withIndex) - { + public void setWithIndex(boolean withIndex) { this.withIndex = withIndex; } - public Log getLogger() - { + public Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/IndexDgnConvertOraSDOJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/IndexDgnConvertOraSDOJobContext.java index e4e1976..ad05038 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/IndexDgnConvertOraSDOJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/IndexDgnConvertOraSDOJobContext.java @@ -17,12 +17,8 @@ import org.geotools.data.DataStore; import org.geotools.data.FeatureWriter; import org.geotools.data.Transaction; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.IllegalAttributeException; +import org.opengis.feature.IllegalAttributeException; import org.geotools.feature.SchemaException; -import org.geotools.feature.SimpleFeature; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Envelope; @@ -30,284 +26,280 @@ import com.vividsolutions.jts.geom.GeometryFactory; import com.ximple.eofms.util.DefaultColorTable; +import com.ximple.eofms.util.EPSG3825GeometryConverterDecorator; +import com.ximple.eofms.util.EPSG3826GeometryConverterDecorator; import com.ximple.eofms.util.FeatureTypeBuilderUtil; +import com.ximple.eofms.util.GeometryConverterDecorator; import com.ximple.eofms.util.TPCLIDConverter; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; import com.ximple.eofms.util.TWDDatumConverter; import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.FrammeAttributeData; import com.ximple.io.dgn7.TextElement; import com.ximple.io.dgn7.UserAttributeData; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; -public class IndexDgnConvertOraSDOJobContext extends AbstractDgnToOraSDOJobContext -{ +public class IndexDgnConvertOraSDOJobContext extends AbstractDgnToOraSDOJobContext { static final Log logger = LogFactory.getLog(IndexDgnConvertOraSDOJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); - TWD97GeometryConverterDecorator convertDecorator = new TWD97GeometryConverterDecorator(); + static final GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); - private HashMap<String, ArrayList<Feature>> featuresContext = new HashMap<String, ArrayList<Feature>>(); + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; - private FeatureTypeBuilder typeBuilderPnt = null; - private FeatureTypeBuilder typeBuilderRect = null; - private FeatureType featureType = null; - private FeatureType featureType2 = null; - private FeatureType featureType3 = null; + private SimpleFeatureTypeBuilder typeBuilderPnt = null; + private SimpleFeatureTypeBuilder typeBuilderRect = null; + private SimpleFeatureType featureType = null; + private SimpleFeatureType featureType2 = null; + private SimpleFeatureType featureType3 = null; - public IndexDgnConvertOraSDOJobContext(String dataPath, DataStore targetDataStore) - { - super(dataPath, targetDataStore); + public IndexDgnConvertOraSDOJobContext(String dataPath, DataStore targetDataStore, boolean profileMode, + boolean useTransform) { + super(dataPath, targetDataStore, profileMode, useTransform); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { - if (!(element instanceof TextElement)) - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { + if (!(element instanceof TextElement)) { return; } - Feature feature = createFeature((TextElement) element); - if (feature == null) - { + SimpleFeature feature = createFeature((TextElement) element); + if (feature == null) { logger.info("cannot craete feature." + element.toString() + "'" + - ((TextElement) element).getText() + "'"); + ((TextElement) element).getText() + "'"); return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); feature = createFeature2((TextElement) element); - if (feature == null) - { + if (feature == null) { logger.info("cannot craete feature2." + element.toString() + "'" + - ((TextElement) element).getText() + "'"); + ((TextElement) element).getText() + "'"); return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); } - public void startTransaction() - { + public void startTransaction() { } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); logger.debug("Begin Save OracleSDO:" + featureType.getTypeName()); FeatureWriter writer; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { - if (!isExistFeature(featureType)) - { + } else { + if (!isExistFeature(featureType)) { targetDataStore.createSchema(featureType); writer = targetDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT); - } else - { + } else { writer = targetDataStore.getFeatureWriterAppend(featureType.getTypeName(), Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } - ArrayList<Feature> features = featuresContext.get(featureType); - for (Feature feature1 : features) - { - ((SimpleFeature) writer.next()).setAttributes(feature1.getAttributes(null)); + ArrayList<SimpleFeature> features = featuresContext.get(featureType); + for (SimpleFeature feature1 : features) { + ((SimpleFeature) writer.next()).setAttributes(feature1.getAttributes()); } //writer.close(); logger.debug("End Save OracleSDO:" + featureType.getTypeName()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - public FeatureType createFeatureElement(String featureName) throws SchemaException - { - if (typeBuilderRect == null) - { + public SimpleFeatureType createFeatureElement(String featureName) throws SchemaException { + if (typeBuilderRect == null) { typeBuilderRect = FeatureTypeBuilderUtil.createNormalIndexFeatureTypeBuilder(featureName); } - return typeBuilderRect.getFeatureType(); + return typeBuilderRect.buildFeatureType(); } - public FeatureType createFeatureElement2(String featureName) throws SchemaException - { - if (typeBuilderPnt == null) - { + public SimpleFeatureType createFeatureElement2(String featureName) throws SchemaException { + if (typeBuilderPnt == null) { typeBuilderPnt = FeatureTypeBuilderUtil.createNormalIndexTextFeatureTypeBuilder(featureName); } - return typeBuilderPnt.getFeatureType(); + return typeBuilderPnt.buildFeatureType(); } - public Feature createFeature(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { + if (element instanceof TextElement) { TextElement textElement = (TextElement) element; String tpclid = textElement.getText(); Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); - Geometry geom = geometryFactory.createLinearRing(new Coordinate[] + Geometry geom = (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826 ? + geometryFactory.createLinearRing(new Coordinate[] { - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMinX(), extent.getMinY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMaxX(), extent.getMinY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMaxX(), extent.getMaxY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMinX(), extent.getMaxY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMinX(), extent.getMinY())), - }); + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMaxX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMaxX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMinY())), + }) : + geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMaxX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMaxX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMinY())), + })); - return featureType.create(new Object[]{ - geom, - extent.getMinX(), - extent.getMinY(), - extent.getMaxX(), - extent.getMaxY(), - tpclid, - colorTable.getColorCode(textElement.getColorIndex()), - textElement.getWeight(), - textElement.getLineStyle() - }); + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + extent.getMinX(), + extent.getMinY(), + extent.getMaxX(), + extent.getMaxY(), + tpclid, + colorTable.getColorCode(textElement.getColorIndex()), + textElement.getWeight(), + textElement.getLineStyle() + }, null); } return null; } - public Feature createFeature2(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature createFeature2(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); + if (element instanceof TextElement) { TextElement txtElement = (TextElement) element; double angle = txtElement.getRotationAngle(); angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); convertDecorator.setConverter(txtElement); - Feature feature = featureType.create(new Object[]{ - convertDecorator.toGeometry(geometryFactory), - colorTable.getColorCode(txtElement.getColorIndex()), - txtElement.getWeight(), - txtElement.getLineStyle(), - txtElement.getJustification(), - txtElement.getTextHeight(), - txtElement.getTextWidth(), - angle, - txtElement.getText() - }); + Geometry geom = convertDecorator.toGeometry(geometryFactory); + SimpleFeature feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(txtElement.getColorIndex()), + txtElement.getWeight(), + txtElement.getLineStyle(), + txtElement.getJustification(), + txtElement.getTextHeight(), + txtElement.getTextWidth(), + angle, + txtElement.getText() + }, null); return feature; } return null; } - public Feature[] createFeature3(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature[] createFeature3(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { + if (element instanceof TextElement) { TextElement textElement = (TextElement) element; String tpclid = textElement.getText(); - Feature[] result = new Feature[4]; + SimpleFeature[] result = new SimpleFeature[4]; Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); - for (int i = 0; i < 4; i++) - { + 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[] + Geometry geom = (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826 ? + 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); + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + }), null) : + geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(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() - }); + result[i] = SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + extent.getMinX(), + extent.getMinY(), + extent.getMaxX(), + extent.getMaxY(), + tpclid + mapSubId, + colorTable.getColorCode(textElement.getColorIndex()), + textElement.getWeight(), + textElement.getLineStyle() + }, null); } return result; @@ -315,14 +307,11 @@ return null; } - private Feature createFeature(TextElement element) throws SchemaException, IllegalAttributeException - { - if (featureType == null) - { + private SimpleFeature createFeature(TextElement element) throws SchemaException, IllegalAttributeException { + if (featureType == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } featureType = createFeatureElement(dgnname); @@ -330,14 +319,11 @@ return createFeature(featureType, element); } - private Feature createFeature2(TextElement element) throws SchemaException, IllegalAttributeException - { - if (featureType2 == null) - { + private SimpleFeature createFeature2(TextElement element) throws SchemaException, IllegalAttributeException { + if (featureType2 == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } dgnname = dgnname + "P"; @@ -346,14 +332,11 @@ return createFeature2(featureType2, element); } - private Feature[] createFeature3(TextElement element) throws SchemaException, IllegalAttributeException - { - if (featureType3 == null) - { + private SimpleFeature[] createFeature3(TextElement element) throws SchemaException, IllegalAttributeException { + if (featureType3 == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } dgnname = dgnname + "_s"; @@ -362,24 +345,20 @@ return createFeature3(featureType3, element); } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } return null; } - public Log getLogger() - { + public Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/OracleConvertOraSDOJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/OracleConvertOraSDOJobContext.java index 847b172..234414c 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/OracleConvertOraSDOJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/orasdo/OracleConvertOraSDOJobContext.java @@ -11,8 +11,15 @@ import java.util.HashMap; import java.util.Iterator; -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.xmlrules.DigesterLoader; +import com.vividsolutions.jts.util.Assert; +import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatcher; +import com.ximple.eofms.jobs.OracleElementLogger; +import com.ximple.eofms.util.ElementDigesterUtils; +import com.ximple.io.dgn7.ComplexElement; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.FrammeAttributeData; +import org.apache.commons.digester3.Digester; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.transaction.memory.PessimisticMapWrapper; @@ -21,39 +28,25 @@ import org.geotools.data.DataStore; import org.geotools.data.FeatureWriter; import org.geotools.data.Transaction; -import org.geotools.data.oracle.OracleDataStoreFactory; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SimpleFeature; +import org.geotools.data.oracle.OracleNGDataStoreFactory; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; import org.quartz.JobExecutionContext; import org.xml.sax.SAXException; -import com.vividsolutions.jts.util.Assert; - -import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; -import com.ximple.eofms.filter.ElementDispatcher; -import com.ximple.eofms.jobs.OracleElementLogger; -import com.ximple.io.dgn7.ComplexElement; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; - -public class OracleConvertOraSDOJobContext extends AbstractOracleToOraSDOJobContext -{ +public class OracleConvertOraSDOJobContext extends AbstractOracleToOraSDOJobContext { static Log logger = LogFactory.getLog(OracleConvertOraSDOJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static OracleDataStoreFactory dataStoreFactory = new OracleDataStoreFactory(); + static OracleNGDataStoreFactory dataStoreFactory = new OracleNGDataStoreFactory(); private OracleElementLogger elmLogger = null; - static - { - try - { + static { + try { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); - } catch (SQLException e) - { + } catch (SQLException e) { Assert.shouldNeverReachHere(e.getMessage()); } } @@ -73,112 +66,91 @@ private boolean schemaChanged = false; // private String _convertElementIn = null; - public OracleConvertOraSDOJobContext(String dataPath, DataStore oraDS, String filterConfig) - { - super(dataPath, oraDS); + public OracleConvertOraSDOJobContext(String dataPath, DataStore oraDS, String filterConfig, boolean profileMode, + boolean useTransform) { + super(dataPath, oraDS, profileMode, useTransform); _filterConfig = filterConfig; elementDispatcher = createElementDispatcher(); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); } - private ElementDispatcher createElementDispatcher() - { - try - { - URL rulesURL = ElementDispatcher.class.getResource("ElementDispatcherRules.xml"); - assert rulesURL != null; - Digester digester = DigesterLoader.createDigester(rulesURL); + private ElementDispatcher createElementDispatcher() { + try { URL filterURL = null; - if (_filterConfig != null) - { + if (_filterConfig != null) { File config = new File(_filterConfig); - if (config.exists()) - { + if (config.exists()) { filterURL = config.toURI().toURL(); } } - if (filterURL == null) - { + if (filterURL == null) { // config = new File("conf/DefaultConvertShpFilter.xml"); filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); } assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); return (ElementDispatcher) digester.parse(filterURL); - } catch (UnsupportedEncodingException e) - { + } catch (UnsupportedEncodingException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (SAXException e) - { + } catch (SAXException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); } } - public void putFeatureCollection(Element element) - { + public void putFeatureCollection(Element element) { assert elementDispatcher != null; - // �P�_�O�_�ũM���� - Feature feature = elementDispatcher.execute(element, true); - if (feature == null) - { + + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { boolean isEmptySize = false; FrammeAttributeData linkage = - AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); logger.warn("Unknown Element:" + element.getElementType().toString() + - ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + - (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); - if (element instanceof ComplexElement) - { + if (element instanceof ComplexElement) { ComplexElement complex = (ComplexElement) element; logger.warn("----Complex Element size=" + complex.size() + ":" + - (linkage == null ? "NULL" : (linkage.getUfid()))); + (linkage == null ? "NULL" : (linkage.getUfid()))); isEmptySize = true; } - if (getElementLogging() && (!isEmptySize)) - { + if (getElementLogging() && (!isEmptySize)) { getElementLogger().logElement(element, getCurrentSchema()); } return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); } - public void startTransaction() - { + public void startTransaction() { //txFeaturesContext.startTransaction(); } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } @@ -186,125 +158,99 @@ this.getElementLogger().flashLogging(); } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); - FeatureWriter writer = null; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); + FeatureWriter writer; + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { - DataStore postGisDataStore = null; + } else { + DataStore postGisDataStore; postGisDataStore = dataStoreFactory.createDataStore(properties); boolean existTable = isExistFeature(featureType); - if (!existTable) - { + if (!existTable) { postGisDataStore.createSchema(featureType); writer = postGisDataStore.getFeatureWriter(featureType.getTypeName(), - Transaction.AUTO_COMMIT); - } else - { + Transaction.AUTO_COMMIT); + } else { writer = postGisDataStore.getFeatureWriterAppend(featureType.getTypeName(), - Transaction.AUTO_COMMIT); + Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } ArrayList features = (ArrayList) featuresContext.get(featureType); - for (Object feature1 : features) - { - Feature feature = (Feature) feature1; - ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); + for (Object feature1 : features) { + SimpleFeature feature = (SimpleFeature) feature1; + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); } //writer.close(); logger.debug("End Save OracleSDO:" + featureType.getTypeName()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } - } - public JobExecutionContext getExecutionContext() - { + public JobExecutionContext getExecutionContext() { return executionContext; } - public void setExecutionContext(JobExecutionContext context) - { + public void setExecutionContext(JobExecutionContext context) { executionContext = context; } - /** - * �����]�Ƽg�J�� - * - * @throws IOException IO�o�Ϳ��~ - */ - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - protected OracleElementLogger getElementLogger() - { - if (elmLogger == null) - { + protected OracleElementLogger getElementLogger() { + if (elmLogger == null) { elmLogger = new OracleElementLogger(getOracleConnection()); elmLogger.setDataPath(this.getDataPath()); } return elmLogger; } - public boolean isSchemaChanged() - { + public boolean isSchemaChanged() { return schemaChanged; } - public String getCurrentSchema() - { + public String getCurrentSchema() { return currentSchema; } - public void setCurrentSchema(String querySchema) - { + public void setCurrentSchema(String querySchema) { this.currentSchema = querySchema; this.schemaChanged = true; } - protected Log getLogger() - { + protected Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/AbstractDgnToPostGISJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/AbstractDgnToPostGISJobContext.java index 615191e..0399f15 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/AbstractDgnToPostGISJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/AbstractDgnToPostGISJobContext.java @@ -10,22 +10,37 @@ import java.sql.Statement; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Set; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.GeometryCollection; +import com.vividsolutions.jts.geom.LineString; +import com.vividsolutions.jts.geom.LinearRing; +import com.vividsolutions.jts.geom.MultiLineString; +import com.vividsolutions.jts.geom.MultiPoint; +import com.vividsolutions.jts.geom.MultiPolygon; +import com.vividsolutions.jts.geom.Point; +import com.vividsolutions.jts.geom.Polygon; +import com.ximple.eofms.jobs.context.AbstractDgnFileJobContext; +import com.ximple.eofms.util.FeatureTypeBuilderUtil; +import com.ximple.eofms.util.postjts.JtsBinaryWriter; import org.geotools.data.DataSourceException; import org.geotools.data.DataStore; import org.geotools.data.SchemaNotFoundException; import org.geotools.data.Transaction; import org.geotools.data.jdbc.JDBCUtils; -import org.geotools.data.postgis.PostgisDataStore; -import org.geotools.feature.AttributeType; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.GeometryAttributeType; import org.geotools.filter.LengthFunction; +import org.geotools.jdbc.JDBCDataStore; import org.geotools.referencing.NamedIdentifier; import org.geotools.referencing.crs.DefaultGeographicCRS; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import org.opengis.feature.type.AttributeDescriptor; +import org.opengis.feature.type.AttributeType; +import org.opengis.feature.type.GeometryDescriptor; +import org.opengis.feature.type.PropertyType; import org.opengis.filter.BinaryComparisonOperator; import org.opengis.filter.Filter; import org.opengis.filter.PropertyIsLessThan; @@ -33,27 +48,12 @@ import org.opengis.filter.expression.Literal; import org.opengis.referencing.crs.CoordinateReferenceSystem; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryCollection; -import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.MultiLineString; -import com.vividsolutions.jts.geom.MultiPoint; -import com.vividsolutions.jts.geom.MultiPolygon; -import com.vividsolutions.jts.geom.Point; -import com.vividsolutions.jts.geom.Polygon; -import com.vividsolutions.jts.io.WKBWriter; -import com.vividsolutions.jts.io.WKTWriter; +public abstract class AbstractDgnToPostGISJobContext extends AbstractDgnFileJobContext { -import com.ximple.eofms.jobs.context.AbstractDgnFileJobContext; -import com.ximple.eofms.util.postjts.JtsBinaryWriter; - -public abstract class AbstractDgnToPostGISJobContext extends AbstractDgnFileJobContext -{ private static Map<String, Class> GEOM_TYPE_MAP = new HashMap<String, Class>(); private static Map<String, Class> GEOM3D_TYPE_MAP = new HashMap<String, Class>(); - static - { + static { GEOM_TYPE_MAP.put("GEOMETRY", Geometry.class); GEOM_TYPE_MAP.put("POINT", Point.class); GEOM_TYPE_MAP.put("LINESTRING", LineString.class); @@ -74,8 +74,7 @@ private static Map<Class, String> CLASS_MAPPINGS = new HashMap<Class, String>(); - static - { + static { CLASS_MAPPINGS.put(String.class, "VARCHAR"); CLASS_MAPPINGS.put(Boolean.class, "BOOLEAN"); @@ -98,13 +97,11 @@ private static Map<Class, String> GEOM_CLASS_MAPPINGS = new HashMap<Class, String>(); //why don't we just stick this in with the non-geom class mappings? - static - { + static { // init the inverse map Set keys = GEOM_TYPE_MAP.keySet(); - for (Object key : keys) - { + for (Object key : keys) { String name = (String) key; Class geomClass = GEOM_TYPE_MAP.get(name); GEOM_CLASS_MAPPINGS.put(geomClass, name); @@ -122,94 +119,71 @@ /** * Well Known Text writer (from JTS). */ - protected static WKTWriter geometryWriter = new WKTWriter(); + // protected static WKTWriter geometryWriter = new WKTWriter(); protected static JtsBinaryWriter binaryWriter = new JtsBinaryWriter(); - protected PostgisDataStore targetDataStore; - protected String targetSchema = "public"; + private JDBCDataStore targetDataStore; + // protected Connection connection; + protected String targetSchema = "public"; - private Connection connection; protected boolean schemaEnabled = true; - public AbstractDgnToPostGISJobContext(String dataPath, DataStore targetDataStore, String targetSchema) - { - super(dataPath); - this.connection = null; - if ((targetDataStore != null) && (targetDataStore instanceof PostgisDataStore)) - { - this.targetDataStore = (PostgisDataStore) targetDataStore; - } else - { + public AbstractDgnToPostGISJobContext(String dataPath, DataStore targetDataStore, String targetSchema, + boolean profileMode, boolean useTransform) { + super(dataPath, profileMode, useTransform); + if ((targetDataStore != null) && (targetDataStore instanceof JDBCDataStore)) { + this.targetDataStore = (JDBCDataStore) targetDataStore; + } else { getLogger().info("targetDataStore has wrong."); } + // this.connection = connection; setTargetSchema(targetSchema); } - public PostgisDataStore getTargetDataStore() - { + public JDBCDataStore getTargetDataStore() { return targetDataStore; } - public void setTargetDataStore(PostgisDataStore targetDataStore) - { + public void setTargetDataStore(JDBCDataStore targetDataStore) { this.targetDataStore = targetDataStore; } - public String getTargetSchema() - { + public String getTargetSchema() { return targetSchema; } - public void setTargetSchema(String schemaName) - { + public void setTargetSchema(String schemaName) { targetSchema = schemaName; + targetDataStore.setDatabaseSchema(targetSchema); } - public Connection getConnection() - { - if (connection != null) return connection; - - if (targetDataStore != null) - { - try - { - connection = targetDataStore.getDataSource().getConnection(); - } catch (SQLException e) - { - getLogger().warn(e.getMessage(), e); - return null; - } - } - return connection; - } - - public void closeConnection() - { - if (connection == null) - { - JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); - connection = null; - } - } - - protected boolean isExistFeature(FeatureType featureType) - { - try - { - FeatureType existFeatureType = targetDataStore.getSchema(featureType.getTypeName()); - return existFeatureType != null; // && existFeatureType.equals(featureType); - } catch (SchemaNotFoundException e) - { - return false; + public Connection getConnection() { + try { + return targetDataStore.getConnection(Transaction.AUTO_COMMIT); } catch (IOException e) { - getLogger().info(e.getMessage(), e); + getLogger().warn(e.getMessage(), e); + return null; + } + // return connection; + } + + protected boolean isExistFeature(SimpleFeatureType featureType) { + try { + SimpleFeatureType existFeatureType = targetDataStore.getSchema(featureType.getTypeName()); + return existFeatureType != null; // && existFeatureType.equals(featureType); + } catch (SchemaNotFoundException e) { + return false; + } catch (IOException e) { + if (e.getMessage().indexOf("Schema") != -1) + getLogger().info(e.getMessage(), e); + else + getLogger().info(e.getMessage()); return false; } } - protected void deleteTable(Connection conn, String tableName) throws SQLException - { + protected void deleteTable(Connection conn, String tableName) throws SQLException { Statement stmt = conn.createStatement(); StringBuilder sb = new StringBuilder(); sb.append("DELETE FROM \""); @@ -218,40 +192,62 @@ sb.append(tableName); sb.append('\"'); stmt.execute(sb.toString()); - stmt.close(); - conn.commit(); + if (!conn.getAutoCommit()) + conn.commit(); + JDBCUtils.close(stmt); } - protected void dropTable(Connection conn, String tableName) throws SQLException - { + protected boolean dropTable(Connection conn, String tableName) throws SQLException { Statement stmt = conn.createStatement(); StringBuilder sb = new StringBuilder(); sb.append("DROP TABLE \""); sb.append(getTargetSchema()); sb.append("\".\""); sb.append(tableName); - sb.append("\" CASCADE"); - stmt.execute(sb.toString()); - stmt.close(); - conn.commit(); + sb.append("\""); + // sb.append(" CASCADE"); + + try { + stmt.execute(sb.toString()); + } catch (SQLException e) { + getLogger().warn("Execute-" + sb.toString()); + getLogger().warn(e.getMessage(), e); + return false; + } finally { + if (!conn.getAutoCommit()) + conn.commit(); + JDBCUtils.close(stmt); + } + + return true; } - protected void dropGeometryColumn(Connection conn, String tableName, String geomField) throws SQLException - { + protected boolean dropGeometryColumn(Connection conn, String dbSchema, String tableName, String geomField) throws SQLException { Statement stmt = conn.createStatement(); StringBuilder sb = new StringBuilder(); - sb.append("SELECT \"public\".DropGeometryColumn('','"); + sb.append("SELECT \"public\".DropGeometryColumn('"); + sb.append(dbSchema); + sb.append("','"); sb.append(tableName); sb.append("','"); sb.append(geomField); sb.append("')"); - stmt.execute(sb.toString()); - stmt.close(); - conn.commit(); + try { + stmt.execute(sb.toString()); + } catch (SQLException e) { + getLogger().warn("Execute-" + sb.toString()); + getLogger().warn(e.getMessage(), e); + return false; + } finally { + if (!conn.getAutoCommit()) + conn.commit(); + JDBCUtils.close(stmt); + } + + return true; } - protected String dropGeometryColumn(String dbSchema, String tableName, String geomField) - { + protected String dropGeometryColumn(String dbSchema, String tableName, String geomField) { StringBuilder sb = new StringBuilder(); sb.append("SELECT \"public\".DropGeometryColumn('"); sb.append(dbSchema); @@ -264,14 +260,12 @@ return sb.toString(); } - private String addGeometryColumn(String dbSchema, String tableName, GeometryAttributeType geometryAttribute, int srid) - { + private String addGeometryColumn(String dbSchema, String tableName, GeometryDescriptor geometryDescriptor, int srid) { StringBuilder sql; - String typeName = getGeometrySQLTypeName(geometryAttribute.getBinding()); - if (typeName == null) - { - getLogger().warn("Error: " + geometryAttribute.getLocalName() + " unknown type!!!"); - throw new RuntimeException("Error: " + geometryAttribute.getLocalName() + " unknown type!!!"); + String typeName = getGeometrySQLTypeName((geometryDescriptor.getType()).getBinding()); + if (typeName == null) { + getLogger().warn("Error: " + geometryDescriptor.getLocalName() + " unknown type!!!"); + throw new RuntimeException("Error: " + geometryDescriptor.getLocalName() + " unknown type!!!"); } sql = new StringBuilder("SELECT \"public\".AddGeometryColumn('"); @@ -279,7 +273,7 @@ sql.append("','"); sql.append(tableName); sql.append("','"); - sql.append(geometryAttribute.getLocalName()); + sql.append(geometryDescriptor.getLocalName()); sql.append("','"); sql.append(srid); sql.append("','"); @@ -290,33 +284,29 @@ return sql.toString(); } - public ArrayList<String> createNewSchemaTexts(FeatureType featureType) throws IOException - { + public ArrayList<String> createNewSchemaTexts(Connection conn, SimpleFeatureType featureType) throws IOException { String origintableName = featureType.getTypeName(); String tableName = origintableName.toLowerCase(); ArrayList<String> result = new ArrayList<String>(); - AttributeType[] attributeType = featureType.getAttributeTypes(); + List<AttributeDescriptor> descriptors = featureType.getAttributeDescriptors(); - Connection con = getConnection(); + boolean shouldDrop = tablePresent(getTargetSchema(), tableName, conn); - boolean shouldDrop = tablePresent(getTargetSchema(), tableName, con); - if (shouldDrop) - { + if (shouldDrop) { String sqlStr; - for (AttributeType anAttributeType : attributeType) - { - if (!(anAttributeType instanceof GeometryAttributeType)) - { + for (AttributeDescriptor descriptor : descriptors) { + if (!(descriptor instanceof GeometryDescriptor)) { continue; } - GeometryAttributeType geomAttribute = (GeometryAttributeType) anAttributeType; - sqlStr = dropGeometryColumn(getTargetSchema(), tableName, geomAttribute.getLocalName()); + GeometryDescriptor geometryDescriptor = (GeometryDescriptor) descriptor; + sqlStr = dropGeometryColumn(getTargetSchema(), tableName, geometryDescriptor.getLocalName()); getLogger().info(sqlStr); result.add(sqlStr); } - sqlStr = "DROP TABLE " + encodeSchemaTableName(tableName) + ";"; + // sqlStr = "DROP TABLE " + encodeSchemaTableName(tableName) + " CASCADE;"; + sqlStr = "DROP TABLE " + encodeSchemaTableName(tableName) + " ;"; getLogger().info(sqlStr); result.add(sqlStr); } @@ -324,25 +314,23 @@ StringBuilder sql = new StringBuilder("CREATE TABLE "); sql.append(encodeSchemaTableName(tableName)); sql.append(" ( gid serial PRIMARY KEY, "); - sql.append(makeNonGeomSqlCreate(attributeType)); + sql.append(makeNonGeomSqlCreate(descriptors)); sql.append(");"); String sqlStr = sql.toString(); getLogger().debug(sqlStr); result.add(sqlStr); - for (AttributeType anAttributeType : attributeType) - { - if (!(anAttributeType instanceof GeometryAttributeType)) - { + for (AttributeDescriptor descriptor : descriptors) { + if (!(descriptor instanceof GeometryDescriptor)) { continue; } - GeometryAttributeType geomAttribute = (GeometryAttributeType) anAttributeType; + GeometryDescriptor geometryDescriptor = (GeometryDescriptor) descriptor; - CoordinateReferenceSystem refSys = geomAttribute.getCoordinateSystem(); + CoordinateReferenceSystem refSys = geometryDescriptor.getCoordinateReferenceSystem(); int SRID = getSRID(refSys); - sqlStr = addGeometryColumn(getTargetSchema(), tableName, geomAttribute, SRID); + sqlStr = addGeometryColumn(getTargetSchema(), tableName, geometryDescriptor, SRID); getLogger().debug(sqlStr); result.add(sqlStr); @@ -352,95 +340,77 @@ sql = new StringBuilder("CREATE INDEX \"spatial_"); sql.append(indexName); sql.append("_"); - sql.append(anAttributeType.getLocalName().toLowerCase()); + sql.append(descriptor.getLocalName().toLowerCase()); sql.append("\" ON "); sql.append(encodeSchemaTableName(tableName)); sql.append(" USING GIST ("); - sql.append(encodeSchemaColumnName(anAttributeType.getLocalName())); - sql.append(" gist_geometry_ops);"); + sql.append(encodeSchemaColumnName(descriptor.getLocalName())); + sql.append(" );"); + // sql.append(" gist_geometry_ops);"); sqlStr = sql.toString(); getLogger().debug(sqlStr); result.add(sqlStr); } - return result; } - private int getSRID(CoordinateReferenceSystem refSys) - { + private int getSRID(CoordinateReferenceSystem refSys) { int SRID; - if (refSys != null) - { - try - { + if (refSys != null) { + try { Set ident = refSys.getIdentifiers(); - if ((ident == null || ident.isEmpty()) && refSys == DefaultGeographicCRS.WGS84) - { + if ((ident == null || ident.isEmpty()) && refSys == DefaultGeographicCRS.WGS84) { SRID = 4326; - } else - { + } else { + assert ident != null; String code = ((NamedIdentifier) ident.toArray()[0]).getCode(); SRID = Integer.parseInt(code); } - } catch (Exception e) - { + } catch (Exception e) { getLogger().warn("SRID could not be determined"); SRID = -1; } - } else - { + } else { SRID = -1; } return SRID; } - private boolean tablePresent(String schema, String table, Connection conn) throws IOException - { + private boolean tablePresent(String schema, String table, Connection conn) throws IOException { final int TABLE_NAME_COL = 3; ResultSet tables = null; - try - { + try { DatabaseMetaData meta = conn.getMetaData(); String[] tableType = {"TABLE"}; tables = meta.getTables(null, schema, "%", tableType); - while (tables.next()) - { + while (tables.next()) { String tableName = tables.getString(TABLE_NAME_COL); if (allowTable(tableName) && (tableName != null) - && (tableName.equalsIgnoreCase(table))) - { + && (tableName.equalsIgnoreCase(table))) { return (true); } } return false; - } catch (SQLException sqlException) - { - // JDBCUtils.close(conn, Transaction.AUTO_COMMIT, sqlException); - // conn = null; - + } catch (SQLException sqlException) { String message = "Error querying database for list of tables:" - + sqlException.getMessage(); + + sqlException.getMessage(); throw new DataSourceException(message, sqlException); - } finally - { - // JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); - if (tables != null) try { tables.close(); } catch (SQLException e) {} + } finally { + if (tables != null) + JDBCUtils.close(tables); } } - protected boolean allowTable(String tablename) - { - if (tablename.equals("geometry_columns")) - { + protected boolean allowTable(String tablename) { + if (tablename.equals("geometry_columns")) { return false; - } else if (tablename.startsWith("spatial_ref_sys")) - { + } else if (tablename.startsWith("spatial_ref_sys")) { return false; } @@ -449,88 +419,71 @@ } - private StringBuilder makeNonGeomSqlCreate(AttributeType[] attributeType) - throws IOException - { + private StringBuilder makeNonGeomSqlCreate(List<AttributeDescriptor> descriptors) + throws IOException { StringBuilder buf = new StringBuilder(""); - for (AttributeType anAttributeType : attributeType) - { + for (AttributeDescriptor descriptor : descriptors) { String typeName; - typeName = CLASS_MAPPINGS.get(anAttributeType.getBinding()); - if (typeName == null) - { - typeName = GEOM_CLASS_MAPPINGS.get(anAttributeType.getBinding()); + typeName = CLASS_MAPPINGS.get(descriptor.getType().getBinding()); + if (typeName == null) { + typeName = GEOM_CLASS_MAPPINGS.get(descriptor.getType().getBinding()); if (typeName != null) continue; } - if (typeName != null) - { - if (typeName.equals("VARCHAR")) - { + if (typeName != null) { + if (typeName.equals("VARCHAR")) { int length = -1; - Filter f = anAttributeType.getRestriction(); - if (f != null && f != Filter.EXCLUDE && f != Filter.INCLUDE && - (f instanceof PropertyIsLessThan || f instanceof PropertyIsLessThanOrEqualTo)) - { - try - { - BinaryComparisonOperator cf = (BinaryComparisonOperator) f; - if (cf.getExpression1() instanceof LengthFunction) - { - length = Integer.parseInt(((Literal) cf.getExpression2()).getValue().toString()); - } else - { - if (cf.getExpression2() instanceof LengthFunction) - { - length = Integer.parseInt(((Literal) cf.getExpression1()).getValue().toString()); + List<Filter> flist = ((PropertyType) descriptor.getType()).getRestrictions(); + for (Filter f : flist) { + if (f != null && f != Filter.EXCLUDE && f != Filter.INCLUDE && + (f instanceof PropertyIsLessThan || f instanceof PropertyIsLessThanOrEqualTo)) { + try { + BinaryComparisonOperator cf = (BinaryComparisonOperator) f; + if (cf.getExpression1() instanceof LengthFunction) { + length = Integer.parseInt(((Literal) cf.getExpression2()).getValue().toString()); + } else { + if (cf.getExpression2() instanceof LengthFunction) { + length = Integer.parseInt(((Literal) cf.getExpression1()).getValue().toString()); + } } + } catch (NumberFormatException e) { + length = 256; } - } catch (NumberFormatException e) - { + } else { length = 256; } - } else - { - length = 256; + break; } - - if (length < 1) - { + if (length < 1) { getLogger().warn("FeatureType did not specify string length; defaulted to 256"); length = 256; - } else if (length > MAX_ALLOWED_VALUE) - { + } else if (length > MAX_ALLOWED_VALUE) { length = MAX_ALLOWED_VALUE; } typeName = typeName + "(" + length + ")"; } - if (!anAttributeType.isNillable()) - { + if (!descriptor.isNillable()) { typeName = typeName + " NOT NULL"; } //TODO review!!! Is toString() always OK??? - Object defaultValue = anAttributeType.createDefaultValue(); + Object defaultValue = descriptor.getDefaultValue(); - if (defaultValue != null) - { + if (defaultValue != null) { typeName = typeName + " DEFAULT '" - + defaultValue.toString() + "'"; + + defaultValue.toString() + "'"; } - buf.append(" \"").append(anAttributeType.getLocalName()).append("\" ").append(typeName).append(","); + buf.append(" \"").append(descriptor.getLocalName()).append("\" ").append(typeName).append(","); - } else - { + } else { String msg; - if (anAttributeType == null) - { + if (descriptor == null) { msg = "AttributeType was null!"; - } else - { - msg = "Type '" + anAttributeType.getBinding() + "' not supported!"; + } else { + msg = "Type '" + ((AttributeType) descriptor.getType()).getBinding() + "' not supported!"; } throw (new IOException(msg)); } @@ -539,14 +492,12 @@ return buf.deleteCharAt(buf.length() - 1); } - private String getGeometrySQLTypeName(Class type) - { + private String getGeometrySQLTypeName(Class type) { String res = GEOM_CLASS_MAPPINGS.get(type); - if (res == null) - { + if (res == null) { throw new RuntimeException("Unknown type name for class " + type - + " please update GEOMETRY_MAPPINGS"); + + " please update GEOMETRY_MAPPINGS"); } return res; @@ -554,36 +505,38 @@ protected String getGeometryInsertText(Geometry geom, int srid) // throws IOException { - if (geom == null) - { + if (geom == null) { return "null"; } - if (targetDataStore.isWKBEnabled()) - { + /* + if (targetDataStore.isWKBEnabled()) { //String wkb = WKBEncoder.encodeGeometryHex(geom); String wkb = WKBWriter.bytesToHex(new WKBWriter().write(geom)); - if (targetDataStore.isByteaWKB()) - { + if (targetDataStore.isByteaWKB()) { return "setSRID('" + wkb + "'::geometry," + srid + ")"; - } else - { + } else { return "GeomFromWKB('" + wkb + "', " + srid + ")"; } } String geoText = geometryWriter.write(geom); - return "GeometryFromText('" + geoText + "', " + srid + ")"; + */ + if (geom instanceof LinearRing) { + //postgis does not handle linear rings, convert to just a line string + geom = geom.getFactory().createLineString(((LinearRing) geom).getCoordinateSequence()); + } + return "ST_GeomFromText('" + geom.toText() + "', " + srid + ")"; } - protected String makeInsertSql(Feature feature, int srid) // throws IOException + protected String makeInsertSql(SimpleFeature feature, int srid) // throws IOException { - FeatureType featureType = feature.getFeatureType(); + SimpleFeatureType featureType = feature.getFeatureType(); String tableName = encodeSchemaTableName(featureType.getTypeName()); - AttributeType[] attributeTypes = featureType.getAttributeTypes(); + List<AttributeDescriptor> descriptors = featureType.getAttributeDescriptors(); String attrValue; @@ -591,12 +544,10 @@ // encode insertion for attributes, but remember to avoid auto-increment ones, // they may be included in the feature type as well - for (AttributeType attributeType : attributeTypes) - { + for (AttributeDescriptor attributeType : descriptors) { String attName = attributeType.getLocalName(); - if (feature.getAttribute(attName) != null) - { + if (feature.getAttribute(attName) != null) { String colName = encodeSchemaColumnName(attName); statementSQL.append(colName).append(","); } @@ -605,35 +556,29 @@ statementSQL.setCharAt(statementSQL.length() - 1, ')'); statementSQL.append(" VALUES ("); - Object[] attributes = feature.getAttributes(null); + List<Object> attributes = feature.getAttributes(); - for (int i = 0; i < attributeTypes.length; i++) - { + for (int i = 0; i < descriptors.size(); i++) { attrValue = null; - if (attributeTypes[i] instanceof GeometryAttributeType) - { - // String geomName = attributeTypes[i].getLocalName(); + if (descriptors.get(i) instanceof GeometryDescriptor) { + // String geomName = descriptors[i].getLocalName(); // int srid = ftInfo.getSRID(geomName); - Geometry geometry = (Geometry) attributes[i]; + Geometry geometry = (Geometry) attributes.get(i); + geometry.setSRID(FeatureTypeBuilderUtil.getDefaultFeatureSRID()); - if (geometry == null) - { + if (geometry == null) { attrValue = "NULL"; - } else - { + } else { attrValue = getGeometryInsertText(geometry, srid); } - } else - { - if (attributes[i] != null) - { - attrValue = addQuotes(attributes[i]); + } else { + if (attributes.get(i) != null) { + attrValue = addQuotes(attributes.get(i)); } } - if (attrValue != null) - { + if (attrValue != null) { statementSQL.append(attrValue).append(","); } } @@ -643,10 +588,9 @@ return (statementSQL.toString()); } - protected String makePrepareInsertSql(FeatureType featureType) - { + protected String makePrepareInsertSql(SimpleFeatureType featureType) { String tableName = encodeSchemaTableName(featureType.getTypeName()); - AttributeType[] attributeTypes = featureType.getAttributeTypes(); + List<AttributeDescriptor> attributeTypes = featureType.getAttributeDescriptors(); String attrValue; @@ -654,9 +598,8 @@ // encode insertion for attributes, but remember to avoid auto-increment ones, // they may be included in the feature type as well - for (AttributeType attributeType : attributeTypes) - { - String attName = attributeType.getLocalName(); + for (AttributeDescriptor descriptor : attributeTypes) { + String attName = descriptor.getName().getLocalPart(); String colName = encodeSchemaColumnName(attName); statementSQL.append(colName).append(","); @@ -665,8 +608,7 @@ statementSQL.setCharAt(statementSQL.length() - 1, ')'); statementSQL.append(" VALUES ("); - for (AttributeType attributeType : attributeTypes) - { + for (AttributeDescriptor attributeType : attributeTypes) { statementSQL.append(" ? ,"); } @@ -675,103 +617,80 @@ return (statementSQL.toString()); } - protected String addQuotes(Object value) - { + protected String addQuotes(Object value) { String retString; - if (value != null) - { - if (value instanceof Number) - { + if (value != null) { + if (value instanceof Number) { retString = value.toString(); - } else - { + } else { retString = "'" + doubleQuote(value) + "'"; } - } else - { + } else { retString = "null"; } return retString; } - String doubleQuote(Object obj) - { + String doubleQuote(Object obj) { return obj.toString().replaceAll("'", "''"); } - protected String encodeName(String tableName) - { + protected String encodeName(String tableName) { return tableName; } - protected String encodeColumnName(String colName) - { + protected String encodeColumnName(String colName) { return encodeName(colName); } - public String encodeSchemaTableName(String tableName) - { + public String encodeSchemaTableName(String tableName) { return schemaEnabled ? ("\"" + getTargetSchema() + "\".\"" + tableName + "\"") - : ("\"" + tableName + "\""); + : ("\"" + tableName + "\""); } - public String encodeSchemaColumnName(String columnName) - { + public String encodeSchemaColumnName(String columnName) { return "\"" + columnName + "\""; } - protected void bindFeatureParameters(PreparedStatement pstmt, Feature feature) throws SQLException - { - FeatureType featureType = feature.getFeatureType(); + protected void bindFeatureParameters(PreparedStatement pstmt, SimpleFeature feature) throws SQLException { + SimpleFeatureType featureType = feature.getFeatureType(); - AttributeType[] attributeTypes = featureType.getAttributeTypes(); - Object[] attributes = feature.getAttributes(null); + List<AttributeDescriptor> descriptors = featureType.getAttributeDescriptors(); + List<Object> attributes = feature.getAttributes(); - for (int i = 0; i < attributeTypes.length; i++) - { - if (attributeTypes[i] instanceof GeometryAttributeType) - { - pstmt.setBytes(i + 1, binaryWriter.writeBinary((Geometry) attributes[i])); - } else - { - if (attributeTypes[i].getBinding().equals(Short.class)) - { - pstmt.setShort(i + 1, (Short) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(Integer.class)) - { - pstmt.setInt(i + 1, (Short) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(Long.class)) - { - pstmt.setLong(i + 1, (Long) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(String.class)) - { - pstmt.setString(i + 1, (String) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(Float.class)) - { - pstmt.setFloat(i + 1, (Float) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(Double.class)) - { - pstmt.setDouble(i + 1, (Double) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(Boolean.class)) - { - pstmt.setBoolean(i + 1, (Boolean) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(BigDecimal.class)) - { - pstmt.setBigDecimal(i + 1, (BigDecimal) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(java.sql.Date.class)) - { - pstmt.setDate(i + 1, (java.sql.Date) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(java.sql.Time.class)) - { - pstmt.setTime(i + 1, (java.sql.Time) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(java.sql.Timestamp.class)) - { - pstmt.setTimestamp(i + 1, (java.sql.Timestamp) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(java.util.Date.class)) - { - java.sql.Date sDate = new java.sql.Date(((java.util.Date) attributes[i]).getTime()); + for (int i = 0; i < descriptors.size(); i++) { + if (descriptors.get(i) instanceof GeometryDescriptor) { + Geometry geom = (Geometry) attributes.get(i); + geom.setSRID(FeatureTypeBuilderUtil.getDefaultFeatureSRID()); + pstmt.setBytes(i + 1, binaryWriter.writeBinary((Geometry) attributes.get(i))); + } else { + Class<?> bindingType = descriptors.get(i).getType().getBinding(); + if (bindingType.equals(Short.class)) { + pstmt.setShort(i + 1, (Short) attributes.get(i)); + } else if (bindingType.equals(Integer.class)) { + pstmt.setInt(i + 1, (Integer) attributes.get(i)); + } else if (bindingType.equals(Long.class)) { + pstmt.setLong(i + 1, (Long) attributes.get(i)); + } else if (bindingType.equals(String.class)) { + pstmt.setString(i + 1, (String) attributes.get(i)); + } else if (bindingType.equals(Float.class)) { + pstmt.setFloat(i + 1, (Float) attributes.get(i)); + } else if (bindingType.equals(Double.class)) { + pstmt.setDouble(i + 1, (Double) attributes.get(i)); + } else if (bindingType.equals(Boolean.class)) { + pstmt.setBoolean(i + 1, (Boolean) attributes.get(i)); + } else if (bindingType.equals(BigDecimal.class)) { + pstmt.setBigDecimal(i + 1, (BigDecimal) attributes.get(i)); + } else if (bindingType.equals(java.sql.Date.class)) { + pstmt.setDate(i + 1, (java.sql.Date) attributes.get(i)); + } else if (bindingType.equals(java.sql.Time.class)) { + pstmt.setTime(i + 1, (java.sql.Time) attributes.get(i)); + } else if (bindingType.equals(java.sql.Timestamp.class)) { + pstmt.setTimestamp(i + 1, (java.sql.Timestamp) attributes.get(i)); + } else if (bindingType.equals(java.util.Date.class)) { + java.sql.Date sDate = new java.sql.Date(((java.util.Date) attributes.get(i)).getTime()); pstmt.setDate(i + 1, sDate); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/AbstractOracleToPostGISJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/AbstractOracleToPostGISJobContext.java index f8452be..359e949 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/AbstractOracleToPostGISJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/AbstractOracleToPostGISJobContext.java @@ -1,60 +1,56 @@ package com.ximple.eofms.jobs.context.postgis; import java.io.IOException; +import java.math.BigDecimal; import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.PreparedStatement; +import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; -import java.sql.DatabaseMetaData; -import java.sql.ResultSet; -import java.sql.PreparedStatement; -import java.util.Map; -import java.util.HashMap; -import java.util.Set; -import java.util.ArrayList; -import java.util.Queue; -import java.math.BigDecimal; +import java.util.*; -import org.geotools.data.DataStore; -import org.geotools.data.Transaction; -import org.geotools.data.SchemaNotFoundException; +import com.vividsolutions.jts.geom.LinearRing; +import com.ximple.eofms.util.FeatureTypeBuilderUtil; import org.geotools.data.DataSourceException; -import org.geotools.data.jdbc.JDBCUtils; -import org.geotools.data.postgis.PostgisDataStore; -import org.geotools.feature.FeatureType; -import org.geotools.feature.AttributeType; -import org.geotools.feature.GeometryAttributeType; -import org.geotools.feature.Feature; -import org.geotools.referencing.crs.DefaultGeographicCRS; -import org.geotools.referencing.NamedIdentifier; +import org.geotools.data.DataStore; +import org.geotools.data.SchemaNotFoundException; import org.geotools.filter.LengthFunction; -import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.geotools.jdbc.JDBCDataStore; +import org.geotools.referencing.NamedIdentifier; +import org.geotools.referencing.crs.DefaultGeographicCRS; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import org.opengis.feature.type.AttributeDescriptor; +import org.opengis.feature.type.AttributeType; +import org.opengis.feature.type.GeometryDescriptor; +import org.opengis.feature.type.PropertyType; +import org.opengis.filter.BinaryComparisonOperator; import org.opengis.filter.Filter; import org.opengis.filter.PropertyIsLessThan; import org.opengis.filter.PropertyIsLessThanOrEqualTo; -import org.opengis.filter.BinaryComparisonOperator; import org.opengis.filter.expression.Literal; +import org.opengis.referencing.crs.CoordinateReferenceSystem; import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.Point; -import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.Polygon; -import com.vividsolutions.jts.geom.MultiPoint; -import com.vividsolutions.jts.geom.MultiLineString; -import com.vividsolutions.jts.geom.MultiPolygon; import com.vividsolutions.jts.geom.GeometryCollection; -import com.vividsolutions.jts.io.WKTWriter; +import com.vividsolutions.jts.geom.LineString; +import com.vividsolutions.jts.geom.MultiLineString; +import com.vividsolutions.jts.geom.MultiPoint; +import com.vividsolutions.jts.geom.MultiPolygon; +import com.vividsolutions.jts.geom.Point; +import com.vividsolutions.jts.geom.Polygon; import com.vividsolutions.jts.io.WKBWriter; +import com.vividsolutions.jts.io.WKTWriter; import com.ximple.eofms.jobs.context.AbstractOracleJobContext; import com.ximple.eofms.util.postjts.JtsBinaryWriter; -public abstract class AbstractOracleToPostGISJobContext extends AbstractOracleJobContext -{ +public abstract class AbstractOracleToPostGISJobContext extends AbstractOracleJobContext { private static Map<String, Class> GEOM_TYPE_MAP = new HashMap<String, Class>(); private static Map<String, Class> GEOM3D_TYPE_MAP = new HashMap<String, Class>(); - static - { + static { GEOM_TYPE_MAP.put("GEOMETRY", Geometry.class); GEOM_TYPE_MAP.put("POINT", Point.class); GEOM_TYPE_MAP.put("LINESTRING", LineString.class); @@ -75,8 +71,7 @@ private static Map<Class, String> CLASS_MAPPINGS = new HashMap<Class, String>(); - static - { + static { CLASS_MAPPINGS.put(String.class, "VARCHAR"); CLASS_MAPPINGS.put(Boolean.class, "BOOLEAN"); @@ -99,13 +94,11 @@ private static Map<Class, String> GEOM_CLASS_MAPPINGS = new HashMap<Class, String>(); //why don't we just stick this in with the non-geom class mappings? - static - { + static { // init the inverse map Set keys = GEOM_TYPE_MAP.keySet(); - for (Object key : keys) - { + for (Object key : keys) { String name = (String) key; Class geomClass = GEOM_TYPE_MAP.get(name); GEOM_CLASS_MAPPINGS.put(geomClass, name); @@ -117,98 +110,77 @@ */ private static final int MAX_ALLOWED_VALUE = 10485760; - protected static final int BATCHSIZE = 512; + // protected static final int BATCHSIZE = 512; + protected static final int BATCHSIZE = 128; /** * Well Known Text writer (from JTS). */ - protected static WKTWriter geometryWriter = new WKTWriter(); + // protected static WKTWriter geometryWriter = new WKTWriter(); protected static JtsBinaryWriter binaryWriter = new JtsBinaryWriter(); - protected PostgisDataStore targetDataStore; - protected String targetSchema = "public"; - - private Connection connection; protected boolean schemaEnabled = true; - public AbstractOracleToPostGISJobContext(String dataPath, DataStore targetDataStore, String targetSchema) - { - if ((targetDataStore != null) && (targetDataStore instanceof PostgisDataStore)) - { - this.targetDataStore = (PostgisDataStore) targetDataStore; - } else - { + private JDBCDataStore targetDataStore; + private String targetSchema = "public"; + + public AbstractOracleToPostGISJobContext(String dataPath, DataStore targetDataStore, String targetSchema, + boolean profileMode, boolean useTransform) { + super(profileMode, useTransform); + if ((targetDataStore != null) && (targetDataStore instanceof JDBCDataStore)) { + this.targetDataStore = (JDBCDataStore) targetDataStore; + } else { getLogger().info("targetDataStore has wrong."); } setDataPath(dataPath); setTargetSchema(targetSchema); } - public PostgisDataStore getTargetDataStore() - { + public JDBCDataStore getTargetDataStore() { return targetDataStore; } - public void setTargetDataStore(PostgisDataStore targetDataStore) - { + public void setTargetDataStore(JDBCDataStore targetDataStore) { this.targetDataStore = targetDataStore; } - public String getTargetSchema() - { + public String getTargetSchema() { return targetSchema; } - public void setTargetSchema(String schemaName) - { + public void setTargetSchema(String schemaName) { targetSchema = schemaName; + targetDataStore.setDatabaseSchema(targetSchema); } - public Connection getConnection() - { - if (connection != null) return connection; - - if (targetDataStore != null) - { - try - { - connection = targetDataStore.getDataSource().getConnection(); - } catch (SQLException e) - { + public Connection getConnection() { + if (targetDataStore != null) { + try { + return targetDataStore.getDataSource().getConnection(); + } catch (SQLException e) { getLogger().warn(e.getMessage(), e); return null; } } - return connection; + return null; } - public void closeConnection() - { - if (connection == null) - { - JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null); - connection = null; - } - } - - protected boolean isExistFeature(FeatureType featureType) - { - try - { - FeatureType existFeatureType = targetDataStore.getSchema(featureType.getTypeName()); + protected boolean isExistFeature(SimpleFeatureType featureType) { + try { + SimpleFeatureType existFeatureType = targetDataStore.getSchema(featureType.getTypeName()); return existFeatureType != null; // && existFeatureType.equals(featureType); - } catch (SchemaNotFoundException e) - { + } catch (SchemaNotFoundException e) { return false; - } catch (IOException e) - { - getLogger().info(e.getMessage(), e); + } catch (IOException e) { + if (e.getMessage().indexOf("Schema") != -1) + getLogger().info(e.getMessage(), e); + else + getLogger().info(e.getMessage()); return false; } } - protected void deleteTable(Connection conn, String schemaName, String tableName) throws SQLException - { + protected void deleteTable(Connection conn, String schemaName, String tableName) throws SQLException { Statement stmt = conn.createStatement(); StringBuilder sb = new StringBuilder(); sb.append("DELETE FROM \""); @@ -221,22 +193,29 @@ conn.commit(); } - protected void dropTable(Connection conn, String schemaName, String tableName) throws SQLException - { + protected boolean dropTable(Connection conn, String schemaName, String tableName) throws SQLException { Statement stmt = conn.createStatement(); StringBuilder sb = new StringBuilder(); sb.append("DROP TABLE \""); sb.append(schemaName); sb.append("\".\""); sb.append(tableName); - sb.append("\" CASCADE"); - stmt.execute(sb.toString()); - stmt.close(); - conn.commit(); + sb.append("\""); + // sb.append(" CASCADE"); + try { + stmt.execute(sb.toString()); + } catch (SQLException e) { + getLogger().warn("Execute-" + sb.toString()); + getLogger().warn(e.getMessage(), e); + return false; + } finally { + stmt.close(); + conn.commit(); + } + return true; } - protected void dropGeometryColumn(Connection conn, String dbSchema, String tableName, String geomField) throws SQLException - { + protected boolean dropGeometryColumn(Connection conn, String dbSchema, String tableName, String geomField) throws SQLException { Statement stmt = conn.createStatement(); StringBuilder sb = new StringBuilder(); sb.append("SELECT \"public\".DropGeometryColumn('"); @@ -246,13 +225,21 @@ sb.append("','"); sb.append(geomField); sb.append("')"); - stmt.execute(sb.toString()); - stmt.close(); - conn.commit(); + + try { + stmt.execute(sb.toString()); + } catch (SQLException e) { + getLogger().warn("Execute-" + sb.toString()); + getLogger().warn(e.getMessage(), e); + return false; + } finally { + stmt.close(); + conn.commit(); + } + return true; } - protected String dropGeometryColumn(String dbSchema, String tableName, String geomField) - { + protected String dropGeometryColumn(String dbSchema, String tableName, String geomField) { StringBuilder sb = new StringBuilder(); sb.append("SELECT \"public\".DropGeometryColumn('"); sb.append(dbSchema); @@ -264,14 +251,12 @@ return sb.toString(); } - private String addGeometryColumn(String dbSchema, String tableName, GeometryAttributeType geometryAttribute, int srid) - { + private String addGeometryColumn(String dbSchema, String tableName, GeometryDescriptor geometryDescriptor, int srid) { StringBuilder sql; - String typeName = getGeometrySQLTypeName(geometryAttribute.getBinding()); - if (typeName == null) - { - getLogger().warn("Error: " + geometryAttribute.getLocalName() + " unknown type!!!"); - throw new RuntimeException("Error: " + geometryAttribute.getLocalName() + " unknown type!!!"); + String typeName = getGeometrySQLTypeName(((PropertyType)geometryDescriptor.getType()).getBinding()); + if (typeName == null) { + getLogger().warn("Error: " + geometryDescriptor.getLocalName() + " unknown type!!!"); + throw new RuntimeException("Error: " + geometryDescriptor.getLocalName() + " unknown type!!!"); } sql = new StringBuilder("SELECT \"public\".AddGeometryColumn('"); @@ -279,7 +264,7 @@ sql.append("','"); sql.append(tableName); sql.append("','"); - sql.append(geometryAttribute.getLocalName()); + sql.append(geometryDescriptor.getLocalName()); sql.append("','"); sql.append(srid); sql.append("','"); @@ -290,34 +275,29 @@ return sql.toString(); } - public ArrayList<String> createNewSchemaTexts(FeatureType featureType) throws IOException - { + public ArrayList<String> createNewSchemaTexts(Connection conn, SimpleFeatureType featureType) throws IOException { String origintableName = featureType.getTypeName(); String tableName = origintableName.toLowerCase(); ArrayList<String> result = new ArrayList<String>(); - AttributeType[] attributeType = featureType.getAttributeTypes(); + List<AttributeDescriptor> attributeType = featureType.getAttributeDescriptors(); // String dbSchema = targetDataStore.getDatabaseSchemaName(); - Connection con = getConnection(); - - boolean shouldDrop = tablePresent(getTargetSchema(), tableName, con); - if (shouldDrop) - { + boolean shouldDrop = tablePresent(getTargetSchema(), tableName, conn); + if (shouldDrop) { String sqlStr; - for (AttributeType anAttributeType : attributeType) - { - if (!(anAttributeType instanceof GeometryAttributeType)) - { + for (AttributeDescriptor descriptor : attributeType) { + if (!(descriptor instanceof GeometryDescriptor)) { continue; } - GeometryAttributeType geomAttribute = (GeometryAttributeType) anAttributeType; + GeometryDescriptor geomAttribute = (GeometryDescriptor) descriptor; sqlStr = dropGeometryColumn(getTargetSchema(), tableName, geomAttribute.getLocalName()); getLogger().info(sqlStr); result.add(sqlStr); } - sqlStr = "DROP TABLE " + encodeSchemaTableName(tableName) + ";"; + // sqlStr = "DROP TABLE " + encodeSchemaTableName(tableName) + " CASCADE;"; + sqlStr = "DROP TABLE " + encodeSchemaTableName(tableName) + " ;"; getLogger().info(sqlStr); result.add(sqlStr); } @@ -334,19 +314,17 @@ String indexName = tableName.replace('-', '_'); - for (AttributeType anAttributeType : attributeType) - { - if (!(anAttributeType instanceof GeometryAttributeType)) - { - String fieldName = anAttributeType.getLocalName().toLowerCase(); + for (AttributeDescriptor descriptor : attributeType) { + if (!(descriptor instanceof GeometryDescriptor)) { + String fieldName = descriptor.getLocalName().toLowerCase(); continue; } - GeometryAttributeType geomAttribute = (GeometryAttributeType) anAttributeType; + GeometryDescriptor geomDescriptor = (GeometryDescriptor) descriptor; - CoordinateReferenceSystem refSys = geomAttribute.getCoordinateSystem(); + CoordinateReferenceSystem refSys = geomDescriptor.getCoordinateReferenceSystem(); int SRID = getSRID(refSys); - sqlStr = addGeometryColumn(getTargetSchema(), tableName, geomAttribute, SRID); + sqlStr = addGeometryColumn(getTargetSchema(), tableName, geomDescriptor, SRID); getLogger().debug(sqlStr); result.add(sqlStr); @@ -355,20 +333,20 @@ sql.append("spatial_"); sql.append(indexName); sql.append("_"); - sql.append(anAttributeType.getLocalName().toLowerCase()); + sql.append(descriptor.getLocalName().toLowerCase()); sql.append("\" ON "); sql.append(encodeSchemaTableName(tableName)); sql.append(" USING GIST ("); - sql.append(encodeSchemaColumnName(anAttributeType.getLocalName())); - sql.append(" gist_geometry_ops);"); + sql.append(encodeSchemaColumnName(descriptor.getLocalName())); + sql.append(" );"); + // sql.append(" gist_geometry_ops);"); sqlStr = sql.toString(); getLogger().debug(sqlStr); result.add(sqlStr); } - if (origintableName.startsWith("fsc")) - { + if (origintableName.startsWith("fsc")) { sql = new StringBuilder("CREATE INDEX \""); sql.append("oid_"); sql.append(indexName); @@ -393,77 +371,64 @@ return result; } - private int getSRID(CoordinateReferenceSystem refSys) - { + private int getSRID(CoordinateReferenceSystem refSys) { int SRID; - if (refSys != null) - { - try - { + if (refSys != null) { + try { Set ident = refSys.getIdentifiers(); - if ((ident == null || ident.isEmpty()) && refSys == DefaultGeographicCRS.WGS84) - { + if ((ident == null || ident.isEmpty()) && refSys == DefaultGeographicCRS.WGS84) { SRID = 4326; - } else - { + } else { String code = ((NamedIdentifier) ident.toArray()[0]).getCode(); SRID = Integer.parseInt(code); } - } catch (Exception e) - { + } catch (Exception e) { getLogger().warn("SRID could not be determined"); SRID = -1; } - } else - { + } else { SRID = -1; } return SRID; } - private boolean tablePresent(String schema, String table, Connection conn) throws IOException - { + private boolean tablePresent(String schema, String table, Connection conn) throws IOException { final int TABLE_NAME_COL = 3; ResultSet tables = null; - try - { + try { DatabaseMetaData meta = conn.getMetaData(); String[] tableType = {"TABLE"}; tables = meta.getTables(null, schema, "%", tableType); - while (tables.next()) - { + while (tables.next()) { String tableName = tables.getString(TABLE_NAME_COL); if (allowTable(tableName) && (tableName != null) - && (tableName.equalsIgnoreCase(table))) - { + && (tableName.equalsIgnoreCase(table))) { return true; } } return false; - } catch (SQLException sqlException) - { + } catch (SQLException sqlException) { // JDBCUtils.close(conn, Transaction.AUTO_COMMIT, sqlException); String message = "Error querying database for list of tables:" - + sqlException.getMessage(); + + sqlException.getMessage(); throw new DataSourceException(message, sqlException); - } finally - { - if (tables != null) try { tables.close(); } catch (SQLException e) {} + } finally { + if (tables != null) try { + tables.close(); + } catch (SQLException e) { + } // JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); } } - protected boolean allowTable(String tablename) - { - if (tablename.equals("geometry_columns")) - { + protected boolean allowTable(String tablename) { + if (tablename.equals("geometry_columns")) { return false; - } else if (tablename.startsWith("spatial_ref_sys")) - { + } else if (tablename.startsWith("spatial_ref_sys")) { return false; } @@ -472,88 +437,73 @@ } - private StringBuffer makeNonGeomSqlCreate(AttributeType[] attributeType) - throws IOException - { + private StringBuffer makeNonGeomSqlCreate(List<AttributeDescriptor> descriptors) + throws IOException { StringBuffer buf = new StringBuffer(""); - for (AttributeType anAttributeType : attributeType) - { + for (AttributeDescriptor descriptor : descriptors) { String typeName; - typeName = CLASS_MAPPINGS.get(anAttributeType.getBinding()); - if (typeName == null) - { - typeName = GEOM_CLASS_MAPPINGS.get(anAttributeType.getBinding()); + typeName = CLASS_MAPPINGS.get(((PropertyType) descriptor.getType()).getBinding()); + if (typeName == null) { + typeName = GEOM_CLASS_MAPPINGS.get(((PropertyType) descriptor.getType()).getBinding()); if (typeName != null) continue; } - if (typeName != null) - { - if (typeName.equals("VARCHAR")) - { + if (typeName != null) { + if (typeName.equals("VARCHAR")) { int length = -1; - Filter f = anAttributeType.getRestriction(); - if (f != null && f != Filter.EXCLUDE && f != Filter.INCLUDE && - (f instanceof PropertyIsLessThan || f instanceof PropertyIsLessThanOrEqualTo)) - { - try - { - BinaryComparisonOperator cf = (BinaryComparisonOperator) f; - if (cf.getExpression1() instanceof LengthFunction) - { - length = Integer.parseInt(((Literal) cf.getExpression2()).getValue().toString()); - } else - { - if (cf.getExpression2() instanceof LengthFunction) - { - length = Integer.parseInt(((Literal) cf.getExpression1()).getValue().toString()); + List<Filter> flist = ((PropertyType) descriptor.getType()).getRestrictions(); + for (Filter f : flist) { + if (f != null && f != Filter.EXCLUDE && f != Filter.INCLUDE && + (f instanceof PropertyIsLessThan || f instanceof PropertyIsLessThanOrEqualTo)) { + try { + BinaryComparisonOperator cf = (BinaryComparisonOperator) f; + if (cf.getExpression1() instanceof LengthFunction) { + length = Integer.parseInt(((Literal) cf.getExpression2()).getValue().toString()); + } else { + if (cf.getExpression2() instanceof LengthFunction) { + length = Integer.parseInt(((Literal) cf.getExpression1()).getValue().toString()); + } } + } catch (NumberFormatException e) { + length = 512; } - } catch (NumberFormatException e) - { - length = 256; + } else { + length = 512; } - } else - { - length = 256; + break; } - if (length < 1) - { - getLogger().warn("FeatureType did not specify string length; defaulted to 256"); - length = 256; - } else if (length > MAX_ALLOWED_VALUE) - { + if (length < 1) { + getLogger().info("FeatureType did not specify string length; defaulted to 512 :" + + descriptor.getLocalName()); + length = 512; + } else if (length > MAX_ALLOWED_VALUE) { length = MAX_ALLOWED_VALUE; } typeName = typeName + "(" + length + ")"; } - if (!anAttributeType.isNillable()) - { + if (!descriptor.isNillable()) { typeName = typeName + " NOT NULL"; } //TODO review!!! Is toString() always OK??? - Object defaultValue = anAttributeType.createDefaultValue(); + Object defaultValue = descriptor.getDefaultValue(); - if (defaultValue != null) - { + if (defaultValue != null) { typeName = typeName + " DEFAULT '" - + defaultValue.toString() + "'"; + + defaultValue.toString() + "'"; } - buf.append(" \"").append(anAttributeType.getLocalName()).append("\" ").append(typeName).append(","); + buf.append(" \"").append(descriptor.getLocalName()).append("\" ").append(typeName).append(","); - } else - { + } else { String msg; - if (anAttributeType == null) - { + if (descriptor == null) { msg = "AttributeType was null!"; - } else - { - msg = "Type '" + anAttributeType.getBinding() + "' not supported!"; + } else { + msg = "Type '" + ((PropertyType) descriptor.getType()).getBinding() + "' not supported!"; } throw (new IOException(msg)); } @@ -562,14 +512,12 @@ return buf.deleteCharAt(buf.length() - 1); } - private String getGeometrySQLTypeName(Class type) - { + private String getGeometrySQLTypeName(Class type) { String res = GEOM_CLASS_MAPPINGS.get(type); - if (res == null) - { + if (res == null) { throw new RuntimeException("Unknown type name for class " + type - + " please update GEOMETRY_MAPPINGS"); + + " please update GEOMETRY_MAPPINGS"); } return res; @@ -577,36 +525,38 @@ protected String getGeometryInsertText(Geometry geom, int srid) // throws IOException { - if (geom == null) - { + if (geom == null) { return "null"; } - if (targetDataStore.isWKBEnabled()) - { + /* + if (targetDataStore.isWKBEnabled()) { //String wkb = WKBEncoder.encodeGeometryHex(geom); String wkb = WKBWriter.bytesToHex(new WKBWriter().write(geom)); - if (targetDataStore.isByteaWKB()) - { + if (targetDataStore.isByteaWKB()) { return "setSRID('" + wkb + "'::geometry," + srid + ")"; - } else - { + } else { return "GeomFromWKB('" + wkb + "', " + srid + ")"; } } String geoText = geometryWriter.write(geom); - return "GeometryFromText('" + geoText + "', " + srid + ")"; + */ + if (geom instanceof LinearRing) { + //postgis does not handle linear rings, convert to just a line string + geom = geom.getFactory().createLineString(((LinearRing) geom).getCoordinateSequence()); + } + return "ST_GeomFromText('" + geom.toText() + "', " + srid + ")"; } - protected String makeInsertSql(Feature feature, int srid) // throws IOException + protected String makeInsertSql(SimpleFeature feature, int srid) // throws IOException { - FeatureType featureType = feature.getFeatureType(); + SimpleFeatureType featureType = feature.getFeatureType(); String tableName = encodeSchemaTableName(featureType.getTypeName()); - AttributeType[] attributeTypes = featureType.getAttributeTypes(); + List<AttributeDescriptor> descriptors = featureType.getAttributeDescriptors(); String attrValue; @@ -615,12 +565,10 @@ // encode insertion for attributes, but remember to avoid auto-increment ones, // they may be included in the feature type as well - for (AttributeType attributeType : attributeTypes) - { - String attName = attributeType.getLocalName(); + for (AttributeDescriptor attributeDescriptor : descriptors) { + String attName = attributeDescriptor.getLocalName(); - if (feature.getAttribute(attName) != null) - { + if (feature.getAttribute(attName) != null) { String colName = encodeSchemaColumnName(attName); statementSQL.append(colName).append(","); } @@ -629,35 +577,28 @@ statementSQL.setCharAt(statementSQL.length() - 1, ')'); statementSQL.append(" VALUES ("); - Object[] attributes = feature.getAttributes(null); + List<Object> attributes = feature.getAttributes(); - for (int i = 0; i < attributeTypes.length; i++) - { + for (int i = 0; i < descriptors.size(); i++) { attrValue = null; - if (attributeTypes[i] instanceof GeometryAttributeType) - { - // String geomName = attributeTypes[i].getLocalName(); + if (descriptors.get(i) instanceof GeometryDescriptor) { + // String geomName = descriptors[i].getLocalName(); // int srid = ftInfo.getSRID(geomName); - Geometry geometry = (Geometry) attributes[i]; + Geometry geometry = (Geometry) attributes.get(i); - if (geometry == null) - { + if (geometry == null) { attrValue = "NULL"; - } else - { + } else { attrValue = getGeometryInsertText(geometry, srid); } - } else - { - if (attributes[i] != null) - { - attrValue = addQuotes(attributes[i]); + } else { + if (attributes.get(i) != null) { + attrValue = addQuotes(attributes.get(i)); } } - if (attrValue != null) - { + if (attrValue != null) { statementSQL.append(attrValue).append(","); } } @@ -667,10 +608,9 @@ return (statementSQL.toString()); } - protected String makePrepareInsertSql(FeatureType featureType) - { + protected String makePrepareInsertSql(SimpleFeatureType featureType) { String tableName = encodeSchemaTableName(featureType.getTypeName()); - AttributeType[] attributeTypes = featureType.getAttributeTypes(); + List<AttributeDescriptor> descriptors = featureType.getAttributeDescriptors(); String attrValue; @@ -678,9 +618,8 @@ // encode insertion for attributes, but remember to avoid auto-increment ones, // they may be included in the feature type as well - for (AttributeType attributeType : attributeTypes) - { - String attName = attributeType.getLocalName(); + for (AttributeDescriptor descriptor : descriptors) { + String attName = descriptor.getLocalName(); String colName = encodeSchemaColumnName(attName); statementSQL.append(colName).append(","); @@ -689,8 +628,7 @@ statementSQL.setCharAt(statementSQL.length() - 1, ')'); statementSQL.append(" VALUES ("); - for (AttributeType attributeType : attributeTypes) - { + for (AttributeDescriptor descriptor : descriptors) { statementSQL.append(" ? ,"); } @@ -699,101 +637,81 @@ return (statementSQL.toString()); } - protected String addQuotes(Object value) - { + protected String addQuotes(Object value) { String retString; - if (value != null) - { - if (value instanceof Number) - { + if (value != null) { + if (value instanceof Number) { retString = value.toString(); - } else - { + } else { retString = "'" + doubleQuote(value) + "'"; } - } else - { + } else { retString = "null"; } return retString; } - String doubleQuote(Object obj) - { + String doubleQuote(Object obj) { return obj.toString().replaceAll("'", "''"); } - protected String encodeName(String tableName) - { + protected String encodeName(String tableName) { return tableName; } - protected String encodeColumnName(String colName) - { + protected String encodeColumnName(String colName) { return encodeName(colName); } public String encodeSchemaTableName(String tableName) { return schemaEnabled ? ("\"" + getTargetSchema() + "\".\"" + tableName + "\"") - : ("\"" + tableName + "\""); + : ("\"" + tableName + "\""); } public String encodeSchemaColumnName(String columnName) { return "\"" + columnName + "\""; } - protected void bindFeatureParameters(PreparedStatement pstmt, Feature feature) throws SQLException - { - FeatureType featureType = feature.getFeatureType(); + protected void bindFeatureParameters(PreparedStatement pstmt, SimpleFeature feature) throws SQLException { + SimpleFeatureType featureType = feature.getFeatureType(); - AttributeType[] attributeTypes = featureType.getAttributeTypes(); - Object[] attributes = feature.getAttributes(null); + List<AttributeDescriptor> descriptors = featureType.getAttributeDescriptors(); + List<Object> attributes = feature.getAttributes(); - for (int i = 0; i < attributeTypes.length; i++) - { - if (attributeTypes[i] instanceof GeometryAttributeType) - { - pstmt.setBytes(i + 1, binaryWriter.writeBinary((Geometry) attributes[i])); - } else - { - if (attributeTypes[i].getBinding().equals(Short.class)) - { - pstmt.setShort(i + 1, (Short) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(Integer.class)) - { - pstmt.setInt(i + 1, (Short) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(Long.class)) - { - pstmt.setLong(i + 1, (Long) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(String.class)) - { - pstmt.setString(i + 1, (String) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(Float.class)) - { - pstmt.setFloat(i + 1, (Float) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(Double.class)) - { - pstmt.setDouble(i + 1, (Double) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(Boolean.class)) - { - pstmt.setBoolean(i + 1, (Boolean) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(BigDecimal.class)) - { - pstmt.setBigDecimal(i + 1, (BigDecimal) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(java.sql.Date.class)) - { - pstmt.setDate(i + 1, (java.sql.Date) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(java.sql.Time.class)) - { - pstmt.setTime(i + 1, (java.sql.Time) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(java.sql.Timestamp.class)) - { - pstmt.setTimestamp(i + 1, (java.sql.Timestamp) attributes[i]); - } else if (attributeTypes[i].getBinding().equals(java.util.Date.class)) - { - java.sql.Date sDate = new java.sql.Date(((java.util.Date) attributes[i]).getTime()); + for (int i = 0; i < descriptors.size(); i++) { + if (descriptors.get(i) instanceof GeometryDescriptor) { + // String wktTest = geometryWriter.write((Geometry) attributes.get(i)); + Geometry geom = (Geometry) attributes.get(i); + geom.setSRID(FeatureTypeBuilderUtil.getDefaultFeatureSRID()); + pstmt.setBytes(i + 1, binaryWriter.writeBinary((Geometry) attributes.get(i))); + } else { + Class<?> bindingType = ((AttributeType)descriptors.get(i).getType()).getBinding(); + if (bindingType.equals(Short.class)) { + pstmt.setShort(i + 1, (Short) attributes.get(i)); + } else if (bindingType.equals(Integer.class)) { + pstmt.setInt(i + 1, (Integer) attributes.get(i)); + } else if (bindingType.equals(Long.class)) { + pstmt.setLong(i + 1, (Long) attributes.get(i)); + } else if (bindingType.equals(String.class)) { + pstmt.setString(i + 1, (String) attributes.get(i)); + } else if (bindingType.equals(Float.class)) { + pstmt.setFloat(i + 1, (Float) attributes.get(i)); + } else if (bindingType.equals(Double.class)) { + pstmt.setDouble(i + 1, (Double) attributes.get(i)); + } else if (bindingType.equals(Boolean.class)) { + pstmt.setBoolean(i + 1, (Boolean) attributes.get(i)); + } else if (bindingType.equals(BigDecimal.class)) { + pstmt.setBigDecimal(i + 1, (BigDecimal) attributes.get(i)); + } else if (bindingType.equals(java.sql.Date.class)) { + pstmt.setDate(i + 1, (java.sql.Date) attributes.get(i)); + } else if (bindingType.equals(java.sql.Time.class)) { + pstmt.setTime(i + 1, (java.sql.Time) attributes.get(i)); + } else if (bindingType.equals(java.sql.Timestamp.class)) { + pstmt.setTimestamp(i + 1, (java.sql.Timestamp) attributes.get(i)); + } else if (bindingType.equals(java.util.Date.class)) { + java.sql.Date sDate = new java.sql.Date(((java.util.Date) attributes.get(i)).getTime()); pstmt.setDate(i + 1, sDate); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/DummyFeatureConvertPostGISJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/DummyFeatureConvertPostGISJobContext.java index 5071bd1..ca42eda 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/DummyFeatureConvertPostGISJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/DummyFeatureConvertPostGISJobContext.java @@ -10,8 +10,18 @@ import java.util.Iterator; import java.util.List; -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.xmlrules.DigesterLoader; +import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatcher; +import com.ximple.eofms.filter.TypeCompIdDispatchableFilter; +import com.ximple.eofms.filter.TypeCompLevelIdDispatchableFilter; +import com.ximple.eofms.filter.TypeIdDispatchableFilter; +import com.ximple.eofms.util.ElementDigesterUtils; +import com.ximple.io.dgn7.ComplexElement; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.FrammeAttributeData; +import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.digester3.Digester; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.transaction.memory.PessimisticMapWrapper; @@ -20,35 +30,19 @@ import org.geotools.data.DataStore; import org.geotools.data.FeatureWriter; import org.geotools.data.Transaction; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; import org.geotools.feature.SchemaException; -import org.geotools.feature.SimpleFeature; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; import org.xml.sax.SAXException; -import com.vividsolutions.jts.geom.GeometryFactory; - -import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; -import com.ximple.eofms.filter.ElementDispatchableFilter; -import com.ximple.eofms.filter.ElementDispatcher; -import com.ximple.eofms.filter.TypeCompIdDispatchableFilter; -import com.ximple.eofms.filter.TypeCompLevelIdDispatchableFilter; -import com.ximple.eofms.filter.TypeIdDispatchableFilter; -import com.ximple.io.dgn7.ComplexElement; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.io.dgn7.UserAttributeData; - -public class DummyFeatureConvertPostGISJobContext extends AbstractDgnToPostGISJobContext -{ +public class DummyFeatureConvertPostGISJobContext extends AbstractDgnToPostGISJobContext { static final Log logger = LogFactory.getLog(DummyFeatureConvertPostGISJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); private String dataOut = null; - private HashMap<String, ArrayList<Feature>> featuresContext = new HashMap<String, ArrayList<Feature>>(); + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; @@ -57,78 +51,64 @@ private String _filterConfig; private boolean withIndex = false; - public DummyFeatureConvertPostGISJobContext(String dataPath, DataStore targetDataStore, String targetSchema, String filterConfig) - { - super(dataPath, targetDataStore, targetSchema); + public DummyFeatureConvertPostGISJobContext(String dataPath, DataStore targetDataStore, String targetSchema, + String filterConfig, boolean profileMode, + boolean useTransform) { + super(dataPath, targetDataStore, targetSchema, profileMode, useTransform); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); _filterConfig = filterConfig; elementDispatcher = createElementDispatcher(); } - private ElementDispatcher createElementDispatcher() - { - try - { - URL rulesURL = ElementDispatcher.class.getResource("ElementDispatcherRules.xml"); - assert rulesURL != null; - Digester digester = DigesterLoader.createDigester(rulesURL); + private ElementDispatcher createElementDispatcher() { + try { URL filterURL = null; - if (_filterConfig != null) - { + if (_filterConfig != null) { File config = new File(_filterConfig); - if (config.exists()) - { + if (config.exists()) { filterURL = config.toURI().toURL(); } } - if (filterURL == null) - { + if (filterURL == null) { // config = new File("conf/DefaultConvertShpFilter.xml"); filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); } assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); return (ElementDispatcher) digester.parse(filterURL); - } catch (UnsupportedEncodingException e) - { + } catch (UnsupportedEncodingException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (SAXException e) - { + } catch (SAXException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); } } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { assert elementDispatcher != null; - if (element == null) - { + if (element == null) { logger.warn("Unknown Element:" + null); return; } - // �P�_�O�_�ũM���� - Feature feature = elementDispatcher.execute(element, true); - if (feature == null) - { + // �P�_�O�_�ũM��� + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { FrammeAttributeData linkage = - AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); logger.warn("Unknown Element:" + element.getElementType().toString() + - ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + - (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); - if (element instanceof ComplexElement) - { + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); + if (element instanceof ComplexElement) { ComplexElement complex = (ComplexElement) element; logger.warn("----Complex Element size=" + complex.size()); } @@ -136,130 +116,102 @@ return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); } - public void startTransaction() - { + public void startTransaction() { assert elementDispatcher != null; - for (ElementDispatchableFilter filter : elementDispatcher.getRules()) - { - if (filter instanceof TypeCompIdDispatchableFilter) - { + for (ElementDispatchableFilter filter : elementDispatcher.getRules()) { + if (filter instanceof TypeCompIdDispatchableFilter) { ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); - } else if (filter instanceof TypeCompLevelIdDispatchableFilter) - { + } else if (filter instanceof TypeCompLevelIdDispatchableFilter) { ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); - } else if (filter instanceof TypeIdDispatchableFilter) - { + } else if (filter instanceof TypeIdDispatchableFilter) { ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); } } } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); logger.debug("Begin Save PostGIS:" + featureType.getTypeName()); FeatureWriter writer; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { - if (!isExistFeature(featureType)) - { - targetDataStore.createSchema(featureType); - writer = targetDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT); - } else - { - writer = targetDataStore.getFeatureWriterAppend(featureType.getTypeName(), Transaction.AUTO_COMMIT); + } else { + if (!isExistFeature(featureType)) { + getTargetDataStore().createSchema(featureType); + writer = getTargetDataStore().getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT); + } else { + writer = getTargetDataStore().getFeatureWriterAppend(featureType.getTypeName(), Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } - ArrayList<Feature> features = featuresContext.get(featureType); + ArrayList<SimpleFeature> features = featuresContext.get(featureType); Iterator itFeature = features.iterator(); - while (itFeature.hasNext()) - { - Feature feature = (Feature) itFeature.next(); - ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); } //writer.close(); logger.debug("End Save PostGIS:" + featureType.getTypeName()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); } } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } @@ -267,18 +219,15 @@ } - public boolean isWithIndex() - { + public boolean isWithIndex() { return withIndex; } - public void setWithIndex(boolean withIndex) - { + public void setWithIndex(boolean withIndex) { this.withIndex = withIndex; } - public Log getLogger() - { + public Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/FeatureDgnConvertPostGISJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/FeatureDgnConvertPostGISJobContext.java index bcd4ac6..69241cf 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/FeatureDgnConvertPostGISJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/FeatureDgnConvertPostGISJobContext.java @@ -10,8 +10,14 @@ import java.util.Iterator; import java.util.List; -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.xmlrules.DigesterLoader; +import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatcher; +import com.ximple.eofms.util.ElementDigesterUtils; +import com.ximple.io.dgn7.ComplexElement; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.FrammeAttributeData; +import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.digester3.Digester; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.transaction.memory.PessimisticMapWrapper; @@ -20,29 +26,17 @@ import org.geotools.data.DataStore; import org.geotools.data.FeatureWriter; import org.geotools.data.Transaction; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; +import org.opengis.feature.IllegalAttributeException; import org.geotools.feature.SchemaException; -import org.geotools.feature.SimpleFeature; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; import org.xml.sax.SAXException; -import com.vividsolutions.jts.geom.GeometryFactory; - -import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; -import com.ximple.eofms.filter.ElementDispatcher; -import com.ximple.io.dgn7.ComplexElement; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.io.dgn7.UserAttributeData; - -public class FeatureDgnConvertPostGISJobContext extends AbstractDgnToPostGISJobContext -{ +public class FeatureDgnConvertPostGISJobContext extends AbstractDgnToPostGISJobContext { static final Log logger = LogFactory.getLog(FeatureDgnConvertPostGISJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); - private HashMap<String, ArrayList<Feature>> featuresContext = new HashMap<String, ArrayList<Feature>>(); + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; @@ -51,78 +45,63 @@ private String _filterConfig; private boolean withIndex = false; - public FeatureDgnConvertPostGISJobContext(String dataPath, DataStore targetDataStore, String targetSchema, String filterConfig) - { - super(dataPath, targetDataStore, targetSchema); + public FeatureDgnConvertPostGISJobContext(String dataPath, DataStore targetDataStore, String targetSchema, + String filterConfig, boolean profileMode, + boolean useTransform) { + super(dataPath, targetDataStore, targetSchema, profileMode, useTransform); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); _filterConfig = filterConfig; elementDispatcher = createElementDispatcher(); } - private ElementDispatcher createElementDispatcher() - { - try - { - URL rulesURL = ElementDispatcher.class.getResource("ElementDispatcherRules.xml"); - assert rulesURL != null; - Digester digester = DigesterLoader.createDigester(rulesURL); + private ElementDispatcher createElementDispatcher() { + try { URL filterURL = null; - if (_filterConfig != null) - { + if (_filterConfig != null) { File config = new File(_filterConfig); - if (config.exists()) - { + if (config.exists()) { filterURL = config.toURI().toURL(); } } - if (filterURL == null) - { + if (filterURL == null) { // config = new File("conf/DefaultConvertShpFilter.xml"); filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); } assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); return (ElementDispatcher) digester.parse(filterURL); - } catch (UnsupportedEncodingException e) - { + } catch (UnsupportedEncodingException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (SAXException e) - { + } catch (SAXException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); } } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { assert elementDispatcher != null; - if (element == null) - { + if (element == null) { logger.warn("Unknown Element:" + null); return; } - // �P�_�O�_�ũM���� - Feature feature = elementDispatcher.execute(element, true); - if (feature == null) - { + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { FrammeAttributeData linkage = - AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); logger.warn("Unknown Element:" + element.getElementType().toString() + - ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + - (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); - if (element instanceof ComplexElement) - { + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); + if (element instanceof ComplexElement) { ComplexElement complex = (ComplexElement) element; logger.warn("----Complex Element size=" + complex.size()); } @@ -130,118 +109,99 @@ return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } - ArrayList<Feature> arrayList = (ArrayList<Feature>) txFeaturesContext.get(feature.getFeatureType()); + ArrayList<SimpleFeature> arrayList = (ArrayList<SimpleFeature>) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); } - public void startTransaction() - { + public void startTransaction() { } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); logger.debug("Begin Save PostGIS:" + featureType.getTypeName()); FeatureWriter writer; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { - if (!isExistFeature(featureType)) - { - targetDataStore.createSchema(featureType); - writer = targetDataStore.getFeatureWriter(featureType.getTypeName(), - Transaction.AUTO_COMMIT); - } else - { - writer = targetDataStore.getFeatureWriterAppend(featureType.getTypeName(), - Transaction.AUTO_COMMIT); + } else { + if (!isExistFeature(featureType)) { + getTargetDataStore().createSchema(featureType); + writer = getTargetDataStore().getFeatureWriter(featureType.getTypeName(), + Transaction.AUTO_COMMIT); + } else { + writer = getTargetDataStore().getFeatureWriterAppend(featureType.getTypeName(), + Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } - ArrayList<Feature> features = featuresContext.get(featureType); + ArrayList<SimpleFeature> features = featuresContext.get(featureType); Iterator itFeature = features.iterator(); - while (itFeature.hasNext()) - { - Feature feature = (Feature) itFeature.next(); - ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); } //writer.close(); logger.debug("End Save PostGIS:" + featureType.getTypeName()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); } } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() { + this.featuresWriterContext.clear(); - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { - featureWriter.close(); + try { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { + featureWriter.close(); + } + } catch (IOException e) { + logger.warn(e.getMessage(), e); } this.featuresWriterContext.clear(); } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } @@ -249,18 +209,15 @@ } - public boolean isWithIndex() - { + public boolean isWithIndex() { return withIndex; } - public void setWithIndex(boolean withIndex) - { + public void setWithIndex(boolean withIndex) { this.withIndex = withIndex; } - public Log getLogger() - { + public Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/GeneralDgnConvertPostGISJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/GeneralDgnConvertPostGISJobContext.java index 2881ab4..84993eb 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/GeneralDgnConvertPostGISJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/GeneralDgnConvertPostGISJobContext.java @@ -3,35 +3,21 @@ import java.io.IOException; import java.math.BigDecimal; import java.math.RoundingMode; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.TreeMap; -import java.sql.Connection; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.PreparedStatement; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.commons.transaction.util.CommonsLoggingLogger; -import org.apache.commons.transaction.util.LoggerFacade; -import org.geotools.data.DataStore; -import org.geotools.data.Transaction; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; -import org.postgresql.util.PSQLException; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; - import com.ximple.eofms.util.DefaultColorTable; import com.ximple.eofms.util.FeatureTypeBuilderUtil; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; +import com.ximple.eofms.util.GeometryConverterDecorator; import com.ximple.io.dgn7.ArcElement; import com.ximple.io.dgn7.ComplexChainElement; import com.ximple.io.dgn7.Element; @@ -43,147 +29,142 @@ import com.ximple.io.dgn7.TextElement; import com.ximple.io.dgn7.TextNodeElement; import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.transaction.util.CommonsLoggingLogger; +import org.apache.commons.transaction.util.LoggerFacade; +import org.geotools.data.DataStore; +import org.geotools.data.Transaction; +import org.geotools.data.jdbc.JDBCUtils; +import org.geotools.feature.SchemaException; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import org.postgresql.util.PSQLException; -public class GeneralDgnConvertPostGISJobContext extends AbstractDgnToPostGISJobContext -{ +public class GeneralDgnConvertPostGISJobContext extends AbstractDgnToPostGISJobContext { static final Log logger = LogFactory.getLog(GeneralDgnConvertPostGISJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); + static final GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); - private HashMap<FeatureType, ArrayList<Feature>> txFeaturesContext = new HashMap<FeatureType, ArrayList<Feature>>(); + private HashMap<SimpleFeatureType, ArrayList<SimpleFeature>> txFeaturesContext = new HashMap<SimpleFeatureType, ArrayList<SimpleFeature>>(); - private TreeMap<String, FeatureTypeBuilder> typeBuilders = new TreeMap<String, FeatureTypeBuilder>(); - private TreeMap<String, FeatureType> featureTypes = new TreeMap<String, FeatureType>(); + private TreeMap<String, SimpleFeatureType> featureTypes = new TreeMap<String, SimpleFeatureType>(); - private TWD97GeometryConverterDecorator convertDecorator = null; private String featureBaseName = null; private boolean dropTableMode = true; private int accumulate = 0; - public GeneralDgnConvertPostGISJobContext(String dataPath, DataStore targetDataStore, String targetSchema) - { - super(dataPath, targetDataStore, targetSchema); - convertDecorator = new TWD97GeometryConverterDecorator(); + public GeneralDgnConvertPostGISJobContext(String dataPath, DataStore targetDataStore, String targetSchema, + boolean profileMode, boolean useTransform) { + super(dataPath, targetDataStore, targetSchema, profileMode, useTransform); } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { - FeatureType ft = lookupFeatureType(element); - if (ft != null) - { - boolean canLog = true; - Feature feature = null; - try - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { + SimpleFeatureType ft = lookupFeatureType(element); + if (ft != null) { + boolean canLog = true; + SimpleFeature feature = null; + try { feature = createFeature(ft, element); - } catch (ArrayIndexOutOfBoundsException e) - { + } catch (ArrayIndexOutOfBoundsException e) { getLogger().warn(e.getMessage(), e); canLog = false; + } catch (ClassCastException e) { + getLogger().warn(e.getMessage(), e); } - if (feature == null) - { - if (!canLog) return; + if (feature == null) { + if (!canLog) return; if (element instanceof TextElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((TextElement) element).getText() + "'"); + ((TextElement) element).getText() + "'"); else if (element instanceof ShapeElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((ShapeElement) element).getVerticeSize() + "'" + - ((ShapeElement) element).getStartPoint()); + ((ShapeElement) element).getVerticeSize() + "'" + + ((ShapeElement) element).getStartPoint()); else if (element instanceof LineStringElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((LineStringElement) element).getVerticeSize() + "'" + - ((LineStringElement) element).getStartPoint()); + ((LineStringElement) element).getVerticeSize() + "'" + + ((LineStringElement) element).getStartPoint()); else if (element instanceof ArcElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((ArcElement) element).getOrigin().toString() + "'" + - ((ArcElement) element).getRotationAngle()); + ((ArcElement) element).getOrigin().toString() + "'" + + ((ArcElement) element).getRotationAngle()); return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { - txFeaturesContext.put(feature.getFeatureType(), new ArrayList<Feature>()); + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); } - ArrayList<Feature> arrayList = txFeaturesContext.get(feature.getFeatureType()); - if (feature.getDefaultGeometry() != null && !feature.getDefaultGeometry().isEmpty()) - { + ArrayList<SimpleFeature> arrayList = txFeaturesContext.get(feature.getFeatureType()); + if (feature.getDefaultGeometry() != null && !((Geometry)feature.getDefaultGeometry()).isEmpty()) { arrayList.add(feature); accumulate++; } - } else - { + } else { logger.info("Unknown Element :" + element.getType() + ", lv=" + element.getLevelIndex()); } - if (accumulate > BATCHSIZE) - { + if (accumulate > BATCHSIZE) { commitTransaction(); } } // private Transaction transaction; - public void startTransaction() - { + public void startTransaction() { } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!txFeaturesContext.isEmpty()) - { + if (!txFeaturesContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { } - private void updateDataStore() - { - Iterator<FeatureType> it = txFeaturesContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = it.next(); + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); + Iterator<SimpleFeatureType> it = txFeaturesContext.keySet().iterator(); + Connection conn = null; + try { + conn = getConnection(); + boolean autoCommit = conn.getAutoCommit(); + conn.setAutoCommit(false); + + while (it.hasNext()) { + SimpleFeatureType featureType = it.next(); logger.debug("Begin Save into PostGIS:" + featureType.getTypeName()); String bindingStmt = makePrepareInsertSql(featureType); - ArrayList<Feature> features = txFeaturesContext.get(featureType); - Connection conn = getConnection(); - boolean autoCommit = conn.getAutoCommit(); - conn.setAutoCommit(true); + ArrayList<SimpleFeature> features = txFeaturesContext.get(featureType); PreparedStatement pstmt = conn.prepareStatement(bindingStmt); - for (Feature feature : features) - { + for (SimpleFeature feature : features) { // currentStmt = feature; // Statement stmt = conn.createStatement(); - try - { + try { // stmt.execute(feature); bindFeatureParameters(pstmt, feature); - pstmt.execute(); - } catch (PSQLException e) - { - if (bindingStmt != null) - { + // pstmt.execute(); + pstmt.addBatch(); + } catch (PSQLException e) { + if (bindingStmt != null) { logger.error("Execute:" + bindingStmt); } logger.error(e.getServerErrorMessage()); @@ -191,20 +172,33 @@ } } - pstmt.close(); + int[] numUpdates = pstmt.executeBatch(); + for (int i = 0; i < numUpdates.length; i++) { + if (numUpdates[i] == -2) + logger.warn("Execution " + i + ": unknown number of rows updated"); + } + conn.commit(); + + JDBCUtils.close(pstmt); features.clear(); - conn.setAutoCommit(autoCommit); logger.debug("End Save into PostGIS:" + featureType.getTypeName()); } + conn.setAutoCommit(autoCommit); + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); accumulate = 0; - } catch (SQLException e) - { + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); logger.error(e.getMessage(), e); + Exception nextE = e.getNextException(); + if (nextE != null) { + logger.error("getNextException:" + nextE.getMessage(), nextE); + } + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() { txFeaturesContext.clear(); /* for (FeatureWriter featureWriter : this.featuresWriterContext.values()) @@ -216,77 +210,71 @@ */ } - public FeatureType createPointFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalPointFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); - clearFeatureData(typeBuilder); + public SimpleFeatureType createPointFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalPointFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); + clearFeatureData(featureName); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public FeatureType createPolygonFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalPolygonFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); - clearFeatureData(typeBuilder); + public SimpleFeatureType createPolygonFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalPolygonFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); + clearFeatureData(featureName); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public FeatureType createLineFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalLineFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); - clearFeatureData(typeBuilder); + public SimpleFeatureType createLineFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalLineFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); + clearFeatureData(featureName); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public FeatureType createMultiLineFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalMultiLineFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); - clearFeatureData(typeBuilder); + public SimpleFeatureType createMultiLineFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalMultiLineFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); + clearFeatureData(featureName); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public FeatureType createArcFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalArcFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); - clearFeatureData(typeBuilder); + public SimpleFeatureType createArcFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalArcFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); + clearFeatureData(featureName); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public FeatureType createEllipseFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalEllipseFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); - clearFeatureData(typeBuilder); + public SimpleFeatureType createEllipseFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalEllipseFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); + clearFeatureData(featureName); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public Feature createFeature(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); + + if (element instanceof TextElement) { TextElement textElement = (TextElement) element; convertDecorator.setConverter(textElement); @@ -295,25 +283,22 @@ String content = textElement.getText(); content = content.replace('\u0000', ' '); angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); - if (geom != null) - { - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(textElement.getColorIndex()), - textElement.getFontIndex(), - textElement.getJustification(), - textElement.getTextHeight(), - textElement.getTextWidth(), - angle, - content - }); - } else - { + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(textElement.getColorIndex()), + textElement.getFontIndex(), + textElement.getJustification(), + textElement.getTextHeight(), + textElement.getTextWidth(), + angle, + content + }, null); + } else { logger.info("geometry is null." + element.toString()); } return null; - } else if (element instanceof TextNodeElement) - { + } else if (element instanceof TextNodeElement) { TextNodeElement textNodeElement = (TextNodeElement) element; convertDecorator.setConverter(textNodeElement); @@ -322,77 +307,70 @@ angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); String[] texts = textNodeElement.getTextArray(); StringBuilder sb = new StringBuilder(); - for (String text : texts) - { + for (String text : texts) { if (sb.length() != 0) sb.append("\n"); String content = text.replace('\u0000', ' '); sb.append(content); } - if (geom != null) - { - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(textNodeElement.getColorIndex()), - textNodeElement.getFontIndex(), - textNodeElement.getJustification(), - textNodeElement.getTextNodeHeight(), - textNodeElement.getTextNodeLength(), - angle, - sb.toString() - }); - } else - { + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(textNodeElement.getColorIndex()), + textNodeElement.getFontIndex(), + textNodeElement.getJustification(), + textNodeElement.getTextNodeHeight(), + textNodeElement.getTextNodeLength(), + angle, + sb.toString() + }, null); + } else { logger.info("geometry is null." + element.toString()); } return null; - } else if (element instanceof ShapeElement) - { + } else if (element instanceof ShapeElement) { ShapeElement shapeElement = (ShapeElement) element; convertDecorator.setConverter(shapeElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - { - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(shapeElement.getColorIndex()), - shapeElement.getWeight(), - shapeElement.getLineStyle() - }); - } else - { + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(shapeElement.getColorIndex()), + shapeElement.getWeight(), + shapeElement.getLineStyle() + }, null); + } else { logger.info("geometry is null." + element.toString()); } return null; - } else if (element instanceof LineStringElement) - { + } else if (element instanceof LineStringElement) { LineStringElement linestring = (LineStringElement) element; convertDecorator.setConverter(linestring); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(linestring.getColorIndex()), - linestring.getWeight(), - linestring.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(linestring.getColorIndex()), + linestring.getWeight(), + linestring.getLineStyle() + }, null); + } return null; - } else if (element instanceof LineElement) - { + } else if (element instanceof LineElement) { LineElement line = (LineElement) element; convertDecorator.setConverter(line); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(line.getColorIndex()), - line.getWeight(), - line.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(line.getColorIndex()), + line.getWeight(), + line.getLineStyle() + }, null); + } return null; - } else if (element instanceof ArcElement) - { + } else if (element instanceof ArcElement) { ArcElement arcElement = (ArcElement) element; /* logger.fatal("" + arcElement.getPrimary() + ":" + arcElement.getSecondary() + @@ -401,52 +379,50 @@ */ convertDecorator.setConverter(arcElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(arcElement.getColorIndex()), - arcElement.getWeight(), - arcElement.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(arcElement.getColorIndex()), + arcElement.getWeight(), + arcElement.getLineStyle() + }, null); + } return null; - } else if (element instanceof EllipseElement) - { + } else if (element instanceof EllipseElement) { EllipseElement arcElement = (EllipseElement) element; convertDecorator.setConverter(arcElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(arcElement.getColorIndex()), - arcElement.getWeight(), - arcElement.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(arcElement.getColorIndex()), + arcElement.getWeight(), + arcElement.getLineStyle() + }, null); + } return null; - } else if (element instanceof ComplexChainElement) - { + } else if (element instanceof ComplexChainElement) { ComplexChainElement complexChainElement = (ComplexChainElement) element; convertDecorator.setConverter(complexChainElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(complexChainElement.getColorIndex()), - complexChainElement.getWeight(), - complexChainElement.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(complexChainElement.getColorIndex()), + complexChainElement.getWeight(), + complexChainElement.getLineStyle() + }, null); + } return null; } return null; } - private String getFeatureBaseName() - { - if (featureBaseName == null) - { + private String getFeatureBaseName() { + if (featureBaseName == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } featureBaseName = dgnname; @@ -454,81 +430,63 @@ return featureBaseName; } - private FeatureType lookupFeatureType(Element element) throws SchemaException, IllegalAttributeException - { + private SimpleFeatureType lookupFeatureType(Element element) throws SchemaException, IllegalAttributeException { String typeName; - if (element instanceof TextElement) - { + if (element instanceof TextElement) { typeName = getFeatureBaseName() + "_P"; typeName = typeName.toLowerCase(); - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createPointFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof TextNodeElement) - { + } else if (element instanceof TextNodeElement) { typeName = getFeatureBaseName() + "_P"; typeName = typeName.toLowerCase(); - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createPointFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof LineStringElement) - { - if (element instanceof ShapeElement) - { + } else if (element instanceof LineStringElement) { + if (element instanceof ShapeElement) { typeName = getFeatureBaseName() + "_R"; typeName = typeName.toLowerCase(); - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createPolygonFeatureElement(typeName)); } return featureTypes.get(typeName); - } else - { + } else { typeName = getFeatureBaseName() + "_L"; typeName = typeName.toLowerCase(); - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createLineFeatureElement(typeName)); } return featureTypes.get(typeName); } - } else if (element instanceof LineElement) - { + } else if (element instanceof LineElement) { typeName = getFeatureBaseName() + "_L"; typeName = typeName.toLowerCase(); - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createLineFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof ComplexChainElement) - { + } else if (element instanceof ComplexChainElement) { typeName = getFeatureBaseName() + "_ML"; typeName = typeName.toLowerCase(); - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createMultiLineFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof ArcElement) - { + } else if (element instanceof ArcElement) { typeName = getFeatureBaseName() + "_A"; typeName = typeName.toLowerCase(); - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createArcFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof EllipseElement) - { + } else if (element instanceof EllipseElement) { typeName = getFeatureBaseName() + "_R"; typeName = typeName.toLowerCase(); - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createEllipseFeatureElement(typeName)); } return featureTypes.get(typeName); @@ -537,88 +495,89 @@ return null; } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } return null; } - public Log getLogger() - { + public Log getLogger() { return logger; } - public boolean isDropTableMode() - { + public boolean isDropTableMode() { return dropTableMode; } - public void setDropTableMode(boolean dropTableMode) - { + public void setDropTableMode(boolean dropTableMode) { this.dropTableMode = dropTableMode; } - protected void clearFeatureData(FeatureTypeBuilder typeBuilder) throws SchemaException - { - String featureName = typeBuilder.getName(); - if (isExistFeature(typeBuilder.getFeatureType())) - { - try - { - Connection conn = targetDataStore.getConnection(Transaction.AUTO_COMMIT); - if (dropTableMode) - { - dropGeometryColumn(conn, featureName, - typeBuilder.getFeatureType().getDefaultGeometry().getLocalName()); + protected void clearFeatureData(String featureTypeName) throws SchemaException { + if (isProfileMode()) markUpdateTime(); + + Connection conn = null; + + SimpleFeatureType featureType = featureTypes.get(featureTypeName); + String featureName = featureType.getName().getLocalPart(); + String currentSQL = null; + if (isExistFeature(featureType)) { + try { + conn = getConnection(); + if (dropTableMode) { + dropGeometryColumn(conn, featureName, getTargetSchema(), + (featureType).getGeometryDescriptor().getLocalName()); dropTable(conn, featureName); - ArrayList<String> schemaTexts = createNewSchemaTexts(typeBuilder.getFeatureType()); - for (String stmtText : schemaTexts) - { + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType); + for (String stmtText : schemaTexts) { Statement stmt = conn.createStatement(); + currentSQL = stmtText; stmt.execute(stmtText); - stmt.close(); + JDBCUtils.close(stmt); } } else { deleteTable(conn, featureName); } - conn.close(); - } catch (IOException e) - { + } catch (IOException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); - } catch (SQLException e) - { + } catch (SQLException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + if (isProfileMode()) accumulateUpdateTime(); } - } else - { - try - { - Connection conn = targetDataStore.getConnection(Transaction.AUTO_COMMIT); - ArrayList<String> schemaTexts = createNewSchemaTexts(typeBuilder.getFeatureType()); - for (String stmtText : schemaTexts) - { + } else { + try { + conn = getConnection(); + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType); + for (String stmtText : schemaTexts) { Statement stmt = conn.createStatement(); stmt.execute(stmtText); - stmt.close(); + JDBCUtils.close(stmt); } - conn.close(); - } catch (IOException e) - { + } catch (IOException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); - } catch (SQLException e) - { + } catch (SQLException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + if (isProfileMode()) accumulateUpdateTime(); } } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/IndexDgnConvertPostGISJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/IndexDgnConvertPostGISJobContext.java index 4cfd27b..8c612ca 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/IndexDgnConvertPostGISJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/IndexDgnConvertPostGISJobContext.java @@ -13,272 +13,236 @@ import java.util.Iterator; import java.util.List; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.commons.transaction.util.CommonsLoggingLogger; -import org.apache.commons.transaction.util.LoggerFacade; -import org.geotools.data.DataStore; -import org.geotools.data.Transaction; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; -import org.postgresql.util.PSQLException; - import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Envelope; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; -import com.vividsolutions.jts.geom.LinearRing; import com.vividsolutions.jts.geom.Polygon; - import com.ximple.eofms.util.DefaultColorTable; import com.ximple.eofms.util.FeatureTypeBuilderUtil; +import com.ximple.eofms.util.GeometryConverterDecorator; import com.ximple.eofms.util.TPCLIDConverter; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; import com.ximple.eofms.util.TWDDatumConverter; import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.FrammeAttributeData; import com.ximple.io.dgn7.ShapeElement; import com.ximple.io.dgn7.TextElement; import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.transaction.util.CommonsLoggingLogger; +import org.apache.commons.transaction.util.LoggerFacade; +import org.geotools.data.DataStore; +import org.geotools.data.Transaction; +import org.geotools.data.jdbc.JDBCUtils; +import org.geotools.feature.SchemaException; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import org.postgresql.util.PSQLException; -public class IndexDgnConvertPostGISJobContext extends AbstractDgnToPostGISJobContext -{ +public class IndexDgnConvertPostGISJobContext extends AbstractDgnToPostGISJobContext { + static final Log logger = LogFactory.getLog(IndexDgnConvertPostGISJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); - TWD97GeometryConverterDecorator convertDecorator = new TWD97GeometryConverterDecorator(); + static final GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); - private HashMap<FeatureType, ArrayList<Feature>> txFeaturesContext = new HashMap<FeatureType, ArrayList<Feature>>(); + private HashMap<SimpleFeatureType, ArrayList<SimpleFeature>> txFeaturesContext = + new HashMap<SimpleFeatureType, ArrayList<SimpleFeature>>(); - private FeatureTypeBuilder typeBuilderPnt = null; - private FeatureTypeBuilder typeBuilderRect = null; - private FeatureTypeBuilder typeBuilderSmallRect = null; + private HashMap<String, SimpleFeatureType> typesMapping = new HashMap<String, SimpleFeatureType>(); - private FeatureType featureType = null; - private FeatureType featureType2 = null; - private FeatureType featureType3 = null; + private SimpleFeatureType featureType1 = null; + private SimpleFeatureType featureType2 = null; + private SimpleFeatureType featureType3 = null; private boolean dropTableMode = true; private int accumulate = 0; - public IndexDgnConvertPostGISJobContext(String dataPath, DataStore targetDataStore, String targetSchema) - { - super(dataPath, targetDataStore, targetSchema); + public IndexDgnConvertPostGISJobContext(String dataPath, DataStore targetDataStore, String targetSchema, + boolean profileMode, boolean useTransform) { + super(dataPath, targetDataStore, targetSchema, profileMode, useTransform); } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { - if ((!(element instanceof TextElement)) && (!(element instanceof ShapeElement))) - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { + if ((!(element instanceof TextElement)) && (!(element instanceof ShapeElement))) { return; } - if ((element instanceof TextElement)) - { + if ((element instanceof TextElement)) { putTextFeatureCollection((TextElement) element); } - if ((element instanceof ShapeElement)) - { + if ((element instanceof ShapeElement)) { putShapeFeatureCollection((ShapeElement) element); } } - protected void putTextFeatureCollection(TextElement element) throws SchemaException, IllegalAttributeException - { - Feature feature = createFeature(element); - if (feature == null) - { - logger.info("cannot craete feature." + element.toString() + "'" + - element.getText() + "'"); + protected void putTextFeatureCollection(TextElement element) throws SchemaException, IllegalAttributeException { + SimpleFeature feature = createFeature(element); + if (feature == null) { + logger.info("cannot craete feature. " + element.toString() + "'" + + element.getText() + "'"); return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { - txFeaturesContext.put(feature.getFeatureType(), new ArrayList<Feature>()); + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); } - ArrayList<Feature> arrayList = txFeaturesContext.get(feature.getFeatureType()); + ArrayList<SimpleFeature> arrayList = txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); feature = createFeature2(element); - if (feature == null) - { - logger.info("cannot craete feature2." + element.toString() + "'" + - element.getText() + "'"); + if (feature == null) { + logger.info("cannot craete feature2. " + element.toString() + "'" + + element.getText() + "'"); return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { - txFeaturesContext.put(feature.getFeatureType(), new ArrayList<Feature>()); + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); } arrayList = txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); - Feature[] features = createFeature3(element); - if (features == null) - { + SimpleFeature[] features = createFeature3(element); + if (features == null) { logger.info("cannot craete feature3." + element.toString() + "'" + - element.getText() + "'"); + element.getText() + "'"); return; } - if (!txFeaturesContext.containsKey(features[0].getFeatureType())) - { - txFeaturesContext.put(features[0].getFeatureType(), new ArrayList<Feature>()); + if (!txFeaturesContext.containsKey(features[0].getFeatureType())) { + txFeaturesContext.put(features[0].getFeatureType(), new ArrayList<SimpleFeature>()); } arrayList = txFeaturesContext.get(features[0].getFeatureType()); arrayList.addAll(Arrays.asList(features)); accumulate++; - if (accumulate > BATCHSIZE) - { + if (accumulate > BATCHSIZE) { commitTransaction(); } } - protected void putShapeFeatureCollection(ShapeElement element) throws SchemaException, IllegalAttributeException - { - Feature feature = createFeature(element); - if (feature == null) - { + protected void putShapeFeatureCollection(ShapeElement element) throws SchemaException, IllegalAttributeException { + SimpleFeature feature = createFeature(element); + if (feature == null) { Polygon polygon = (Polygon) element.toGeometry(geometryFactory); - if (polygon == null) - { - logger.info("cannot craete feature." + element.toString() + "'" + - "linear is null" + "'"); - } else - { + if (polygon == null) { + logger.info("cannot craete feature. " + element.toString() + "'" + + "linear is null" + "'"); + } else { Coordinate pt = polygon.getEnvelopeInternal().centre(); String id = TPCLIDConverter.CoordinateToTpclId(pt); - logger.info("cannot craete feature." + element.toString() + "'" + - id + "'- from pt=" + pt); + logger.info("cannot craete feature. " + element.toString() + "'" + + id + "'- from pt=" + pt); } return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { - txFeaturesContext.put(feature.getFeatureType(), new ArrayList<Feature>()); + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); } - ArrayList<Feature> arrayList = txFeaturesContext.get(feature.getFeatureType()); + ArrayList<SimpleFeature> arrayList = txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); feature = createFeature2(element); - if (feature == null) - { + if (feature == null) { Polygon polygon = (Polygon) element.toGeometry(geometryFactory); - if (polygon == null) - { + if (polygon == null) { logger.info("cannot craete feature2." + element.toString() + "'" + - "linear is null" + "'"); - } else - { + "linear is null" + "'"); + } else { Coordinate pt = polygon.getEnvelopeInternal().centre(); String id = TPCLIDConverter.CoordinateToTpclId(pt); logger.info("cannot craete feature2." + element.toString() + "'" + - id + "'- from pt=" + pt); + id + "'- from pt=" + pt); } return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { - txFeaturesContext.put(feature.getFeatureType(), new ArrayList<Feature>()); + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); } arrayList = txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); - Feature[] features = createFeature3(element); - if (features == null) - { + SimpleFeature[] features = createFeature3(element); + if (features == null) { Polygon polygon = (Polygon) element.toGeometry(geometryFactory); - if (polygon == null) - { + if (polygon == null) { logger.info("cannot craete feature3." + element.toString() + "'" + - "linear is null" + "'"); - } else - { + "linear is null" + "'"); + } else { Coordinate pt = polygon.getEnvelopeInternal().centre(); String id = TPCLIDConverter.CoordinateToTpclId(pt); logger.info("cannot craete feature3." + element.toString() + "'" + - id + "'- from pt=" + pt); + id + "'- from pt=" + pt); } return; } - if (!txFeaturesContext.containsKey(features[0].getFeatureType())) - { - txFeaturesContext.put(features[0].getFeatureType(), new ArrayList<Feature>()); + if (!txFeaturesContext.containsKey(features[0].getFeatureType())) { + txFeaturesContext.put(features[0].getFeatureType(), new ArrayList<SimpleFeature>()); } arrayList = txFeaturesContext.get(features[0].getFeatureType()); arrayList.addAll(Arrays.asList(features)); accumulate++; - if (accumulate > BATCHSIZE) - { + if (accumulate > BATCHSIZE) { commitTransaction(); } } - public void startTransaction() - { + public void startTransaction() { } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!txFeaturesContext.isEmpty()) - { + if (!txFeaturesContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { } - private void updateDataStore() - { - Iterator<FeatureType> it = txFeaturesContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = it.next(); + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); + + Iterator<SimpleFeatureType> it = txFeaturesContext.keySet().iterator(); + Connection conn = null; + try { + conn = getConnection(); + boolean autoCommit = conn.getAutoCommit(); + conn.setAutoCommit(false); + + while (it.hasNext()) { + SimpleFeatureType featureType = it.next(); logger.debug("Begin Save PostGIS:" + featureType.getTypeName()); String bindingStmt = makePrepareInsertSql(featureType); - ArrayList<Feature> features = txFeaturesContext.get(featureType); - Connection conn = getConnection(); - boolean autoCommit = conn.getAutoCommit(); - conn.setAutoCommit(true); + ArrayList<SimpleFeature> features = txFeaturesContext.get(featureType); PreparedStatement pstmt = conn.prepareStatement(bindingStmt); - for (Feature feature : features) - { + for (SimpleFeature feature : features) { // currentStmt = feature; // Statement stmt = conn.createStatement(); - try - { + try { // stmt.execute(feature); bindFeatureParameters(pstmt, feature); - pstmt.execute(); - } catch (PSQLException e) - { - if (bindingStmt != null) - { + // pstmt.execute(); + pstmt.addBatch(); + } catch (PSQLException e) { + if (bindingStmt != null) { logger.error("Execute:" + bindingStmt); } logger.error(e.getServerErrorMessage()); @@ -296,26 +260,38 @@ } stmt.close(); */ + int[] numUpdates = pstmt.executeBatch(); + for (int i = 0; i < numUpdates.length; i++) { + if (numUpdates[i] == -2) + logger.warn("Execution " + i + ": unknown number of rows updated"); + } + conn.commit(); pstmt.close(); features.clear(); - conn.setAutoCommit(autoCommit); logger.debug("End Save PostGIS:" + featureType.getTypeName()); } accumulate = 0; - } catch (PSQLException e) - { + conn.setAutoCommit(autoCommit); + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } catch (PSQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); logger.error(e.getServerErrorMessage()); logger.error(e.getMessage(), e); - } catch (SQLException e) - { + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); logger.error(e.getMessage(), e); + Exception nextE = e.getNextException(); + if (nextE != null) { + logger.error("getNextException:" + nextE.getMessage(), nextE); + } + } finally { + if (isProfileMode()) this.accumulateUpdateTime(); } } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() { txFeaturesContext.clear(); /* for (FeatureWriter featureWriter : this.featuresWriterContext.values()) @@ -327,264 +303,288 @@ */ } - public FeatureType createFeatureElement(String featureName) throws SchemaException - { - if (typeBuilderRect == null) - { - typeBuilderRect = FeatureTypeBuilderUtil.createNormalIndexFeatureTypeBuilder(featureName); - if (isExistFeature(typeBuilderRect.getFeatureType())) - { - try - { - Connection conn = targetDataStore.getConnection(Transaction.AUTO_COMMIT); - if (dropTableMode) - { - try - { - dropGeometryColumn(conn, featureName, - typeBuilderRect.getFeatureType().getDefaultGeometry().getLocalName()); - } catch (PSQLException e) - { + public void createFeatureElement(String featureName) throws SchemaException { + if (featureType1 == null) { + Connection conn = null; + SimpleFeatureTypeBuilder typeBuilder1 = FeatureTypeBuilderUtil.createNormalIndexFeatureTypeBuilder(featureName); + featureType1 = typeBuilder1.buildFeatureType(); + String currentSQL = null; + + if (isExistFeature(featureType1)) { + try { + conn = getConnection(); + if (dropTableMode) { + try { + dropGeometryColumn(conn, getTargetSchema(), featureName, + (featureType1).getGeometryDescriptor().getLocalName()); + } catch (PSQLException e) { logger.debug(e.getMessage(), e); } - try - { + try { dropTable(conn, featureName); - } catch (PSQLException e) - { + } catch (PSQLException e) { logger.debug(e.getMessage(), e); } - ArrayList<String> schemaTexts = createNewSchemaTexts(typeBuilderRect.getFeatureType()); - for (String stmtText : schemaTexts) - { + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType1); + for (String stmtText : schemaTexts) { Statement stmt = conn.createStatement(); + currentSQL = stmtText; stmt.execute(stmtText); - stmt.close(); + JDBCUtils.close(stmt); } - } else - { + } else { deleteTable(conn, featureName); } - conn.close(); - } catch (IOException e) - { + } catch (IOException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); - } catch (SQLException e) - { + } catch (SQLException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); } - } else - { - try - { - Connection conn = targetDataStore.getConnection(Transaction.AUTO_COMMIT); - ArrayList<String> schemaTexts = createNewSchemaTexts(typeBuilderRect.getFeatureType()); - for (String stmtText : schemaTexts) - { + } else { + try { + conn = getConnection(); + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType1); + for (String stmtText : schemaTexts) { Statement stmt = conn.createStatement(); stmt.execute(stmtText); - stmt.close(); + currentSQL = stmtText; + JDBCUtils.close(stmt); } - conn.close(); - } catch (IOException e) - { + } catch (IOException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); - } catch (SQLException e) - { + } catch (SQLException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); } } } - return typeBuilderRect.getFeatureType(); } - public FeatureType createFeatureElement2(String featureName) throws SchemaException - { - if (typeBuilderPnt == null) - { - typeBuilderPnt = FeatureTypeBuilderUtil.createNormalIndexTextFeatureTypeBuilder(featureName); - if (isExistFeature(typeBuilderPnt.getFeatureType())) - { - try - { - Connection conn = targetDataStore.getConnection(Transaction.AUTO_COMMIT); - if (dropTableMode) - { - dropGeometryColumn(conn, featureName, - typeBuilderPnt.getFeatureType().getDefaultGeometry().getLocalName()); + public void createFeatureElement2(String featureName) throws SchemaException { + if (featureType2 == null) { + Connection conn = null; + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalIndexTextFeatureTypeBuilder(featureName); + featureType2 = typeBuilder.buildFeatureType(); + String currentSQL = null; + if (isExistFeature(featureType2)) { + try { + conn = getConnection(); + if (dropTableMode) { + dropGeometryColumn(conn, getTargetSchema(), featureName, + (featureType2).getGeometryDescriptor().getLocalName()); dropTable(conn, featureName); - ArrayList<String> schemaTexts = createNewSchemaTexts(typeBuilderPnt.getFeatureType()); - for (String stmtText : schemaTexts) - { + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType2); + for (String stmtText : schemaTexts) { Statement stmt = conn.createStatement(); + currentSQL = stmtText; stmt.execute(stmtText); - stmt.close(); + JDBCUtils.close(stmt); } - } else - { + } else { deleteTable(conn, featureName); } - conn.close(); - } catch (IOException e) - { + } catch (IOException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); - } catch (SQLException e) - { + } catch (SQLException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); } - } else - { - try - { - Connection conn = targetDataStore.getConnection(Transaction.AUTO_COMMIT); - ArrayList<String> schemaTexts = createNewSchemaTexts(typeBuilderPnt.getFeatureType()); - for (String stmtText : schemaTexts) - { + } else { + try { + conn = getConnection(); + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType2); + for (String stmtText : schemaTexts) { Statement stmt = conn.createStatement(); + currentSQL = stmtText; stmt.execute(stmtText); - stmt.close(); + JDBCUtils.close(stmt); } - conn.close(); - } catch (IOException e) - { + } catch (IOException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); - } catch (SQLException e) - { + } catch (SQLException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); } } } - return typeBuilderPnt.getFeatureType(); } - public FeatureType createFeatureElement3(String featureName) throws SchemaException - { - if (typeBuilderSmallRect == null) - { - typeBuilderSmallRect = FeatureTypeBuilderUtil.createNormalIndexFeatureTypeBuilder(featureName); - if (isExistFeature(typeBuilderSmallRect.getFeatureType())) - { - try - { - Connection conn = targetDataStore.getConnection(Transaction.AUTO_COMMIT); - if (dropTableMode) - { - try - { - dropGeometryColumn(conn, featureName, - typeBuilderSmallRect.getFeatureType().getDefaultGeometry().getLocalName()); - } catch (PSQLException e) - { + public void createFeatureElement3(String featureName) throws SchemaException { + if (featureType3 == null) { + Connection conn = null; + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalIndexFeatureTypeBuilder(featureName); + featureType3 = typeBuilder.buildFeatureType(); + String currentSQL = null; + if (isExistFeature(featureType3)) { + try { + conn = getConnection(); + if (dropTableMode) { + try { + dropGeometryColumn(conn, getTargetSchema(), featureName, + (featureType3).getGeometryDescriptor().getLocalName()); + } catch (PSQLException e) { logger.debug(e.getMessage(), e); } - try - { + try { dropTable(conn, featureName); - } catch (PSQLException e) - { + } catch (PSQLException e) { logger.debug(e.getMessage(), e); } - ArrayList<String> schemaTexts = createNewSchemaTexts(typeBuilderSmallRect.getFeatureType()); - for (String stmtText : schemaTexts) - { + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType3); + for (String stmtText : schemaTexts) { Statement stmt = conn.createStatement(); + currentSQL = stmtText; stmt.execute(stmtText); - stmt.close(); + JDBCUtils.close(stmt); } - } else - { + } else { deleteTable(conn, featureName); } - conn.close(); - } catch (IOException e) - { + } catch (IOException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); - } catch (SQLException e) - { + } catch (SQLException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); } - } else - { - try - { - Connection conn = targetDataStore.getConnection(Transaction.AUTO_COMMIT); - ArrayList<String> schemaTexts = createNewSchemaTexts(typeBuilderSmallRect.getFeatureType()); - for (String stmtText : schemaTexts) - { + } else { + try { + conn = getConnection(); + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType3); + for (String stmtText : schemaTexts) { Statement stmt = conn.createStatement(); + currentSQL = stmtText; stmt.execute(stmtText); - stmt.close(); + JDBCUtils.close(stmt); } - conn.close(); - } catch (IOException e) - { + } catch (IOException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); - } catch (SQLException e) - { + } catch (SQLException e) { + if (currentSQL != null) + logger.warn("executeSQL:" + currentSQL); logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); } } } - return typeBuilderSmallRect.getFeatureType(); } - public Feature createFeature(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { + if (element instanceof TextElement) { TextElement textElement = (TextElement) element; String tpclid = textElement.getText(); - Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); - Geometry geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] - { - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMinX(), extent.getMinY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMaxX(), extent.getMinY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMaxX(), extent.getMaxY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMinX(), extent.getMaxY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMinX(), extent.getMinY())), - }), null); + if(tpclid.trim().endsWith("")) + { + return null; + } - return featureType.create(new Object[]{ - geom, - extent.getMinX(), - extent.getMinY(), - extent.getMaxX(), - extent.getMaxY(), - tpclid, - colorTable.getColorCode(textElement.getColorIndex()), - textElement.getWeight(), - textElement.getLineStyle() - }); - } else if (element instanceof ShapeElement) - { + Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); + Geometry geom; + if (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826) { + geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMaxX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMaxX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMinY())), + }), null); + } else { + geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMaxX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMaxX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMinY())), + }), null); + } + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + extent.getMinX(), + extent.getMinY(), + extent.getMaxX(), + extent.getMaxY(), + tpclid, + colorTable.getColorCode(textElement.getColorIndex()), + textElement.getWeight(), + textElement.getLineStyle() + }, null); + } else if (element instanceof ShapeElement) { ShapeElement shapeElement = (ShapeElement) element; Geometry geomShape = shapeElement.toGeometry(geometryFactory); Polygon polygon = (Polygon) geomShape; - if (polygon.isRectangle()) - { + if (polygon.isRectangle()) { Envelope bounds = polygon.getEnvelopeInternal(); - if (bounds.getWidth() == TPCLIDConverter.SX1200) - { + if (bounds.getWidth() == TPCLIDConverter.SX1200) { Coordinate center = bounds.centre(); String tpclid = TPCLIDConverter.CoordinateToTpclId(center); - if (tpclid.length() > 5) - { + if ((tpclid == null) || (tpclid.length() == 0)) { + logger.warn("Cannot convert coordinate to tpclid-[" + center.toString() + "]"); + return null; + } + if (tpclid.length() > 5) { tpclid = tpclid.substring(0, 5); } Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); - Geometry geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] - { - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMinX(), extent.getMinY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMaxX(), extent.getMinY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMaxX(), extent.getMaxY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMinX(), extent.getMaxY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMinX(), extent.getMinY())), - }), null); + Geometry geom = null; + try { + geom = (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826 ? + geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMaxX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMaxX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMinY())), + }), null) : + geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMaxX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMaxX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMinY())), + }), null)); + } catch (NullPointerException e) { + logger.warn("TPCLIDConverter has error at [" + tpclid + "]"); + logger.warn(e.getMessage(), e); + return null; + } - return featureType.create(new Object[]{ + return (geom == null ? null : + SimpleFeatureBuilder.build(featureType, new Object[]{ geom, extent.getMinX(), extent.getMinY(), @@ -594,69 +594,66 @@ colorTable.getColorCode(shapeElement.getColorIndex()), shapeElement.getWeight(), shapeElement.getLineStyle() - }); + }, null)); } } } return null; } - public Feature createFeature2(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature createFeature2(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { - Feature feature = null; + if (element instanceof TextElement) { + SimpleFeature feature = null; TextElement txtElement = (TextElement) element; double angle = txtElement.getRotationAngle(); angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(txtElement); Geometry gobj = convertDecorator.toGeometry(geometryFactory); if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - colorTable.getColorCode(txtElement.getColorIndex()), - txtElement.getWeight(), - txtElement.getLineStyle(), - txtElement.getJustification(), - txtElement.getTextHeight(), - txtElement.getTextWidth(), - angle, - txtElement.getText() - }); + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + colorTable.getColorCode(txtElement.getColorIndex()), + txtElement.getWeight(), + txtElement.getLineStyle(), + txtElement.getJustification(), + txtElement.getTextHeight(), + txtElement.getTextWidth(), + angle, + txtElement.getText() + }, null); return feature; - } else if (element instanceof ShapeElement) - { - Feature feature = null; + } else if (element instanceof ShapeElement) { + SimpleFeature feature = null; ShapeElement shapeElement = (ShapeElement) element; double angle = 0.0; Geometry geomShape = shapeElement.toGeometry(geometryFactory); Polygon polygon = (Polygon) geomShape; - if (polygon.isRectangle()) - { + if (polygon.isRectangle()) { Envelope bounds = polygon.getEnvelopeInternal(); - if (bounds.getWidth() == TPCLIDConverter.SX1200) - { + if (bounds.getWidth() == TPCLIDConverter.SX1200) { Coordinate center = bounds.centre(); String tpclid = TPCLIDConverter.CoordinateToTpclId(center); - if (tpclid.length() > 5) - { + if (tpclid.length() > 5) { tpclid = tpclid.substring(0, 5); - Coordinate pos = TWDDatumConverter.fromTM2ToTWD97(new Coordinate(center.x, center.y)); + Coordinate pos = (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826 ? + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(center.x, center.y)) : + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(center.x, center.y))); Geometry gobj = geometryFactory.createPoint(pos); if (gobj != null) - feature = featureType.create(new Object[]{ - gobj, - colorTable.getColorCode(shapeElement.getColorIndex()), - shapeElement.getWeight(), - shapeElement.getLineStyle(), - 0, - 15.0, - 15 * 5, - angle, - tpclid - }); + feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + gobj, + colorTable.getColorCode(shapeElement.getColorIndex()), + shapeElement.getWeight(), + shapeElement.getLineStyle(), + 0, + 15.0, + 15 * 5, + angle, + tpclid + }, null); return feature; } @@ -666,99 +663,126 @@ return null; } - public Feature[] createFeature3(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature[] createFeature3(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { + if (element instanceof TextElement) { TextElement textElement = (TextElement) element; String tpclid = textElement.getText(); - Feature[] result = new Feature[4]; + SimpleFeature[] result = new SimpleFeature[4]; Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); - for (int i = 0; i < 4; i++) - { + 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); + Geometry geom; + if (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826) { + geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + }), null); + } else { + geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + }), null); + } Envelope innerExtent = geom.getEnvelopeInternal(); - result[i] = featureType.create(new Object[]{ - geom, - innerExtent.getMinX(), - innerExtent.getMinY(), - innerExtent.getMaxX(), - innerExtent.getMaxY(), - tpclid + mapSubId, - colorTable.getColorCode(textElement.getColorIndex()), - textElement.getWeight(), - textElement.getLineStyle() - }); + result[i] = SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + innerExtent.getMinX(), + innerExtent.getMinY(), + innerExtent.getMaxX(), + innerExtent.getMaxY(), + tpclid + mapSubId, + colorTable.getColorCode(textElement.getColorIndex()), + textElement.getWeight(), + textElement.getLineStyle() + }, null); } return result; - } else if (element instanceof ShapeElement) - { + } else if (element instanceof ShapeElement) { ShapeElement shapeElement = (ShapeElement) element; Geometry geomShape = shapeElement.toGeometry(geometryFactory); Polygon polygon = (Polygon) geomShape; - if (polygon.isRectangle()) - { + if (polygon.isRectangle()) { Envelope extent = polygon.getEnvelopeInternal(); - if (extent.getWidth() == TPCLIDConverter.SX1200) - { - Feature[] result = new Feature[4]; + if (extent.getWidth() == TPCLIDConverter.SX1200) { + SimpleFeature[] result = new SimpleFeature[4]; Coordinate center = extent.centre(); String tpclid = TPCLIDConverter.CoordinateToTpclId(center); - for (int i = 0; i < 4; i++) - { + if (tpclid.length() > 5) { + tpclid = tpclid.substring(0, 5); + } + 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[] + Geometry geom = (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826 ? + 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); + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + }), null) : + geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + }), null)); Envelope innerExtent = geom.getEnvelopeInternal(); - result[i] = featureType.create(new Object[]{ - geom, - innerExtent.getMinX(), - innerExtent.getMinY(), - innerExtent.getMaxX(), - innerExtent.getMaxY(), - tpclid + mapSubId, - colorTable.getColorCode(shapeElement.getColorIndex()), - shapeElement.getWeight(), - shapeElement.getLineStyle() - }); + result[i] = SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + innerExtent.getMinX(), + innerExtent.getMinY(), + innerExtent.getMaxX(), + innerExtent.getMaxY(), + tpclid + mapSubId, + colorTable.getColorCode(shapeElement.getColorIndex()), + shapeElement.getWeight(), + shapeElement.getLineStyle() + }, null); } return result; @@ -769,85 +793,69 @@ return null; } - private Feature createFeature(Element element) throws SchemaException, IllegalAttributeException - { - if (featureType == null) - { + private SimpleFeature createFeature(Element element) throws SchemaException, IllegalAttributeException { + if (featureType1 == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } - featureType = createFeatureElement(dgnname.toLowerCase()); + createFeatureElement(dgnname.toLowerCase()); } - return createFeature(featureType, element); + return createFeature(featureType1, element); } - private Feature createFeature2(Element element) throws SchemaException, IllegalAttributeException - { - if (featureType2 == null) - { + private SimpleFeature createFeature2(Element element) throws SchemaException, IllegalAttributeException { + if (featureType2 == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } dgnname = dgnname + "_p"; - featureType2 = createFeatureElement2(dgnname.toLowerCase()); + createFeatureElement2(dgnname.toLowerCase()); } return createFeature2(featureType2, element); } - private Feature[] createFeature3(Element element) throws SchemaException, IllegalAttributeException - { - if (featureType3 == null) - { + private SimpleFeature[] createFeature3(Element element) throws SchemaException, IllegalAttributeException { + if (featureType3 == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } dgnname = dgnname + "_s"; - featureType3 = createFeatureElement3(dgnname.toLowerCase()); + createFeatureElement3(dgnname.toLowerCase()); } return createFeature3(featureType3, element); } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } return null; } - public Log getLogger() - { + public Log getLogger() { return logger; } - public boolean isDropTableMode() - { + public boolean isDropTableMode() { return dropTableMode; } - public void setDropTableMode(boolean dropTableMode) - { + public void setDropTableMode(boolean dropTableMode) { this.dropTableMode = dropTableMode; } - public void clearOutputDatabase() - { + public void clearOutputDatabase() { } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleConvertGeoServerContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleConvertGeoServerContext.java new file mode 100644 index 0000000..96ace1e --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleConvertGeoServerContext.java @@ -0,0 +1,10 @@ +package com.ximple.eofms.jobs.context.postgis; + +import org.geotools.data.DataStore; + +public class OracleConvertGeoServerContext extends OracleConvertPostGISJobContext { + + public OracleConvertGeoServerContext(String dataPath, DataStore pgDS, String targetSchema, String filterConfig, boolean profileMode, boolean useTransform) { + super(dataPath, pgDS, targetSchema, filterConfig, profileMode, useTransform); + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleConvertPostGISJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleConvertPostGISJobContext.java index a7388e1..46ebe1f 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleConvertPostGISJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleConvertPostGISJobContext.java @@ -5,6 +5,7 @@ import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URL; +import java.sql.BatchUpdateException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; @@ -14,50 +15,45 @@ import java.util.HashMap; import java.util.Iterator; -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.xmlrules.DigesterLoader; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.util.Assert; +import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; +import com.ximple.eofms.filter.CreateFeatureTypeEventListener; +import com.ximple.eofms.filter.ElementDispatcher; +import com.ximple.eofms.filter.FeatureTypeEvent; +import com.ximple.eofms.jobs.OracleElementLogger; +import com.ximple.eofms.util.ElementDigesterUtils; +import com.ximple.io.dgn7.ComplexElement; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.FrammeAttributeData; +import org.apache.commons.digester3.Digester; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.transaction.util.CommonsLoggingLogger; import org.apache.commons.transaction.util.LoggerFacade; import org.geotools.data.DataStore; import org.geotools.data.Transaction; -import org.geotools.data.postgis.PostgisDataStoreFactory; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; +import org.geotools.data.jdbc.JDBCUtils; import org.geotools.feature.SchemaException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; import org.postgresql.util.PSQLException; import org.quartz.JobExecutionContext; import org.xml.sax.SAXException; -import com.vividsolutions.jts.util.Assert; - -import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; -import com.ximple.eofms.filter.CreateFeatureTypeEventListener; -import com.ximple.eofms.filter.ElementDispatcher; -import com.ximple.eofms.filter.FeatureTypeEvent; -import com.ximple.eofms.jobs.OracleElementLogger; -import com.ximple.io.dgn7.ComplexElement; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; - public class OracleConvertPostGISJobContext extends AbstractOracleToPostGISJobContext - implements CreateFeatureTypeEventListener -{ + implements CreateFeatureTypeEventListener { static Log logger = LogFactory.getLog(OracleConvertPostGISJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static PostgisDataStoreFactory dataStoreFactory = new PostgisDataStoreFactory(); + // static PostgisNGDataStoreFactory dataStoreFactory = new PostgisNGDataStoreFactory(); private OracleElementLogger elmLogger = null; - static - { - try - { + static { + try { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); - } catch (SQLException e) - { + } catch (SQLException e) { Assert.shouldNeverReachHere(e.getMessage()); } } @@ -66,7 +62,7 @@ private ElementDispatcher elementDispatcher; - private HashMap<FeatureType, ArrayList<Feature>> txFeaturesContext = new HashMap<FeatureType, ArrayList<Feature>>(); + private HashMap<SimpleFeatureType, ArrayList<SimpleFeature>> txFeaturesContext = new HashMap<SimpleFeatureType, ArrayList<SimpleFeature>>(); private JobExecutionContext executionContext; @@ -75,143 +71,118 @@ private boolean dropTableMode = true; private int accumulate = 0; - public OracleConvertPostGISJobContext(String dataPath, DataStore pgDS, String targetSchema, String filterConfig) - { - super(dataPath, pgDS, targetSchema); + public OracleConvertPostGISJobContext(String dataPath, DataStore pgDS, String targetSchema, String filterConfig, + boolean profileMode, boolean useTransform) { + super(dataPath, pgDS, targetSchema, profileMode, useTransform); _filterConfig = filterConfig; elementDispatcher = createElementDispatcher(); elementDispatcher.addCreateFeatureTypeEventListener(this); // txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); } - private ElementDispatcher createElementDispatcher() - { - try - { - URL rulesURL = ElementDispatcher.class.getResource("ElementDispatcherRules.xml"); - assert rulesURL != null; - Digester digester = DigesterLoader.createDigester(rulesURL); + private ElementDispatcher createElementDispatcher() { + try { URL filterURL = null; - if (_filterConfig != null) - { + if (_filterConfig != null) { File config = new File(_filterConfig); - if (config.exists()) - { + if (config.exists()) { filterURL = config.toURI().toURL(); } } - if (filterURL == null) - { + if (filterURL == null) { // config = new File("conf/DefaultConvertShpFilter.xml"); filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); } assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); return (ElementDispatcher) digester.parse(filterURL); - } catch (UnsupportedEncodingException e) - { + } catch (UnsupportedEncodingException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (SAXException e) - { + } catch (SAXException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); } } - public void putFeatureCollection(Element element) - { + public void putFeatureCollection(Element element) { assert elementDispatcher != null; - // �P�_�O�_�ũM���� - Feature feature = elementDispatcher.execute(element, true); - if (feature == null) - { + // 判斷是否符和條件 + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { boolean isEmptySize = false; FrammeAttributeData linkage = - AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); logger.warn("Unknown Element:" + element.getElementType().toString() + - ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + - (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); - if (element instanceof ComplexElement) - { + if (element instanceof ComplexElement) { ComplexElement complex = (ComplexElement) element; logger.warn("----Complex Element size=" + complex.size() + ":" + - (linkage == null ? "NULL" : (linkage.getUfid()))); + (linkage == null ? "NULL" : (linkage.getUfid()))); if (complex.size() == 0) isEmptySize = true; } - if (getElementLogging() && (!isEmptySize)) - { + if (getElementLogging() && (!isEmptySize)) { getElementLogger().logElement(element, getCurrentSchema()); } return; } - if (feature.getDefaultGeometry().isEmpty()) - { + if (((Geometry)feature.getDefaultGeometry()).isEmpty()) { boolean isEmptySize = false; FrammeAttributeData linkage = - AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); logger.warn("Empty Geom Element:" + element.getElementType().toString() + - ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + - (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); - if (element instanceof ComplexElement) - { + if (element instanceof ComplexElement) { ComplexElement complex = (ComplexElement) element; logger.warn("----Complex Element size=" + complex.size() + ":" + - (linkage == null ? "NULL" : (linkage.getUfid()))); + (linkage == null ? "NULL" : (linkage.getUfid()))); if (complex.size() == 0) isEmptySize = true; } - if (getElementLogging() && (!isEmptySize)) - { + if (getElementLogging() && (!isEmptySize)) { getElementLogger().logElement(element, getCurrentSchema()); } return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { - txFeaturesContext.put(feature.getFeatureType(), new ArrayList<Feature>()); + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); } - ArrayList<Feature> arrayList = txFeaturesContext.get(feature.getFeatureType()); + ArrayList<SimpleFeature> arrayList = txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); accumulate++; - if (accumulate > BATCHSIZE) - { + if (accumulate > BATCHSIZE) { commitTransaction(); } } - public void startTransaction() - { + public void startTransaction() { } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!txFeaturesContext.isEmpty()) - { + if (!txFeaturesContext.isEmpty()) { updateDataStore(); } @@ -219,202 +190,197 @@ this.getElementLogger().flashLogging(); } - public void rollbackTransaction() - { + public void rollbackTransaction() { } - public void resetFeatureContext() - { + public void resetFeatureContext() { txFeaturesContext.clear(); } - private void updateDataStore() - { - Iterator<FeatureType> it = txFeaturesContext.keySet().iterator(); - try - { - Connection conn = getConnection(); + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); + Iterator<SimpleFeatureType> it = txFeaturesContext.keySet().iterator(); + Connection conn = null; + try { + conn = getConnection(); boolean autoCommit = conn.getAutoCommit(); - conn.setAutoCommit(true); - while (it.hasNext()) - { - FeatureType featureType = it.next(); + conn.setAutoCommit(false); + + while (it.hasNext()) { + SimpleFeatureType featureType = it.next(); logger.debug("Begin Save into PostGIS:" + featureType.getTypeName()); + int batchCount = 0; String bindingStmt = makePrepareInsertSql(featureType); - ArrayList<Feature> features = txFeaturesContext.get(featureType); + ArrayList<SimpleFeature> features = txFeaturesContext.get(featureType); PreparedStatement pstmt = conn.prepareStatement(bindingStmt); - for (Feature feature : features) - { - try - { + for (SimpleFeature feature : features) { + try { // stmt.execute(feature); bindFeatureParameters(pstmt, feature); - pstmt.execute(); - } catch (PSQLException e) - { - if (bindingStmt != null) - { + // pstmt.executeUpdate(); + pstmt.addBatch(); + } catch (PSQLException e) { + if (bindingStmt != null) { logger.error("Execute:" + bindingStmt); } logger.error(e.getServerErrorMessage()); logger.error(e.getMessage(), e); - } catch (ClassCastException e) - { - if (bindingStmt != null) - { + } catch (NullPointerException e) { + if (bindingStmt != null) { logger.error("Execute:" + bindingStmt); } - for (int i = 0; i < feature.getNumberOfAttributes(); i++) - { + logger.error(feature.toString()); + logger.error(e.getMessage(), e); + } catch (ClassCastException e) { + if (bindingStmt != null) { + logger.error("Execute:" + bindingStmt); + } + for (int i = 0; i < feature.getAttributeCount(); i++) { logger.info("attr[" + i + "]-" + ((feature.getAttribute(i) == null) ? " NULL" : - feature.getAttribute(i).toString())); + feature.getAttribute(i).toString())); } logger.error(e.getMessage(), e); } + batchCount++; } + + int[] numUpdates = pstmt.executeBatch(); + for (int i = 0; i < numUpdates.length; i++) { + if (numUpdates[i] == -2) + logger.warn("Execution " + i + ": unknown number of rows updated"); + } + conn.commit(); pstmt.close(); features.clear(); logger.debug("End Save into PostGIS:" + featureType.getTypeName()); } conn.setAutoCommit(autoCommit); + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); accumulate = 0; - } catch (SQLException e) - { + } catch (BatchUpdateException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); logger.error(e.getMessage(), e); + SQLException ex; + while ((ex = e.getNextException()) != null) { + // logger.warn(ex.getMessage(), ex); + logger.warn(ex.getMessage()); + } + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public JobExecutionContext getExecutionContext() - { + public JobExecutionContext getExecutionContext() { return executionContext; } - public void setExecutionContext(JobExecutionContext context) - { + public void setExecutionContext(JobExecutionContext context) { executionContext = context; } /** - * �����]�Ƽg�J�� + * �����]�Ƽg�J�� * - * @throws IOException IO�o�Ϳ��~ + * @throws IOException IO�o�Ϳ�~ */ - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { } - protected OracleElementLogger getElementLogger() - { - if (elmLogger == null) - { + protected OracleElementLogger getElementLogger() { + if (elmLogger == null) { elmLogger = new OracleElementLogger(getOracleConnection()); elmLogger.setDataPath(this.getDataPath()); } return elmLogger; } - public String getCurrentSchema() - { + public String getCurrentSchema() { return currentSchema; } - public void setCurrentSchema(String querySchema) - { + public void setCurrentSchema(String querySchema) { this.currentSchema = querySchema; this.schemaChanged = true; } - protected Log getLogger() - { + protected Log getLogger() { return logger; } - public boolean isDropTableMode() - { + public boolean isDropTableMode() { return dropTableMode; } - public void setDropTableMode(boolean dropTableMode) - { + public void setDropTableMode(boolean dropTableMode) { this.dropTableMode = dropTableMode; } - public void createFeatureTypeOccurred(FeatureTypeEvent evt) - { - try - { + public void createFeatureTypeOccurred(FeatureTypeEvent evt) { + try { createOrClearFeatureDataTable(evt.getFeatureType()); - } catch (SchemaException e) - { + } catch (SchemaException e) { logger.warn(e.getMessage(), e); } } - protected void createOrClearFeatureDataTable(FeatureType featureType) throws SchemaException - { + protected void createOrClearFeatureDataTable(SimpleFeatureType featureType) throws SchemaException { String featureName = featureType.getTypeName(); - if (isExistFeature(featureType)) - { - try - { - Connection conn = targetDataStore.getConnection(Transaction.AUTO_COMMIT); - if (dropTableMode) - { + Connection conn = null; + if (isExistFeature(featureType)) { + try { + conn = getConnection(); + if (dropTableMode) { dropGeometryColumn(conn, getTargetSchema(), featureName, - featureType.getDefaultGeometry().getLocalName()); + (featureType).getGeometryDescriptor().getName().getLocalPart()); dropTable(conn, getTargetSchema(), featureName); - ArrayList<String> schemaTexts = createNewSchemaTexts(featureType); - for (String stmtText : schemaTexts) - { + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType); + for (String stmtText : schemaTexts) { Statement stmt = conn.createStatement(); stmt.execute(stmtText); - stmt.close(); + JDBCUtils.close(stmt); } - } else - { + } else { deleteTable(conn, getTargetSchema(), featureName); } - conn.close(); - } catch (IOException e) - { + } catch (IOException e) { logger.warn(e.getMessage(), e); - } catch (SQLException e) - { + } catch (SQLException e) { logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); } - } else - { + } else { String tempStmt = null; - try - { - Connection conn = targetDataStore.getConnection(Transaction.AUTO_COMMIT); - ArrayList<String> schemaTexts = createNewSchemaTexts(featureType); - for (String stmtText : schemaTexts) - { + try { + conn = getConnection(); + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType); + for (String stmtText : schemaTexts) { Statement stmt = conn.createStatement(); tempStmt = stmtText; stmt.execute(stmtText); stmt.close(); } - conn.close(); - } catch (IOException e) - { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } catch (IOException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); logger.warn("RUN--" + tempStmt); logger.warn(e.getMessage(), e); - } catch (SQLException e) - { + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); logger.warn("RUN--" + tempStmt); logger.warn(e.getMessage(), e); } } } - public boolean isSchemaChanged() - { + public boolean isSchemaChanged() { return schemaChanged; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleIncrementPostGISJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleIncrementPostGISJobContext.java new file mode 100644 index 0000000..524976b --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleIncrementPostGISJobContext.java @@ -0,0 +1,420 @@ +package com.ximple.eofms.jobs.context.postgis; + +import java.io.File; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.sql.BatchUpdateException; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; + +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.util.Assert; +import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; +import com.ximple.eofms.filter.CreateFeatureTypeEventListener; +import com.ximple.eofms.filter.ElementDispatcher; +import com.ximple.eofms.filter.FeatureTypeEvent; +import com.ximple.eofms.jobs.OracleElementLogger; +import com.ximple.eofms.util.ElementDigesterUtils; +import com.ximple.io.dgn7.ComplexElement; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.FrammeAttributeData; +import org.apache.commons.digester3.Digester; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.transaction.util.CommonsLoggingLogger; +import org.apache.commons.transaction.util.LoggerFacade; +import org.geotools.data.DataStore; +import org.geotools.data.Transaction; +import org.geotools.data.jdbc.JDBCUtils; +import org.geotools.feature.SchemaException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import org.postgresql.util.PSQLException; +import org.quartz.JobExecutionContext; +import org.xml.sax.SAXException; + +public class OracleIncrementPostGISJobContext extends AbstractOracleToPostGISJobContext + implements CreateFeatureTypeEventListener { + + static Log logger = LogFactory.getLog(OracleIncrementPostGISJobContext.class); + static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); + + // static PostgisNGDataStoreFactory dataStoreFactory = new PostgisNGDataStoreFactory(); + + private OracleElementLogger elmLogger = null; + + static { + try { + DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); + } catch (SQLException e) { + Assert.shouldNeverReachHere(e.getMessage()); + } + } + + private String _filterConfig; + + private ElementDispatcher elementDispatcher; + + private HashMap<SimpleFeatureType, ArrayList<SimpleFeature>> txFeaturesContext = new HashMap<SimpleFeatureType, ArrayList<SimpleFeature>>(); + + private JobExecutionContext executionContext; + + private String currentSchema = null; + private boolean schemaChanged = false; + private boolean dropTableMode = true; + private int accumulate = 0; + + public static class ElementTransactionContext { + public int transcationType; + public short cid; + public int oid; + public short compid; + public short occid; + public int taskid; + public Element element; + public int result; + }; + + public OracleIncrementPostGISJobContext(String dataPath, DataStore pgDS, String targetSchema, String filterConfig, + boolean profileMode, boolean useTransform) { + super(dataPath, pgDS, targetSchema, profileMode, useTransform); + _filterConfig = filterConfig; + elementDispatcher = createElementDispatcher(); + elementDispatcher.addCreateFeatureTypeEventListener(this); + // txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); + } + + private ElementDispatcher createElementDispatcher() { + try { + URL filterURL = null; + if (_filterConfig != null) { + File config = new File(_filterConfig); + if (config.exists()) { + filterURL = config.toURI().toURL(); + } + } + if (filterURL == null) { + // config = new File("conf/DefaultConvertShpFilter.xml"); + filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); + // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); + } + assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); + return (ElementDispatcher) digester.parse(filterURL); + } catch (UnsupportedEncodingException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } catch (MalformedURLException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } catch (IOException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } catch (SAXException e) { + logger.info(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); + } + } + + /** + * STATUS 欄位 :0:新增 2:編輯 3:刪除設備 4:刪除元件 + * @param context + */ + public void putFeatureCollection(ElementTransactionContext context) { + assert elementDispatcher != null; + if (context == null) { + logger.warn("putFeatureCollection context is null"); + return; + } + if (context.transcationType == 0) { + // insert Element + putFeatureCollection(context.element); + } else if (context.transcationType == 2) { + // Update Element + } else if (context.transcationType == 3) { + // Remove Whole Feature + } else if (context.transcationType == 4) { + // Remove Feature Part + } + } + + protected void putFeatureCollection(Element element) { + assert elementDispatcher != null; + // 判斷是否符和條件 + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { + boolean isEmptySize = false; + FrammeAttributeData linkage = + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + logger.warn("Unknown Element:" + element.getElementType().toString() + + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); + + if (element instanceof ComplexElement) { + ComplexElement complex = (ComplexElement) element; + logger.warn("----Complex Element size=" + complex.size() + ":" + + (linkage == null ? "NULL" : (linkage.getUfid()))); + if (complex.size() == 0) + isEmptySize = true; + } + + if (getElementLogging() && (!isEmptySize)) { + getElementLogger().logElement(element, getCurrentSchema()); + } + return; + } + + if (((Geometry)feature.getDefaultGeometry()).isEmpty()) { + boolean isEmptySize = false; + FrammeAttributeData linkage = + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + logger.warn("Empty Geom Element:" + element.getElementType().toString() + + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); + + if (element instanceof ComplexElement) { + ComplexElement complex = (ComplexElement) element; + logger.warn("----Complex Element size=" + complex.size() + ":" + + (linkage == null ? "NULL" : (linkage.getUfid()))); + if (complex.size() == 0) + isEmptySize = true; + } + + if (getElementLogging() && (!isEmptySize)) { + getElementLogger().logElement(element, getCurrentSchema()); + } + return; + } + + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); + } + ArrayList<SimpleFeature> arrayList = txFeaturesContext.get(feature.getFeatureType()); + arrayList.add(feature); + accumulate++; + if (accumulate > BATCHSIZE) { + commitTransaction(); + } + } + + public void startTransaction() { + } + + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { + logger.debug("Transaction size = " + txFeaturesContext.size()); + //txFeaturesContext.commitTransaction(); + } else { + logger.debug("Transaction is empty."); + } + + if (!txFeaturesContext.isEmpty()) { + updateDataStore(); + } + + if (this.getElementLogger() != null) + this.getElementLogger().flashLogging(); + } + + public void rollbackTransaction() { + } + + public void resetFeatureContext() { + txFeaturesContext.clear(); + } + + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); + Iterator<SimpleFeatureType> it = txFeaturesContext.keySet().iterator(); + Connection conn = null; + try { + conn = getConnection(); + boolean autoCommit = conn.getAutoCommit(); + conn.setAutoCommit(false); + + while (it.hasNext()) { + SimpleFeatureType featureType = it.next(); + logger.debug("Begin Save into PostGIS:" + featureType.getTypeName()); + + int batchCount = 0; + String bindingStmt = makePrepareInsertSql(featureType); + ArrayList<SimpleFeature> features = txFeaturesContext.get(featureType); + PreparedStatement pstmt = conn.prepareStatement(bindingStmt); + + for (SimpleFeature feature : features) { + try { + // stmt.execute(feature); + bindFeatureParameters(pstmt, feature); + // pstmt.executeUpdate(); + pstmt.addBatch(); + } catch (PSQLException e) { + if (bindingStmt != null) { + logger.error("Execute:" + bindingStmt); + } + logger.error(e.getServerErrorMessage()); + logger.error(e.getMessage(), e); + } catch (NullPointerException e) { + if (bindingStmt != null) { + logger.error("Execute:" + bindingStmt); + } + logger.error(feature.toString()); + logger.error(e.getMessage(), e); + } catch (ClassCastException e) { + if (bindingStmt != null) { + logger.error("Execute:" + bindingStmt); + } + for (int i = 0; i < feature.getAttributeCount(); i++) { + logger.info("attr[" + i + "]-" + ((feature.getAttribute(i) == null) ? " NULL" : + feature.getAttribute(i).toString())); + } + logger.error(e.getMessage(), e); + } + batchCount++; + } + + int[] numUpdates = pstmt.executeBatch(); + for (int i = 0; i < numUpdates.length; i++) { + if (numUpdates[i] == -2) + logger.warn("Execution " + i + ": unknown number of rows updated"); + } + conn.commit(); + + pstmt.close(); + features.clear(); + logger.debug("End Save into PostGIS:" + featureType.getTypeName()); + } + conn.setAutoCommit(autoCommit); + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + accumulate = 0; + } catch (BatchUpdateException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.error(e.getMessage(), e); + SQLException ex; + while ((ex = e.getNextException()) != null) { + // logger.warn(ex.getMessage(), ex); + logger.warn(ex.getMessage()); + } + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); + } + } + + public JobExecutionContext getExecutionContext() { + return executionContext; + } + + public void setExecutionContext(JobExecutionContext context) { + executionContext = context; + } + + /** + * �����]�Ƽg�J�� + * + * @throws IOException IO�o�Ϳ�~ + */ + public void closeFeatureWriter() throws IOException { + } + + protected OracleElementLogger getElementLogger() { + if (elmLogger == null) { + elmLogger = new OracleElementLogger(getOracleConnection()); + elmLogger.setDataPath(this.getDataPath()); + } + return elmLogger; + } + + public String getCurrentSchema() { + return currentSchema; + } + + public void setCurrentSchema(String querySchema) { + this.currentSchema = querySchema; + this.schemaChanged = true; + } + + protected Log getLogger() { + return logger; + } + + public boolean isDropTableMode() { + return dropTableMode; + } + + public void setDropTableMode(boolean dropTableMode) { + this.dropTableMode = dropTableMode; + } + + public void createFeatureTypeOccurred(FeatureTypeEvent evt) { + try { + createOrClearFeatureDataTable(evt.getFeatureType()); + } catch (SchemaException e) { + logger.warn(e.getMessage(), e); + } + } + + protected void createOrClearFeatureDataTable(SimpleFeatureType featureType) throws SchemaException { + String featureName = featureType.getTypeName(); + Connection conn = null; + if (isExistFeature(featureType)) { + try { + conn = getConnection(); + if (dropTableMode) { + dropGeometryColumn(conn, getTargetSchema(), featureName, + (featureType).getGeometryDescriptor().getName().getLocalPart()); + dropTable(conn, getTargetSchema(), featureName); + + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType); + for (String stmtText : schemaTexts) { + Statement stmt = conn.createStatement(); + stmt.execute(stmtText); + JDBCUtils.close(stmt); + } + } else { + deleteTable(conn, getTargetSchema(), featureName); + } + } catch (IOException e) { + logger.warn(e.getMessage(), e); + } catch (SQLException e) { + logger.warn(e.getMessage(), e); + } finally { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } + } else { + String tempStmt = null; + try { + conn = getConnection(); + ArrayList<String> schemaTexts = createNewSchemaTexts(conn, featureType); + for (String stmtText : schemaTexts) { + Statement stmt = conn.createStatement(); + tempStmt = stmtText; + stmt.execute(stmtText); + stmt.close(); + } + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + } catch (IOException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); + logger.warn("RUN--" + tempStmt); + logger.warn(e.getMessage(), e); + } catch (SQLException e) { + JDBCUtils.close(conn, Transaction.AUTO_COMMIT, e); + logger.warn("RUN--" + tempStmt); + logger.warn(e.getMessage(), e); + } + } + } + + public boolean isSchemaChanged() { + return schemaChanged; + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/AbstractDgnToShapefileJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/AbstractDgnToShapefileJobContext.java index 395adc2..5caa4e9 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/AbstractDgnToShapefileJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/AbstractDgnToShapefileJobContext.java @@ -2,11 +2,10 @@ import com.ximple.eofms.jobs.context.AbstractDgnFileJobContext; -public abstract class AbstractDgnToShapefileJobContext extends AbstractDgnFileJobContext -{ - public AbstractDgnToShapefileJobContext(String dataPath) - { - super(dataPath); +public abstract class AbstractDgnToShapefileJobContext extends AbstractDgnFileJobContext { + public AbstractDgnToShapefileJobContext(String dataPath, boolean profileMode, + boolean useTransform) { + super(dataPath, profileMode, useTransform); } public abstract String getDataOutPath(); diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/DummyFeatureConvertShpJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/DummyFeatureConvertShpJobContext.java index 79a3fd7..33313b2 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/DummyFeatureConvertShpJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/DummyFeatureConvertShpJobContext.java @@ -10,9 +10,20 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.TimeZone; -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.xmlrules.DigesterLoader; +import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatcher; +import com.ximple.eofms.filter.TypeCompIdDispatchableFilter; +import com.ximple.eofms.filter.TypeCompLevelIdDispatchableFilter; +import com.ximple.eofms.filter.TypeIdDispatchableFilter; +import com.ximple.eofms.util.ElementDigesterUtils; +import com.ximple.io.dgn7.ComplexElement; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.FrammeAttributeData; +import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.digester3.Digester; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.transaction.memory.PessimisticMapWrapper; @@ -21,37 +32,20 @@ import org.geotools.data.FeatureWriter; import org.geotools.data.Transaction; import org.geotools.data.shapefile.ShapefileDataStore; -import org.geotools.data.shapefile.indexed.IndexedShapefileDataStore; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; import org.geotools.feature.SchemaException; -import org.geotools.feature.SimpleFeature; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; import org.xml.sax.SAXException; -import com.vividsolutions.jts.geom.GeometryFactory; - -import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; -import com.ximple.eofms.filter.ElementDispatchableFilter; -import com.ximple.eofms.filter.ElementDispatcher; -import com.ximple.eofms.filter.TypeCompIdDispatchableFilter; -import com.ximple.eofms.filter.TypeCompLevelIdDispatchableFilter; -import com.ximple.eofms.filter.TypeIdDispatchableFilter; -import com.ximple.io.dgn7.ComplexElement; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.io.dgn7.UserAttributeData; - -public class DummyFeatureConvertShpJobContext extends AbstractDgnToShapefileJobContext -{ +public class DummyFeatureConvertShpJobContext extends AbstractDgnToShapefileJobContext { static final Log logger = LogFactory.getLog(DummyFeatureConvertShpJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); static final String SHPOUTPATH = "shpout"; private String dataOut = null; - private HashMap<String, ArrayList<Feature>> featuresContext = new HashMap<String, ArrayList<Feature>>(); + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; @@ -60,78 +54,63 @@ private String _filterConfig; private boolean withIndex = false; - public DummyFeatureConvertShpJobContext(String dataPath, String filterConfig) - { - super(dataPath); + public DummyFeatureConvertShpJobContext(String dataPath, String filterConfig, boolean profileMode, + boolean useTransform) { + super(dataPath, profileMode, useTransform); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); _filterConfig = filterConfig; elementDispatcher = createElementDispatcher(); } - private ElementDispatcher createElementDispatcher() - { - try - { - URL rulesURL = ElementDispatcher.class.getResource("ElementDispatcherRules.xml"); - assert rulesURL != null; - Digester digester = DigesterLoader.createDigester(rulesURL); + private ElementDispatcher createElementDispatcher() { + try { URL filterURL = null; - if (_filterConfig != null) - { + if (_filterConfig != null) { File config = new File(_filterConfig); - if (config.exists()) - { + if (config.exists()) { filterURL = config.toURI().toURL(); } } - if (filterURL == null) - { + if (filterURL == null) { // config = new File("conf/DefaultConvertShpFilter.xml"); filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); } assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); return (ElementDispatcher) digester.parse(filterURL); - } catch (UnsupportedEncodingException e) - { + } catch (UnsupportedEncodingException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (SAXException e) - { + } catch (SAXException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); } } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { assert elementDispatcher != null; - if (element == null) - { + if (element == null) { logger.warn("Unknown Element:" + null); return; } - // �P�_�O�_�ũM���� - Feature feature = elementDispatcher.execute(element, true); - if (feature == null) - { + // �P�_�O�_�ũM��� + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { FrammeAttributeData linkage = - AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); logger.warn("Unknown Element:" + element.getElementType().toString() + - ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + - (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); - if (element instanceof ComplexElement) - { + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); + if (element instanceof ComplexElement) { ComplexElement complex = (ComplexElement) element; logger.warn("----Complex Element size=" + complex.size()); } @@ -139,135 +118,113 @@ return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); } - public void startTransaction() - { + public void startTransaction() { assert elementDispatcher != null; - for (ElementDispatchableFilter filter : elementDispatcher.getRules()) - { - if (filter instanceof TypeCompIdDispatchableFilter) - { + for (ElementDispatchableFilter filter : elementDispatcher.getRules()) { + if (filter instanceof TypeCompIdDispatchableFilter) { ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); - } else if (filter instanceof TypeCompLevelIdDispatchableFilter) - { - ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); - } else if (filter instanceof TypeIdDispatchableFilter) - { - ((TypeCompIdDispatchableFilter) filter).getCreateStrategy(); + } else if (filter instanceof TypeCompLevelIdDispatchableFilter) { + ((TypeCompLevelIdDispatchableFilter) filter).getCreateStrategy(); + } else if (filter instanceof TypeIdDispatchableFilter) { + ((TypeIdDispatchableFilter) filter).getCreateStrategy(); } } } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); File sfile = new File(getDataOutPath() + File.separator + featureType.getTypeName()); logger.debug("Begin Save shapefile:" + sfile.toURI()); FeatureWriter writer; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { - ShapefileDataStore shapefileDataStore = null; + } else { boolean existFile = sfile.exists(); - if (!withIndex) - { - shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL(), - true, Charset.forName("UTF-8")); - } else - { - shapefileDataStore = new IndexedShapefileDataStore(sfile.toURI().toURL(), - null, true, true, IndexedShapefileDataStore.TREE_QIX, Charset.forName("UTF-8")); + ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL()); + /* + if(namespace != null) { + store.setNamespaceURI(namespace.toString()); } + */ + shapefileDataStore.setMemoryMapped(true); + // store.setBufferCachingEnabled(cacheMemoryMaps); + shapefileDataStore.setCharset(Charset.forName("UTF-8")); + shapefileDataStore.setTimeZone(TimeZone.getDefault()); + shapefileDataStore.setIndexed(withIndex); + shapefileDataStore.setIndexCreationEnabled(withIndex); - if (!existFile) - { + if (!existFile) { shapefileDataStore.createSchema(featureType); writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(), - Transaction.AUTO_COMMIT); - } else - { + Transaction.AUTO_COMMIT); + } else { writer = shapefileDataStore.getFeatureWriterAppend(featureType.getTypeName(), - Transaction.AUTO_COMMIT); + Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } - ArrayList<Feature> features = featuresContext.get(featureType); + ArrayList<SimpleFeature> features = featuresContext.get(featureType); Iterator itFeature = features.iterator(); - while (itFeature.hasNext()) - { - Feature feature = (Feature) itFeature.next(); - ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); } //writer.close(); logger.debug("End Save shapefile:" + sfile.toURI()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public String getDataOutPath() - { - if (dataOut == null) - { + public String getDataOutPath() { + if (dataOut == null) { File outPath = new File(getDataPath(), SHPOUTPATH); - if (!outPath.exists()) - { + if (!outPath.exists()) { outPath.mkdir(); - } else if (!outPath.isDirectory()) - { + } else if (!outPath.isDirectory()) { outPath.mkdir(); } dataOut = outPath.toString(); @@ -275,27 +232,22 @@ return dataOut; } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } @@ -303,18 +255,15 @@ } - public boolean isWithIndex() - { + public boolean isWithIndex() { return withIndex; } - public void setWithIndex(boolean withIndex) - { + public void setWithIndex(boolean withIndex) { this.withIndex = withIndex; } - public Log getLogger() - { + public Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/FeatureDgnConvertShpJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/FeatureDgnConvertShpJobContext.java index 5bc6067..dea1d27 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/FeatureDgnConvertShpJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/FeatureDgnConvertShpJobContext.java @@ -10,9 +10,16 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.TimeZone; -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.xmlrules.DigesterLoader; +import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatcher; +import com.ximple.eofms.util.ElementDigesterUtils; +import com.ximple.io.dgn7.ComplexElement; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.FrammeAttributeData; +import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.digester3.Digester; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.transaction.memory.PessimisticMapWrapper; @@ -21,33 +28,22 @@ import org.geotools.data.FeatureWriter; import org.geotools.data.Transaction; import org.geotools.data.shapefile.ShapefileDataStore; -import org.geotools.data.shapefile.indexed.IndexedShapefileDataStore; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; import org.geotools.feature.SchemaException; -import org.geotools.feature.SimpleFeature; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; import org.xml.sax.SAXException; -import com.vividsolutions.jts.geom.GeometryFactory; +public class FeatureDgnConvertShpJobContext extends AbstractDgnToShapefileJobContext { -import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; -import com.ximple.eofms.filter.ElementDispatcher; -import com.ximple.io.dgn7.ComplexElement; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.io.dgn7.UserAttributeData; - -public class FeatureDgnConvertShpJobContext extends AbstractDgnToShapefileJobContext -{ static final Log logger = LogFactory.getLog(FeatureDgnConvertShpJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); + static final String SHPOUTPATH = "shpout"; private String dataOut = null; - private HashMap<String, ArrayList<Feature>> featuresContext = new HashMap<String, ArrayList<Feature>>(); + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; @@ -56,78 +52,63 @@ private String _filterConfig; private boolean withIndex = false; - public FeatureDgnConvertShpJobContext(String dataPath, String filterConfig) - { - super(dataPath); + public FeatureDgnConvertShpJobContext(String dataPath, String filterConfig, boolean profileMode, + boolean useTransform) { + super(dataPath, profileMode, useTransform); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); _filterConfig = filterConfig; elementDispatcher = createElementDispatcher(); } - private ElementDispatcher createElementDispatcher() - { - try - { - URL rulesURL = ElementDispatcher.class.getResource("ElementDispatcherRules.xml"); - assert rulesURL != null; - Digester digester = DigesterLoader.createDigester(rulesURL); + private ElementDispatcher createElementDispatcher() { + try { URL filterURL = null; - if (_filterConfig != null) - { + if (_filterConfig != null) { File config = new File(_filterConfig); - if (config.exists()) - { + if (config.exists()) { filterURL = config.toURI().toURL(); } } - if (filterURL == null) - { + if (filterURL == null) { // config = new File("conf/DefaultConvertShpFilter.xml"); filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); } assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); return (ElementDispatcher) digester.parse(filterURL); - } catch (UnsupportedEncodingException e) - { + } catch (UnsupportedEncodingException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (SAXException e) - { + } catch (SAXException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); } } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { assert elementDispatcher != null; - if (element == null) - { + if (element == null) { logger.warn("Unknown Element:" + null); return; } - // �P�_�O�_�ũM���� - Feature feature = elementDispatcher.execute(element, true); - if (feature == null) - { + // �P�_�O�_�ũM��� + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { FrammeAttributeData linkage = - AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); logger.warn("Unknown Element:" + element.getElementType().toString() + - ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + - (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); - if (element instanceof ComplexElement) - { + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); + if (element instanceof ComplexElement) { ComplexElement complex = (ComplexElement) element; logger.warn("----Complex Element size=" + complex.size()); } @@ -135,121 +116,103 @@ return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); } - public void startTransaction() - { + public void startTransaction() { } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); File sfile = new File(getDataOutPath() + File.separator + featureType.getTypeName()); logger.debug("Begin Save shapefile:" + sfile.toURI()); FeatureWriter writer; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { - ShapefileDataStore shapefileDataStore = null; + } else { boolean existFile = sfile.exists(); - if (!withIndex) - { - shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL(), - true, Charset.forName("UTF-8")); - } else - { - shapefileDataStore = new IndexedShapefileDataStore(sfile.toURI().toURL(), - null, true, true, IndexedShapefileDataStore.TREE_QIX, Charset.forName("UTF-8")); + ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL()); + /* + if(namespace != null) { + shapefileDataStore.setNamespaceURI(namespace.toString()); } + */ + shapefileDataStore.setMemoryMapped(true); + // shapefileDataStore.setBufferCachingEnabled(cacheMemoryMaps); + shapefileDataStore.setCharset(Charset.forName("UTF-8")); + shapefileDataStore.setTimeZone(TimeZone.getDefault()); + shapefileDataStore.setIndexed(withIndex); + shapefileDataStore.setIndexCreationEnabled(withIndex); - if (!existFile) - { + if (!existFile) { shapefileDataStore.createSchema(featureType); writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(), - Transaction.AUTO_COMMIT); - } else - { + Transaction.AUTO_COMMIT); + } else { writer = shapefileDataStore.getFeatureWriterAppend(featureType.getTypeName(), - Transaction.AUTO_COMMIT); + Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } - ArrayList<Feature> features = featuresContext.get(featureType); + ArrayList<SimpleFeature> features = featuresContext.get(featureType); Iterator itFeature = features.iterator(); - while (itFeature.hasNext()) - { - Feature feature = (Feature) itFeature.next(); - ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); } //writer.close(); logger.debug("End Save shapefile:" + sfile.toURI()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public String getDataOutPath() - { - if (dataOut == null) - { + public String getDataOutPath() { + if (dataOut == null) { File outPath = new File(getDataPath(), SHPOUTPATH); - if (!outPath.exists()) - { + if (!outPath.exists()) { outPath.mkdir(); - } else if (!outPath.isDirectory()) - { + } else if (!outPath.isDirectory()) { outPath.mkdir(); } dataOut = outPath.toString(); @@ -257,27 +220,22 @@ return dataOut; } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } @@ -285,18 +243,15 @@ } - public boolean isWithIndex() - { + public boolean isWithIndex() { return withIndex; } - public void setWithIndex(boolean withIndex) - { + public void setWithIndex(boolean withIndex) { this.withIndex = withIndex; } - public Log getLogger() - { + public Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/GeneralDgnConvertShpJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/GeneralDgnConvertShpJobContext.java index fc717dd..c22b317 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/GeneralDgnConvertShpJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/GeneralDgnConvertShpJobContext.java @@ -10,30 +10,14 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.TimeZone; import java.util.TreeMap; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.commons.transaction.memory.PessimisticMapWrapper; -import org.apache.commons.transaction.util.CommonsLoggingLogger; -import org.apache.commons.transaction.util.LoggerFacade; -import org.geotools.data.FeatureWriter; -import org.geotools.data.Transaction; -import org.geotools.data.shapefile.ShapefileDataStore; -import org.geotools.data.shapefile.indexed.IndexedShapefileDataStore; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SchemaException; -import org.geotools.feature.SimpleFeature; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; - import com.ximple.eofms.util.DefaultColorTable; import com.ximple.eofms.util.FeatureTypeBuilderUtil; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; +import com.ximple.eofms.util.GeometryConverterDecorator; import com.ximple.io.dgn7.ArcElement; import com.ximple.io.dgn7.ComplexChainElement; import com.ximple.io.dgn7.Element; @@ -45,180 +29,168 @@ import com.ximple.io.dgn7.TextElement; import com.ximple.io.dgn7.TextNodeElement; import com.ximple.io.dgn7.UserAttributeData; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.transaction.memory.PessimisticMapWrapper; +import org.apache.commons.transaction.util.CommonsLoggingLogger; +import org.apache.commons.transaction.util.LoggerFacade; +import org.geotools.data.FeatureWriter; +import org.geotools.data.Transaction; +import org.geotools.data.shapefile.ShapefileDataStore; +import org.geotools.feature.SchemaException; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; -public class GeneralDgnConvertShpJobContext extends AbstractDgnToShapefileJobContext -{ +public class GeneralDgnConvertShpJobContext extends AbstractDgnToShapefileJobContext { static final Log logger = LogFactory.getLog(GeneralDgnConvertShpJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); + static final GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); public static final String SHPOUTPATH = "shpout"; private String dataOut = null; - private HashMap<String, ArrayList<Feature>> featuresContext = new HashMap<String, ArrayList<Feature>>(); + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; - private TreeMap<String, FeatureTypeBuilder> typeBuilders = new TreeMap<String, FeatureTypeBuilder>(); - private TreeMap<String, FeatureType> featureTypes = new TreeMap<String, FeatureType>(); + private TreeMap<String, SimpleFeatureType> featureTypes = new TreeMap<String, SimpleFeatureType>(); - private TWD97GeometryConverterDecorator convertDecorator = null; private String featureBaseName = null; private boolean withIndex = false; - public GeneralDgnConvertShpJobContext(String dataPath) - { - super(dataPath); + public GeneralDgnConvertShpJobContext(String dataPath, boolean profileMode, + boolean useTransform) { + super(dataPath, profileMode, useTransform); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); - convertDecorator = new TWD97GeometryConverterDecorator(); } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { - FeatureType ft = lookupFeatureType(element); - if (ft != null) - { - Feature feature = createFeature(ft, element); - if (feature == null) - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { + SimpleFeatureType ft = lookupFeatureType(element); + if (ft != null) { + SimpleFeature feature = createFeature(ft, element); + if (feature == null) { if (element instanceof TextElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((TextElement) element).getText() + "'"); + ((TextElement) element).getText() + "'"); else if (element instanceof ShapeElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((ShapeElement) element).getVerticeSize() + "'" + - ((ShapeElement) element).getStartPoint()); + ((ShapeElement) element).getVerticeSize() + "'" + + ((ShapeElement) element).getStartPoint()); else if (element instanceof LineStringElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((LineStringElement) element).getVerticeSize() + "'" + - ((LineStringElement) element).getStartPoint()); + ((LineStringElement) element).getVerticeSize() + "'" + + ((LineStringElement) element).getStartPoint()); else if (element instanceof ArcElement) logger.info("cannot craete feature." + element.toString() + "'" + - ((ArcElement) element).getOrigin().toString() + "'" + - ((ArcElement) element).getRotationAngle()); + ((ArcElement) element).getOrigin().toString() + "'" + + ((ArcElement) element).getRotationAngle()); return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { - txFeaturesContext.put(feature.getFeatureType(), new ArrayList<Feature>()); + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { + txFeaturesContext.put(feature.getFeatureType(), new ArrayList<SimpleFeature>()); } - ArrayList<Feature> arrayList = (ArrayList<Feature>) txFeaturesContext.get(feature.getFeatureType()); + ArrayList<SimpleFeature> arrayList = (ArrayList<SimpleFeature>) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); - } else - { + } else { logger.info("Unknown Element :" + element.getType() + ", lv=" + element.getLevelIndex()); } } - public void startTransaction() - { + public void startTransaction() { } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); File sfile = new File(getDataOutPath() + File.separator + featureType.getTypeName()); logger.debug("Begin Save shapefile:" + sfile.toURI()); FeatureWriter writer; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { - ShapefileDataStore shapefileDataStore = null; + } else { boolean existFile = sfile.exists(); - - if (!withIndex) - { - shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL(), - true, Charset.forName("UTF-8")); - } else - { - shapefileDataStore = new IndexedShapefileDataStore(sfile.toURI().toURL(), - null, true, true, IndexedShapefileDataStore.TREE_QIX, Charset.forName("UTF-8")); + ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL()); + /* + if(namespace != null) { + shapefileDataStore.setNamespaceURI(namespace.toString()); } + */ + shapefileDataStore.setMemoryMapped(true); + // shapefileDataStore.setBufferCachingEnabled(cacheMemoryMaps); + shapefileDataStore.setCharset(Charset.forName("UTF-8")); + shapefileDataStore.setTimeZone(TimeZone.getDefault()); + shapefileDataStore.setIndexed(withIndex); + shapefileDataStore.setIndexCreationEnabled(withIndex); - if (!existFile) - { + if (!existFile) { shapefileDataStore.createSchema(featureType); writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(), - Transaction.AUTO_COMMIT); - } else - { + Transaction.AUTO_COMMIT); + } else { writer = shapefileDataStore.getFeatureWriterAppend(featureType.getTypeName(), - Transaction.AUTO_COMMIT); + Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } - ArrayList<Feature> features = featuresContext.get(featureType); + ArrayList<SimpleFeature> features = featuresContext.get(featureType); Iterator itFeature = features.iterator(); - while (itFeature.hasNext()) - { - Feature feature = (Feature) itFeature.next(); - ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); } //writer.close(); logger.debug("End Save shapefile:" + sfile.toURI()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public String getDataOutPath() - { - if (dataOut == null) - { + public String getDataOutPath() { + if (dataOut == null) { File outPath = new File(getDataPath(), SHPOUTPATH); - if (!outPath.exists()) - { + if (!outPath.exists()) { outPath.mkdir(); - } else if (!outPath.isDirectory()) - { + } else if (!outPath.isDirectory()) { outPath.mkdir(); } dataOut = outPath.toString(); @@ -226,62 +198,55 @@ return dataOut; } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - public FeatureType createPointFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalPointFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); + public SimpleFeatureType createPointFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalPointFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public FeatureType createLineFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalLineFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); + public SimpleFeatureType createLineFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalLineFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public FeatureType createArcFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalArcFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); + public SimpleFeatureType createArcFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalArcFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public FeatureType createEllipseFeatureElement(String featureName) throws SchemaException - { - if (!typeBuilders.containsKey(featureName)) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalEllipseFeatureTypeBuilder(featureName); - typeBuilders.put(featureName, typeBuilder); + public SimpleFeatureType createEllipseFeatureElement(String featureName) throws SchemaException { + if (!featureTypes.containsKey(featureName)) { + SimpleFeatureTypeBuilder typeBuilder = FeatureTypeBuilderUtil.createNormalEllipseFeatureTypeBuilder(featureName); + SimpleFeatureType featureType = typeBuilder.buildFeatureType(); + featureTypes.put(featureName, featureType); } - return typeBuilders.get(featureName).getFeatureType(); + return featureTypes.get(featureName); } - public Feature createFeature(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); + if (element instanceof TextElement) { TextElement textElement = (TextElement) element; convertDecorator.setConverter(textElement); @@ -289,25 +254,22 @@ double angle = textElement.getRotationAngle(); String content = textElement.getText(); angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); - if (geom != null) - { - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(textElement.getColorIndex()), - textElement.getFontIndex(), - textElement.getJustification(), - textElement.getTextHeight(), - textElement.getTextWidth(), - angle, - content - }); - } else - { + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(textElement.getColorIndex()), + textElement.getFontIndex(), + textElement.getJustification(), + textElement.getTextHeight(), + textElement.getTextWidth(), + angle, + content + }, null); + } else { logger.info("geometry is null." + element.toString()); } return null; - } else if (element instanceof TextNodeElement) - { + } else if (element instanceof TextNodeElement) { TextNodeElement textNodeElement = (TextNodeElement) element; convertDecorator.setConverter(textNodeElement); @@ -316,76 +278,69 @@ angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); String[] texts = textNodeElement.getTextArray(); StringBuilder sb = new StringBuilder(); - for (String text : texts) - { + for (String text : texts) { if (sb.length() != 0) sb.append("\n"); sb.append(text); } - if (geom != null) - { - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(textNodeElement.getColorIndex()), - textNodeElement.getFontIndex(), - textNodeElement.getJustification(), - textNodeElement.getTextNodeHeight(), - textNodeElement.getTextNodeLength(), - angle, - sb.toString() - }); - } else - { + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(textNodeElement.getColorIndex()), + textNodeElement.getFontIndex(), + textNodeElement.getJustification(), + textNodeElement.getTextNodeHeight(), + textNodeElement.getTextNodeLength(), + angle, + sb.toString() + }, null); + } else { logger.info("geometry is null." + element.toString()); } return null; - } else if (element instanceof ShapeElement) - { + } else if (element instanceof ShapeElement) { ShapeElement shapeElement = (ShapeElement) element; convertDecorator.setConverter(shapeElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - { - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(shapeElement.getColorIndex()), - shapeElement.getWeight(), - shapeElement.getLineStyle() - }); - } else - { + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(shapeElement.getColorIndex()), + shapeElement.getWeight(), + shapeElement.getLineStyle() + }, null); + } else { logger.info("geometry is null." + element.toString()); } return null; - } else if (element instanceof LineStringElement) - { + } else if (element instanceof LineStringElement) { LineStringElement linestring = (LineStringElement) element; convertDecorator.setConverter(linestring); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(linestring.getColorIndex()), - linestring.getWeight(), - linestring.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(linestring.getColorIndex()), + linestring.getWeight(), + linestring.getLineStyle() + }, null); + } return null; - } else if (element instanceof LineElement) - { + } else if (element instanceof LineElement) { LineElement line = (LineElement) element; convertDecorator.setConverter(line); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(line.getColorIndex()), - line.getWeight(), - line.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(line.getColorIndex()), + line.getWeight(), + line.getLineStyle() + }, null); + } return null; - } else if (element instanceof ArcElement) - { + } else if (element instanceof ArcElement) { ArcElement arcElement = (ArcElement) element; /* logger.fatal("" + arcElement.getPrimary() + ":" + arcElement.getSecondary() + @@ -394,52 +349,50 @@ */ convertDecorator.setConverter(arcElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(arcElement.getColorIndex()), - arcElement.getWeight(), - arcElement.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(arcElement.getColorIndex()), + arcElement.getWeight(), + arcElement.getLineStyle() + }, null); + } return null; - } else if (element instanceof EllipseElement) - { + } else if (element instanceof EllipseElement) { EllipseElement arcElement = (EllipseElement) element; convertDecorator.setConverter(arcElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(arcElement.getColorIndex()), - arcElement.getWeight(), - arcElement.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(arcElement.getColorIndex()), + arcElement.getWeight(), + arcElement.getLineStyle() + }, null); + } return null; - } else if (element instanceof ComplexChainElement) - { + } else if (element instanceof ComplexChainElement) { ComplexChainElement complexChainElement = (ComplexChainElement) element; convertDecorator.setConverter(complexChainElement); Geometry geom = convertDecorator.toGeometry(geometryFactory); - if (geom != null) - return featureType.create(new Object[]{ - geom, - colorTable.getColorCode(complexChainElement.getColorIndex()), - complexChainElement.getWeight(), - complexChainElement.getLineStyle() - }); + if (geom != null) { + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(complexChainElement.getColorIndex()), + complexChainElement.getWeight(), + complexChainElement.getLineStyle() + }, null); + } return null; } return null; } - private String getFeatureBaseName() - { - if (featureBaseName == null) - { + private String getFeatureBaseName() { + if (featureBaseName == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } featureBaseName = dgnname; @@ -447,73 +400,55 @@ return featureBaseName; } - private FeatureType lookupFeatureType(Element element) throws SchemaException, IllegalAttributeException - { + private SimpleFeatureType lookupFeatureType(Element element) throws SchemaException, IllegalAttributeException { String typeName; - if (element instanceof TextElement) - { + if (element instanceof TextElement) { typeName = getFeatureBaseName() + "P"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createPointFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof TextNodeElement) - { + } else if (element instanceof TextNodeElement) { typeName = getFeatureBaseName() + "P"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createPointFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof LineStringElement) - { - if (element instanceof ShapeElement) - { + } else if (element instanceof LineStringElement) { + if (element instanceof ShapeElement) { typeName = getFeatureBaseName() + "R"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createLineFeatureElement(typeName)); } return featureTypes.get(typeName); - } else - { + } else { typeName = getFeatureBaseName() + "L"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createLineFeatureElement(typeName)); } return featureTypes.get(typeName); } - } else if (element instanceof LineElement) - { + } else if (element instanceof LineElement) { typeName = getFeatureBaseName() + "L"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createLineFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof ComplexChainElement) - { + } else if (element instanceof ComplexChainElement) { typeName = getFeatureBaseName() + "L"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createLineFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof ArcElement) - { + } else if (element instanceof ArcElement) { typeName = getFeatureBaseName() + "A"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createArcFeatureElement(typeName)); } return featureTypes.get(typeName); - } else if (element instanceof EllipseElement) - { + } else if (element instanceof EllipseElement) { typeName = getFeatureBaseName() + "R"; - if (!featureTypes.containsKey(typeName)) - { + if (!featureTypes.containsKey(typeName)) { featureTypes.put(typeName, createEllipseFeatureElement(typeName)); } return featureTypes.get(typeName); @@ -522,16 +457,13 @@ return null; } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } @@ -539,18 +471,15 @@ } - public boolean isWithIndex() - { + public boolean isWithIndex() { return withIndex; } - public void setWithIndex(boolean withIndex) - { + public void setWithIndex(boolean withIndex) { this.withIndex = withIndex; } - public Log getLogger() - { + public Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/IndexDgnConvertShpJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/IndexDgnConvertShpJobContext.java index e737bda..85010ea 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/IndexDgnConvertShpJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/IndexDgnConvertShpJobContext.java @@ -7,11 +7,25 @@ import java.net.MalformedURLException; import java.nio.charset.Charset; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.util.Arrays; +import java.util.TimeZone; +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.Envelope; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.GeometryFactory; +import com.ximple.eofms.util.DefaultColorTable; +import com.ximple.eofms.util.FeatureTypeBuilderUtil; +import com.ximple.eofms.util.GeometryConverterDecorator; +import com.ximple.eofms.util.TPCLIDConverter; +import com.ximple.eofms.util.TWDDatumConverter; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.FrammeAttributeData; +import com.ximple.io.dgn7.TextElement; +import com.ximple.io.dgn7.UserAttributeData; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.transaction.memory.PessimisticMapWrapper; @@ -20,104 +34,79 @@ import org.geotools.data.FeatureWriter; import org.geotools.data.Transaction; import org.geotools.data.shapefile.ShapefileDataStore; -import org.geotools.data.shapefile.indexed.IndexedShapefileDataStore; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.FeatureTypeBuilder; -import org.geotools.feature.IllegalAttributeException; import org.geotools.feature.SchemaException; -import org.geotools.feature.SimpleFeature; +import org.geotools.feature.simple.SimpleFeatureBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.geometry.jts.JTSFactoryFinder; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryFactory; - -import com.ximple.eofms.util.DefaultColorTable; -import com.ximple.eofms.util.FeatureTypeBuilderUtil; -import com.ximple.eofms.util.TPCLIDConverter; -import com.ximple.eofms.util.TWD97GeometryConverterDecorator; -import com.ximple.eofms.util.TWDDatumConverter; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; -import com.ximple.io.dgn7.TextElement; -import com.ximple.io.dgn7.UserAttributeData; - -public class IndexDgnConvertShpJobContext extends AbstractDgnToShapefileJobContext -{ +public class IndexDgnConvertShpJobContext extends AbstractDgnToShapefileJobContext { static final Log logger = LogFactory.getLog(IndexDgnConvertShpJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); - static final GeometryFactory geometryFactory = new GeometryFactory(); - TWD97GeometryConverterDecorator convertDecorator = new TWD97GeometryConverterDecorator(); + static final GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); public static final String SHPOUTPATH = "shpout"; private String dataOut = null; - private HashMap<String, ArrayList<Feature>> featuresContext = new HashMap<String, ArrayList<Feature>>(); + private HashMap<String, ArrayList<SimpleFeature>> featuresContext = new HashMap<String, ArrayList<SimpleFeature>>(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; - private FeatureTypeBuilder typeBuilderPnt = null; - private FeatureTypeBuilder typeBuilderRect = null; - private FeatureType featureType = null; - private FeatureType featureType2 = null; - private FeatureType featureType3 = null; + private SimpleFeatureTypeBuilder typeBuilderPnt = null; + private SimpleFeatureTypeBuilder typeBuilderRect = null; + private SimpleFeatureType featureType = null; + private SimpleFeatureType featureType2 = null; + private SimpleFeatureType featureType3 = null; private int accumulate = 0; - public IndexDgnConvertShpJobContext(String dataPath) - { - super(dataPath); + public IndexDgnConvertShpJobContext(String dataPath, boolean profileMode, + boolean useTransform) { + super(dataPath, profileMode, useTransform); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); } - public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException - { - if (!(element instanceof TextElement)) - { + public void putFeatureCollection(Element element) throws IllegalAttributeException, SchemaException { + if (!(element instanceof TextElement)) { return; } - Feature feature = createFeature((TextElement) element); - if (feature == null) - { + SimpleFeature feature = createFeature((TextElement) element); + if (feature == null) { logger.info("cannot craete feature." + element.toString() + "'" + - ((TextElement) element).getText() + "'"); + ((TextElement) element).getText() + "'"); return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); feature = createFeature2((TextElement) element); - if (feature == null) - { + if (feature == null) { logger.info("cannot craete feature2." + element.toString() + "'" + - ((TextElement) element).getText() + "'"); + ((TextElement) element).getText() + "'"); return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); - Feature[] features = createFeature3((TextElement) element); - if (features == null) - { + SimpleFeature[] features = createFeature3((TextElement) element); + if (features == null) { logger.info("cannot craete feature3." + element.toString() + "'" + - ((TextElement) element).getText() + "'"); + ((TextElement) element).getText() + "'"); return; } - if (!txFeaturesContext.containsKey(features[0].getFeatureType())) - { - txFeaturesContext.put(features[0].getFeatureType(), new ArrayList<Feature>()); + if (!txFeaturesContext.containsKey(features[0].getFeatureType())) { + txFeaturesContext.put(features[0].getFeatureType(), new ArrayList<SimpleFeature>()); } arrayList = (ArrayList) txFeaturesContext.get(features[0].getFeatureType()); arrayList.addAll(Arrays.asList(features)); @@ -125,96 +114,89 @@ accumulate++; } - public void startTransaction() - { + public void startTransaction() { } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); File sfile = new File(getDataOutPath() + File.separator + featureType.getTypeName()); logger.debug("Begin Save shapefile:" + sfile.toURI()); FeatureWriter writer; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { + } else { /* ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL(), true, Charset.forName("UTF-8")); */ - ShapefileDataStore shapefileDataStore = new IndexedShapefileDataStore(sfile.toURI().toURL(), - null, true, true, IndexedShapefileDataStore.TREE_QIX, Charset.forName("UTF-8")); + ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL()); + /* + if(namespace != null) { + shapefileDataStore.setNamespaceURI(namespace.toString()); + } + */ + shapefileDataStore.setMemoryMapped(true); + // shapefileDataStore.setBufferCachingEnabled(cacheMemoryMaps); + shapefileDataStore.setCharset(Charset.forName("UTF-8")); + shapefileDataStore.setTimeZone(TimeZone.getDefault()); + shapefileDataStore.setIndexed(true); + shapefileDataStore.setIndexCreationEnabled(true); shapefileDataStore.createSchema(featureType); writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT); featuresWriterContext.put(featureType.getTypeName(), writer); } - ArrayList<Feature> features = featuresContext.get(featureType); - for (Feature feature1 : features) - { - ((SimpleFeature) writer.next()).setAttributes(feature1.getAttributes(null)); + ArrayList<SimpleFeature> features = featuresContext.get(featureType); + for (SimpleFeature feature1 : features) { + ((SimpleFeature) writer.next()).setAttributes(feature1.getAttributes()); } //writer.close(); logger.debug("End Save shapefile:" + sfile.toURI()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public String getDataOutPath() - { - if (dataOut == null) - { + public String getDataOutPath() { + if (dataOut == null) { File outPath = new File(getDataPath(), SHPOUTPATH); - if (!outPath.exists()) - { + if (!outPath.exists()) { outPath.mkdir(); - } else if (!outPath.isDirectory()) - { + } else if (!outPath.isDirectory()) { outPath.mkdir(); } dataOut = outPath.toString(); @@ -222,135 +204,151 @@ return dataOut; } - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } - public FeatureType createFeatureElement(String featureName) throws SchemaException - { - if (typeBuilderRect == null) - { + public SimpleFeatureType createFeatureElement(String featureName) throws SchemaException { + if (typeBuilderRect == null) { typeBuilderRect = FeatureTypeBuilderUtil.createNormalIndexFeatureTypeBuilder(featureName); } - return typeBuilderRect.getFeatureType(); + return typeBuilderRect.buildFeatureType(); } - public FeatureType createFeatureElement2(String featureName) throws SchemaException - { - if (typeBuilderPnt == null) - { + public SimpleFeatureType createFeatureElement2(String featureName) throws SchemaException { + if (typeBuilderPnt == null) { typeBuilderPnt = FeatureTypeBuilderUtil.createNormalIndexTextFeatureTypeBuilder(featureName); } - return typeBuilderPnt.getFeatureType(); + return typeBuilderPnt.buildFeatureType(); } - public Feature createFeature(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature createFeature(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { + if (element instanceof TextElement) { TextElement textElement = (TextElement) element; String tpclid = textElement.getText(); Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); - Geometry geom = geometryFactory.createLinearRing(new Coordinate[] + Geometry geom; + if (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826) { + geom = geometryFactory.createLinearRing(new Coordinate[] { - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMinX(), extent.getMinY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMaxX(), extent.getMinY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMaxX(), extent.getMaxY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMinX(), extent.getMaxY())), - TWDDatumConverter.fromTM2ToTWD97(new Coordinate(extent.getMinX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMaxX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMaxX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate(extent.getMinX(), extent.getMinY())), }); - - return featureType.create(new Object[]{ - geom, - extent.getMinX(), - extent.getMinY(), - extent.getMaxX(), - extent.getMaxY(), - tpclid, - colorTable.getColorCode(textElement.getColorIndex()), - textElement.getWeight(), - textElement.getLineStyle() - }); + } else { + geom = geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMaxX(), extent.getMinY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMaxX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMaxY())), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate(extent.getMinX(), extent.getMinY())), + }); + } + return SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + extent.getMinX(), + extent.getMinY(), + extent.getMaxX(), + extent.getMaxY(), + tpclid, + colorTable.getColorCode(textElement.getColorIndex()), + textElement.getWeight(), + textElement.getLineStyle() + }, null); } return null; } - public Feature createFeature2(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature createFeature2(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { + if (element instanceof TextElement) { TextElement txtElement = (TextElement) element; double angle = txtElement.getRotationAngle(); angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); + GeometryConverterDecorator convertDecorator = FeatureTypeBuilderUtil.lookupDefaultGeometryConverter(); convertDecorator.setConverter(txtElement); - Feature feature = featureType.create(new Object[]{ - convertDecorator.toGeometry(geometryFactory), - colorTable.getColorCode(txtElement.getColorIndex()), - txtElement.getWeight(), - txtElement.getLineStyle(), - txtElement.getJustification(), - txtElement.getTextHeight(), - txtElement.getTextWidth(), - angle, - txtElement.getText() - }); + Geometry geom = convertDecorator.toGeometry(geometryFactory); + SimpleFeature feature = SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + colorTable.getColorCode(txtElement.getColorIndex()), + txtElement.getWeight(), + txtElement.getLineStyle(), + txtElement.getJustification(), + txtElement.getTextHeight(), + txtElement.getTextWidth(), + angle, + txtElement.getText() + }, null); return feature; } return null; } - public Feature[] createFeature3(FeatureType featureType, Element element) throws IllegalAttributeException - { + public SimpleFeature[] createFeature3(SimpleFeatureType featureType, Element element) throws IllegalAttributeException { DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); - if (element instanceof TextElement) - { + if (element instanceof TextElement) { TextElement textElement = (TextElement) element; String tpclid = textElement.getText(); - Feature[] result = new Feature[4]; + SimpleFeature[] result = new SimpleFeature[4]; Envelope extent = TPCLIDConverter.convertTpclIdToEnvelope(tpclid); - for (int i = 0; i < 4; i++) - { + 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[] + Geometry geom; + if (FeatureTypeBuilderUtil.getDefaultFeatureSRID() == 3826) { + 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)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3826(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() - }); + } else { + geom = geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] + { + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + TPCLIDConverter.SX600 + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - dy)), + TWDDatumConverter.fromTM2ToEPSG3825(new Coordinate( + extent.getMinX() + dx, extent.getMaxY() - TPCLIDConverter.SY600 - dy)), + }), null); + } + result[i] = SimpleFeatureBuilder.build(featureType, new Object[]{ + geom, + extent.getMinX(), + extent.getMinY(), + extent.getMaxX(), + extent.getMaxY(), + tpclid + mapSubId, + colorTable.getColorCode(textElement.getColorIndex()), + textElement.getWeight(), + textElement.getLineStyle() + }, null); } return result; @@ -358,14 +356,11 @@ return null; } - private Feature createFeature(TextElement element) throws SchemaException, IllegalAttributeException - { - if (featureType == null) - { + private SimpleFeature createFeature(TextElement element) throws SchemaException, IllegalAttributeException { + if (featureType == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } featureType = createFeatureElement(dgnname); @@ -373,14 +368,11 @@ return createFeature(featureType, element); } - private Feature createFeature2(TextElement element) throws SchemaException, IllegalAttributeException - { - if (featureType2 == null) - { + private SimpleFeature createFeature2(TextElement element) throws SchemaException, IllegalAttributeException { + if (featureType2 == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } dgnname = dgnname + "P"; @@ -389,14 +381,11 @@ return createFeature2(featureType2, element); } - private Feature[] createFeature3(TextElement element) throws SchemaException, IllegalAttributeException - { - if (featureType3 == null) - { + private SimpleFeature[] createFeature3(TextElement element) throws SchemaException, IllegalAttributeException { + if (featureType3 == null) { String dgnname = getFilename().toLowerCase(); int i = dgnname.lastIndexOf("."); - if (i != -1) - { + if (i != -1) { dgnname = dgnname.substring(0, i); } dgnname = dgnname + "_s"; @@ -405,24 +394,20 @@ return createFeature3(featureType3, element); } - protected FrammeAttributeData getFeatureLinkage(Element element) - { + protected FrammeAttributeData getFeatureLinkage(Element element) { if (!element.hasUserAttributeData()) return null; List<UserAttributeData> usrDatas = element.getUserAttributeData(); - for (UserAttributeData anUsrData : usrDatas) - { - if (anUsrData instanceof FrammeAttributeData) - { + for (UserAttributeData anUsrData : usrDatas) { + if (anUsrData instanceof FrammeAttributeData) { return (FrammeAttributeData) anUsrData; } } return null; } - public Log getLogger() - { + public Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/OracleConvertShapefilesJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/OracleConvertShapefilesJobContext.java index bee06de..1760b0f 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/OracleConvertShapefilesJobContext.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/OracleConvertShapefilesJobContext.java @@ -12,9 +12,18 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Properties; +import java.util.TimeZone; -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.xmlrules.DigesterLoader; +import com.vividsolutions.jts.util.Assert; +import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; +import com.ximple.eofms.filter.ElementDispatcher; +import com.ximple.eofms.jobs.OracleElementLogger; +import com.ximple.eofms.jobs.context.AbstractOracleJobContext; +import com.ximple.eofms.util.ElementDigesterUtils; +import com.ximple.io.dgn7.ComplexElement; +import com.ximple.io.dgn7.Element; +import com.ximple.io.dgn7.FrammeAttributeData; +import org.apache.commons.digester3.Digester; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.transaction.memory.PessimisticMapWrapper; @@ -23,41 +32,27 @@ import org.geotools.data.FeatureWriter; import org.geotools.data.Transaction; import org.geotools.data.shapefile.ShapefileDataStore; -import org.geotools.data.shapefile.indexed.IndexedShapefileDataStore; -import org.geotools.feature.Feature; -import org.geotools.feature.FeatureType; -import org.geotools.feature.IllegalAttributeException; -import org.geotools.feature.SimpleFeature; +import org.opengis.feature.IllegalAttributeException; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; import org.quartz.JobExecutionContext; import org.xml.sax.SAXException; -import com.vividsolutions.jts.util.Assert; -import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; -import com.ximple.eofms.filter.ElementDispatcher; -import com.ximple.eofms.jobs.OracleElementLogger; -import com.ximple.eofms.jobs.context.AbstractOracleJobContext; -import com.ximple.io.dgn7.ComplexElement; -import com.ximple.io.dgn7.Element; -import com.ximple.io.dgn7.FrammeAttributeData; - - -public class OracleConvertShapefilesJobContext extends AbstractOracleJobContext -{ +public class OracleConvertShapefilesJobContext extends AbstractOracleJobContext { static Log logger = LogFactory.getLog(OracleConvertShapefilesJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); public static final String SHPOUTPATH = "shpout"; + protected boolean profileMode = false; + private OracleElementLogger elmLogger = null; - static - { - try - { + static { + try { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); - } catch (SQLException e) - { + } catch (SQLException e) { Assert.shouldNeverReachHere(e.getMessage()); } } @@ -80,112 +75,92 @@ private boolean schemaChanged = false; private boolean withIndex = false; - public OracleConvertShapefilesJobContext(String filterConfig) - { + public OracleConvertShapefilesJobContext(String filterConfig, boolean profileMode, + boolean useTransform) { + super(profileMode, useTransform); properties = new Properties(); _filterConfig = filterConfig; elementDispatcher = createElementDispatcher(); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); } - private ElementDispatcher createElementDispatcher() - { - try - { - URL rulesURL = ElementDispatcher.class.getResource("ElementDispatcherRules.xml"); - assert rulesURL != null; - Digester digester = DigesterLoader.createDigester(rulesURL); + private ElementDispatcher createElementDispatcher() { + try { URL filterURL = null; - if (_filterConfig != null) - { + if (_filterConfig != null) { File config = new File(_filterConfig); - if (config.exists()) - { + if (config.exists()) { filterURL = config.toURI().toURL(); } } - if (filterURL == null) - { + if (filterURL == null) { // config = new File("conf/DefaultConvertShpFilter.xml"); filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); } assert filterURL != null; + Digester digester = ElementDigesterUtils.getElementDigester(); return (ElementDispatcher) digester.parse(filterURL); - } catch (UnsupportedEncodingException e) - { + } catch (UnsupportedEncodingException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); - } catch (SAXException e) - { + } catch (SAXException e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); } } - public void putFeatureCollection(Element element) - { + public void putFeatureCollection(Element element) { assert elementDispatcher != null; - // �P�_�O�_�ũM���� - Feature feature = elementDispatcher.execute(element, true); - if (feature == null) - { + // �P�_�O�_�ũM��� + SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); + if (feature == null) { boolean isEmptySize = false; FrammeAttributeData linkage = - AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); + AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); logger.warn("Unknown Element:" + element.getElementType().toString() + - ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + - (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + + (linkage == null ? "NULL" : "FSC=" + (linkage.getFsc() + "|COMPID=" + linkage.getComponentID()))); - if (element instanceof ComplexElement) - { + if (element instanceof ComplexElement) { ComplexElement complex = (ComplexElement) element; logger.warn("----Complex Element size=" + complex.size() + ":" + - (linkage == null ? "NULL" : (linkage.getUfid()))); + (linkage == null ? "NULL" : (linkage.getUfid()))); isEmptySize = true; } - if (getElementLogging() && (!isEmptySize)) - { + if (getElementLogging() && (!isEmptySize)) { getElementLogger().logElement(element, getCurrentSchema()); } return; } - if (!txFeaturesContext.containsKey(feature.getFeatureType())) - { + if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); } - public void startTransaction() - { + public void startTransaction() { //txFeaturesContext.startTransaction(); } - public void commitTransaction() - { - if (!txFeaturesContext.isEmpty()) - { + public void commitTransaction() { + if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); - } else - { + } else { logger.debug("Transaction is empty."); } - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } @@ -193,103 +168,90 @@ this.getElementLogger().flashLogging(); } - public void rollbackTransaction() - { + public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); - if (!featuresContext.isEmpty()) - { + if (!featuresContext.isEmpty()) { updateDataStore(); } } - private void updateDataStore() - { + private void updateDataStore() { + if (isProfileMode()) markUpdateTime(); Iterator it = featuresContext.keySet().iterator(); - try - { - while (it.hasNext()) - { - FeatureType featureType = (FeatureType) it.next(); + try { + while (it.hasNext()) { + SimpleFeatureType featureType = (SimpleFeatureType) it.next(); File sfile = new File(getDataOutPath() + File.separator + featureType.getTypeName()); logger.debug("Begin Save shapefile:" + sfile.toURI()); - FeatureWriter writer = null; - if (featuresWriterContext.containsKey(featureType.getTypeName())) - { + FeatureWriter writer; + if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); - } else - { - ShapefileDataStore shapefileDataStore = null; + } else { boolean existFile = sfile.exists(); - - if (!withIndex) - { - shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL(), - true, Charset.forName("UTF-8")); - } else - { - shapefileDataStore = new IndexedShapefileDataStore(sfile.toURI().toURL(), - null, true, true, IndexedShapefileDataStore.TREE_QIX, Charset.forName("UTF-8")); + ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL()); + /* + if(namespace != null) { + shapefileDataStore.setNamespaceURI(namespace.toString()); } + */ + shapefileDataStore.setMemoryMapped(true); + // shapefileDataStore.setBufferCachingEnabled(cacheMemoryMaps); + shapefileDataStore.setCharset(Charset.forName("UTF-8")); + shapefileDataStore.setTimeZone(TimeZone.getDefault()); + shapefileDataStore.setIndexed(withIndex); + shapefileDataStore.setIndexCreationEnabled(withIndex); - if (!existFile) - { + if (!existFile) { shapefileDataStore.createSchema(featureType); writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(), - Transaction.AUTO_COMMIT); - } else - { + Transaction.AUTO_COMMIT); + } else { writer = shapefileDataStore.getFeatureWriterAppend(featureType.getTypeName(), - Transaction.AUTO_COMMIT); + Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } ArrayList features = (ArrayList) featuresContext.get(featureType); Iterator itFeature = features.iterator(); - while (itFeature.hasNext()) - { - Feature feature = (Feature) itFeature.next(); - ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); + while (itFeature.hasNext()) { + SimpleFeature feature = (SimpleFeature) itFeature.next(); + ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes()); } //writer.close(); logger.debug("End Save shapefile:" + sfile.toURI()); } featuresContext.clear(); - } catch (MalformedURLException e) - { + } catch (MalformedURLException e) { logger.error(e.getMessage(), e); - } catch (IllegalAttributeException e) - { + } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); - } catch (IOException e) - { + } catch (IOException e) { logger.error(e.getMessage(), e); + } finally { + if (isProfileMode()) accumulateUpdateTime(); } } - public JobExecutionContext getExecutionContext() - { + public JobExecutionContext getExecutionContext() { return executionContext; } - public void setExecutionContext(JobExecutionContext context) - { + public void setExecutionContext(JobExecutionContext context) { executionContext = context; } /** - * �����]�Ƽg�J�� + * �����]�Ƽg�J�� * - * @throws IOException IO�o�Ϳ��~ + * @throws IOException IO�o�Ϳ�~ */ - public void closeFeatureWriter() throws IOException - { + public void closeFeatureWriter() throws IOException { - for (FeatureWriter featureWriter : this.featuresWriterContext.values()) - { + for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } @@ -297,20 +259,16 @@ } /** - * ���o��ƿ�X���| + * ��o��ƿ�X���| * - * @return ���|���r�� + * @return ���|���r�� */ - public String getDataOutPath() - { - if (dataOut == null) - { + public String getDataOutPath() { + if (dataOut == null) { File outPath = new File(getDataPath(), SHPOUTPATH); - if (!outPath.exists()) - { + if (!outPath.exists()) { outPath.mkdir(); - } else if (!outPath.isDirectory()) - { + } else if (!outPath.isDirectory()) { outPath.mkdir(); } dataOut = outPath.toString(); @@ -318,54 +276,44 @@ return dataOut; } - public void setConvertDB(String convertDB) - { + public void setConvertDB(String convertDB) { _convertDB = convertDB; } - public void setConvertFile(String convertFile) - { + public void setConvertFile(String convertFile) { _convertFile = convertFile; } - protected OracleElementLogger getElementLogger() - { - if (elmLogger == null) - { + protected OracleElementLogger getElementLogger() { + if (elmLogger == null) { elmLogger = new OracleElementLogger(getOracleConnection()); elmLogger.setDataPath(this.getDataPath()); } return elmLogger; } - public String getCurrentSchema() - { + public String getCurrentSchema() { return currentSchema; } - public void setCurrentSchema(String querySchema) - { + public void setCurrentSchema(String querySchema) { this.currentSchema = querySchema; this.schemaChanged = true; } - public void setConvertElementIn(String convertElementIn) - { + public void setConvertElementIn(String convertElementIn) { _convertElementIn = convertElementIn; } - public boolean isWithIndex() - { + public boolean isWithIndex() { return withIndex; } - public void setWithIndex(boolean withIndex) - { + public void setWithIndex(boolean withIndex) { this.withIndex = withIndex; } - protected Log getLogger() - { + protected Log getLogger() { return logger; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/Base64.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/Base64.java index 13d7c92..dc4bd41 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/Base64.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/Base64.java @@ -2,13 +2,11 @@ import java.util.Arrays; -public class Base64 -{ +public class Base64 { private static final char[] CA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray(); private static final int[] IA = new int[256]; - static - { + static { Arrays.fill(IA, -1); for (int i = 0, iS = CA.length; i < iS; i++) IA[CA[i]] = i; @@ -28,8 +26,7 @@ * little faster. * @return A BASE64 encoded array. Never <code>null</code>. */ - public static char[] encodeToChar(byte[] sArr, boolean lineSep) - { + public static char[] encodeToChar(byte[] sArr, boolean lineSep) { // Check special case int sLen = sArr != null ? sArr.length : 0; if (sLen == 0) @@ -41,8 +38,7 @@ char[] dArr = new char[dLen]; // Encode even 24-bits - for (int s = 0, d = 0, cc = 0; s < eLen;) - { + for (int s = 0, d = 0, cc = 0; s < eLen;) { // Copy next three bytes into lower 24 bits of int, paying attension to sign. int i = (sArr[s++] & 0xff) << 16 | (sArr[s++] & 0xff) << 8 | (sArr[s++] & 0xff); @@ -53,8 +49,7 @@ dArr[d++] = CA[i & 0x3f]; // Add optional line separator - if (lineSep && ++cc == 19 && d < dLen - 2) - { + if (lineSep && ++cc == 19 && d < dLen - 2) { dArr[d++] = '\r'; dArr[d++] = '\n'; cc = 0; @@ -63,8 +58,7 @@ // Pad and encode last bits if source isn't even 24 bits. int left = sLen - eLen; // 0 - 2. - if (left > 0) - { + if (left > 0) { // Prepare the int int i = ((sArr[eLen] & 0xff) << 10) | (left == 2 ? ((sArr[sLen - 1] & 0xff) << 2) : 0); @@ -85,8 +79,7 @@ * @return The decoded array of bytes. May be of length 0. Will be <code>null</code> if the legal characters * (including '=') isn't divideable by 4. (I.e. definitely corrupted). */ - public static byte[] decode(char[] sArr) - { + public static byte[] decode(char[] sArr) { // Check special case int sLen = sArr != null ? sArr.length : 0; if (sLen == 0) @@ -112,12 +105,10 @@ byte[] dArr = new byte[len]; // Preallocate byte[] of exact length - for (int s = 0, d = 0; d < len;) - { + for (int s = 0, d = 0; d < len;) { // Assemble three bytes into an int from four "valid" characters. int i = 0; - for (int j = 0; j < 4; j++) - { // j only increased if a valid char was found. + for (int j = 0; j < 4; j++) { // j only increased if a valid char was found. int c = IA[sArr[s++]]; if (c >= 0) i |= c << (18 - j * 6); @@ -126,8 +117,7 @@ } // Add the bytes dArr[d++] = (byte) (i >> 16); - if (d < len) - { + if (d < len) { dArr[d++] = (byte) (i >> 8); if (d < len) dArr[d++] = (byte) i; @@ -147,8 +137,7 @@ * @param sArr The source array. Length 0 will return an empty array. <code>null</code> will throw an exception. * @return The decoded array of bytes. May be of length 0. */ - public byte[] decodeFast(char[] sArr) - { + public byte[] decodeFast(char[] sArr) { // Check special case int sLen = sArr.length; if (sLen == 0) @@ -174,8 +163,7 @@ // Decode all but the last 0 - 2 bytes. int d = 0; - for (int cc = 0, eLen = (len / 3) * 3; d < eLen;) - { + for (int cc = 0, eLen = (len / 3) * 3; d < eLen;) { // Assemble three bytes into an int from four "valid" characters. int i = IA[sArr[sIx++]] << 18 | IA[sArr[sIx++]] << 12 | IA[sArr[sIx++]] << 6 | IA[sArr[sIx++]]; @@ -185,15 +173,13 @@ dArr[d++] = (byte) i; // If line separator, jump over it. - if (sepCnt > 0 && ++cc == 19) - { + if (sepCnt > 0 && ++cc == 19) { sIx += 2; cc = 0; } } - if (d < len) - { + if (d < len) { // Decode last 1-3 bytes (incl '=') into 1-3 bytes int i = 0; for (int j = 0; sIx <= eIx - pad; j++) @@ -219,8 +205,7 @@ * little faster. * @return A BASE64 encoded array. Never <code>null</code>. */ - public static byte[] encodeToByte(byte[] sArr, boolean lineSep) - { + public static byte[] encodeToByte(byte[] sArr, boolean lineSep) { // Check special case int sLen = sArr != null ? sArr.length : 0; if (sLen == 0) @@ -232,8 +217,7 @@ byte[] dArr = new byte[dLen]; // Encode even 24-bits - for (int s = 0, d = 0, cc = 0; s < eLen;) - { + for (int s = 0, d = 0, cc = 0; s < eLen;) { // Copy next three bytes into lower 24 bits of int, paying attension to sign. int i = (sArr[s++] & 0xff) << 16 | (sArr[s++] & 0xff) << 8 | (sArr[s++] & 0xff); @@ -244,8 +228,7 @@ dArr[d++] = (byte) CA[i & 0x3f]; // Add optional line separator - if (lineSep && ++cc == 19 && d < dLen - 2) - { + if (lineSep && ++cc == 19 && d < dLen - 2) { dArr[d++] = '\r'; dArr[d++] = '\n'; cc = 0; @@ -254,8 +237,7 @@ // Pad and encode last bits if source isn't an even 24 bits. int left = sLen - eLen; // 0 - 2. - if (left > 0) - { + if (left > 0) { // Prepare the int int i = ((sArr[eLen] & 0xff) << 10) | (left == 2 ? ((sArr[sLen - 1] & 0xff) << 2) : 0); @@ -276,8 +258,7 @@ * @return The decoded array of bytes. May be of length 0. Will be <code>null</code> if the legal characters * (including '=') isn't divideable by 4. (I.e. definitely corrupted). */ - public static byte[] decode(byte[] sArr) - { + public static byte[] decode(byte[] sArr) { // Check special case int sLen = sArr.length; @@ -301,12 +282,10 @@ byte[] dArr = new byte[len]; // Preallocate byte[] of exact length - for (int s = 0, d = 0; d < len;) - { + for (int s = 0, d = 0; d < len;) { // Assemble three bytes into an int from four "valid" characters. int i = 0; - for (int j = 0; j < 4; j++) - { // j only increased if a valid char was found. + for (int j = 0; j < 4; j++) { // j only increased if a valid char was found. int c = IA[sArr[s++] & 0xff]; if (c >= 0) i |= c << (18 - j * 6); @@ -316,8 +295,7 @@ // Add the bytes dArr[d++] = (byte) (i >> 16); - if (d < len) - { + if (d < len) { dArr[d++] = (byte) (i >> 8); if (d < len) dArr[d++] = (byte) i; @@ -339,8 +317,7 @@ * @param sArr The source array. Length 0 will return an empty array. <code>null</code> will throw an exception. * @return The decoded array of bytes. May be of length 0. */ - public static byte[] decodeFast(byte[] sArr) - { + public static byte[] decodeFast(byte[] sArr) { // Check special case int sLen = sArr.length; if (sLen == 0) @@ -366,8 +343,7 @@ // Decode all but the last 0 - 2 bytes. int d = 0; - for (int cc = 0, eLen = (len / 3) * 3; d < eLen;) - { + for (int cc = 0, eLen = (len / 3) * 3; d < eLen;) { // Assemble three bytes into an int from four "valid" characters. int i = IA[sArr[sIx++]] << 18 | IA[sArr[sIx++]] << 12 | IA[sArr[sIx++]] << 6 | IA[sArr[sIx++]]; @@ -377,15 +353,13 @@ dArr[d++] = (byte) i; // If line separator, jump over it. - if (sepCnt > 0 && ++cc == 19) - { + if (sepCnt > 0 && ++cc == 19) { sIx += 2; cc = 0; } } - if (d < len) - { + if (d < len) { // Decode last 1-3 bytes (incl '=') into 1-3 bytes int i = 0; for (int j = 0; sIx <= eIx - pad; j++) @@ -411,8 +385,7 @@ * little faster. * @return A BASE64 encoded array. Never <code>null</code>. */ - public static String encodeToString(byte[] sArr, boolean lineSep) - { + public static String encodeToString(byte[] sArr, boolean lineSep) { // Reuse char[] since we can't create a String incrementally anyway and StringBuffer/Builder would be slower. return new String(encodeToChar(sArr, lineSep)); } @@ -427,8 +400,7 @@ * @return The decoded array of bytes. May be of length 0. Will be <code>null</code> if the legal characters * (including '=') isn't divideable by 4. (I.e. definitely corrupted). */ - public static byte[] decode(String str) - { + public static byte[] decode(String str) { // Check special case int sLen = str != null ? str.length() : 0; if (sLen == 0) @@ -455,12 +427,10 @@ byte[] dArr = new byte[len]; // Preallocate byte[] of exact length - for (int s = 0, d = 0; d < len;) - { + for (int s = 0, d = 0; d < len;) { // Assemble three bytes into an int from four "valid" characters. int i = 0; - for (int j = 0; j < 4; j++) - { // j only increased if a valid char was found. + for (int j = 0; j < 4; j++) { // j only increased if a valid char was found. int c = IA[str.charAt(s++)]; if (c >= 0) i |= c << (18 - j * 6); @@ -469,8 +439,7 @@ } // Add the bytes dArr[d++] = (byte) (i >> 16); - if (d < len) - { + if (d < len) { dArr[d++] = (byte) (i >> 8); if (d < len) dArr[d++] = (byte) i; @@ -490,8 +459,7 @@ * @param s The source string. Length 0 will return an empty array. <code>null</code> will throw an exception. * @return The decoded array of bytes. May be of length 0. */ - public static byte[] decodeFast(String s) - { + public static byte[] decodeFast(String s) { // Check special case int sLen = s.length(); if (sLen == 0) @@ -517,8 +485,7 @@ // Decode all but the last 0 - 2 bytes. int d = 0; - for (int cc = 0, eLen = (len / 3) * 3; d < eLen;) - { + for (int cc = 0, eLen = (len / 3) * 3; d < eLen;) { // Assemble three bytes into an int from four "valid" characters. int i = IA[s.charAt(sIx++)] << 18 | IA[s.charAt(sIx++)] << 12 | IA[s.charAt(sIx++)] << 6 | IA[s.charAt(sIx++)]; @@ -528,15 +495,13 @@ dArr[d++] = (byte) i; // If line separator, jump over it. - if (sepCnt > 0 && ++cc == 19) - { + if (sepCnt > 0 && ++cc == 19) { sIx += 2; cc = 0; } } - if (d < len) - { + if (d < len) { // Decode last 1-3 bytes (incl '=') into 1-3 bytes int i = 0; for (int j = 0; sIx <= eIx - pad; j++) diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/BinConverter.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/BinConverter.java index 2dd4c53..cce5008 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/BinConverter.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/BinConverter.java @@ -10,15 +10,13 @@ * BinConverter * User: Ulysses * Date: 2007/9/17 - * Time: �W�� 01:13:13 */ -public class BinConverter -{ +public class BinConverter { // our table for binhex conversion final static char[] HEXTAB = - { - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' - }; + { + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' + }; /** * gets bytes from an array into a long @@ -27,12 +25,11 @@ * @param nStartIndex index from where to read the data * @return the 64bit integer */ - public static long byteArrayToLong(byte[] buffer, int nStartIndex) - { + public static long byteArrayToLong(byte[] buffer, int nStartIndex) { return (((long) buffer[nStartIndex]) << 56) | (((long) buffer[nStartIndex + 1] & 0x0ffL) << 48) - | (((long) buffer[nStartIndex + 2] & 0x0ffL) << 40) | (((long) buffer[nStartIndex + 3] & 0x0ffL) << 32) - | (((long) buffer[nStartIndex + 4] & 0x0ffL) << 24) | (((long) buffer[nStartIndex + 5] & 0x0ffL) << 16) - | (((long) buffer[nStartIndex + 6] & 0x0ffL) << 8) | ((long) buffer[nStartIndex + 7] & 0x0ff); + | (((long) buffer[nStartIndex + 2] & 0x0ffL) << 40) | (((long) buffer[nStartIndex + 3] & 0x0ffL) << 32) + | (((long) buffer[nStartIndex + 4] & 0x0ffL) << 24) | (((long) buffer[nStartIndex + 5] & 0x0ffL) << 16) + | (((long) buffer[nStartIndex + 6] & 0x0ffL) << 8) | ((long) buffer[nStartIndex + 7] & 0x0ff); } /** @@ -42,8 +39,7 @@ * @param buffer the target buffer * @param nStartIndex where to place the bytes in the buffer */ - public static void longToByteArray(long lValue, byte[] buffer, int nStartIndex) - { + public static void longToByteArray(long lValue, byte[] buffer, int nStartIndex) { buffer[nStartIndex] = (byte) (lValue >>> 56); buffer[nStartIndex + 1] = (byte) ((lValue >>> 48) & 0x0ff); buffer[nStartIndex + 2] = (byte) ((lValue >>> 40) & 0x0ff); @@ -61,8 +57,7 @@ * @param nStartIndex index from where to read the data * @return the 64bit integer */ - public static long intArrayToLong(int[] buffer, int nStartIndex) - { + public static long intArrayToLong(int[] buffer, int nStartIndex) { return (((long) buffer[nStartIndex]) << 32) | (((long) buffer[nStartIndex + 1]) & 0x0ffffffffL); } @@ -73,8 +68,7 @@ * @param buffer the target buffer * @param nStartIndex where to place the bytes in the buffer */ - public static void longToIntArray(long lValue, int[] buffer, int nStartIndex) - { + public static void longToIntArray(long lValue, int[] buffer, int nStartIndex) { buffer[nStartIndex] = (int) (lValue >>> 32); buffer[nStartIndex + 1] = (int) lValue; } @@ -86,8 +80,7 @@ * @param nHi higher 32bits * @return the built long */ - public static long makeLong(int nLo, int nHi) - { + public static long makeLong(int nLo, int nHi) { return (((long) nHi << 32) | ((long) nLo & 0x00000000ffffffffL)); } @@ -97,8 +90,7 @@ * @param lVal the long integer * @return lower 32 bits */ - public static int longLo32(long lVal) - { + public static int longLo32(long lVal) { return (int) lVal; } @@ -108,8 +100,7 @@ * @param lVal the long integer * @return higher 32 bits */ - public static int longHi32(long lVal) - { + public static int longHi32(long lVal) { return (int) ((long) (lVal >>> 32)); } @@ -119,8 +110,7 @@ * @param data the byte array * @return the binhex string */ - public static String bytesToBinHex(byte[] data) - { + public static String bytesToBinHex(byte[] data) { // just map the call return bytesToBinHex(data, 0, data.length); } @@ -133,16 +123,14 @@ * @param nNumOfBytes number of bytes to convert * @return the binhex string */ - public static String bytesToBinHex(byte[] data, int nStartPos, int nNumOfBytes) - { + public static String bytesToBinHex(byte[] data, int nStartPos, int nNumOfBytes) { StringBuffer sbuf = new StringBuffer(); sbuf.setLength(nNumOfBytes << 1); int nPos = 0; - for (int nI = 0; nI < nNumOfBytes; nI++) - { + for (int nI = 0; nI < nNumOfBytes; nI++) { sbuf.setCharAt(nPos++, HEXTAB[(data[nI + nStartPos] >> 4) & 0x0f]); sbuf.setCharAt(nPos++, HEXTAB[data[nI + nStartPos] & 0x0f]); } @@ -161,52 +149,43 @@ * @param nNumOfBytes number of bytes to extract * @return number of extracted bytes */ - public static int binHexToBytes(String sBinHex, byte[] data, int nSrcPos, int nDstPos, int nNumOfBytes) - { + public static int binHexToBytes(String sBinHex, byte[] data, int nSrcPos, int nDstPos, int nNumOfBytes) { // check for correct ranges int nStrLen = sBinHex.length(); int nAvailBytes = (nStrLen - nSrcPos) >> 1; - if (nAvailBytes < nNumOfBytes) - { + if (nAvailBytes < nNumOfBytes) { nNumOfBytes = nAvailBytes; } int nOutputCapacity = data.length - nDstPos; - if (nNumOfBytes > nOutputCapacity) - { + if (nNumOfBytes > nOutputCapacity) { nNumOfBytes = nOutputCapacity; } // convert now int nResult = 0; - for (int nI = 0; nI < nNumOfBytes; nI++) - { + for (int nI = 0; nI < nNumOfBytes; nI++) { byte bActByte = 0; boolean blConvertOK = true; - for (int nJ = 0; nJ < 2; nJ++) - { + for (int nJ = 0; nJ < 2; nJ++) { bActByte <<= 4; char cActChar = sBinHex.charAt(nSrcPos++); - if ((cActChar >= 'a') && (cActChar <= 'f')) - { + if ((cActChar >= 'a') && (cActChar <= 'f')) { bActByte |= (byte) (cActChar - 'a') + 10; - } else if ((cActChar >= '0') && (cActChar <= '9')) - { + } else if ((cActChar >= '0') && (cActChar <= '9')) { bActByte |= (byte) (cActChar - '0'); - } else - { + } else { blConvertOK = false; } } - if (blConvertOK) - { + if (blConvertOK) { data[nDstPos++] = bActByte; nResult++; } @@ -223,16 +202,14 @@ * @param nNumOfBytes number of bytes to handle * @return the string */ - public static String byteArrayToUNCString(byte[] data, int nStartPos, int nNumOfBytes) - { + public static String byteArrayToUNCString(byte[] data, int nStartPos, int nNumOfBytes) { // we need two bytes for every character nNumOfBytes &= ~1; // enough bytes in the buffer? int nAvailCapacity = data.length - nStartPos; - if (nAvailCapacity < nNumOfBytes) - { + if (nAvailCapacity < nNumOfBytes) { nNumOfBytes = nAvailCapacity; } @@ -242,8 +219,7 @@ int nSBufPos = 0; - while (nNumOfBytes > 0) - { + while (nNumOfBytes > 0) { sbuf.setCharAt(nSBufPos++, (char) (((int) data[nStartPos] << 8) | ((int) data[nStartPos + 1] & 0x0ff))); nStartPos += 2; nNumOfBytes -= 2; @@ -252,8 +228,7 @@ return sbuf.toString(); } - public static long[] marshalByteArray(byte[] raws, boolean hasSignature) - { + public static long[] marshalByteArray(byte[] raws, boolean hasSignature) { int remainder = raws.length % 8; ByteBuffer rawData = ByteBuffer.wrap(raws); @@ -262,36 +237,32 @@ LongBuffer longBuffer = ((ByteBuffer) rawData.rewind()).asLongBuffer(); int resultSize = longBuffer.limit() + ((remainder != 0) - ? 1 - : 0) + (hasSignature - ? 1 - : 0); + ? 1 + : 0) + (hasSignature + ? 1 + : 0); long[] result = new long[resultSize]; int i = 0; - if (hasSignature) - { + if (hasSignature) { result[i] = raws.length; i++; } - while (longBuffer.hasRemaining()) - { + while (longBuffer.hasRemaining()) { result[i] = longBuffer.get(); i++; } - if (remainder != 0) - { + if (remainder != 0) { int pos = (i - (hasSignature - ? 1 - : 0)) * 8; + ? 1 + : 0)) * 8; // int pos = rawData.position(); byte[] temp = new byte[8]; - for (int j = 0; j < remainder; j++) - { + for (int j = 0; j < remainder; j++) { temp[7 - j] = raws[pos + j]; } @@ -302,16 +273,14 @@ return result; } - public static byte[] unmarshalByteArray(long[] raws, boolean hasSignature) - { + public static byte[] unmarshalByteArray(long[] raws, boolean hasSignature) { LongBuffer longBuffer = LongBuffer.wrap(raws); int resultBufferSize = (raws.length - (hasSignature - ? 1 - : 0)) * 8; + ? 1 + : 0)) * 8; int resultSize = resultBufferSize; - if (hasSignature) - { + if (hasSignature) { resultSize = (int) longBuffer.get(); } @@ -319,13 +288,11 @@ result.order(ByteOrder.LITTLE_ENDIAN); - while (longBuffer.hasRemaining()) - { + while (longBuffer.hasRemaining()) { result.putLong(longBuffer.get()); } - if (resultSize == resultBufferSize) - { + if (resultSize == resultBufferSize) { return result.array(); } @@ -337,8 +304,7 @@ return resultData; } - public static long[] marshalCompactByteArray(byte[] raws) - { + public static long[] marshalCompactByteArray(byte[] raws) { byte[] compactRaws = new byte[raws.length + 2]; ByteBuffer bbCompact = ByteBuffer.wrap(compactRaws); bbCompact.order(ByteOrder.LITTLE_ENDIAN); @@ -348,8 +314,7 @@ return longData; } - public static byte[] unmarshalCompactByteArray(long[] raws) - { + public static byte[] unmarshalCompactByteArray(long[] raws) { byte[] rawData = BinConverter.unmarshalByteArray(raws, false); ByteBuffer bbCompact = ByteBuffer.wrap(rawData); diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/Bits.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/Bits.java index 5e529ac..c924225 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/Bits.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/Bits.java @@ -12,10 +12,9 @@ * Bits * User: Ulysses * Date: 2007/6/17 - * Time: �W�� 01:16:39 + * Time: 01:16:39 */ -public class Bits -{ +public class Bits { // -- Unsafe access -- // private static final Unsafe unsafe = Unsafe.getUnsafe(); @@ -33,164 +32,133 @@ private static volatile long reservedMemory = 0; private static boolean memoryLimitSet = false; - private Bits() - { + private Bits() { } // -- Swapping -- - public static short swap(short x) - { + public static short swap(short x) { return (short) ((x << 8) | ((x >> 8) & 0xff)); } - public static char swap(char x) - { + public static char swap(char x) { return (char) ((x << 8) | ((x >> 8) & 0xff)); } - public static int swap(int x) - { + public static int swap(int x) { return (int) ((swap((short) x) << 16) | (swap((short) (x >> 16)) & 0xffff)); } - public static long swap(long x) - { + public static long swap(long x) { return (long) (((long) swap((int) (x)) << 32) | ((long) swap((int) (x >> 32)) & 0xffffffffL)); } // -- get/put char -- - static private char makeChar(byte b1, byte b0) - { + static private char makeChar(byte b1, byte b0) { return (char) ((b1 << 8) | (b0 & 0xff)); } - private static byte char1(char x) - { + private static byte char1(char x) { return (byte) (x >> 8); } - private static byte char0(char x) - { + private static byte char0(char x) { return (byte) (x >> 0); } // --get/put short-- - public static short makeShort(byte b1, byte b0) - { + public static short makeShort(byte b1, byte b0) { return (short) ((b1 << 8) | (b0 & 0xff)); } - private static byte short1(short x) - { + private static byte short1(short x) { return (byte) (x >> 8); } - public static byte short0(short x) - { + public static byte short0(short x) { return (byte) (x >> 0); } // -- get/put int -- - public static int makeInt(byte b3, byte b2, byte b1, byte b0) - { + public static int makeInt(byte b3, byte b2, byte b1, byte b0) { return (int) ((((b3 & 0xff) << 24) | ((b2 & 0xff) << 16) | ((b1 & 0xff) << 8) | ((b0 & 0xff) << 0))); } - public static int makeInt(short hiword, short loword) - { + public static int makeInt(short hiword, short loword) { return ((hiword & 0xffff) << 16) + (loword & 0xffff); } - public static short getHiShort(int qwValue) - { + public static short getHiShort(int qwValue) { return ((short) (qwValue >>> 16)); } - public static short getLoShort(int qwValue) - { + public static short getLoShort(int qwValue) { return ((short) (qwValue & 0xFFFF)); } - public static byte int3(int x) - { + public static byte int3(int x) { return (byte) (x >> 24); } - public static byte int2(int x) - { + public static byte int2(int x) { return (byte) (x >> 16); } - private static byte int1(int x) - { + private static byte int1(int x) { return (byte) (x >> 8); } - private static byte int0(int x) - { + private static byte int0(int x) { return (byte) (x >> 0); } // -- get/put long -- - public static long makeLong(byte b7, byte b6, byte b5, byte b4, byte b3, byte b2, byte b1, byte b0) - { + public static long makeLong(byte b7, byte b6, byte b5, byte b4, byte b3, byte b2, byte b1, byte b0) { return ((((long) b7 & 0xff) << 56) | (((long) b6 & 0xff) << 48) | (((long) b5 & 0xff) << 40) | (((long) b4 & 0xff) << 32) - | (((long) b3 & 0xff) << 24) | (((long) b2 & 0xff) << 16) | (((long) b1 & 0xff) << 8) - | (((long) b0 & 0xff) << 0)); + | (((long) b3 & 0xff) << 24) | (((long) b2 & 0xff) << 16) | (((long) b1 & 0xff) << 8) + | (((long) b0 & 0xff) << 0)); } - public static long makeLong(int LoValue, int HiValue) - { + public static long makeLong(int LoValue, int HiValue) { return (((long) HiValue & 0xFFFFFFFF) << 32) + (((long) LoValue) & 0xFFFFFFFF); } - public static int getHiInt(long qwValue) - { + public static int getHiInt(long qwValue) { return ((int) (qwValue >>> 32)); } - public static int getLoInt(long qwValue) - { + public static int getLoInt(long qwValue) { return ((int) (qwValue & 0xFFFFFFFF)); } - private static byte long7(long x) - { + private static byte long7(long x) { return (byte) (x >> 56); } - private static byte long6(long x) - { + private static byte long6(long x) { return (byte) (x >> 48); } - private static byte long5(long x) - { + private static byte long5(long x) { return (byte) (x >> 40); } - private static byte long4(long x) - { + private static byte long4(long x) { return (byte) (x >> 32); } - private static byte long3(long x) - { + private static byte long3(long x) { return (byte) (x >> 24); } - private static byte long2(long x) - { + private static byte long2(long x) { return (byte) (x >> 16); } - private static byte long1(long x) - { + private static byte long1(long x) { return (byte) (x >> 8); } - private static byte long0(long x) - { + private static byte long0(long x) { return (byte) (x >> 0); } @@ -253,10 +221,8 @@ } */ - static boolean unaligned() - { - if (unalignedKnown) - { + static boolean unaligned() { + if (unalignedKnown) { return unaligned; } @@ -272,18 +238,14 @@ // These methods should be called whenever direct memory is allocated or // freed. They allow the user to control the amount of direct memory // which a process may access. All sizes are specified in bytes. - static void reserveMemory(long size) - { - synchronized (Bits.class) - { - if (!memoryLimitSet && VM.isBooted()) - { + static void reserveMemory(long size) { + synchronized (Bits.class) { + if (!memoryLimitSet && VM.isBooted()) { maxMemory = VM.maxDirectMemory(); memoryLimitSet = true; } - if (size <= maxMemory - reservedMemory) - { + if (size <= maxMemory - reservedMemory) { reservedMemory += size; return; @@ -292,19 +254,15 @@ System.gc(); - try - { + try { Thread.sleep(100); - } catch (InterruptedException x) - { + } catch (InterruptedException x) { // Restore interrupt status Thread.currentThread().interrupt(); } - synchronized (Bits.class) - { - if (reservedMemory + size > maxMemory) - { + synchronized (Bits.class) { + if (reservedMemory + size > maxMemory) { throw new OutOfMemoryError("Direct buffer memory"); } @@ -312,10 +270,8 @@ } } - static synchronized void unreserveMemory(long size) - { - if (reservedMemory > 0) - { + static synchronized void unreserveMemory(long size) { + if (reservedMemory > 0) { reservedMemory -= size; assert (reservedMemory > -1); } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ByteArrayCompressor.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ByteArrayCompressor.java index f22eaec..22e1be5 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ByteArrayCompressor.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ByteArrayCompressor.java @@ -12,13 +12,10 @@ * ByteArrayCompressor * User: Ulysses * Date: 2007/6/15 - * Time: �U�� 02:21:00 * To change this template use File | Settings | File Templates. */ -public final class ByteArrayCompressor -{ - public static byte[] decompressByteArray(byte[] raw) - { +public final class ByteArrayCompressor { + public static byte[] decompressByteArray(byte[] raw) { // Create the decompressor and give it the data to compress Inflater decompressor = new Inflater(); @@ -30,23 +27,18 @@ // Decompress the data byte[] buf = new byte[1024]; - while (!decompressor.finished()) - { - try - { + while (!decompressor.finished()) { + try { int count = decompressor.inflate(buf); bos.write(buf, 0, count); - } catch (DataFormatException e) - { + } catch (DataFormatException e) { } } - try - { + try { bos.close(); - } catch (IOException e) - { + } catch (IOException e) { } // Get the decompressed data @@ -55,8 +47,7 @@ return decompressedData; } - public static byte[] compressByteArray(byte[] raw) - { + public static byte[] compressByteArray(byte[] raw) { // Create the compressor with highest level of compression Deflater compressor = new Deflater(); @@ -75,18 +66,15 @@ // Compress the data byte[] buf = new byte[1024]; - while (!compressor.finished()) - { + while (!compressor.finished()) { int count = compressor.deflate(buf); bos.write(buf, 0, count); } - try - { + try { bos.close(); - } catch (IOException e) - { + } catch (IOException e) { } // Get the compressed data diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ColorTableMapping.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ColorTableMapping.java index a93c23e..0a6c01d 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ColorTableMapping.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ColorTableMapping.java @@ -3,8 +3,7 @@ import java.awt.Color; import java.util.List; -public interface ColorTableMapping -{ +public interface ColorTableMapping { boolean contain(Color color); List findId(Color color); diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ConnectivityDirectionEnum.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ConnectivityDirectionEnum.java new file mode 100644 index 0000000..9d64738 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ConnectivityDirectionEnum.java @@ -0,0 +1,275 @@ +package com.ximple.eofms.util; + +/** + * + * TODO Purpose of + * <p> + * + * </p> + * @author Ulysses + * @since 1.1.0 + */ +public enum ConnectivityDirectionEnum { + Noneflow((short) 0), + + ForwardflowON((short) 0x01), + + BackflowON((short) 0x02), + + ForwardflowOFF((short) 0x03), + + BackflowOFF((short) 0x04), + + ForwardFixflowON((short) 0x05), + + ForwardFixflowOFF((short) 0x06), + + BackFixflowON((short) 0x07), + + BackFixflowOFF((short) 0x08), + + Breakflow((short) 0x62), + + Nondeterminate((short) 0x63), + + PhaseAON((short) 0x64), // 100 + + PhaseBON((short) 0xC8), // 200 + + PhaseCON((short) 0x190); // 400 + + private final short value; + + ConnectivityDirectionEnum(short value) { + this.value = value; + } + + public short getValue() { + return this.value; + } + + public static ConnectivityDirectionEnum convertShort(short val) { + if (val == 0) + return Noneflow; + if (val == 0x1) + return ForwardflowON; + if (val == 0x2) + return BackflowON; + if (val == 0x3) + return ForwardflowOFF; + if (val == 0x4) + return BackflowOFF; + if (val == 0x5) + return ForwardFixflowON; + if (val == 0x6) + return ForwardFixflowOFF; + if (val == 0x7) + return BackFixflowON; + if (val == 0x8) + return BackFixflowOFF; + if (val == 0x62) + return Breakflow; + return Nondeterminate; + } + + public static boolean isOn(short val) { + short dir = (short) (val & 0x00ff); + switch (dir) { + case 0x0: + case 0x1: + case 0x2: + case 0x5: + case 0x7: + return true; + } + + return false; + } + + public static boolean isOff(short val) { + return (!isOn(val)); + } + + public static boolean isForward(short val) { + short dir = (short) (val & 0x00ff); + switch (dir) { + case 0x1: + case 0x3: + case 0x5: + case 0x6: + return true; + } + + return false; + } + + public static boolean isBackward(short val) { + short dir = (short) (val & 0x00ff); + switch (dir) { + case 0x2: + case 0x4: + case 0x7: + case 0x8: + return true; + } + + return false; + } + + public static boolean isFixDirection(short val) { + short dir = (short) (val & 0x00ff); + switch (dir) { + case 0x5: + case 0x6: + case 0x7: + case 0x8: + return true; + } + + return false; + } + + public static boolean isNondeterminate(short val) { + short dir = (short) (val & 0x00ff); + return (dir == 0x63); + } + + public static short getWeight(short val) { + short weight = (short) (val & 0xff00); + return (short) (weight >>> 8); + } + + @Override + public String toString() { + boolean isA = (this.value & PhaseAON.getValue()) != 0; + boolean isB = (this.value & PhaseBON.getValue()) != 0; + boolean isC = (this.value & PhaseCON.getValue()) != 0; + String phase = "" + (isA ? "A" : "") + (isB ? "B" : "") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + + (isC ? "C" : ""); //$NON-NLS-1$ //$NON-NLS-2$ + if (phase.length() != 0) + phase = "[" + phase + "]"; //$NON-NLS-1$ //$NON-NLS-2$ + + if (value == 0) + return "Noneflow" + phase; //$NON-NLS-1$ + if (value == 0x1) + return "ForwardflowON" + phase; //$NON-NLS-1$ + if (value == 0x2) + return "BackflowON" + phase; //$NON-NLS-1$ + if (value == 0x3) + return "ForwardflowOFF" + phase; //$NON-NLS-1$ + if (value == 0x4) + return "BackflowOFF" + phase; //$NON-NLS-1$ + if (value == 0x5) + return "ForwardFixflowON" + phase; //$NON-NLS-1$ + if (value == 0x6) + return "ForwardFixflowOFF" + phase; //$NON-NLS-1$ + if (value == 0x7) + return "BackFixflowON" + phase; //$NON-NLS-1$ + if (value == 0x8) + return "BackFixflowOFF" + phase; //$NON-NLS-1$ + if (value == 0x62) + return "Breakflow" + phase; //$NON-NLS-1$ + return "Nondeterminate"; //$NON-NLS-1$ + } + + /* + * + * enum DirectionType { Noneflow = 0, ForwardflowON = 0x01, BackflowON = + * 0x02, ForwardflowOFF = 0x03, BackflowOFF = 0x04, ForwardFixflowON = 0x05, + * ForwardFixflowOFF = 0x06, BackFixflowON = 0x07, BackFixflowOFF = 0x08, + * Breakflow = 0x62, Nondeterminate = 0x63, PhaseAON = 0x64, // 100 PhaseBON + * = 0xC8, // 200 PhaseCON = 0x190 // 400 }; + * + * enum OperationType { OFF = 0, ON = 0x01, NSTATUS = 0x10 }; + * + * + * enum tagNetworkEdgeFlowType { FLOWUNKNOWN = 0x0000, // "???w" FLOWFORWARD + * = 0x0001, // "???V" FLOWBACKWARD = 0x0002, // "�Xf?V" FLOWTWOWAY = + * 0x0003, // "???V" FLOWBREAK = 0x00F0, // "???_" FLOWUNDELEGATED = 0x00FF, + * // "?L�PN?q" + * + * FLOWWT_1 = 0x0100, // A FLOWWT_2 = 0x0200, // B FLOWWT_3 = 0x0400, // C + * FLOWWT_4 = 0x0800, // ?-Unused + * + * FLOWON = 0x1000, // "On" FLOWOFF = 0x0000, // "Off" + * + * FLOWFIX = 0x2000, // Fix Dir + * + * FLOWONMASK = 0xF000, FLOWWTMASK = 0x0F00, FLOWWAYMASK = 0x00FF }; + * + * enum tagNetworkEdgeOStatusType { OPSTATUS_OFF = 0x0000, OPSTATUS_ON = + * 0x0001, BOUNDSTATUS = 0x0010, OPSTATUSMASK = 0x000F }; + * + * enum tagPhaseMask { PhaseUnknown = 0x0, PhaseA = 0x1, PhaseB = 0x2, + * PhaseC = 0x4, PhaseN = 0x8 }; + * + * BYTE CNetworkSnapshot::marshalDIRFromDirection(short wFlag) { // BYTE + * bRet = 0xFF; bool bON; bool bFix; if ((wFlag & CNetworkEdge::FLOWONMASK) + * == CNetworkEdge::FLOWON) bON = true; else bON = false; if ((wFlag & + * CNetworkEdge::FLOWONMASK) == CNetworkEdge::FLOWFIX) bFix = true; else + * bFix = false; + * + * switch (wFlag & CNetworkEdge::FLOWWAYMASK) { case + * CNetworkEdge::FLOWFORWARD: if (bFix) if (bON) return + * CFacility::ForwardFixflowON ; else return CFacility::ForwardFixflowOFF; + * else if (bON) return CFacility::ForwardflowON; else return + * CFacility::ForwardflowOFF; + * + * case CNetworkEdge::FLOWBACKWARD: if (bFix) if (bON) return + * CFacility::BackFixflowON; else return CFacility::BackFixflowOFF; else if + * (bON) return CFacility::BackflowON; else return CFacility::BackflowOFF; + * + * case CNetworkEdge::FLOWUNKNOWN: case CNetworkEdge::FLOWTWOWAY: return + * CFacility::Noneflow; + * + * case CNetworkEdge::FLOWBREAK: return CFacility::Breakflow; + * + * case CNetworkEdge::FLOWUNDELEGATED: return CFacility::Nondeterminate; + * + * default: break; } + * + * return 0xFF; } + * + * short CNetworkSnapshot::marshalDirectionFromDIR(WORD bFlag) { short wRet + * = CNetworkEdge::FLOWUNDELEGATED; switch (bFlag) { case + * CFacility::Noneflow: wRet = CNetworkEdge::FLOWUNKNOWN; break; case + * CFacility::ForwardflowON: wRet = CNetworkEdge::FLOWFORWARD | + * CNetworkEdge::FLOWON; break; case CFacility::BackflowON: wRet = + * CNetworkEdge::FLOWBACKWARD | CNetworkEdge::FLOWON; break; case + * CFacility::ForwardflowOFF: wRet = CNetworkEdge::FLOWFORWARD; break; case + * CFacility::BackflowOFF: wRet = CNetworkEdge::FLOWBACKWARD; break; case + * CFacility::ForwardFixflowON: wRet = CNetworkEdge::FLOWFORWARD | + * CNetworkEdge::FLOWON | CNetworkEdge::FLOWFIX; break; case + * CFacility::ForwardFixflowOFF: wRet = CNetworkEdge::FLOWFORWARD | + * CNetworkEdge::FLOWFIX; break; case CFacility::BackFixflowON: wRet = + * CNetworkEdge::FLOWBACKWARD | CNetworkEdge::FLOWON | + * CNetworkEdge::FLOWFIX; break; case CFacility::BackFixflowOFF: wRet = + * CNetworkEdge::FLOWBACKWARD | CNetworkEdge::FLOWFIX; break; case + * CFacility::Breakflow: wRet = CNetworkEdge::FLOWBREAK; break; case + * CFacility::Nondeterminate: wRet = CNetworkEdge::FLOWUNDELEGATED; break; + * default: break; } return wRet; } + * + * short CNetworkSnapshot::marshalPhaseToMask(short wPhase) { short + * wMaskValue = 0; + * + * if (wPhase == 1) { wMaskValue |= CNetworkEdge::PhaseA | + * CNetworkEdge::PhaseB | CNetworkEdge::PhaseC; return wMaskValue; } + * + * if (wPhase > 16) { wMaskValue = CNetworkEdge::PhaseN; wPhase -= 16; } + * + * if (wPhase > 10) { wMaskValue |= CNetworkEdge::PhaseA | + * CNetworkEdge::PhaseB | CNetworkEdge::PhaseC; return wMaskValue; } + * + * switch (wPhase) { case 5: // AB case 6: // BA wMaskValue |= + * CNetworkEdge::PhaseA | CNetworkEdge::PhaseB; break; case 7: // BC case 8: + * // CB wMaskValue |= CNetworkEdge::PhaseB | CNetworkEdge::PhaseC; break; + * case 9: // CA case 10: // AC wMaskValue |= CNetworkEdge::PhaseA | + * CNetworkEdge::PhaseC; break; case 2: // A wMaskValue |= + * CNetworkEdge::PhaseA; break; case 3: // B wMaskValue |= + * CNetworkEdge::PhaseB; break; case 4: // C wMaskValue |= + * CNetworkEdge::PhaseC; break; default: wMaskValue |= + * CNetworkEdge::PhaseUnknown; break; } + * + * return wMaskValue; } + */ +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/DefaultColorTable.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/DefaultColorTable.java index 36c1a5f..ade64f4 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/DefaultColorTable.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/DefaultColorTable.java @@ -4,14 +4,11 @@ import java.util.ArrayList; import java.util.List; -public class DefaultColorTable implements ColorTableMapping -{ +public class DefaultColorTable implements ColorTableMapping { private static DefaultColorTable _instance = null; - public static ColorTableMapping getInstance() - { - if (_instance == null) - { + public static ColorTableMapping getInstance() { + if (_instance == null) { _instance = new DefaultColorTable(); } @@ -20,15 +17,12 @@ private ArrayList<Color> colortable = null; - private DefaultColorTable() - { + private DefaultColorTable() { initializeColorTable(); } - private void initializeColorTable() - { - if (colortable != null) - { + private void initializeColorTable() { + if (colortable != null) { return; } @@ -290,76 +284,61 @@ colortable.add(254, new Color(30, 52, 0)); } - public List findId(Color color) - { + public List findId(Color color) { ArrayList<Integer> codelist = new ArrayList<Integer>(); - for (int i = 0; i < colortable.size(); i++) - { + for (int i = 0; i < colortable.size(); i++) { Color colorDef = colortable.get(i); - if (colorDef.equals(color)) - { + if (colorDef.equals(color)) { codelist.add(i); } } return codelist; } - public Color getColor(int i) - { + public Color getColor(int i) { return colortable.get(i); } - public String getColorCode(int i) - { + public String getColorCode(int i) { Color color = colortable.get(i); if (!color.equals(Color.WHITE)) return colorToString(colortable.get(i)); return colorToString(Color.GRAY); } - public boolean contain(Color color) - { - for (Color colorDef : colortable) - { - if (colorDef.equals(color)) - { + public boolean contain(Color color) { + for (Color colorDef : colortable) { + if (colorDef.equals(color)) { return true; } } return false; } - private static String colorToString(Color c) - { + private static String colorToString(Color c) { char[] buf = new char[7]; buf[0] = '#'; String s = Integer.toHexString(c.getRed()); - if (s.length() == 1) - { + if (s.length() == 1) { buf[1] = '0'; buf[2] = s.charAt(0); - } else - { + } else { buf[1] = s.charAt(0); buf[2] = s.charAt(1); } s = Integer.toHexString(c.getGreen()); - if (s.length() == 1) - { + if (s.length() == 1) { buf[3] = '0'; buf[4] = s.charAt(0); - } else - { + } else { buf[3] = s.charAt(0); buf[4] = s.charAt(1); } s = Integer.toHexString(c.getBlue()); - if (s.length() == 1) - { + if (s.length() == 1) { buf[5] = '0'; buf[6] = s.charAt(0); - } else - { + } else { buf[5] = s.charAt(0); buf[6] = s.charAt(1); } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/EPSG3825GeometryConverterDecorator.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/EPSG3825GeometryConverterDecorator.java new file mode 100644 index 0000000..c0335b9 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/EPSG3825GeometryConverterDecorator.java @@ -0,0 +1,66 @@ +package com.ximple.eofms.util; + +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.CoordinateSequence; +import com.vividsolutions.jts.geom.CoordinateSequenceFilter; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.GeometryFactory; +import com.vividsolutions.jts.util.Assert; + +import com.ximple.io.dgn7.GeometryConverter; + +public class EPSG3825GeometryConverterDecorator implements GeometryConverterDecorator { + private GeometryConverter converter; + private EPSG3825ConvertFilter coordinatesFilter = new EPSG3825ConvertFilter(); + + public EPSG3825GeometryConverterDecorator() { + } + + public GeometryConverter getConverter() { + return converter; + } + + public void setConverter(GeometryConverter converter) { + this.converter = converter; + } + + protected EPSG3825ConvertFilter getCoordinatesFilter() { + return coordinatesFilter; + } + + protected void setCoordinatesFilter(EPSG3825ConvertFilter coordinatesFilter) { + this.coordinatesFilter = coordinatesFilter; + } + + public Geometry toGeometry(GeometryFactory factory) { + if (converter == null) Assert.shouldNeverReachHere(); + + coordinatesFilter.reset(); + + Geometry geom = converter.toGeometry(factory); + if (geom == null) return null; + geom.apply(coordinatesFilter); + return geom; + } + + protected class EPSG3825ConvertFilter implements CoordinateSequenceFilter { + public void filter(CoordinateSequence coordinateSequence, int i) { + Coordinate pt = coordinateSequence.getCoordinate(i); + Coordinate pt97 = TWDDatumConverter.fromTM2ToEPSG3825(pt); + pt.x = pt97.x; + pt.y = pt97.y; + pt.z = pt97.z; + } + + public boolean isDone() { + return false; + } + + public boolean isGeometryChanged() { + return true; + } + + public void reset() { + } + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/EPSG3826GeometryConverterDecorator.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/EPSG3826GeometryConverterDecorator.java new file mode 100644 index 0000000..ecf0445 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/EPSG3826GeometryConverterDecorator.java @@ -0,0 +1,66 @@ +package com.ximple.eofms.util; + +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.CoordinateSequence; +import com.vividsolutions.jts.geom.CoordinateSequenceFilter; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.GeometryFactory; +import com.vividsolutions.jts.util.Assert; + +import com.ximple.io.dgn7.GeometryConverter; + +public class EPSG3826GeometryConverterDecorator implements GeometryConverterDecorator { + private GeometryConverter converter; + private EPSG3826ConvertFilter coordinatesFilter = new EPSG3826ConvertFilter(); + + public EPSG3826GeometryConverterDecorator() { + } + + public GeometryConverter getConverter() { + return converter; + } + + public void setConverter(GeometryConverter converter) { + this.converter = converter; + } + + protected EPSG3826ConvertFilter getCoordinatesFilter() { + return coordinatesFilter; + } + + protected void setCoordinatesFilter(EPSG3826ConvertFilter coordinatesFilter) { + this.coordinatesFilter = coordinatesFilter; + } + + public Geometry toGeometry(GeometryFactory factory) { + if (converter == null) Assert.shouldNeverReachHere(); + + coordinatesFilter.reset(); + + Geometry geom = converter.toGeometry(factory); + if (geom == null) return null; + geom.apply(coordinatesFilter); + return geom; + } + + protected class EPSG3826ConvertFilter implements CoordinateSequenceFilter { + public void filter(CoordinateSequence coordinateSequence, int i) { + Coordinate pt = coordinateSequence.getCoordinate(i); + Coordinate pt97 = TWDDatumConverter.fromTM2ToEPSG3826(pt); + pt.x = pt97.x; + pt.y = pt97.y; + pt.z = pt97.z; + } + + public boolean isDone() { + return false; + } + + public boolean isGeometryChanged() { + return true; + } + + public void reset() { + } + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ElementDigesterUtils.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ElementDigesterUtils.java new file mode 100644 index 0000000..393f76e --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/ElementDigesterUtils.java @@ -0,0 +1,25 @@ +package com.ximple.eofms.util; + +import com.ximple.eofms.filter.ElementDispatcher; +import org.apache.commons.digester3.Digester; +import org.apache.commons.digester3.binder.DigesterLoader; +import org.apache.commons.digester3.xmlrules.FromXmlRulesModule; + +public class ElementDigesterUtils { + protected static Digester digester = null; + protected static DigesterLoader loader = DigesterLoader.newLoader( new FromXmlRulesModule() { + @Override + protected void loadRules() { + loadXMLRules(ElementDispatcher.class.getResource("ElementDispatcherRules.xml")); + } + + } ); + + static { + digester = loader.newDigester(); + } + + public static Digester getElementDigester() { + return digester; + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/FeatureTypeBuilderUtil.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/FeatureTypeBuilderUtil.java index 7dd10cf..584ffe4 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/FeatureTypeBuilderUtil.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/FeatureTypeBuilderUtil.java @@ -1,269 +1,772 @@ package com.ximple.eofms.util; -import org.geotools.feature.AttributeTypeFactory; -import org.geotools.feature.FeatureTypeBuilder; +import java.util.ArrayList; +import java.util.TreeMap; -import com.vividsolutions.jts.geom.GeometryFactory; -import com.vividsolutions.jts.geom.Point; -import com.vividsolutions.jts.geom.Polygon; import com.vividsolutions.jts.geom.LineString; import com.vividsolutions.jts.geom.MultiLineString; import com.vividsolutions.jts.geom.MultiPoint; +import com.vividsolutions.jts.geom.Point; +import com.vividsolutions.jts.geom.Polygon; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; +import org.geotools.feature.AttributeTypeBuilder; +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; +import org.geotools.referencing.CRS; +import org.opengis.feature.type.AttributeDescriptor; +import org.opengis.feature.type.AttributeType; +import org.opengis.feature.type.GeometryType; +import org.opengis.referencing.FactoryException; +import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.opengis.referencing.operation.MathTransform; -public final class FeatureTypeBuilderUtil -{ - protected static GeometryFactory _geomFactory = new GeometryFactory(); - private static boolean notAllowNull = false ; +public final class FeatureTypeBuilderUtil { - public static boolean isNotAllowNull() - { + protected static final String DEFAULTNAMESPACE = "http://www.ximple.com.tw/tpc/"; + + private static final Logger LOGGER = LogManager.getLogger(FeatureTypeBuilderUtil.class); + private static boolean notAllowNull = false; + private static boolean allowNull = true; + + public static boolean isNotAllowNull() { return notAllowNull; } - public static void setNotAllowNull(boolean notAllowNull) - { + public static void setNotAllowNull(boolean notAllowNull) { FeatureTypeBuilderUtil.notAllowNull = notAllowNull; } - public static FeatureTypeBuilder createNormalPointFeatureTypeBuilder(String featureName) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", Point.class, true)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12, "")); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("font", Short.class, notAllowNull, 1, (short) 0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("just", Short.class, notAllowNull, 1, (short) 0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("height", Float.class, notAllowNull, 1, (float) 1.0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("width", Float.class, notAllowNull, 1, (float) 1.0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("angle", Float.class, notAllowNull, 1, (float) 0.0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("context", String.class, notAllowNull, 254, "")); + protected static AttributeType createAttributeType(String name, Class clazz, boolean isNillable) { + AttributeTypeBuilder attrBuilder = new AttributeTypeBuilder(); + attrBuilder.setName(name); + attrBuilder.setBinding(clazz); + attrBuilder.setNillable(isNillable); + return attrBuilder.buildType(); + } + + protected static GeometryType createGeometryType(AttributeTypeBuilder attrBuilder, + String name, Class clazz, boolean isNillable, + CoordinateReferenceSystem crs) { + return createGeometryType(attrBuilder, name, clazz, isNillable, crs, null); + } + + protected static GeometryType createGeometryType(AttributeTypeBuilder attrBuilder, + String name, Class clazz, boolean isNillable, + CoordinateReferenceSystem crs, + Object defaultValue) { + attrBuilder.setName(name); + attrBuilder.setBinding(clazz); + attrBuilder.setNillable(isNillable); + if (defaultValue != null) attrBuilder.setDefaultValue(defaultValue); + if (crs != null) attrBuilder.setCRS(crs); + return attrBuilder.buildGeometryType(); + } + + protected static AttributeType createAttributeType(AttributeTypeBuilder attrBuilder, + String name, Class clazz, boolean isNillable) { + attrBuilder.setName(name); + attrBuilder.setBinding(clazz); + attrBuilder.setNillable(isNillable); + return attrBuilder.buildType(); + } + + protected static AttributeType createAttributeType(AttributeTypeBuilder attrBuilder, + String name, Class clazz, boolean isNillable, Object defaultValue) { + attrBuilder.setName(name); + attrBuilder.setBinding(clazz); + attrBuilder.setNillable(isNillable); + attrBuilder.setDefaultValue(defaultValue); + return attrBuilder.buildType(); + } + + protected static AttributeType createAttributeType(AttributeTypeBuilder attrBuilder, + String name, Class clazz, boolean isNillable, int len, + Object defaultValue) { + attrBuilder.setName(name); + attrBuilder.setBinding(clazz); + attrBuilder.setNillable(isNillable); + attrBuilder.setLength(len); + attrBuilder.setDefaultValue(defaultValue); + return attrBuilder.buildType(); + } + + public static SimpleFeatureTypeBuilder createNormalPointFeatureTypeBuilder(String featureName) { + SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder(); + typeBuilder.setName(featureName); + typeBuilder.setNamespaceURI(DEFAULTNAMESPACE); + + // typeBuilder.add("geom", Point.class, -1); + AttributeTypeBuilder attrBuilder; + ArrayList<AttributeDescriptor> attrDescs = new ArrayList<AttributeDescriptor>(); + + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "geom", createGeometryType(attrBuilder, "PointType", Point.class, false, lookupCRS(defaultSRID)))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + */ + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "font", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "just", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "height", createAttributeType(attrBuilder, "FloatType", Float.class, notAllowNull, 1, (float) 1.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "width", createAttributeType(attrBuilder, "FloatType", Float.class, notAllowNull, 1, (float) 1.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "angle", createAttributeType(attrBuilder, "FloatType", Float.class, notAllowNull, 1, (float) 0.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "context", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 254, ""))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1))); + */ + typeBuilder.addAll(attrDescs); return typeBuilder; } - public static FeatureTypeBuilder createNormalLineFeatureTypeBuilder(String featureName) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", LineString.class, true)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12, "")); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symweight", Short.class, notAllowNull, 1, (short) 0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symstyle", Short.class, notAllowNull, 1, (short) 0)); + public static SimpleFeatureTypeBuilder createNormalLineFeatureTypeBuilder(String featureName) { + SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder(); // .build(featureName); + typeBuilder.setName(featureName); + typeBuilder.setNamespaceURI(DEFAULTNAMESPACE); + + AttributeTypeBuilder attrBuilder; + ArrayList<AttributeDescriptor> attrDescs = new ArrayList<AttributeDescriptor>(); + + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "geom", createGeometryType(attrBuilder, "LineType", LineString.class, true, lookupCRS(defaultSRID)))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + */ + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symweight", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1))); + */ + + typeBuilder.addAll(attrDescs); return typeBuilder; } - public static FeatureTypeBuilder createNormalMultiLineFeatureTypeBuilder(String featureName) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", MultiLineString.class, true)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12, "")); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symweight", Short.class, notAllowNull, 1, (short) 0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symstyle", Short.class, notAllowNull, 1, (short) 0)); + public static SimpleFeatureTypeBuilder createNormalMultiLineFeatureTypeBuilder(String featureName) { + SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder(); // .build(featureName); + typeBuilder.setName(featureName); + typeBuilder.setNamespaceURI(DEFAULTNAMESPACE); + + AttributeTypeBuilder attrBuilder; + ArrayList<AttributeDescriptor> attrDescs = new ArrayList<AttributeDescriptor>(); + + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "geom", createGeometryType(attrBuilder, "MultiLineStringType", MultiLineString.class, true, lookupCRS(defaultSRID)))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + */ + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symweight", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1))); + */ + + typeBuilder.addAll(attrDescs); return typeBuilder; } - public static FeatureTypeBuilder createNormalPolygonFeatureTypeBuilder(String featureName) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", Polygon.class, true)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12, "")); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symweight", Short.class, notAllowNull, 1, (short) 0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symstyle", Short.class, notAllowNull, 1, (short) 0)); + public static SimpleFeatureTypeBuilder createNormalPolygonFeatureTypeBuilder(String featureName) { + SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder(); // .build(featureName); + typeBuilder.setName(featureName); + typeBuilder.setNamespaceURI(DEFAULTNAMESPACE); + + AttributeTypeBuilder attrBuilder; + ArrayList<AttributeDescriptor> attrDescs = new ArrayList<AttributeDescriptor>(); + + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "geom", createGeometryType(attrBuilder, "PolygonType", Polygon.class, true, lookupCRS(defaultSRID)))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + */ + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symweight", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1))); + */ + + typeBuilder.addAll(attrDescs); return typeBuilder; } - public static FeatureTypeBuilder createNormalArcFeatureTypeBuilder(String featureName) - { + public static SimpleFeatureTypeBuilder createNormalArcFeatureTypeBuilder(String featureName) { return createNormalLineFeatureTypeBuilder(featureName); - /* - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", Geometry.class, false)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symweight", Short.class, false)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symstyle", Short.class, false)); - return typeBuilder; - */ } - public static FeatureTypeBuilder createNormalEllipseFeatureTypeBuilder(String featureName) - { + public static SimpleFeatureTypeBuilder createNormalEllipseFeatureTypeBuilder(String featureName) { return createNormalPolygonFeatureTypeBuilder(featureName); + } + + public static SimpleFeatureTypeBuilder createNormalIndexFeatureTypeBuilder(String featureName) { + SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder(); // .build(featureName); + typeBuilder.setName(featureName); + typeBuilder.setNamespaceURI(DEFAULTNAMESPACE); + + AttributeTypeBuilder attrBuilder; + ArrayList<AttributeDescriptor> attrDescs = new ArrayList<AttributeDescriptor>(); + + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "geom", createGeometryType(attrBuilder, "PolygonType", Polygon.class, true, lookupCRS(defaultSRID)))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "x1", createAttributeType(attrBuilder, "DoubleType", Double.class, notAllowNull, 1, 0.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "y1", createAttributeType(attrBuilder, "DoubleType", Double.class, notAllowNull, 1, 0.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "x2", createAttributeType(attrBuilder, "DoubleType", Double.class, notAllowNull, 1, 0.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "y2", createAttributeType(attrBuilder, "DoubleType", Double.class, notAllowNull, 1, 0.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "tpclid", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symweight", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + + typeBuilder.addAll(attrDescs); + return typeBuilder; + } + + public static SimpleFeatureTypeBuilder createNormalIndexTextFeatureTypeBuilder(String featureName) { + SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder(); // .build(featureName); + typeBuilder.setName(featureName); + typeBuilder.setNamespaceURI(DEFAULTNAMESPACE); + + AttributeTypeBuilder attrBuilder; + ArrayList<AttributeDescriptor> attrDescs = new ArrayList<AttributeDescriptor>(); + + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "geom", createGeometryType(attrBuilder, "PointType", Point.class, true, lookupCRS(defaultSRID)))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symweight", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "just", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "height", createAttributeType(attrBuilder, "FloatType", Float.class, notAllowNull, 1, (float) 1.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "width", createAttributeType(attrBuilder, "FloatType", Float.class, notAllowNull, 1, (float) 1.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "angle", createAttributeType(attrBuilder, "FloatType", Float.class, notAllowNull, 1, (float) 0.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "tpclid", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + + typeBuilder.addAll(attrDescs); + return typeBuilder; + } + + public static SimpleFeatureTypeBuilder createPointFeatureTypeBuilder(String featureName) { + SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder(); // .build(featureName); + typeBuilder.setName(featureName); + typeBuilder.setNamespaceURI(DEFAULTNAMESPACE); + + AttributeTypeBuilder attrBuilder; + ArrayList<AttributeDescriptor> attrDescs = new ArrayList<AttributeDescriptor>(); + + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "geom", createGeometryType(attrBuilder, "PointType", Point.class, notAllowNull, lookupCRS(defaultSRID)))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "did", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "tid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "oid", createAttributeType(attrBuilder, "LongType", Long.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "cid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "lid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "level", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); /* - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", Geometry.class, false)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symweight", Short.class, false)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symstyle", Short.class, false)); - return typeBuilder; + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); */ - } + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symweight", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "just", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "height", createAttributeType(attrBuilder, "FloatType", Float.class, notAllowNull, 1, (float) 1.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "width", createAttributeType(attrBuilder, "FloatType", Float.class, notAllowNull, 1, (float) 1.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "angle", createAttributeType(attrBuilder, "FloatType", Float.class, notAllowNull, 1, (float) 0.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "context", createAttributeType(attrBuilder, "StringType", String.class, allowNull, 254, ""))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1))); + */ - public static FeatureTypeBuilder createNormalIndexFeatureTypeBuilder(String featureName) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", Polygon.class, true)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("x1", Double.class, notAllowNull, 1, 0.0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("y1", Double.class, notAllowNull, 1, 0.0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("x2", Double.class, notAllowNull, 1, 0.0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("y2", Double.class, notAllowNull, 1, 0.0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("tpclid", String.class, notAllowNull, 12, "")); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12, "")); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symweight", Short.class, notAllowNull, 1, (short) 0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symstyle", Short.class, notAllowNull, 1, (short) 0)); + typeBuilder.addAll(attrDescs); return typeBuilder; } - public static FeatureTypeBuilder createNormalIndexTextFeatureTypeBuilder(String featureName) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", Point.class, true)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12, "")); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symweight", Short.class, notAllowNull, 1, (short) 0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symstyle", Short.class, notAllowNull, 1, (short) 0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("just", Short.class, notAllowNull, 1, (short) 0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("height", Float.class, notAllowNull, 1, (float) 0.0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("width", Float.class, notAllowNull, 1, (float) 0.0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("angle", Float.class, notAllowNull, 1, (float) 0.0)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("tpclid", String.class, notAllowNull, 12, "")); + public static SimpleFeatureTypeBuilder createSymbolFeatureTypeBuilder(String featureName) { + SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder(); // .build(featureName); + typeBuilder.setName(featureName); + typeBuilder.setNamespaceURI(DEFAULTNAMESPACE); + + AttributeTypeBuilder attrBuilder; + ArrayList<AttributeDescriptor> attrDescs = new ArrayList<AttributeDescriptor>(); + + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "geom", createGeometryType(attrBuilder, "PolygonType", Polygon.class, notAllowNull, lookupCRS(defaultSRID)))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "did", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "tid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "oid", createAttributeType(attrBuilder, "LongType", Long.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "cid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "lid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "level", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + */ + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symweight", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "just", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "height", createAttributeType(attrBuilder, "FloatType", Float.class, notAllowNull, 1, (float) 1.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "width", createAttributeType(attrBuilder, "FloatType", Float.class, notAllowNull, 1, (float) 1.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "angle", createAttributeType(attrBuilder, "FloatType", Float.class, notAllowNull, 1, (float) 0.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symbol", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 20))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1))); + */ + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "origin", createGeometryType(attrBuilder, "PointType", Point.class, notAllowNull, lookupCRS(defaultSRID)))); + + typeBuilder.addAll(attrDescs); return typeBuilder; } - public static FeatureTypeBuilder createPointFeatureTypeBuilder(String featureName) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", Point.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("tid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("oid", Long.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("cid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("lid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("level", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symweight", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symstyle", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("just", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("height", Float.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("width", Float.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("angle", Float.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("context", String.class, true, 254)); + public static SimpleFeatureTypeBuilder createPolygonFeatureTypeBuilder(String featureName) { + SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder(); // .build(featureName); + typeBuilder.setName(featureName); + typeBuilder.setNamespaceURI(DEFAULTNAMESPACE); + + AttributeTypeBuilder attrBuilder; + ArrayList<AttributeDescriptor> attrDescs = new ArrayList<AttributeDescriptor>(); + + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "geom", createGeometryType(attrBuilder, "PolygonType", Polygon.class, notAllowNull, lookupCRS(defaultSRID)))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "did", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "tid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "oid", createAttributeType(attrBuilder, "LongType", Long.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "cid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "lid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "level", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + */ + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symweight", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1))); + */ + + typeBuilder.addAll(attrDescs); return typeBuilder; } - public static FeatureTypeBuilder createSymbolFeatureTypeBuilder(String featureName) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", Point.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("tid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("oid", Long.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("cid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("lid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("level", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symweight", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symstyle", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("just", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("height", Float.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("width", Float.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("angle", Float.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symbol", String.class, notAllowNull, 20)); + public static SimpleFeatureTypeBuilder createLineFeatureTypeBuilder(String featureName) { + SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder(); // .build(featureName); + typeBuilder.setName(featureName); + typeBuilder.setNamespaceURI(DEFAULTNAMESPACE); + + AttributeTypeBuilder attrBuilder; + ArrayList<AttributeDescriptor> attrDescs = new ArrayList<AttributeDescriptor>(); + + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "geom", createGeometryType(attrBuilder, "LineStringType", LineString.class, notAllowNull, lookupCRS(defaultSRID)))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "did", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "tid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "oid", createAttributeType(attrBuilder, "LongType", Long.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "cid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "lid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "level", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + */ + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symweight", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1))); + */ + typeBuilder.addAll(attrDescs); return typeBuilder; } - public static FeatureTypeBuilder createPolygonFeatureTypeBuilder(String featureName) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", Polygon.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("tid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("oid", Long.class)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("cid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("lid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("level", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symweight", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symstyle", Short.class, notAllowNull)); + public static SimpleFeatureTypeBuilder createMultiLineFeatureTypeBuilder(String featureName) { + SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder(); // .build(featureName); + typeBuilder.setName(featureName); + typeBuilder.setNamespaceURI(DEFAULTNAMESPACE); + + AttributeTypeBuilder attrBuilder; + ArrayList<AttributeDescriptor> attrDescs = new ArrayList<AttributeDescriptor>(); + + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "geom", createGeometryType(attrBuilder, "MultiLineStringType", MultiLineString.class, notAllowNull, lookupCRS(defaultSRID)))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "did", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "tid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "oid", createAttributeType(attrBuilder, "LongType", Long.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "cid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "lid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "level", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + */ + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symweight", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1))); + */ + + typeBuilder.addAll(attrDescs); return typeBuilder; } - public static FeatureTypeBuilder createLineFeatureTypeBuilder(String featureName) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", LineString.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("tid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("oid", Long.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("cid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("lid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("level", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symweight", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symstyle", Short.class, notAllowNull)); - return typeBuilder; - } - - public static FeatureTypeBuilder createMultiLineFeatureTypeBuilder(String featureName) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", MultiLineString.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("tid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("oid", Long.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("cid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("lid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("level", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symweight", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symstyle", Short.class, notAllowNull)); - return typeBuilder; - } - - public static FeatureTypeBuilder createEllipseFeatureTypeBuilder(String featureName) - { + public static SimpleFeatureTypeBuilder createEllipseFeatureTypeBuilder(String featureName) { return createPolygonFeatureTypeBuilder(featureName); - /* - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", Geometry.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("tid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("oid", Long.class)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("cid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("lid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("level", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symweight", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symstyle", Short.class, notAllowNull)); - return typeBuilder; - */ } - public static FeatureTypeBuilder createArcFeatureTypeBuilder(String featureName) - { + public static SimpleFeatureTypeBuilder createArcFeatureTypeBuilder(String featureName) { return createLineFeatureTypeBuilder(featureName); - /* - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", Geometry.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("tid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("oid", Long.class)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("cid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("lid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("level", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symweight", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symstyle", Short.class, notAllowNull)); - return typeBuilder; - */ } - public static FeatureTypeBuilder createMultiSymbolFeatureTypeBuilder(String featureName) - { - FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("geom", MultiPoint.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("tid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("oid", Long.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("cid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("lid", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("level", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symcolor", String.class, notAllowNull, 12)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symweight", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symstyle", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("just", Short.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("height", Float.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("width", Float.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("angle", Float.class, notAllowNull)); - typeBuilder.addType(AttributeTypeFactory.newAttributeType("symbol", String.class, notAllowNull, 20)); + public static SimpleFeatureTypeBuilder createMultiSymbolFeatureTypeBuilder(String featureName) { + SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder(); // .build(featureName); + typeBuilder.setName(featureName); + typeBuilder.setNamespaceURI(DEFAULTNAMESPACE); + + AttributeTypeBuilder attrBuilder; + ArrayList<AttributeDescriptor> attrDescs = new ArrayList<AttributeDescriptor>(); + + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "geom", createGeometryType(attrBuilder, "MultiPointType", MultiPoint.class, notAllowNull, lookupCRS(defaultSRID)))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "did", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "tid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "oid", createAttributeType(attrBuilder, "LongType", Long.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "cid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "lid", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "level", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + */ + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, ""))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symweight", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "just", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "height", createAttributeType(attrBuilder, "FloatType", Float.class, notAllowNull, 1, (float) 1.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "width", createAttributeType(attrBuilder, "FloatType", Float.class, notAllowNull, 1, (float) 1.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "angle", createAttributeType(attrBuilder, "FloatType", Float.class, notAllowNull, 1, (float) 0.0))); + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "symbol", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 20))); + /* + attrBuilder = new AttributeTypeBuilder(); + attrDescs.add(attrBuilder.buildDescriptor( + "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1))); + */ + + typeBuilder.addAll(attrDescs); return typeBuilder; } + + static int defaultSRID = 3826; + + static TreeMap<Integer, CoordinateReferenceSystem> crsMap = null; + static TreeMap<Integer, GeometryConverterDecorator> geometryConverterMap = null; + + static void initializeFactories() { + try { + crsMap = new TreeMap<Integer, CoordinateReferenceSystem>(); + CoordinateReferenceSystem wgs84 = CRS.decode("EPSG:4326"); + crsMap.put(4326, wgs84); + CoordinateReferenceSystem epsg3825 = CRS.decode("EPSG:3825"); // TWD97-ZONE 119 + crsMap.put(3825, epsg3825); + CoordinateReferenceSystem epsg3826 = CRS.decode("EPSG:3826"); // TWD97-ZONE 121 + crsMap.put(3826, epsg3826); + CoordinateReferenceSystem epsg3827 = CRS.decode("EPSG:3827"); // TWD67-ZONE 119 + crsMap.put(3827, epsg3827); + CoordinateReferenceSystem epsg3828 = CRS.decode("EPSG:3828"); // TWD67-ZONE 121 + crsMap.put(3828, epsg3828); + } catch (FactoryException e) { + LOGGER.warn(e.getMessage(), e); + } + + geometryConverterMap = new TreeMap<Integer, GeometryConverterDecorator>(); + geometryConverterMap.put(3825, new EPSG3825GeometryConverterDecorator()); + geometryConverterMap.put(3826, new EPSG3826GeometryConverterDecorator()); + } + + public static CoordinateReferenceSystem lookupCRS(int SRID) { + if (crsMap == null) initializeFactories(); + return crsMap.get(SRID); + } + + public static GeometryConverterDecorator lookupGeometryConverter(int SRID) { + if (crsMap == null) initializeFactories(); + return geometryConverterMap.get(SRID); + } + + public static GeometryConverterDecorator lookupDefaultGeometryConverter() { + return lookupGeometryConverter(defaultSRID); + } + + public static int getDefaultFeatureSRID() { + return defaultSRID; + } + + public static void setDefaultFeatureSRID(int SRID) { + initializeFactories(); + defaultSRID = SRID; + } + + public static MathTransform getTWD67ToTWD97Zone191Transform() throws FactoryException { + CoordinateReferenceSystem sourceCRS = lookupCRS(3827); + CoordinateReferenceSystem targetCRS = lookupCRS(3825); + + MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS, true); + return transform; + } + + public static MathTransform getTWD67ToTWD97Zone121Transform() throws FactoryException { + CoordinateReferenceSystem sourceCRS = lookupCRS(3828); + CoordinateReferenceSystem targetCRS = lookupCRS(3826); + + MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS, true); + // Geometry targetGeometry = JTS.transform( sourceGeometry, transform); + return transform; + } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/FileUtils.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/FileUtils.java new file mode 100644 index 0000000..850cfde --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/FileUtils.java @@ -0,0 +1,63 @@ +package com.ximple.eofms.util; + +import java.io.File; +import java.io.FileFilter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class FileUtils { + + public static List<File> recurseDir(File dir, FileFilter filter) { + return recurseInDirFrom(dir, filter); + } + + private static ArrayList<File> recurseInDirFrom(File dirItem, FileFilter filter) { + ArrayList<File> result = new ArrayList<File>(); + File[] list; + if (filter.accept(dirItem)) { + result.add(dirItem); + } + + if (dirItem.isDirectory()) { + list = dirItem.listFiles(); + for (File item : list) { + result.addAll(recurseInDirFrom(item, filter)); + } + } + return result; + } + + public static List recurseDir(String dir) { + return recurseDir(dir, null); + } + + public static List recurseDir(String dir, String suffix) { + String result, _result[]; + + result = recurseInDirFrom(dir, suffix); + _result = result.split("\\|"); + return Arrays.asList(_result); + } + + private static String recurseInDirFrom(String dirItem, String suffix) { + File file; + String list[]; + StringBuilder result = new StringBuilder(dirItem); + + file = new File(dirItem); + if (file.isDirectory()) { + list = file.list(); + for (String item : list) { + if (suffix == null) + result.append("|").append(recurseInDirFrom(dirItem + File.separatorChar + item, suffix)); + else { + if (item.toLowerCase().endsWith(suffix)) { + result.append("|").append(recurseInDirFrom(dirItem + File.separatorChar + item, suffix)); + } + } + } + } + return result.toString(); + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/GeomUtil.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/GeomUtil.java index 8cd89e4..2a13867 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/GeomUtil.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/GeomUtil.java @@ -7,24 +7,19 @@ * Created by IntelliJ IDEA. * User: Ulysses * Date: 2007/6/15 - * Time: �W�� 01:20:20 * To change this template use File | Settings | File Templates. */ -public final class GeomUtil -{ - public static double convertLogicalValue(double value) - { +public final class GeomUtil { + public static double convertLogicalValue(double value) { return value / 1000.0 + 2147483.648; } - public static Coordinate convertLogicalCooridate(Coordinate value) - { + public static Coordinate convertLogicalCooridate(Coordinate value) { return new Coordinate(convertLogicalValue(value.x), convertLogicalValue(value.y), convertLogicalValue(value.z)); } - public static Envelope convertLogicalEnvelope(Envelope value) - { + public static Envelope convertLogicalEnvelope(Envelope value) { return new Envelope(convertLogicalValue(value.getMinX()), convertLogicalValue(value.getMaxX()), - convertLogicalValue(value.getMinY()), convertLogicalValue(value.getMaxY())); + convertLogicalValue(value.getMinY()), convertLogicalValue(value.getMaxY())); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/GeometryConverterDecorator.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/GeometryConverterDecorator.java new file mode 100644 index 0000000..cf0d72c --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/GeometryConverterDecorator.java @@ -0,0 +1,9 @@ +package com.ximple.eofms.util; + +import com.ximple.io.dgn7.GeometryConverter; + +public interface GeometryConverterDecorator extends GeometryConverter { + public GeometryConverter getConverter(); + + public void setConverter(GeometryConverter converter); +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/LangUtil.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/LangUtil.java index c8c933d..6c9a245 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/LangUtil.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/LangUtil.java @@ -13,13 +13,10 @@ * Created by IntelliJ IDEA. * User: Ulysses * Date: 2007/6/15 - * Time: �W�� 01:21:25 * To change this template use File | Settings | File Templates. */ -public class LangUtil -{ - private static Map primitiveToWrapperMap = new HashMap() - { +public class LangUtil { + private static Map primitiveToWrapperMap = new HashMap() { { put(byte.class, Byte.class); @@ -33,8 +30,7 @@ } }; - public static String emptyStringIfNull(String s) - { + public static String emptyStringIfNull(String s) { return (s == null) ? "" : s; } @@ -42,60 +38,48 @@ * Useful because an expression used to generate o need only be * evaluated once. */ - public static Object ifNull(Object o, Object alternative) - { + public static Object ifNull(Object o, Object alternative) { return (o == null) ? alternative : o; } - public static Object ifNotNull(Object o, Object alternative) - { + public static Object ifNotNull(Object o, Object alternative) { return (o != null) ? alternative : o; } - public static Class toPrimitiveWrapperClass(Class primitiveClass) - { + public static Class toPrimitiveWrapperClass(Class primitiveClass) { return (Class) primitiveToWrapperMap.get(primitiveClass); } - public static boolean isPrimitive(Class c) - { + public static boolean isPrimitive(Class c) { return primitiveToWrapperMap.containsKey(c); } - public static boolean bothNullOrEqual(Object a, Object b) - { + public static boolean bothNullOrEqual(Object a, Object b) { return (a == null && b == null) || (a != null && b != null && a.equals(b)); } - public static Object newInstance(Class c) - { - try - { + public static Object newInstance(Class c) { + try { return c.newInstance(); - } catch (Exception e) - { + } catch (Exception e) { Assert.shouldNeverReachHere(e.toString()); return null; } } - public static Collection classesAndInterfaces(Class c) - { + public static Collection classesAndInterfaces(Class c) { ArrayList classesAndInterfaces = new ArrayList(); classesAndInterfaces.add(c); superclasses(c, classesAndInterfaces); - for (Iterator i = new ArrayList(classesAndInterfaces).iterator(); i.hasNext();) - { + for (Iterator i = new ArrayList(classesAndInterfaces).iterator(); i.hasNext();) { Class x = (Class) i.next(); classesAndInterfaces.addAll(Arrays.asList(x.getInterfaces())); } return classesAndInterfaces; } - private static void superclasses(Class c, Collection results) - { - if (c.getSuperclass() == null) - { + private static void superclasses(Class c, Collection results) { + if (c.getSuperclass() == null) { return; } results.add(c.getSuperclass()); diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/PrintfFormat.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/PrintfFormat.java index 0cf5c23..c185160 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/PrintfFormat.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/PrintfFormat.java @@ -441,8 +441,7 @@ * formatting of -0.0f * round up/down when last digits are 50000... */ -public final class PrintfFormat -{ +public final class PrintfFormat { /** * Vector of control strings and format literals. */ @@ -471,8 +470,7 @@ * string is null, zero length, or otherwise * malformed. */ - public PrintfFormat(String fmtArg) throws IllegalArgumentException - { + public PrintfFormat(String fmtArg) throws IllegalArgumentException { this(Locale.getDefault(), fmtArg); } @@ -489,91 +487,74 @@ * string is null, zero length, or otherwise * malformed. */ - public PrintfFormat(Locale locale, String fmtArg) throws IllegalArgumentException - { + public PrintfFormat(Locale locale, String fmtArg) throws IllegalArgumentException { dfs = new DecimalFormatSymbols(locale); int ePos = 0; ConversionSpecification sFmt = null; String unCS = this.nonControl(fmtArg, 0); - if (unCS != null) - { + if (unCS != null) { sFmt = new ConversionSpecification(); sFmt.setLiteral(unCS); vFmt.addElement(sFmt); } - while ((cPos != -1) && (cPos < fmtArg.length())) - { - for (ePos = cPos + 1; ePos < fmtArg.length(); ePos++) - { + while ((cPos != -1) && (cPos < fmtArg.length())) { + for (ePos = cPos + 1; ePos < fmtArg.length(); ePos++) { char c = 0; c = fmtArg.charAt(ePos); - if (c == 'i') - { + if (c == 'i') { break; } - if (c == 'd') - { + if (c == 'd') { break; } - if (c == 'f') - { + if (c == 'f') { break; } - if (c == 'g') - { + if (c == 'g') { break; } - if (c == 'G') - { + if (c == 'G') { break; } - if (c == 'o') - { + if (c == 'o') { break; } - if (c == 'x') - { + if (c == 'x') { break; } - if (c == 'X') - { + if (c == 'X') { break; } - if (c == 'e') - { + if (c == 'e') { break; } - if (c == 'E') - { + if (c == 'E') { break; } - if (c == 'c') - { + if (c == 'c') { break; } - if (c == 's') - { + if (c == 's') { break; } - if (c == '%') - { + if (c == '%') { break; } } @@ -583,8 +564,7 @@ vFmt.addElement(sFmt); unCS = this.nonControl(fmtArg, ePos); - if (unCS != null) - { + if (unCS != null) { sFmt = new ConversionSpecification(); sFmt.setLiteral(unCS); vFmt.addElement(sFmt); @@ -606,14 +586,12 @@ * @return the substring from the start position * to the beginning of the control string. */ - private String nonControl(String s, int start) - { + private String nonControl(String s, int start) { String ret = ""; cPos = s.indexOf("%", start); - if (cPos == -1) - { + if (cPos == -1) { cPos = s.length(); } @@ -629,90 +607,69 @@ * @param o The array of objects to format. * @return The formatted String. */ - public String sprintf(Object[] o) - { + public String sprintf(Object[] o) { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; int i = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { - if (cs.isPositionalSpecification()) - { + } else { + if (cs.isPositionalSpecification()) { i = cs.getArgumentPosition() - 1; - if (cs.isPositionalFieldWidth()) - { + if (cs.isPositionalFieldWidth()) { int ifw = cs.getArgumentPositionForFieldWidth() - 1; cs.setFieldWidthWithArg(((Integer) o[ifw]).intValue()); } - if (cs.isPositionalPrecision()) - { + if (cs.isPositionalPrecision()) { int ipr = cs.getArgumentPositionForPrecision() - 1; cs.setPrecisionWithArg(((Integer) o[ipr]).intValue()); } - } else - { - if (cs.isVariableFieldWidth()) - { + } else { + if (cs.isVariableFieldWidth()) { cs.setFieldWidthWithArg(((Integer) o[i]).intValue()); i++; } - if (cs.isVariablePrecision()) - { + if (cs.isVariablePrecision()) { cs.setPrecisionWithArg(((Integer) o[i]).intValue()); i++; } } - if (o[i] instanceof Byte) - { + if (o[i] instanceof Byte) { sb.append(cs.internalsprintf(((Byte) o[i]).byteValue())); - } else if (o[i] instanceof Short) - { + } else if (o[i] instanceof Short) { sb.append(cs.internalsprintf(((Short) o[i]).shortValue())); - } else if (o[i] instanceof Integer) - { + } else if (o[i] instanceof Integer) { sb.append(cs.internalsprintf(((Integer) o[i]).intValue())); - } else if (o[i] instanceof Long) - { + } else if (o[i] instanceof Long) { sb.append(cs.internalsprintf(((Long) o[i]).longValue())); - } else if (o[i] instanceof Float) - { + } else if (o[i] instanceof Float) { sb.append(cs.internalsprintf(((Float) o[i]).floatValue())); - } else if (o[i] instanceof Double) - { + } else if (o[i] instanceof Double) { sb.append(cs.internalsprintf(((Double) o[i]).doubleValue())); - } else if (o[i] instanceof Character) - { + } else if (o[i] instanceof Character) { sb.append(cs.internalsprintf(((Character) o[i]).charValue())); - } else if (o[i] instanceof String) - { + } else if (o[i] instanceof String) { sb.append(cs.internalsprintf((String) o[i])); - } else - { + } else { sb.append(cs.internalsprintf(o[i])); } - if (!cs.isPositionalSpecification()) - { + if (!cs.isPositionalSpecification()) { i++; } } @@ -726,23 +683,19 @@ * * @return the formatted String. */ - public String sprintf() - { + public String sprintf() { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); } } @@ -759,26 +712,21 @@ * conversion character is f, e, E, g, G, s, * or S. */ - public String sprintf(int x) throws IllegalArgumentException - { + public String sprintf(int x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { + } else { sb.append(cs.internalsprintf(x)); } } @@ -795,26 +743,21 @@ * conversion character is f, e, E, g, G, s, * or S. */ - public String sprintf(long x) throws IllegalArgumentException - { + public String sprintf(long x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { + } else { sb.append(cs.internalsprintf(x)); } } @@ -831,26 +774,21 @@ * conversion character is c, C, s, S, * d, d, x, X, or o. */ - public String sprintf(double x) throws IllegalArgumentException - { + public String sprintf(double x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { + } else { sb.append(cs.internalsprintf(x)); } } @@ -866,26 +804,21 @@ * @throws IllegalArgumentException if the * conversion character is neither s nor S. */ - public String sprintf(String x) throws IllegalArgumentException - { + public String sprintf(String x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { + } else { sb.append(cs.internalsprintf(x)); } } @@ -907,52 +840,38 @@ * conversion character is inappropriate for * formatting an unwrapped value. */ - public String sprintf(Object x) throws IllegalArgumentException - { + public String sprintf(Object x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { - if (x instanceof Byte) - { + } else { + if (x instanceof Byte) { sb.append(cs.internalsprintf(((Byte) x).byteValue())); - } else if (x instanceof Short) - { + } else if (x instanceof Short) { sb.append(cs.internalsprintf(((Short) x).shortValue())); - } else if (x instanceof Integer) - { + } else if (x instanceof Integer) { sb.append(cs.internalsprintf(((Integer) x).intValue())); - } else if (x instanceof Long) - { + } else if (x instanceof Long) { sb.append(cs.internalsprintf(((Long) x).longValue())); - } else if (x instanceof Float) - { + } else if (x instanceof Float) { sb.append(cs.internalsprintf(((Float) x).floatValue())); - } else if (x instanceof Double) - { + } else if (x instanceof Double) { sb.append(cs.internalsprintf(((Double) x).doubleValue())); - } else if (x instanceof Character) - { + } else if (x instanceof Character) { sb.append(cs.internalsprintf(((Character) x).charValue())); - } else if (x instanceof String) - { + } else if (x instanceof String) { sb.append(cs.internalsprintf((String) x)); - } else - { + } else { sb.append(cs.internalsprintf(x)); } } @@ -994,8 +913,7 @@ * optional L does not imply conversion to a long * long double. */ - private class ConversionSpecification - { + private class ConversionSpecification { /** * Default precision. */ @@ -1136,8 +1054,7 @@ * Constructor. Used to prepare an instance * to hold a literal, not a control string. */ - ConversionSpecification() - { + ConversionSpecification() { } /** @@ -1152,20 +1069,16 @@ * input string is null, zero length, or * otherwise malformed. */ - ConversionSpecification(String fmtArg) throws IllegalArgumentException - { - if (fmtArg == null) - { + ConversionSpecification(String fmtArg) throws IllegalArgumentException { + if (fmtArg == null) { throw new NullPointerException(); } - if (fmtArg.length() == 0) - { + if (fmtArg.length() == 0) { throw new IllegalArgumentException("Control strings must have positive" + " lengths."); } - if (fmtArg.charAt(0) == '%') - { + if (fmtArg.charAt(0) == '%') { fmt = fmtArg; pos = 1; setArgPosition(); @@ -1174,33 +1087,25 @@ setPrecision(); setOptionalHL(); - if (setConversionCharacter()) - { - if (pos == fmtArg.length()) - { - if (leadingZeros && leftJustify) - { + if (setConversionCharacter()) { + if (pos == fmtArg.length()) { + if (leadingZeros && leftJustify) { leadingZeros = false; } - if (precisionSet && leadingZeros) - { + if (precisionSet && leadingZeros) { if ((conversionCharacter == 'd') || (conversionCharacter == 'i') || (conversionCharacter == 'o') - || (conversionCharacter == 'x')) - { + || (conversionCharacter == 'x')) { leadingZeros = false; } } - } else - { + } else { throw new IllegalArgumentException("Malformed conversion specification=" + fmtArg); } - } else - { + } else { throw new IllegalArgumentException("Malformed conversion specification=" + fmtArg); } - } else - { + } else { throw new IllegalArgumentException("Control strings must begin with %."); } } @@ -1210,8 +1115,7 @@ * * @param s the String to store. */ - void setLiteral(String s) - { + void setLiteral(String s) { fmt = s; } @@ -1221,23 +1125,18 @@ * * @return s the stored String. */ - String getLiteral() - { + String getLiteral() { StringBuilder sb = new StringBuilder(); int i = 0; - while (i < fmt.length()) - { - if (fmt.charAt(i) == '\\') - { + while (i < fmt.length()) { + if (fmt.charAt(i) == '\\') { i++; - if (i < fmt.length()) - { + if (i < fmt.length()) { char c = fmt.charAt(i); - switch (c) - { + switch (c) { case 'a': sb.append((char) 0x07); @@ -1280,12 +1179,10 @@ } i++; - } else - { + } else { sb.append('\\'); } - } else - { + } else { i++; } } @@ -1299,8 +1196,7 @@ * * @return the conversion character. */ - char getConversionCharacter() - { + char getConversionCharacter() { return conversionCharacter; } @@ -1313,8 +1209,7 @@ * uses an * field width; otherwise * <code>false</code>. */ - boolean isVariableFieldWidth() - { + boolean isVariableFieldWidth() { return variableFieldWidth; } @@ -1325,10 +1220,8 @@ * * @param fw the field width. */ - void setFieldWidthWithArg(int fw) - { - if (fw < 0) - { + void setFieldWidthWithArg(int fw) { + if (fw < 0) { leftJustify = true; } @@ -1345,8 +1238,7 @@ * uses an * precision; otherwise * <code>false</code>. */ - boolean isVariablePrecision() - { + boolean isVariablePrecision() { return variablePrecision; } @@ -1356,8 +1248,7 @@ * * @param pr the precision. */ - void setPrecisionWithArg(int pr) - { + void setPrecisionWithArg(int pr) { precisionSet = true; precision = Math.max(pr, 0); } @@ -1371,22 +1262,17 @@ * @throws IllegalArgumentException if the * conversion character is f, e, E, g, or G. */ - String internalsprintf(int s) throws IllegalArgumentException - { + String internalsprintf(int s) throws IllegalArgumentException { String s2 = ""; - switch (conversionCharacter) - { + switch (conversionCharacter) { case 'd': case 'i': - if (optionalh) - { + if (optionalh) { s2 = printDFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printDFormat((long) s); - } else - { + } else { s2 = printDFormat(s); } @@ -1394,28 +1280,22 @@ case 'x': case 'X': - if (optionalh) - { + if (optionalh) { s2 = printXFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printXFormat((long) s); - } else - { + } else { s2 = printXFormat(s); } break; case 'o': - if (optionalh) - { + if (optionalh) { s2 = printOFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printOFormat((long) s); - } else - { + } else { s2 = printOFormat(s); } @@ -1429,7 +1309,7 @@ default: throw new IllegalArgumentException("Cannot format a int with a format using a " + conversionCharacter - + " conversion character."); + + " conversion character."); } return s2; @@ -1444,22 +1324,17 @@ * @throws IllegalArgumentException if the * conversion character is f, e, E, g, or G. */ - String internalsprintf(long s) throws IllegalArgumentException - { + String internalsprintf(long s) throws IllegalArgumentException { String s2 = ""; - switch (conversionCharacter) - { + switch (conversionCharacter) { case 'd': case 'i': - if (optionalh) - { + if (optionalh) { s2 = printDFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printDFormat(s); - } else - { + } else { s2 = printDFormat((int) s); } @@ -1467,28 +1342,22 @@ case 'x': case 'X': - if (optionalh) - { + if (optionalh) { s2 = printXFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printXFormat(s); - } else - { + } else { s2 = printXFormat((int) s); } break; case 'o': - if (optionalh) - { + if (optionalh) { s2 = printOFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printOFormat(s); - } else - { + } else { s2 = printOFormat((int) s); } @@ -1502,7 +1371,7 @@ default: throw new IllegalArgumentException("Cannot format a long with a format using a " + conversionCharacter - + " conversion character."); + + " conversion character."); } return s2; @@ -1518,12 +1387,10 @@ * conversion character is c, C, s, S, i, d, * x, X, or o. */ - String internalsprintf(double s) throws IllegalArgumentException - { + String internalsprintf(double s) throws IllegalArgumentException { String s2 = ""; - switch (conversionCharacter) - { + switch (conversionCharacter) { case 'f': s2 = printFFormat(s); @@ -1543,7 +1410,7 @@ default: throw new IllegalArgumentException("Cannot " + "format a double with a format using a " + conversionCharacter - + " conversion character."); + + " conversion character."); } return s2; @@ -1558,17 +1425,14 @@ * @throws IllegalArgumentException if the * conversion character is neither s nor S. */ - String internalsprintf(String s) throws IllegalArgumentException - { + String internalsprintf(String s) throws IllegalArgumentException { String s2 = ""; - if ((conversionCharacter == 's') || (conversionCharacter == 'S')) - { + if ((conversionCharacter == 's') || (conversionCharacter == 'S')) { s2 = printSFormat(s); - } else - { + } else { throw new IllegalArgumentException("Cannot " + "format a String with a format using a " + conversionCharacter - + " conversion character."); + + " conversion character."); } return s2; @@ -1583,17 +1447,14 @@ * @throws IllegalArgumentException if the * conversion character is neither s nor S. */ - String internalsprintf(Object s) - { + String internalsprintf(Object s) { String s2 = ""; - if ((conversionCharacter == 's') || (conversionCharacter == 'S')) - { + if ((conversionCharacter == 's') || (conversionCharacter == 'S')) { s2 = printSFormat(s.toString()); - } else - { + } else { throw new IllegalArgumentException("Cannot format a String with a format using" + " a " + conversionCharacter - + " conversion character."); + + " conversion character."); } return s2; @@ -1621,8 +1482,7 @@ * to appear after the radix character. Padding is * with trailing 0s. */ - private char[] fFormatDigits(double x) - { + private char[] fFormatDigits(double x) { // int defaultDigits=6; String sx, sxOut; int i, j, k; @@ -1630,19 +1490,15 @@ int expon = 0; boolean minusSign = false; - if (x > 0.0) - { + if (x > 0.0) { sx = Double.toString(x); - } else if (x < 0.0) - { + } else if (x < 0.0) { sx = Double.toString(-x); minusSign = true; - } else - { + } else { sx = Double.toString(x); - if (sx.charAt(0) == '-') - { + if (sx.charAt(0) == '-') { minusSign = true; sx = sx.substring(1); } @@ -1651,68 +1507,51 @@ int ePos = sx.indexOf('E'); int rPos = sx.indexOf('.'); - if (rPos != -1) - { + if (rPos != -1) { n1In = rPos; - } else if (ePos != -1) - { + } else if (ePos != -1) { n1In = ePos; - } else - { + } else { n1In = sx.length(); } - if (rPos != -1) - { - if (ePos != -1) - { + if (rPos != -1) { + if (ePos != -1) { n2In = ePos - rPos - 1; - } else - { + } else { n2In = sx.length() - rPos - 1; } - } else - { + } else { n2In = 0; } - if (ePos != -1) - { + if (ePos != -1) { int ie = ePos + 1; expon = 0; - if (sx.charAt(ie) == '-') - { - for (++ie; ie < sx.length(); ie++) - { - if (sx.charAt(ie) != '0') - { + if (sx.charAt(ie) == '-') { + for (++ie; ie < sx.length(); ie++) { + if (sx.charAt(ie) != '0') { break; } } - if (ie < sx.length()) - { + if (ie < sx.length()) { expon = -Integer.parseInt(sx.substring(ie)); } - } else - { - if (sx.charAt(ie) == '+') - { + } else { + if (sx.charAt(ie) == '+') { ++ie; } - for (; ie < sx.length(); ie++) - { - if (sx.charAt(ie) != '0') - { + for (; ie < sx.length(); ie++) { + if (sx.charAt(ie) != '0') { break; } } - if (ie < sx.length()) - { + if (ie < sx.length()) { expon = Integer.parseInt(sx.substring(ie)); } } @@ -1720,11 +1559,9 @@ int p; - if (precisionSet) - { + if (precisionSet) { p = precision; - } else - { + } else { p = defaultDigits - 1; } @@ -1732,102 +1569,79 @@ char[] ca2 = new char[n1In + n2In]; char[] ca3, ca4, ca5; - for (j = 0; j < n1In; j++) - { + for (j = 0; j < n1In; j++) { ca2[j] = ca1[j]; } i = j + 1; - for (k = 0; k < n2In; j++, i++, k++) - { + for (k = 0; k < n2In; j++, i++, k++) { ca2[j] = ca1[i]; } - if (n1In + expon <= 0) - { + if (n1In + expon <= 0) { ca3 = new char[-expon + n2In]; - for (j = 0, k = 0; k < (-n1In - expon); k++, j++) - { + for (j = 0, k = 0; k < (-n1In - expon); k++, j++) { ca3[j] = '0'; } - for (i = 0; i < (n1In + n2In); i++, j++) - { + for (i = 0; i < (n1In + n2In); i++, j++) { ca3[j] = ca2[i]; } - } else - { + } else { ca3 = ca2; } boolean carry = false; - if (p < -expon + n2In) - { - if (expon < 0) - { + if (p < -expon + n2In) { + if (expon < 0) { i = p; - } else - { + } else { i = p + n1In; } carry = checkForCarry(ca3, i); - if (carry) - { + if (carry) { carry = startSymbolicCarry(ca3, i - 1, 0); } } - if (n1In + expon <= 0) - { + if (n1In + expon <= 0) { ca4 = new char[2 + p]; - if (!carry) - { + if (!carry) { ca4[0] = '0'; - } else - { + } else { ca4[0] = '1'; } - if (alternateForm || !precisionSet || (precision != 0)) - { + if (alternateForm || !precisionSet || (precision != 0)) { ca4[1] = '.'; - for (i = 0, j = 2; i < Math.min(p, ca3.length); i++, j++) - { + for (i = 0, j = 2; i < Math.min(p, ca3.length); i++, j++) { ca4[j] = ca3[i]; } - for (; j < ca4.length; j++) - { + for (; j < ca4.length; j++) { ca4[j] = '0'; } } - } else - { - if (!carry) - { - if (alternateForm || !precisionSet || (precision != 0)) - { + } else { + if (!carry) { + if (alternateForm || !precisionSet || (precision != 0)) { ca4 = new char[n1In + expon + p + 1]; - } else - { + } else { ca4 = new char[n1In + expon]; } j = 0; - } else - { - if (alternateForm || !precisionSet || (precision != 0)) - { + } else { + if (alternateForm || !precisionSet || (precision != 0)) { ca4 = new char[n1In + expon + p + 2]; - } else - { + } else { ca4 = new char[n1In + expon + 1]; } @@ -1835,28 +1649,23 @@ j = 1; } - for (i = 0; i < Math.min(n1In + expon, ca3.length); i++, j++) - { + for (i = 0; i < Math.min(n1In + expon, ca3.length); i++, j++) { ca4[j] = ca3[i]; } - for (; i < n1In + expon; i++, j++) - { + for (; i < n1In + expon; i++, j++) { ca4[j] = '0'; } - if (alternateForm || !precisionSet || (precision != 0)) - { + if (alternateForm || !precisionSet || (precision != 0)) { ca4[j] = '.'; j++; - for (k = 0; (i < ca3.length) && (k < p); i++, j++, k++) - { + for (k = 0; (i < ca3.length) && (k < p); i++, j++, k++) { ca4[j] = ca3[i]; } - for (; j < ca4.length; j++) - { + for (; j < ca4.length; j++) { ca4[j] = '0'; } } @@ -1864,25 +1673,20 @@ int nZeros = 0; - if (!leftJustify && leadingZeros) - { + if (!leftJustify && leadingZeros) { int xThousands = 0; - if (thousands) - { + if (thousands) { int xlead = 0; - if ((ca4[0] == '+') || (ca4[0] == '-') || (ca4[0] == ' ')) - { + if ((ca4[0] == '+') || (ca4[0] == '-') || (ca4[0] == ' ')) { xlead = 1; } int xdp = xlead; - for (; xdp < ca4.length; xdp++) - { - if (ca4[xdp] == '.') - { + for (; xdp < ca4.length; xdp++) { + if (ca4[xdp] == '.') { break; } } @@ -1890,74 +1694,60 @@ xThousands = (xdp - xlead) / 3; } - if (fieldWidthSet) - { + if (fieldWidthSet) { nZeros = fieldWidth - ca4.length; } - if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) - { + if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) { nZeros--; } nZeros -= xThousands; - if (nZeros < 0) - { + if (nZeros < 0) { nZeros = 0; } } j = 0; - if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) - { + if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) { ca5 = new char[ca4.length + nZeros + 1]; j++; - } else - { + } else { ca5 = new char[ca4.length + nZeros]; } - if (!minusSign) - { - if (leadingSign) - { + if (!minusSign) { + if (leadingSign) { ca5[0] = '+'; } - if (leadingSpace) - { + if (leadingSpace) { ca5[0] = ' '; } - } else - { + } else { ca5[0] = '-'; } - for (i = 0; i < nZeros; i++, j++) - { + for (i = 0; i < nZeros; i++, j++) { ca5[j] = '0'; } - for (i = 0; i < ca4.length; i++, j++) - { + for (i = 0; i < ca4.length; i++, j++) { ca5[j] = ca4[i]; } int lead = 0; - if ((ca5[0] == '+') || (ca5[0] == '-') || (ca5[0] == ' ')) - { + if ((ca5[0] == '+') || (ca5[0] == '-') || (ca5[0] == ' ')) { lead = 1; } int dp = lead; - for (; dp < ca5.length; dp++) - { - if (ca5[dp] == '.') - { + for (; dp < ca5.length; dp++) { + if (ca5[dp] == '.') { break; } } @@ -1965,35 +1755,29 @@ int nThousands = (dp - lead) / 3; // Localize the decimal point. - if (dp < ca5.length) - { + if (dp < ca5.length) { ca5[dp] = dfs.getDecimalSeparator(); } char[] ca6 = ca5; - if (thousands && (nThousands > 0)) - { + if (thousands && (nThousands > 0)) { ca6 = new char[ca5.length + nThousands + lead]; ca6[0] = ca5[0]; - for (i = lead, k = lead; i < dp; i++) - { - if ((i > 0) && (dp - i) % 3 == 0) - { + for (i = lead, k = lead; i < dp; i++) { + if ((i > 0) && (dp - i) % 3 == 0) { // ca6[k]=','; ca6[k] = dfs.getGroupingSeparator(); ca6[k + 1] = ca5[i]; k += 2; - } else - { + } else { ca6[k] = ca5[i]; k++; } } - for (; i < ca5.length; i++, k++) - { + for (; i < ca5.length; i++, k++) { ca6[k] = ca5[i]; } } @@ -2011,47 +1795,35 @@ * @param x the double value to be formatted. * @return the converted double value. */ - private String fFormatString(double x) - { + private String fFormatString(double x) { boolean noDigits = false; char[] ca6, ca7; - if (Double.isInfinite(x)) - { - if (x == Double.POSITIVE_INFINITY) - { - if (leadingSign) - { + if (Double.isInfinite(x)) { + if (x == Double.POSITIVE_INFINITY) { + if (leadingSign) { ca6 = "+Inf".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca6 = " Inf".toCharArray(); - } else - { + } else { ca6 = "Inf".toCharArray(); } - } else - { + } else { ca6 = "-Inf".toCharArray(); } noDigits = true; - } else if (Double.isNaN(x)) - { - if (leadingSign) - { + } else if (Double.isNaN(x)) { + if (leadingSign) { ca6 = "+NaN".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca6 = " NaN".toCharArray(); - } else - { + } else { ca6 = "NaN".toCharArray(); } noDigits = true; - } else - { + } else { ca6 = fFormatDigits(x); } @@ -2090,8 +1862,7 @@ * L does not imply conversion to a long long * double. */ - private char[] eFormatDigits(double x, char eChar) - { + private char[] eFormatDigits(double x, char eChar) { char[] ca1, ca2, ca3; // int defaultDigits=6; @@ -2102,19 +1873,15 @@ int ePos, rPos, eSize; boolean minusSign = false; - if (x > 0.0) - { + if (x > 0.0) { sx = Double.toString(x); - } else if (x < 0.0) - { + } else if (x < 0.0) { sx = Double.toString(-x); minusSign = true; - } else - { + } else { sx = Double.toString(x); - if (sx.charAt(0) == '-') - { + if (sx.charAt(0) == '-') { minusSign = true; sx = sx.substring(1); } @@ -2122,145 +1889,111 @@ ePos = sx.indexOf('E'); - if (ePos == -1) - { + if (ePos == -1) { ePos = sx.indexOf('e'); } rPos = sx.indexOf('.'); - if (rPos != -1) - { + if (rPos != -1) { n1In = rPos; - } else if (ePos != -1) - { + } else if (ePos != -1) { n1In = ePos; - } else - { + } else { n1In = sx.length(); } - if (rPos != -1) - { - if (ePos != -1) - { + if (rPos != -1) { + if (ePos != -1) { n2In = ePos - rPos - 1; - } else - { + } else { n2In = sx.length() - rPos - 1; } - } else - { + } else { n2In = 0; } - if (ePos != -1) - { + if (ePos != -1) { int ie = ePos + 1; expon = 0; - if (sx.charAt(ie) == '-') - { - for (++ie; ie < sx.length(); ie++) - { - if (sx.charAt(ie) != '0') - { + if (sx.charAt(ie) == '-') { + for (++ie; ie < sx.length(); ie++) { + if (sx.charAt(ie) != '0') { break; } } - if (ie < sx.length()) - { + if (ie < sx.length()) { expon = -Integer.parseInt(sx.substring(ie)); } - } else - { - if (sx.charAt(ie) == '+') - { + } else { + if (sx.charAt(ie) == '+') { ++ie; } - for (; ie < sx.length(); ie++) - { - if (sx.charAt(ie) != '0') - { + for (; ie < sx.length(); ie++) { + if (sx.charAt(ie) != '0') { break; } } - if (ie < sx.length()) - { + if (ie < sx.length()) { expon = Integer.parseInt(sx.substring(ie)); } } } - if (rPos != -1) - { + if (rPos != -1) { expon += rPos - 1; } - if (precisionSet) - { + if (precisionSet) { p = precision; - } else - { + } else { p = defaultDigits - 1; } - if ((rPos != -1) && (ePos != -1)) - { + if ((rPos != -1) && (ePos != -1)) { ca1 = (sx.substring(0, rPos) + sx.substring(rPos + 1, ePos)).toCharArray(); - } else if (rPos != -1) - { + } else if (rPos != -1) { ca1 = (sx.substring(0, rPos) + sx.substring(rPos + 1)).toCharArray(); - } else if (ePos != -1) - { + } else if (ePos != -1) { ca1 = sx.substring(0, ePos).toCharArray(); - } else - { + } else { ca1 = sx.toCharArray(); } boolean carry = false; int i0 = 0; - if (ca1[0] != '0') - { + if (ca1[0] != '0') { i0 = 0; - } else - { - for (i0 = 0; i0 < ca1.length; i0++) - { - if (ca1[i0] != '0') - { + } else { + for (i0 = 0; i0 < ca1.length; i0++) { + if (ca1[i0] != '0') { break; } } } - if (i0 + p < ca1.length - 1) - { + if (i0 + p < ca1.length - 1) { carry = checkForCarry(ca1, i0 + p + 1); - if (carry) - { + if (carry) { carry = startSymbolicCarry(ca1, i0 + p, i0); } - if (carry) - { + if (carry) { ca2 = new char[i0 + p + 1]; ca2[i0] = '1'; - for (j = 0; j < i0; j++) - { + for (j = 0; j < i0; j++) { ca2[j] = '0'; } - for (i = i0, j = i0 + 1; j < p + 1; i++, j++) - { + for (i = i0, j = i0 + 1; j < p + 1; i++, j++) { ca2[j] = ca1[i]; } @@ -2269,85 +2002,67 @@ } } - if ((Math.abs(expon) < 100) && !optionalL) - { + if ((Math.abs(expon) < 100) && !optionalL) { eSize = 4; - } else - { + } else { eSize = 5; } - if (alternateForm || !precisionSet || (precision != 0)) - { + if (alternateForm || !precisionSet || (precision != 0)) { ca2 = new char[2 + p + eSize]; - } else - { + } else { ca2 = new char[1 + eSize]; } - if (ca1[0] != '0') - { + if (ca1[0] != '0') { ca2[0] = ca1[0]; j = 1; - } else - { + } else { for (j = 1; j < ((ePos == -1) - ? ca1.length - : ePos); j++) - { - if (ca1[j] != '0') - { + ? ca1.length + : ePos); j++) { + if (ca1[j] != '0') { break; } } - if (((ePos != -1) && (j < ePos)) || ((ePos == -1) && (j < ca1.length))) - { + if (((ePos != -1) && (j < ePos)) || ((ePos == -1) && (j < ca1.length))) { ca2[0] = ca1[j]; expon -= j; j++; - } else - { + } else { ca2[0] = '0'; j = 2; } } - if (alternateForm || !precisionSet || (precision != 0)) - { + if (alternateForm || !precisionSet || (precision != 0)) { ca2[1] = '.'; i = 2; - } else - { + } else { i = 1; } - for (k = 0; (k < p) && (j < ca1.length); j++, i++, k++) - { + for (k = 0; (k < p) && (j < ca1.length); j++, i++, k++) { ca2[i] = ca1[j]; } - for (; i < ca2.length - eSize; i++) - { + for (; i < ca2.length - eSize; i++) { ca2[i] = '0'; } ca2[i++] = eChar; - if (expon < 0) - { + if (expon < 0) { ca2[i++] = '-'; - } else - { + } else { ca2[i++] = '+'; } expon = Math.abs(expon); - if (expon >= 100) - { - switch (expon / 100) - { + if (expon >= 100) { + switch (expon / 100) { case 1: ca2[i] = '1'; @@ -2397,8 +2112,7 @@ i++; } - switch ((expon % 100) / 10) - { + switch ((expon % 100) / 10) { case 0: ca2[i] = '0'; @@ -2452,8 +2166,7 @@ i++; - switch (expon % 10) - { + switch (expon % 10) { case 0: ca2[i] = '0'; @@ -2507,25 +2220,20 @@ int nZeros = 0; - if (!leftJustify && leadingZeros) - { + if (!leftJustify && leadingZeros) { int xThousands = 0; - if (thousands) - { + if (thousands) { int xlead = 0; - if ((ca2[0] == '+') || (ca2[0] == '-') || (ca2[0] == ' ')) - { + if ((ca2[0] == '+') || (ca2[0] == '-') || (ca2[0] == ' ')) { xlead = 1; } int xdp = xlead; - for (; xdp < ca2.length; xdp++) - { - if (ca2[xdp] == '.') - { + for (; xdp < ca2.length; xdp++) { + if (ca2[xdp] == '.') { break; } } @@ -2533,74 +2241,60 @@ xThousands = (xdp - xlead) / 3; } - if (fieldWidthSet) - { + if (fieldWidthSet) { nZeros = fieldWidth - ca2.length; } - if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) - { + if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) { nZeros--; } nZeros -= xThousands; - if (nZeros < 0) - { + if (nZeros < 0) { nZeros = 0; } } j = 0; - if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) - { + if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) { ca3 = new char[ca2.length + nZeros + 1]; j++; - } else - { + } else { ca3 = new char[ca2.length + nZeros]; } - if (!minusSign) - { - if (leadingSign) - { + if (!minusSign) { + if (leadingSign) { ca3[0] = '+'; } - if (leadingSpace) - { + if (leadingSpace) { ca3[0] = ' '; } - } else - { + } else { ca3[0] = '-'; } - for (k = 0; k < nZeros; j++, k++) - { + for (k = 0; k < nZeros; j++, k++) { ca3[j] = '0'; } - for (i = 0; (i < ca2.length) && (j < ca3.length); i++, j++) - { + for (i = 0; (i < ca2.length) && (j < ca3.length); i++, j++) { ca3[j] = ca2[i]; } int lead = 0; - if ((ca3[0] == '+') || (ca3[0] == '-') || (ca3[0] == ' ')) - { + if ((ca3[0] == '+') || (ca3[0] == '-') || (ca3[0] == ' ')) { lead = 1; } int dp = lead; - for (; dp < ca3.length; dp++) - { - if (ca3[dp] == '.') - { + for (; dp < ca3.length; dp++) { + if (ca3[dp] == '.') { break; } } @@ -2608,35 +2302,29 @@ int nThousands = dp / 3; // Localize the decimal point. - if (dp < ca3.length) - { + if (dp < ca3.length) { ca3[dp] = dfs.getDecimalSeparator(); } char[] ca4 = ca3; - if (thousands && (nThousands > 0)) - { + if (thousands && (nThousands > 0)) { ca4 = new char[ca3.length + nThousands + lead]; ca4[0] = ca3[0]; - for (i = lead, k = lead; i < dp; i++) - { - if ((i > 0) && (dp - i) % 3 == 0) - { + for (i = lead, k = lead; i < dp; i++) { + if ((i > 0) && (dp - i) % 3 == 0) { // ca4[k]=','; ca4[k] = dfs.getGroupingSeparator(); ca4[k + 1] = ca3[i]; k += 2; - } else - { + } else { ca4[k] = ca3[i]; k++; } } - for (; i < ca3.length; i++, k++) - { + for (; i < ca3.length; i++, k++) { ca4[k] = ca3[i]; } } @@ -2655,33 +2343,26 @@ * @return <code>true</code> if the truncation forces * a round that will change the print */ - private boolean checkForCarry(char[] ca1, int icarry) - { + private boolean checkForCarry(char[] ca1, int icarry) { boolean carry = false; - if (icarry < ca1.length) - { - if ((ca1[icarry] == '6') || (ca1[icarry] == '7') || (ca1[icarry] == '8') || (ca1[icarry] == '9')) - { + if (icarry < ca1.length) { + if ((ca1[icarry] == '6') || (ca1[icarry] == '7') || (ca1[icarry] == '8') || (ca1[icarry] == '9')) { carry = true; - } else if (ca1[icarry] == '5') - { + } else if (ca1[icarry] == '5') { int ii = icarry + 1; - for (; ii < ca1.length; ii++) - { - if (ca1[ii] != '0') - { + for (; ii < ca1.length; ii++) { + if (ca1[ii] != '0') { break; } } carry = ii < ca1.length; - if (!carry && (icarry > 0)) - { + if (!carry && (icarry > 0)) { carry = ((ca1[icarry - 1] == '1') || (ca1[icarry - 1] == '3') || (ca1[icarry - 1] == '5') - || (ca1[icarry - 1] == '7') || (ca1[icarry - 1] == '9')); + || (ca1[icarry - 1] == '7') || (ca1[icarry - 1] == '9')); } } } @@ -2703,16 +2384,13 @@ * a round that will change the print still * more */ - private boolean startSymbolicCarry(char[] ca, int cLast, int cFirst) - { + private boolean startSymbolicCarry(char[] ca, int cLast, int cFirst) { boolean carry = true; - for (int i = cLast; carry && (i >= cFirst); i--) - { + for (int i = cLast; carry && (i >= cFirst); i--) { carry = false; - switch (ca[i]) - { + switch (ca[i]) { case '0': ca[i] = '1'; @@ -2781,47 +2459,35 @@ * converted double value. * @return the converted double value. */ - private String eFormatString(double x, char eChar) - { + private String eFormatString(double x, char eChar) { boolean noDigits = false; char[] ca4, ca5; - if (Double.isInfinite(x)) - { - if (x == Double.POSITIVE_INFINITY) - { - if (leadingSign) - { + if (Double.isInfinite(x)) { + if (x == Double.POSITIVE_INFINITY) { + if (leadingSign) { ca4 = "+Inf".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca4 = " Inf".toCharArray(); - } else - { + } else { ca4 = "Inf".toCharArray(); } - } else - { + } else { ca4 = "-Inf".toCharArray(); } noDigits = true; - } else if (Double.isNaN(x)) - { - if (leadingSign) - { + } else if (Double.isNaN(x)) { + if (leadingSign) { ca4 = "+NaN".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca4 = " NaN".toCharArray(); - } else - { + } else { ca4 = "NaN".toCharArray(); } noDigits = true; - } else - { + } else { ca4 = eFormatDigits(x, eChar); } @@ -2838,74 +2504,59 @@ * @param noDigits NaN or signed Inf * @return a padded array of characters */ - private char[] applyFloatPadding(char[] ca4, boolean noDigits) - { + private char[] applyFloatPadding(char[] ca4, boolean noDigits) { char[] ca5 = ca4; - if (fieldWidthSet) - { + if (fieldWidthSet) { int i, j, nBlanks; - if (leftJustify) - { + if (leftJustify) { nBlanks = fieldWidth - ca4.length; - if (nBlanks > 0) - { + if (nBlanks > 0) { ca5 = new char[ca4.length + nBlanks]; - for (i = 0; i < ca4.length; i++) - { + for (i = 0; i < ca4.length; i++) { ca5[i] = ca4[i]; } - for (j = 0; j < nBlanks; j++, i++) - { + for (j = 0; j < nBlanks; j++, i++) { ca5[i] = ' '; } } - } else if (!leadingZeros || noDigits) - { + } else if (!leadingZeros || noDigits) { nBlanks = fieldWidth - ca4.length; - if (nBlanks > 0) - { + if (nBlanks > 0) { ca5 = new char[ca4.length + nBlanks]; - for (i = 0; i < nBlanks; i++) - { + for (i = 0; i < nBlanks; i++) { ca5[i] = ' '; } - for (j = 0; j < ca4.length; i++, j++) - { + for (j = 0; j < ca4.length; i++, j++) { ca5[i] = ca4[j]; } } - } else if (leadingZeros) - { + } else if (leadingZeros) { nBlanks = fieldWidth - ca4.length; - if (nBlanks > 0) - { + if (nBlanks > 0) { ca5 = new char[ca4.length + nBlanks]; i = 0; j = 0; - if (ca4[0] == '-') - { + if (ca4[0] == '-') { ca5[0] = '-'; i++; j++; } - for (int k = 0; k < nBlanks; i++, k++) - { + for (int k = 0; k < nBlanks; i++, k++) { ca5[i] = '0'; } - for (; j < ca4.length; i++, j++) - { + for (; j < ca4.length; i++, j++) { ca5[i] = ca4[j]; } } @@ -2921,8 +2572,7 @@ * @param x the double to format. * @return the formatted String. */ - private String printFFormat(double x) - { + private String printFFormat(double x) { return fFormatString(x); } @@ -2933,13 +2583,10 @@ * @param x the double to format. * @return the formatted String. */ - private String printEFormat(double x) - { - if (conversionCharacter == 'e') - { + private String printEFormat(double x) { + if (conversionCharacter == 'e') { return eFormatString(x, 'e'); - } else - { + } else { return eFormatString(x, 'E'); } } @@ -2971,68 +2618,52 @@ * @param x the double to format. * @return the formatted String. */ - private String printGFormat(double x) - { + private String printGFormat(double x) { String sx, sy, sz, ret; int savePrecision = precision; int i; char[] ca4, ca5; boolean noDigits = false; - if (Double.isInfinite(x)) - { - if (x == Double.POSITIVE_INFINITY) - { - if (leadingSign) - { + if (Double.isInfinite(x)) { + if (x == Double.POSITIVE_INFINITY) { + if (leadingSign) { ca4 = "+Inf".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca4 = " Inf".toCharArray(); - } else - { + } else { ca4 = "Inf".toCharArray(); } - } else - { + } else { ca4 = "-Inf".toCharArray(); } noDigits = true; - } else if (Double.isNaN(x)) - { - if (leadingSign) - { + } else if (Double.isNaN(x)) { + if (leadingSign) { ca4 = "+NaN".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca4 = " NaN".toCharArray(); - } else - { + } else { ca4 = "NaN".toCharArray(); } noDigits = true; - } else - { - if (!precisionSet) - { + } else { + if (!precisionSet) { precision = defaultDigits; } - if (precision == 0) - { + if (precision == 0) { precision = 1; } int ePos = -1; - if (conversionCharacter == 'g') - { + if (conversionCharacter == 'g') { sx = eFormatString(x, 'e').trim(); ePos = sx.indexOf('e'); - } else - { + } else { sx = eFormatString(x, 'E').trim(); ePos = sx.indexOf('E'); } @@ -3041,37 +2672,28 @@ int expon = 0; - if (sx.charAt(i) == '-') - { - for (++i; i < sx.length(); i++) - { - if (sx.charAt(i) != '0') - { + if (sx.charAt(i) == '-') { + for (++i; i < sx.length(); i++) { + if (sx.charAt(i) != '0') { break; } } - if (i < sx.length()) - { + if (i < sx.length()) { expon = -Integer.parseInt(sx.substring(i)); } - } else - { - if (sx.charAt(i) == '+') - { + } else { + if (sx.charAt(i) == '+') { ++i; } - for (; i < sx.length(); i++) - { - if (sx.charAt(i) != '0') - { + for (; i < sx.length(); i++) { + if (sx.charAt(i) != '0') { break; } } - if (i < sx.length()) - { + if (i < sx.length()) { expon = Integer.parseInt(sx.substring(i)); } } @@ -3079,66 +2701,50 @@ // Trim trailing zeros. // If the radix character is not followed by // a digit, trim it, too. - if (!alternateForm) - { - if ((expon >= -4) && (expon < precision)) - { + if (!alternateForm) { + if ((expon >= -4) && (expon < precision)) { sy = fFormatString(x).trim(); - } else - { + } else { sy = sx.substring(0, ePos); } i = sy.length() - 1; - for (; i >= 0; i--) - { - if (sy.charAt(i) != '0') - { + for (; i >= 0; i--) { + if (sy.charAt(i) != '0') { break; } } - if ((i >= 0) && (sy.charAt(i) == '.')) - { + if ((i >= 0) && (sy.charAt(i) == '.')) { i--; } - if (i == -1) - { + if (i == -1) { sz = "0"; - } else if (!Character.isDigit(sy.charAt(i))) - { + } else if (!Character.isDigit(sy.charAt(i))) { sz = sy.substring(0, i + 1) + "0"; - } else - { + } else { sz = sy.substring(0, i + 1); } - if ((expon >= -4) && (expon < precision)) - { + if ((expon >= -4) && (expon < precision)) { ret = sz; - } else - { + } else { ret = sz + sx.substring(ePos); } - } else - { - if ((expon >= -4) && (expon < precision)) - { + } else { + if ((expon >= -4) && (expon < precision)) { ret = fFormatString(x).trim(); - } else - { + } else { ret = sx; } } // leading space was trimmed off during // construction - if (leadingSpace) - { - if (x >= 0) - { + if (leadingSpace) { + if (x >= 0) { ret = " " + ret; } } @@ -3180,8 +2786,7 @@ * @param x the short to format. * @return the formatted String. */ - private String printDFormat(short x) - { + private String printDFormat(short x) { return printDFormat(Short.toString(x)); } @@ -3212,8 +2817,7 @@ * @param x the long to format. * @return the formatted String. */ - private String printDFormat(long x) - { + private String printDFormat(long x) { return printDFormat(Long.toString(x)); } @@ -3244,8 +2848,7 @@ * @param x the int to format. * @return the formatted String. */ - private String printDFormat(int x) - { + private String printDFormat(int x) { return printDFormat(Integer.toString(x)); } @@ -3258,59 +2861,47 @@ * String. * @return the formatted String. */ - private String printDFormat(String sx) - { + private String printDFormat(String sx) { int nLeadingZeros = 0; int nBlanks = 0, - n = 0; + n = 0; int i = 0, - jFirst = 0; + jFirst = 0; boolean neg = sx.charAt(0) == '-'; - if (sx.equals("0") && precisionSet && (precision == 0)) - { + if (sx.equals("0") && precisionSet && (precision == 0)) { sx = ""; } - if (!neg) - { - if (precisionSet && (sx.length() < precision)) - { + if (!neg) { + if (precisionSet && (sx.length() < precision)) { nLeadingZeros = precision - sx.length(); } - } else - { - if (precisionSet && (sx.length() - 1) < precision) - { + } else { + if (precisionSet && (sx.length() - 1) < precision) { nLeadingZeros = precision - sx.length() + 1; } } - if (nLeadingZeros < 0) - { + if (nLeadingZeros < 0) { nLeadingZeros = 0; } - if (fieldWidthSet) - { + if (fieldWidthSet) { nBlanks = fieldWidth - nLeadingZeros - sx.length(); - if (!neg && (leadingSign || leadingSpace)) - { + if (!neg && (leadingSign || leadingSpace)) { nBlanks--; } } - if (nBlanks < 0) - { + if (nBlanks < 0) { nBlanks = 0; } - if (leadingSign) - { + if (leadingSign) { n++; - } else if (leadingSpace) - { + } else if (leadingSpace) { n++; } @@ -3320,90 +2911,70 @@ char[] ca = new char[n]; - if (leftJustify) - { - if (neg) - { + if (leftJustify) { + if (neg) { ca[i++] = '-'; - } else if (leadingSign) - { + } else if (leadingSign) { ca[i++] = '+'; - } else if (leadingSpace) - { + } else if (leadingSpace) { ca[i++] = ' '; } char[] csx = sx.toCharArray(); jFirst = neg - ? 1 - : 0; + ? 1 + : 0; - for (int j = 0; j < nLeadingZeros; i++, j++) - { + for (int j = 0; j < nLeadingZeros; i++, j++) { ca[i] = '0'; } - for (int j = jFirst; j < csx.length; j++, i++) - { + for (int j = jFirst; j < csx.length; j++, i++) { ca[i] = csx[j]; } - for (int j = 0; j < nBlanks; i++, j++) - { + for (int j = 0; j < nBlanks; i++, j++) { ca[i] = ' '; } - } else - { - if (!leadingZeros) - { - for (i = 0; i < nBlanks; i++) - { + } else { + if (!leadingZeros) { + for (i = 0; i < nBlanks; i++) { ca[i] = ' '; } - if (neg) - { + if (neg) { ca[i++] = '-'; - } else if (leadingSign) - { + } else if (leadingSign) { ca[i++] = '+'; - } else if (leadingSpace) - { + } else if (leadingSpace) { ca[i++] = ' '; } - } else - { - if (neg) - { + } else { + if (neg) { ca[i++] = '-'; - } else if (leadingSign) - { + } else if (leadingSign) { ca[i++] = '+'; - } else if (leadingSpace) - { + } else if (leadingSpace) { ca[i++] = ' '; } - for (int j = 0; j < nBlanks; j++, i++) - { + for (int j = 0; j < nBlanks; j++, i++) { ca[i] = '0'; } } - for (int j = 0; j < nLeadingZeros; j++, i++) - { + for (int j = 0; j < nLeadingZeros; j++, i++) { ca[i] = '0'; } char[] csx = sx.toCharArray(); jFirst = neg - ? 1 - : 0; + ? 1 + : 0; - for (int j = jFirst; j < csx.length; j++, i++) - { + for (int j = jFirst; j < csx.length; j++, i++) { ca[i] = csx[j]; } } @@ -3432,32 +3003,25 @@ * @param x the short to format. * @return the formatted String. */ - private String printXFormat(short x) - { + private String printXFormat(short x) { String sx = null; - if (x == Short.MIN_VALUE) - { + if (x == Short.MIN_VALUE) { sx = "8000"; - } else if (x < 0) - { + } else if (x < 0) { String t; - if (x == Short.MIN_VALUE) - { + if (x == Short.MIN_VALUE) { t = "0"; - } else - { + } else { t = Integer.toString((~(-x - 1)) ^ Short.MIN_VALUE, 16); - if ((t.charAt(0) == 'F') || (t.charAt(0) == 'f')) - { + if ((t.charAt(0) == 'F') || (t.charAt(0) == 'f')) { t = t.substring(16, 32); } } - switch (t.length()) - { + switch (t.length()) { case 1: sx = "800" + t; @@ -3474,8 +3038,7 @@ break; case 4: - switch (t.charAt(0)) - { + switch (t.charAt(0)) { case '1': sx = "9" + t.substring(1, 4); @@ -3514,8 +3077,7 @@ break; } - } else - { + } else { sx = Integer.toString((int) x, 16); } @@ -3543,19 +3105,15 @@ * @param x the long to format. * @return the formatted String. */ - private String printXFormat(long x) - { + private String printXFormat(long x) { String sx = null; - if (x == Long.MIN_VALUE) - { + if (x == Long.MIN_VALUE) { sx = "8000000000000000"; - } else if (x < 0) - { + } else if (x < 0) { String t = Long.toString((~(-x - 1)) ^ Long.MIN_VALUE, 16); - switch (t.length()) - { + switch (t.length()) { case 1: sx = "800000000000000" + t; @@ -3632,8 +3190,7 @@ break; case 16: - switch (t.charAt(0)) - { + switch (t.charAt(0)) { case '1': sx = "9" + t.substring(1, 16); @@ -3672,8 +3229,7 @@ break; } - } else - { + } else { sx = Long.toString(x, 16); } @@ -3701,19 +3257,15 @@ * @param x the int to format. * @return the formatted String. */ - private String printXFormat(int x) - { + private String printXFormat(int x) { String sx = null; - if (x == Integer.MIN_VALUE) - { + if (x == Integer.MIN_VALUE) { sx = "80000000"; - } else if (x < 0) - { + } else if (x < 0) { String t = Integer.toString((~(-x - 1)) ^ Integer.MIN_VALUE, 16); - switch (t.length()) - { + switch (t.length()) { case 1: sx = "8000000" + t; @@ -3750,8 +3302,7 @@ break; case 8: - switch (t.charAt(0)) - { + switch (t.charAt(0)) { case '1': sx = "9" + t.substring(1, 8); @@ -3790,8 +3341,7 @@ break; } - } else - { + } else { sx = Integer.toString(x, 16); } @@ -3807,45 +3357,37 @@ * String. * @return the formatted String. */ - private String printXFormat(String sx) - { + private String printXFormat(String sx) { int nLeadingZeros = 0; int nBlanks = 0; - if (sx.equals("0") && precisionSet && (precision == 0)) - { + if (sx.equals("0") && precisionSet && (precision == 0)) { sx = ""; } - if (precisionSet) - { + if (precisionSet) { nLeadingZeros = precision - sx.length(); } - if (nLeadingZeros < 0) - { + if (nLeadingZeros < 0) { nLeadingZeros = 0; } - if (fieldWidthSet) - { + if (fieldWidthSet) { nBlanks = fieldWidth - nLeadingZeros - sx.length(); - if (alternateForm) - { + if (alternateForm) { nBlanks = nBlanks - 2; } } - if (nBlanks < 0) - { + if (nBlanks < 0) { nBlanks = 0; } int n = 0; - if (alternateForm) - { + if (alternateForm) { n += 2; } @@ -3856,71 +3398,57 @@ char[] ca = new char[n]; int i = 0; - if (leftJustify) - { - if (alternateForm) - { + if (leftJustify) { + if (alternateForm) { ca[i++] = '0'; ca[i++] = 'x'; } - for (int j = 0; j < nLeadingZeros; j++, i++) - { + for (int j = 0; j < nLeadingZeros; j++, i++) { ca[i] = '0'; } char[] csx = sx.toCharArray(); - for (int j = 0; j < csx.length; j++, i++) - { + for (int j = 0; j < csx.length; j++, i++) { ca[i] = csx[j]; } - for (int j = 0; j < nBlanks; j++, i++) - { + for (int j = 0; j < nBlanks; j++, i++) { ca[i] = ' '; } - } else - { - if (!leadingZeros) - { - for (int j = 0; j < nBlanks; j++, i++) - { + } else { + if (!leadingZeros) { + for (int j = 0; j < nBlanks; j++, i++) { ca[i] = ' '; } } - if (alternateForm) - { + if (alternateForm) { ca[i++] = '0'; ca[i++] = 'x'; } - if (leadingZeros) - { - for (int j = 0; j < nBlanks; j++, i++) - { + if (leadingZeros) { + for (int j = 0; j < nBlanks; j++, i++) { ca[i] = '0'; } } - for (int j = 0; j < nLeadingZeros; j++, i++) - { + for (int j = 0; j < nLeadingZeros; j++, i++) { ca[i] = '0'; } char[] csx = sx.toCharArray(); - for (int j = 0; j < csx.length; j++, i++) - { + for (int j = 0; j < csx.length; j++, i++) { ca[i] = csx[j]; } } String caReturn = new String(ca); - if (conversionCharacter == 'X') - { + if (conversionCharacter == 'X') { caReturn = caReturn.toUpperCase(); } @@ -3949,19 +3477,15 @@ * @param x the short to format. * @return the formatted String. */ - private String printOFormat(short x) - { + private String printOFormat(short x) { String sx = null; - if (x == Short.MIN_VALUE) - { + if (x == Short.MIN_VALUE) { sx = "100000"; - } else if (x < 0) - { + } else if (x < 0) { String t = Integer.toString((~(-x - 1)) ^ Short.MIN_VALUE, 8); - switch (t.length()) - { + switch (t.length()) { case 1: sx = "10000" + t; @@ -3987,8 +3511,7 @@ break; } - } else - { + } else { sx = Integer.toString((int) x, 8); } @@ -4017,19 +3540,15 @@ * @param x the long to format. * @return the formatted String. */ - private String printOFormat(long x) - { + private String printOFormat(long x) { String sx = null; - if (x == Long.MIN_VALUE) - { + if (x == Long.MIN_VALUE) { sx = "1000000000000000000000"; - } else if (x < 0) - { + } else if (x < 0) { String t = Long.toString((~(-x - 1)) ^ Long.MIN_VALUE, 8); - switch (t.length()) - { + switch (t.length()) { case 1: sx = "100000000000000000000" + t; @@ -4135,8 +3654,7 @@ break; } - } else - { + } else { sx = Long.toString(x, 8); } @@ -4165,19 +3683,15 @@ * @param x the int to format. * @return the formatted String. */ - private String printOFormat(int x) - { + private String printOFormat(int x) { String sx = null; - if (x == Integer.MIN_VALUE) - { + if (x == Integer.MIN_VALUE) { sx = "20000000000"; - } else if (x < 0) - { + } else if (x < 0) { String t = Integer.toString((~(-x - 1)) ^ Integer.MIN_VALUE, 8); - switch (t.length()) - { + switch (t.length()) { case 1: sx = "2000000000" + t; @@ -4233,8 +3747,7 @@ break; } - } else - { + } else { sx = Integer.toString(x, 8); } @@ -4250,38 +3763,31 @@ * String. * @return the formatted String. */ - private String printOFormat(String sx) - { + private String printOFormat(String sx) { int nLeadingZeros = 0; int nBlanks = 0; - if (sx.equals("0") && precisionSet && (precision == 0)) - { + if (sx.equals("0") && precisionSet && (precision == 0)) { sx = ""; } - if (precisionSet) - { + if (precisionSet) { nLeadingZeros = precision - sx.length(); } - if (alternateForm) - { + if (alternateForm) { nLeadingZeros++; } - if (nLeadingZeros < 0) - { + if (nLeadingZeros < 0) { nLeadingZeros = 0; } - if (fieldWidthSet) - { + if (fieldWidthSet) { nBlanks = fieldWidth - nLeadingZeros - sx.length(); } - if (nBlanks < 0) - { + if (nBlanks < 0) { nBlanks = 0; } @@ -4289,49 +3795,38 @@ char[] ca = new char[n]; int i; - if (leftJustify) - { - for (i = 0; i < nLeadingZeros; i++) - { + if (leftJustify) { + for (i = 0; i < nLeadingZeros; i++) { ca[i] = '0'; } char[] csx = sx.toCharArray(); - for (int j = 0; j < csx.length; j++, i++) - { + for (int j = 0; j < csx.length; j++, i++) { ca[i] = csx[j]; } - for (int j = 0; j < nBlanks; j++, i++) - { + for (int j = 0; j < nBlanks; j++, i++) { ca[i] = ' '; } - } else - { - if (leadingZeros) - { - for (i = 0; i < nBlanks; i++) - { + } else { + if (leadingZeros) { + for (i = 0; i < nBlanks; i++) { ca[i] = '0'; } - } else - { - for (i = 0; i < nBlanks; i++) - { + } else { + for (i = 0; i < nBlanks; i++) { ca[i] = ' '; } } - for (int j = 0; j < nLeadingZeros; j++, i++) - { + for (int j = 0; j < nLeadingZeros; j++, i++) { ca[i] = '0'; } char[] csx = sx.toCharArray(); - for (int j = 0; j < csx.length; j++, i++) - { + for (int j = 0; j < csx.length; j++, i++) { ca[i] = csx[j]; } } @@ -4357,31 +3852,25 @@ * @param x the char to format. * @return the formatted String. */ - private String printCFormat(char x) - { + private String printCFormat(char x) { int nPrint = 1; int width = fieldWidth; - if (!fieldWidthSet) - { + if (!fieldWidthSet) { width = nPrint; } char[] ca = new char[width]; int i = 0; - if (leftJustify) - { + if (leftJustify) { ca[0] = x; - for (i = 1; i <= width - nPrint; i++) - { + for (i = 1; i <= width - nPrint; i++) { ca[i] = ' '; } - } else - { - for (i = 0; i < width - nPrint; i++) - { + } else { + for (i = 0; i < width - nPrint; i++) { ca[i] = ' '; } @@ -4415,84 +3904,66 @@ * @param x the String to format. * @return the formatted String. */ - private String printSFormat(String x) - { + private String printSFormat(String x) { int nPrint = x.length(); int width = fieldWidth; - if (precisionSet && (nPrint > precision)) - { + if (precisionSet && (nPrint > precision)) { nPrint = precision; } - if (!fieldWidthSet) - { + if (!fieldWidthSet) { width = nPrint; } int n = 0; - if (width > nPrint) - { + if (width > nPrint) { n += width - nPrint; } - if (nPrint >= x.length()) - { + if (nPrint >= x.length()) { n += x.length(); - } else - { + } else { n += nPrint; } char[] ca = new char[n]; int i = 0; - if (leftJustify) - { - if (nPrint >= x.length()) - { + if (leftJustify) { + if (nPrint >= x.length()) { char[] csx = x.toCharArray(); - for (i = 0; i < x.length(); i++) - { + for (i = 0; i < x.length(); i++) { ca[i] = csx[i]; } - } else - { + } else { char[] csx = x.substring(0, nPrint).toCharArray(); - for (i = 0; i < nPrint; i++) - { + for (i = 0; i < nPrint; i++) { ca[i] = csx[i]; } } - for (int j = 0; j < width - nPrint; j++, i++) - { + for (int j = 0; j < width - nPrint; j++, i++) { ca[i] = ' '; } - } else - { - for (i = 0; i < width - nPrint; i++) - { + } else { + for (i = 0; i < width - nPrint; i++) { ca[i] = ' '; } - if (nPrint >= x.length()) - { + if (nPrint >= x.length()) { char[] csx = x.toCharArray(); - for (int j = 0; j < x.length(); i++, j++) - { + for (int j = 0; j < x.length(); i++, j++) { ca[i] = csx[j]; } - } else - { + } else { char[] csx = x.substring(0, nPrint).toCharArray(); - for (int j = 0; j < nPrint; i++, j++) - { + for (int j = 0; j < nPrint; i++, j++) { ca[i] = csx[j]; } } @@ -4509,20 +3980,17 @@ * character is there, and * <code>false</code> otherwise. */ - private boolean setConversionCharacter() - { + private boolean setConversionCharacter() { /* idfgGoxXeEcs */ boolean ret = false; conversionCharacter = '\0'; - if (pos < fmt.length()) - { + if (pos < fmt.length()) { char c = fmt.charAt(pos); if ((c == 'i') || (c == 'd') || (c == 'f') || (c == 'g') || (c == 'G') || (c == 'o') || (c == 'x') || (c == 'X') - || (c == 'e') || (c == 'E') || (c == 'c') || (c == 's') || (c == '%')) - { + || (c == 'e') || (c == 'E') || (c == 'c') || (c == 's') || (c == '%')) { conversionCharacter = c; pos++; ret = true; @@ -4541,26 +4009,21 @@ * respectively, before formatting. If any of * these is present, store them. */ - private void setOptionalHL() - { + private void setOptionalHL() { optionalh = false; optionall = false; optionalL = false; - if (pos < fmt.length()) - { + if (pos < fmt.length()) { char c = fmt.charAt(pos); - if (c == 'h') - { + if (c == 'h') { optionalh = true; pos++; - } else if (c == 'l') - { + } else if (c == 'l') { optionall = true; pos++; - } else if (c == 'L') - { + } else if (c == 'L') { optionalL = true; pos++; } @@ -4570,44 +4033,35 @@ /** * Set the precision. */ - private void setPrecision() - { + private void setPrecision() { int firstPos = pos; precisionSet = false; - if ((pos < fmt.length()) && (fmt.charAt(pos) == '.')) - { + if ((pos < fmt.length()) && (fmt.charAt(pos) == '.')) { pos++; - if ((pos < fmt.length()) && (fmt.charAt(pos) == '*')) - { + if ((pos < fmt.length()) && (fmt.charAt(pos) == '*')) { pos++; - if (!setPrecisionArgPosition()) - { + if (!setPrecisionArgPosition()) { variablePrecision = true; precisionSet = true; } return; - } else - { - while (pos < fmt.length()) - { + } else { + while (pos < fmt.length()) { char c = fmt.charAt(pos); - if (Character.isDigit(c)) - { + if (Character.isDigit(c)) { pos++; - } else - { + } else { break; } } - if (pos > firstPos + 1) - { + if (pos > firstPos + 1) { String sz = fmt.substring(firstPos + 1, pos); precision = Integer.parseInt(sz); @@ -4620,39 +4074,31 @@ /** * Set the field width. */ - private void setFieldWidth() - { + private void setFieldWidth() { int firstPos = pos; fieldWidth = 0; fieldWidthSet = false; - if ((pos < fmt.length()) && (fmt.charAt(pos) == '*')) - { + if ((pos < fmt.length()) && (fmt.charAt(pos) == '*')) { pos++; - if (!setFieldWidthArgPosition()) - { + if (!setFieldWidthArgPosition()) { variableFieldWidth = true; fieldWidthSet = true; } - } else - { - while (pos < fmt.length()) - { + } else { + while (pos < fmt.length()) { char c = fmt.charAt(pos); - if (Character.isDigit(c)) - { + if (Character.isDigit(c)) { pos++; - } else - { + } else { break; } } - if ((firstPos < pos) && (firstPos < fmt.length())) - { + if ((firstPos < pos) && (firstPos < fmt.length())) { String sz = fmt.substring(firstPos, pos); fieldWidth = Integer.parseInt(sz); @@ -4664,22 +4110,17 @@ /** * Store the digits <code>n</code> in %n$ forms. */ - private void setArgPosition() - { + private void setArgPosition() { int xPos; - for (xPos = pos; xPos < fmt.length(); xPos++) - { - if (!Character.isDigit(fmt.charAt(xPos))) - { + for (xPos = pos; xPos < fmt.length(); xPos++) { + if (!Character.isDigit(fmt.charAt(xPos))) { break; } } - if ((xPos > pos) && (xPos < fmt.length())) - { - if (fmt.charAt(xPos) == '$') - { + if ((xPos > pos) && (xPos < fmt.length())) { + if (fmt.charAt(xPos) == '$') { positionalSpecification = true; argumentPosition = Integer.parseInt(fmt.substring(pos, xPos)); pos = xPos + 1; @@ -4690,23 +4131,18 @@ /** * Store the digits <code>n</code> in *n$ forms. */ - private boolean setFieldWidthArgPosition() - { + private boolean setFieldWidthArgPosition() { boolean ret = false; int xPos; - for (xPos = pos; xPos < fmt.length(); xPos++) - { - if (!Character.isDigit(fmt.charAt(xPos))) - { + for (xPos = pos; xPos < fmt.length(); xPos++) { + if (!Character.isDigit(fmt.charAt(xPos))) { break; } } - if ((xPos > pos) && (xPos < fmt.length())) - { - if (fmt.charAt(xPos) == '$') - { + if ((xPos > pos) && (xPos < fmt.length())) { + if (fmt.charAt(xPos) == '$') { positionalFieldWidth = true; argumentPositionForFieldWidth = Integer.parseInt(fmt.substring(pos, xPos)); pos = xPos + 1; @@ -4720,23 +4156,18 @@ /** * Store the digits <code>n</code> in *n$ forms. */ - private boolean setPrecisionArgPosition() - { + private boolean setPrecisionArgPosition() { boolean ret = false; int xPos; - for (xPos = pos; xPos < fmt.length(); xPos++) - { - if (!Character.isDigit(fmt.charAt(xPos))) - { + for (xPos = pos; xPos < fmt.length(); xPos++) { + if (!Character.isDigit(fmt.charAt(xPos))) { break; } } - if ((xPos > pos) && (xPos < fmt.length())) - { - if (fmt.charAt(xPos) == '$') - { + if ((xPos > pos) && (xPos < fmt.length())) { + if (fmt.charAt(xPos) == '$') { positionalPrecision = true; argumentPositionForPrecision = Integer.parseInt(fmt.substring(pos, xPos)); pos = xPos + 1; @@ -4747,41 +4178,34 @@ return ret; } - boolean isPositionalSpecification() - { + boolean isPositionalSpecification() { return positionalSpecification; } - int getArgumentPosition() - { + int getArgumentPosition() { return argumentPosition; } - boolean isPositionalFieldWidth() - { + boolean isPositionalFieldWidth() { return positionalFieldWidth; } - int getArgumentPositionForFieldWidth() - { + int getArgumentPositionForFieldWidth() { return argumentPositionForFieldWidth; } - boolean isPositionalPrecision() - { + boolean isPositionalPrecision() { return positionalPrecision; } - int getArgumentPositionForPrecision() - { + int getArgumentPositionForPrecision() { return argumentPositionForPrecision; } /** * Set flag characters, one of '-+#0 or a space. */ - private void setFlagCharacters() - { + private void setFlagCharacters() { /* '-+ #0 */ thousands = false; leftJustify = false; @@ -4790,38 +4214,28 @@ alternateForm = false; leadingZeros = false; - for (; pos < fmt.length(); pos++) - { + for (; pos < fmt.length(); pos++) { char c = fmt.charAt(pos); - if (c == '\'') - { + if (c == '\'') { thousands = true; - } else if (c == '-') - { + } else if (c == '-') { leftJustify = true; leadingZeros = false; - } else if (c == '+') - { + } else if (c == '+') { leadingSign = true; leadingSpace = false; - } else if (c == ' ') - { - if (!leadingSign) - { + } else if (c == ' ') { + if (!leadingSign) { leadingSpace = true; } - } else if (c == '#') - { + } else if (c == '#') { alternateForm = true; - } else if (c == '0') - { - if (!leftJustify) - { + } else if (c == '0') { + if (!leftJustify) { leadingZeros = true; } - } else - { + } else { break; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/StringUtils.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/StringUtils.java index 5821070..272e230 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/StringUtils.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/StringUtils.java @@ -18,8 +18,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -public abstract class StringUtils -{ +public abstract class StringUtils { public static String ENCODING_US_ASCII = "US-ASCII"; public static String ENCODING_ISO_8859_1 = "ISO-8859-1"; public static String ENCODING_ISO_8859_2 = "ISO-8859-2"; @@ -50,8 +49,7 @@ private static final HtmlEncoderFallbackHandler HTML_ENCODER_FALLBACK = new HtmlEncoderFallbackHandler(); - static - { + static { // Html encoding mapping according to the HTML 4.0 spec // http://www.w3.org/TR/REC-html40/sgml/entities.html @@ -315,14 +313,12 @@ DEFENSIVE_HTML_ENCODE_MAP.put('\u2666', "♦"); Set<Map.Entry<Character, String>> aggresive_entries = AGGRESSIVE_HTML_ENCODE_MAP.entrySet(); - for (Map.Entry<Character, String> entry : aggresive_entries) - { + for (Map.Entry<Character, String> entry : aggresive_entries) { HTML_DECODE_MAP.put(entry.getValue(), entry.getKey()); } Set<Map.Entry<Character, String>> defensive_entries = DEFENSIVE_HTML_ENCODE_MAP.entrySet(); - for (Map.Entry<Character, String> entry : defensive_entries) - { + for (Map.Entry<Character, String> entry : defensive_entries) { HTML_DECODE_MAP.put(entry.getValue(), entry.getKey()); } @@ -433,10 +429,8 @@ * @see #encodeRegexp(String) * @since 1.0 */ - public static String encodeClassname(String name) - { - if (null == name) - { + public static String encodeClassname(String name) { + if (null == name) { return null; } @@ -446,10 +440,8 @@ return matcher.replaceAll("_"); } - private static boolean needsUrlEncoding(String source) - { - if (null == source) - { + private static boolean needsUrlEncoding(String source) { + if (null == source) { return false; } @@ -458,15 +450,13 @@ // string is returned as-is boolean encode = false; char ch; - for (int i = 0; i < source.length(); i++) - { + for (int i = 0; i < source.length(); i++) { ch = source.charAt(i); if (ch >= 'a' && ch <= 'z' || - ch >= 'A' && ch <= 'Z' || - ch >= '0' && ch <= '9' || - ch == '-' || ch == '_' || ch == '.' || ch == '*') - { + ch >= 'A' && ch <= 'Z' || + ch >= '0' && ch <= '9' || + ch == '-' || ch == '_' || ch == '.' || ch == '*') { continue; } @@ -493,20 +483,16 @@ * @see #encodeRegexp(String) * @since 1.0 */ - public static String encodeUrl(String source) - { - if (!needsUrlEncoding(source)) - { + public static String encodeUrl(String source) { + if (!needsUrlEncoding(source)) { return source; } - try - { + try { return URLEncoder.encode(source, ENCODING_ISO_8859_1); } ///CLOVER:OFF - catch (UnsupportedEncodingException e) - { + catch (UnsupportedEncodingException e) { // this should never happen, ISO-8859-1 is a standard encoding throw new RuntimeException(e); } @@ -533,36 +519,29 @@ * @see #encodeRegexp(String) * @since 1.0 */ - public static String encodeUrlValue(String source) - { - if (!needsUrlEncoding(source)) - { + public static String encodeUrlValue(String source) { + if (!needsUrlEncoding(source)) { return source; } // check if the string is valid US-ASCII encoding boolean valid = true; CharsetEncoder encoder = CHARSET_US_ASCII.newEncoder(); - try - { + try { encoder.encode(CharBuffer.wrap(source)); } - catch (CharacterCodingException e) - { + catch (CharacterCodingException e) { valid = false; } - try - { + try { // if it is valid US-ASCII, use the regular URL encoding method - if (valid) - { + if (valid) { return URLEncoder.encode(source, ENCODING_US_ASCII); } // otherwise, base-64 encode the UTF-8 bytes and mark the string // as being encoded in a special way - else - { + else { StringBuilder encoded = new StringBuilder("%02%02"); String base64 = Base64.encodeToString(source.getBytes(ENCODING_UTF_8), false); String base64_urlsafe = replace(base64, "=", "%3D"); @@ -572,8 +551,7 @@ } } ///CLOVER:OFF - catch (UnsupportedEncodingException e) - { + catch (UnsupportedEncodingException e) { // this should never happen, ISO-8859-1 is a standard encoding throw new RuntimeException(e); } @@ -593,22 +571,17 @@ * @see #doesUrlValueNeedDecoding(String) * @since 1.0 */ - public static String decodeUrlValue(String source) - { - try - { + public static String decodeUrlValue(String source) { + try { byte[] decoded = Base64.decode(source.substring(2)); - if (null == decoded) - { + if (null == decoded) { return null; - } else - { + } else { return new String(decoded, StringUtils.ENCODING_UTF_8); } } ///CLOVER:OFF - catch (UnsupportedEncodingException e) - { + catch (UnsupportedEncodingException e) { // this should never happen, UTF-8 is a standard encoding throw new RuntimeException(e); } @@ -628,34 +601,28 @@ * @see #decodeUrlValue(String) * @since 1.0 */ - public static boolean doesUrlValueNeedDecoding(String source) - { + public static boolean doesUrlValueNeedDecoding(String source) { if (source != null && - source.length() > 2 && - source.startsWith("\u0002\u0002")) - { + source.length() > 2 && + source.startsWith("\u0002\u0002")) { return true; } return false; } - private static boolean needsHtmlEncoding(String source, boolean defensive) - { - if (null == source) - { + private static boolean needsHtmlEncoding(String source, boolean defensive) { + if (null == source) { return false; } boolean encode = false; char ch; - for (int i = 0; i < source.length(); i++) - { + for (int i = 0; i < source.length(); i++) { ch = source.charAt(i); if ((defensive || (ch != '\u0022' && ch != '\u0026' && ch != '\u003C' && ch != '\u003E')) && - ch < '\u00A0') - { + ch < '\u00A0') { continue; } @@ -669,11 +636,9 @@ /** * @since 1.6 */ - public static String decodeHtml(String source) - { + public static String decodeHtml(String source) { if (null == source || - 0 == source.length()) - { + 0 == source.length()) { return source; } @@ -683,23 +648,18 @@ StringBuilder result = null; - while (current_index <= source.length()) - { + while (current_index <= source.length()) { delimiter_start_index = source.indexOf('&', current_index); - if (delimiter_start_index != -1) - { + if (delimiter_start_index != -1) { delimiter_end_index = source.indexOf(';', delimiter_start_index + 1); - if (delimiter_end_index != -1) - { + if (delimiter_end_index != -1) { // ensure that the string builder is setup correctly - if (null == result) - { + if (null == result) { result = new StringBuilder(); } // add the text that leads up to this match - if (delimiter_start_index > current_index) - { + if (delimiter_start_index > current_index) { result.append(source.substring(current_index, delimiter_start_index)); } @@ -709,55 +669,44 @@ current_index = delimiter_end_index + 1; // try to decoded numeric entities - if (entity.charAt(1) == '#') - { + if (entity.charAt(1) == '#') { int start = 2; int radix = 10; // check if the number is hexadecimal - if (entity.charAt(2) == 'X' || entity.charAt(2) == 'x') - { + if (entity.charAt(2) == 'X' || entity.charAt(2) == 'x') { start++; radix = 16; } - try - { + try { Character c = new Character((char) Integer.parseInt(entity.substring(start, entity.length() - 1), radix)); result.append(c); } // when the number of the entity can't be parsed, add the entity as-is - catch (NumberFormatException e) - { + catch (NumberFormatException e) { result.append(entity); } - } else - { + } else { // try to decode the entity as a literal Character decoded = HTML_DECODE_MAP.get(entity); - if (decoded != null) - { + if (decoded != null) { result.append(decoded); } // if there was no match, add the entity as-is - else - { + else { result.append(entity); } } - } else - { + } else { break; } - } else - { + } else { break; } } - if (null == result) - { + if (null == result) { return source; - } else if (current_index < source.length()) - { + } else if (current_index < source.length()) { result.append(source.substring(current_index)); } @@ -781,10 +730,8 @@ * @see #encodeRegexp(String) * @since 1.0 */ - public static String encodeHtml(String source) - { - if (needsHtmlEncoding(source, false)) - { + public static String encodeHtml(String source) { + if (needsHtmlEncoding(source, false)) { return encode(source, HTML_ENCODER_FALLBACK, AGGRESSIVE_HTML_ENCODE_MAP, DEFENSIVE_HTML_ENCODE_MAP); } return source; @@ -809,10 +756,8 @@ * @see #encodeRegexp(String) * @since 1.0 */ - public static String encodeHtmlDefensive(String source) - { - if (needsHtmlEncoding(source, true)) - { + public static String encodeHtmlDefensive(String source) { + if (needsHtmlEncoding(source, true)) { return encode(source, null, DEFENSIVE_HTML_ENCODE_MAP); } return source; @@ -835,8 +780,7 @@ * @see #encodeRegexp(String) * @since 1.0 */ - public static String encodeXml(String source) - { + public static String encodeXml(String source) { return encode(source, null, XML_ENCODE_MAP); } @@ -857,8 +801,7 @@ * @see #encodeRegexp(String) * @since 1.0 */ - public static String encodeString(String source) - { + public static String encodeString(String source) { return encode(source, null, STRING_ENCODE_MAP); } @@ -879,22 +822,18 @@ * @see #encodeRegexp(String) * @since 1.0 */ - public static String encodeUnicode(String source) - { - if (null == source) - { + public static String encodeUnicode(String source) { + if (null == source) { return null; } StringBuilder encoded = new StringBuilder(); String hexstring = null; - for (int i = 0; i < source.length(); i++) - { + for (int i = 0; i < source.length(); i++) { hexstring = Integer.toHexString((int) source.charAt(i)).toUpperCase(); encoded.append("\\u"); // fill with zeros - for (int j = hexstring.length(); j < 4; j++) - { + for (int j = hexstring.length(); j < 4; j++) { encoded.append("0"); } encoded.append(hexstring); @@ -920,8 +859,7 @@ * @see #encodeRegexp(String) * @since 1.0 */ - public static String encodeSql(String source) - { + public static String encodeSql(String source) { return encode(source, null, SQL_ENCODE_MAP); } @@ -942,10 +880,8 @@ * @see #encodeRegexp(String) * @since 1.0 */ - public static String encodeLatex(String source) - { - if (null == source) - { + public static String encodeLatex(String source) { + if (null == source) { return null; } @@ -970,16 +906,13 @@ * @return The encoded <code>String</code> object. * @since 1.0 */ - private static String encode(String source, EncoderFallbackHandler fallbackHandler, Map<Character, String>... encodingTables) - { - if (null == source) - { + private static String encode(String source, EncoderFallbackHandler fallbackHandler, Map<Character, String>... encodingTables) { + if (null == source) { return null; } if (null == encodingTables || - 0 == encodingTables.length) - { + 0 == encodingTables.length) { return source; } @@ -987,13 +920,10 @@ char[] string_to_encode_array = source.toCharArray(); int last_match = -1; - for (int i = 0; i < string_to_encode_array.length; i++) - { + for (int i = 0; i < string_to_encode_array.length; i++) { char char_to_encode = string_to_encode_array[i]; - for (Map<Character, String> encoding_table : encodingTables) - { - if (encoding_table.containsKey(char_to_encode)) - { + for (Map<Character, String> encoding_table : encodingTables) { + if (encoding_table.containsKey(char_to_encode)) { encoded_string = prepareEncodedString(source, encoded_string, i, last_match, string_to_encode_array); encoded_string.append(encoding_table.get(char_to_encode)); @@ -1002,9 +932,8 @@ } if (fallbackHandler != null && - last_match < i && - fallbackHandler.hasFallback(char_to_encode)) - { + last_match < i && + fallbackHandler.hasFallback(char_to_encode)) { encoded_string = prepareEncodedString(source, encoded_string, i, last_match, string_to_encode_array); fallbackHandler.appendFallback(encoded_string, char_to_encode); @@ -1012,60 +941,49 @@ } } - if (null == encoded_string) - { + if (null == encoded_string) { return source; - } else - { + } else { int difference = string_to_encode_array.length - (last_match + 1); - if (difference > 0) - { + if (difference > 0) { encoded_string.append(string_to_encode_array, last_match + 1, difference); } return encoded_string.toString(); } } - private static StringBuilder prepareEncodedString(String source, StringBuilder encodedString, int i, int lastMatch, char[] stringToEncodeArray) - { - if (null == encodedString) - { + private static StringBuilder prepareEncodedString(String source, StringBuilder encodedString, int i, int lastMatch, char[] stringToEncodeArray) { + if (null == encodedString) { encodedString = new StringBuilder(source.length()); } int difference = i - (lastMatch + 1); - if (difference > 0) - { + if (difference > 0) { encodedString.append(stringToEncodeArray, lastMatch + 1, difference); } return encodedString; } - private static interface EncoderFallbackHandler - { + private static interface EncoderFallbackHandler { abstract boolean hasFallback(char character); abstract void appendFallback(StringBuilder encodedBuffer, char character); } - private static class HtmlEncoderFallbackHandler implements EncoderFallbackHandler - { + private static class HtmlEncoderFallbackHandler implements EncoderFallbackHandler { private final static String PREFIX = "&#"; private final static String SUFFIX = ";"; - public boolean hasFallback(char character) - { - if (character < '\u00A0') - { + public boolean hasFallback(char character) { + if (character < '\u00A0') { return false; } return true; } - public void appendFallback(StringBuilder encodedBuffer, char character) - { + public void appendFallback(StringBuilder encodedBuffer, char character) { encodedBuffer.append(PREFIX); encodedBuffer.append((int) character); encodedBuffer.append(SUFFIX); @@ -1089,11 +1007,9 @@ * @see #encodeLatex(String) * @since 1.3 */ - public static String encodeRegexp(String source) - { + public static String encodeRegexp(String source) { int regexp_quote_start = source.indexOf("\\E"); - if (-1 == regexp_quote_start) - { + if (-1 == regexp_quote_start) { return "\\Q" + source + "\\E"; } @@ -1103,8 +1019,7 @@ regexp_quote_start = 0; int current = 0; - while (-1 == (regexp_quote_start = source.indexOf("\\E", current))) - { + while (-1 == (regexp_quote_start = source.indexOf("\\E", current))) { buffer.append(source.substring(current, regexp_quote_start)); current = regexp_quote_start + 2; buffer.append("\\E\\\\E\\Q"); @@ -1126,8 +1041,7 @@ * of the substring. * @since 1.0 */ - public static int count(String source, String substring) - { + public static int count(String source, String substring) { return count(source, substring, true); } @@ -1142,15 +1056,12 @@ * of the substring. * @since 1.0 */ - public static int count(String source, String substring, boolean matchCase) - { - if (null == source) - { + public static int count(String source, String substring, boolean matchCase) { + if (null == source) { return 0; } - if (null == substring) - { + if (null == substring) { return 0; } @@ -1158,21 +1069,17 @@ int substring_index = 0; int count = 0; - if (!matchCase) - { + if (!matchCase) { source = source.toLowerCase(); substring = substring.toLowerCase(); } - while (current_index < source.length() - 1) - { + while (current_index < source.length() - 1) { substring_index = source.indexOf(substring, current_index); - if (-1 == substring_index) - { + if (-1 == substring_index) { break; - } else - { + } else { current_index = substring_index + substring.length(); count++; } @@ -1193,8 +1100,7 @@ * <code>String</code> objects. * @since 1.0 */ - public static ArrayList<String> split(String source, String seperator) - { + public static ArrayList<String> split(String source, String seperator) { return split(source, seperator, true); } @@ -1212,17 +1118,14 @@ * <code>String</code> objects. * @since 1.0 */ - public static ArrayList<String> split(String source, String seperator, boolean matchCase) - { + public static ArrayList<String> split(String source, String seperator, boolean matchCase) { ArrayList<String> substrings = new ArrayList<String>(); - if (null == source) - { + if (null == source) { return substrings; } - if (null == seperator) - { + if (null == seperator) { substrings.add(source); return substrings; } @@ -1232,26 +1135,21 @@ String element = null; String source_lookup_reference = null; - if (!matchCase) - { + if (!matchCase) { source_lookup_reference = source.toLowerCase(); seperator = seperator.toLowerCase(); - } else - { + } else { source_lookup_reference = source; } - while (current_index <= source_lookup_reference.length()) - { + while (current_index <= source_lookup_reference.length()) { delimiter_index = source_lookup_reference.indexOf(seperator, current_index); - if (-1 == delimiter_index) - { + if (-1 == delimiter_index) { element = new String(source.substring(current_index, source.length())); substrings.add(element); current_index = source.length() + 1; - } else - { + } else { element = new String(source.substring(current_index, delimiter_index)); substrings.add(element); current_index = delimiter_index + seperator.length(); @@ -1272,8 +1170,7 @@ * @return A <code>String[]</code> array containing the seperated parts. * @since 1.0 */ - public static String[] splitToArray(String source, String seperator) - { + public static String[] splitToArray(String source, String seperator) { return splitToArray(source, seperator, true); } @@ -1290,8 +1187,7 @@ * @return A <code>String[]</code> array containing the seperated parts. * @since 1.0 */ - public static String[] splitToArray(String source, String seperator, boolean matchCase) - { + public static String[] splitToArray(String source, String seperator, boolean matchCase) { ArrayList<String> substrings = split(source, seperator, matchCase); String[] substrings_array = new String[substrings.size()]; substrings_array = substrings.toArray(substrings_array); @@ -1310,8 +1206,7 @@ * @return An <code>int[]</code> array containing the seperated parts. * @since 1.0 */ - public static int[] splitToIntArray(String source, String seperator) - { + public static int[] splitToIntArray(String source, String seperator) { return splitToIntArray(source, seperator, true); } @@ -1328,20 +1223,16 @@ * @return An <code>int[]</code> array containing the seperated parts. * @since 1.0 */ - public static int[] splitToIntArray(String source, String seperator, boolean matchCase) - { + public static int[] splitToIntArray(String source, String seperator, boolean matchCase) { ArrayList<String> string_parts = split(source, seperator, matchCase); int number_of_valid_parts = 0; - for (String string_part : string_parts) - { - try - { + for (String string_part : string_parts) { + try { Integer.parseInt(string_part); number_of_valid_parts++; } - catch (NumberFormatException e) - { + catch (NumberFormatException e) { // just continue } } @@ -1349,15 +1240,12 @@ int[] string_parts_int = (int[]) Array.newInstance(int.class, number_of_valid_parts); int added_parts = 0; - for (String string_part : string_parts) - { - try - { + for (String string_part : string_parts) { + try { string_parts_int[added_parts] = Integer.parseInt(string_part); added_parts++; } - catch (NumberFormatException e) - { + catch (NumberFormatException e) { // just continue } } @@ -1377,8 +1265,7 @@ * @return A <code>byte[]</code> array containing the bytes. * @since 1.0 */ - public static byte[] splitToByteArray(String source, String seperator) - { + public static byte[] splitToByteArray(String source, String seperator) { return splitToByteArray(source, seperator, true); } @@ -1395,34 +1282,27 @@ * @return A <code>byte[]</code> array containing the bytes. * @since 1.0 */ - public static byte[] splitToByteArray(String source, String seperator, boolean matchCase) - { + public static byte[] splitToByteArray(String source, String seperator, boolean matchCase) { ArrayList<String> string_parts = split(source, seperator, matchCase); int number_of_valid_parts = 0; - for (String string_part : string_parts) - { - try - { + for (String string_part : string_parts) { + try { Byte.parseByte(string_part); number_of_valid_parts++; } - catch (NumberFormatException e) - { + catch (NumberFormatException e) { // just continue } } byte[] string_parts_byte = (byte[]) Array.newInstance(byte.class, number_of_valid_parts); int added_parts = 0; - for (String string_part : string_parts) - { - try - { + for (String string_part : string_parts) { + try { string_parts_byte[added_parts] = Byte.parseByte(string_part); added_parts++; } - catch (NumberFormatException e) - { + catch (NumberFormatException e) { // just continue } } @@ -1439,8 +1319,7 @@ * @return A new <code>String</code> containing the stripped result. * @since 1.0 */ - public static String stripFromFront(String source, String stringToStrip) - { + public static String stripFromFront(String source, String stringToStrip) { return stripFromFront(source, stringToStrip, true); } @@ -1454,15 +1333,12 @@ * @return A new <code>String</code> containing the stripping result. * @since 1.0 */ - public static String stripFromFront(String source, String stringToStrip, boolean matchCase) - { - if (null == source) - { + public static String stripFromFront(String source, String stringToStrip, boolean matchCase) { + if (null == source) { return null; } - if (null == stringToStrip) - { + if (null == stringToStrip) { return source; } @@ -1471,29 +1347,24 @@ int last_index = 0; String source_lookup_reference = null; - if (!matchCase) - { + if (!matchCase) { source_lookup_reference = source.toLowerCase(); stringToStrip = stringToStrip.toLowerCase(); - } else - { + } else { source_lookup_reference = source; } new_index = source_lookup_reference.indexOf(stringToStrip); - if (0 == new_index) - { - do - { + if (0 == new_index) { + do { last_index = new_index; new_index = source_lookup_reference.indexOf(stringToStrip, new_index + strip_length); } while (new_index != -1 && - new_index == last_index + strip_length); + new_index == last_index + strip_length); return source.substring(last_index + strip_length); - } else - { + } else { return source; } } @@ -1507,8 +1378,7 @@ * @return A new <code>String</code> containing the stripped result. * @since 1.0 */ - public static String stripFromEnd(String source, String stringToStrip) - { + public static String stripFromEnd(String source, String stringToStrip) { return stripFromEnd(source, stringToStrip, true); } @@ -1522,15 +1392,12 @@ * @return A new <code>String</code> containing the stripped result. * @since 1.0 */ - public static String stripFromEnd(String source, String stringToStrip, boolean matchCase) - { - if (null == source) - { + public static String stripFromEnd(String source, String stringToStrip, boolean matchCase) { + if (null == source) { return null; } - if (null == stringToStrip) - { + if (null == stringToStrip) { return source; } @@ -1539,30 +1406,25 @@ int last_index = 0; String source_lookup_reference = null; - if (!matchCase) - { + if (!matchCase) { source_lookup_reference = source.toLowerCase(); stringToStrip = stringToStrip.toLowerCase(); - } else - { + } else { source_lookup_reference = source; } new_index = source_lookup_reference.lastIndexOf(stringToStrip); if (new_index != -1 && - source.length() == new_index + strip_length) - { - do - { + source.length() == new_index + strip_length) { + do { last_index = new_index; new_index = source_lookup_reference.lastIndexOf(stringToStrip, last_index - 1); } while (new_index != -1 && - new_index == last_index - strip_length); + new_index == last_index - strip_length); return source.substring(0, last_index); - } else - { + } else { return source; } } @@ -1579,8 +1441,7 @@ * result. * @since 1.0 */ - public static String replace(String source, String stringToReplace, String replacementString) - { + public static String replace(String source, String stringToReplace, String replacementString) { return replace(source, stringToReplace, replacementString, true); } @@ -1598,32 +1459,26 @@ * result. * @since 1.0 */ - public static String replace(String source, String stringToReplace, String replacementString, boolean matchCase) - { - if (null == source) - { + public static String replace(String source, String stringToReplace, String replacementString, boolean matchCase) { + if (null == source) { return null; } - if (null == stringToReplace) - { + if (null == stringToReplace) { return source; } - if (null == replacementString) - { + if (null == replacementString) { return source; } Iterator<String> string_parts = split(source, stringToReplace, matchCase).iterator(); StringBuilder new_string = new StringBuilder(); - while (string_parts.hasNext()) - { + while (string_parts.hasNext()) { String string_part = string_parts.next(); new_string.append(string_part); - if (string_parts.hasNext()) - { + if (string_parts.hasNext()) { new_string.append(replacementString); } } @@ -1641,16 +1496,13 @@ * concatenation result. * @since 1.0 */ - public static String repeat(String source, int count) - { - if (null == source) - { + public static String repeat(String source, int count) { + if (null == source) { return null; } StringBuilder new_string = new StringBuilder(); - while (count > 0) - { + while (count > 0) { new_string.append(source); count--; } @@ -1667,17 +1519,14 @@ * @return The new <code>String</code> array. * @since 1.0 */ - public static String[] toStringArray(Iterator<String> iterator) - { - if (null == iterator) - { + public static String[] toStringArray(Iterator<String> iterator) { + if (null == iterator) { return new String[0]; } ArrayList<String> strings = new ArrayList<String>(); - while (iterator.hasNext()) - { + while (iterator.hasNext()) { strings.add(iterator.next()); } @@ -1697,17 +1546,14 @@ * <code>String</code> array. * @since 1.0 */ - public static ArrayList<String> toArrayList(String[] stringArray) - { + public static ArrayList<String> toArrayList(String[] stringArray) { ArrayList<String> strings = new ArrayList<String>(); - if (null == stringArray) - { + if (null == stringArray) { return strings; } - for (String element : stringArray) - { + for (String element : stringArray) { strings.add(element); } @@ -1725,26 +1571,20 @@ * @return A new <code>String</code> with the join result. * @since 1.0 */ - public static String join(Collection collection, String seperator) - { - if (null == collection) - { + public static String join(Collection collection, String seperator) { + if (null == collection) { return null; } - if (null == seperator) - { + if (null == seperator) { seperator = ""; } - if (0 == collection.size()) - { + if (0 == collection.size()) { return ""; - } else - { + } else { StringBuilder result = new StringBuilder(); - for (Object element : collection) - { + for (Object element : collection) { result.append(String.valueOf(element)); result.append(seperator); } @@ -1763,8 +1603,7 @@ * @return A new <code>String</code> with the join result. * @since 1.0 */ - public static String join(Object[] array, String seperator) - { + public static String join(Object[] array, String seperator) { return join(array, seperator, null, false); } @@ -1778,8 +1617,7 @@ * @return A new <code>String</code> with the join result. * @since 1.0 */ - public static String join(Object[] array, String seperator, String delimiter) - { + public static String join(Object[] array, String seperator, String delimiter) { return join(array, seperator, delimiter, false); } @@ -1795,41 +1633,31 @@ * @return A new <code>String</code> with the join result. * @since 1.0 */ - public static String join(Object[] array, String seperator, String delimiter, boolean encodeStrings) - { - if (null == array) - { + public static String join(Object[] array, String seperator, String delimiter, boolean encodeStrings) { + if (null == array) { return null; } - if (null == seperator) - { + if (null == seperator) { seperator = ""; } - if (null == delimiter) - { + if (null == delimiter) { delimiter = ""; } - if (0 == array.length) - { + if (0 == array.length) { return ""; - } else - { + } else { int current_index = 0; String array_value = null; StringBuilder result = new StringBuilder(); - while (current_index < array.length - 1) - { - if (null == array[current_index]) - { + while (current_index < array.length - 1) { + if (null == array[current_index]) { result.append("null"); - } else - { + } else { array_value = String.valueOf(array[current_index]); - if (encodeStrings) - { + if (encodeStrings) { array_value = encodeString(array_value); } result.append(delimiter); @@ -1840,14 +1668,11 @@ current_index++; } - if (null == array[current_index]) - { + if (null == array[current_index]) { result.append("null"); - } else - { + } else { array_value = String.valueOf(array[current_index]); - if (encodeStrings) - { + if (encodeStrings) { array_value = encodeString(array_value); } result.append(delimiter); @@ -1867,27 +1692,21 @@ * @return A new <code>String</code> with the join result. * @since 1.0 */ - public static String join(boolean[] array, String seperator) - { - if (null == array) - { + public static String join(boolean[] array, String seperator) { + if (null == array) { return null; } - if (null == seperator) - { + if (null == seperator) { seperator = ""; } - if (0 == array.length) - { + if (0 == array.length) { return ""; - } else - { + } else { int current_index = 0; String result = ""; - while (current_index < array.length - 1) - { + while (current_index < array.length - 1) { result = result + array[current_index] + seperator; current_index++; } @@ -1906,27 +1725,21 @@ * @return A new <code>String</code> with the join result. * @since 1.0 */ - public static String join(byte[] array, String seperator) - { - if (null == array) - { + public static String join(byte[] array, String seperator) { + if (null == array) { return null; } - if (null == seperator) - { + if (null == seperator) { seperator = ""; } - if (0 == array.length) - { + if (0 == array.length) { return ""; - } else - { + } else { int current_index = 0; String result = ""; - while (current_index < array.length - 1) - { + while (current_index < array.length - 1) { result = result + array[current_index] + seperator; current_index++; } @@ -1945,27 +1758,21 @@ * @return A new <code>String</code> with the join result. * @since 1.0 */ - public static String join(double[] array, String seperator) - { - if (null == array) - { + public static String join(double[] array, String seperator) { + if (null == array) { return null; } - if (null == seperator) - { + if (null == seperator) { seperator = ""; } - if (0 == array.length) - { + if (0 == array.length) { return ""; - } else - { + } else { int current_index = 0; String result = ""; - while (current_index < array.length - 1) - { + while (current_index < array.length - 1) { result = result + array[current_index] + seperator; current_index++; } @@ -1984,27 +1791,21 @@ * @return A new <code>String</code> with the join result. * @since 1.0 */ - public static String join(float[] array, String seperator) - { - if (null == array) - { + public static String join(float[] array, String seperator) { + if (null == array) { return null; } - if (null == seperator) - { + if (null == seperator) { seperator = ""; } - if (0 == array.length) - { + if (0 == array.length) { return ""; - } else - { + } else { int current_index = 0; String result = ""; - while (current_index < array.length - 1) - { + while (current_index < array.length - 1) { result = result + array[current_index] + seperator; current_index++; } @@ -2023,27 +1824,21 @@ * @return A new <code>String</code> with the join result. * @since 1.0 */ - public static String join(int[] array, String seperator) - { - if (null == array) - { + public static String join(int[] array, String seperator) { + if (null == array) { return null; } - if (null == seperator) - { + if (null == seperator) { seperator = ""; } - if (0 == array.length) - { + if (0 == array.length) { return ""; - } else - { + } else { int current_index = 0; String result = ""; - while (current_index < array.length - 1) - { + while (current_index < array.length - 1) { result = result + array[current_index] + seperator; current_index++; } @@ -2062,27 +1857,21 @@ * @return A new <code>String</code> with the join result. * @since 1.0 */ - public static String join(long[] array, String seperator) - { - if (null == array) - { + public static String join(long[] array, String seperator) { + if (null == array) { return null; } - if (null == seperator) - { + if (null == seperator) { seperator = ""; } - if (0 == array.length) - { + if (0 == array.length) { return ""; - } else - { + } else { int current_index = 0; String result = ""; - while (current_index < array.length - 1) - { + while (current_index < array.length - 1) { result = result + array[current_index] + seperator; current_index++; } @@ -2101,27 +1890,21 @@ * @return A new <code>String</code> with the join result. * @since 1.0 */ - public static String join(short[] array, String seperator) - { - if (null == array) - { + public static String join(short[] array, String seperator) { + if (null == array) { return null; } - if (null == seperator) - { + if (null == seperator) { seperator = ""; } - if (0 == array.length) - { + if (0 == array.length) { return ""; - } else - { + } else { int current_index = 0; String result = ""; - while (current_index < array.length - 1) - { + while (current_index < array.length - 1) { result = result + array[current_index] + seperator; current_index++; } @@ -2140,8 +1923,7 @@ * @return A new <code>String</code> with the join result. * @since 1.0 */ - public static String join(char[] array, String seperator) - { + public static String join(char[] array, String seperator) { return join(array, seperator, null); } @@ -2155,32 +1937,25 @@ * @return A new <code>String</code> with the join result. * @since 1.0 */ - public static String join(char[] array, String seperator, String delimiter) - { - if (null == array) - { + public static String join(char[] array, String seperator, String delimiter) { + if (null == array) { return null; } - if (null == seperator) - { + if (null == seperator) { seperator = ""; } - if (null == delimiter) - { + if (null == delimiter) { delimiter = ""; } - if (0 == array.length) - { + if (0 == array.length) { return ""; - } else - { + } else { int current_index = 0; StringBuilder result = new StringBuilder(); - while (current_index < array.length - 1) - { + while (current_index < array.length - 1) { result.append(delimiter); result.append(array[current_index]); result.append(delimiter); @@ -2206,8 +1981,7 @@ * substring. * @since 1.0 */ - public static int[] indicesOf(String source, String substring) - { + public static int[] indicesOf(String source, String substring) { return indicesOf(source, substring, true); } @@ -2223,21 +1997,17 @@ * substring. * @since 1.0 */ - public static int[] indicesOf(String source, String substring, boolean matchCase) - { + public static int[] indicesOf(String source, String substring, boolean matchCase) { if (null == source || - null == substring) - { + null == substring) { return new int[0]; } String source_lookup_reference = null; - if (!matchCase) - { + if (!matchCase) { source_lookup_reference = source.toLowerCase(); substring = substring.toLowerCase(); - } else - { + } else { source_lookup_reference = source; } @@ -2247,15 +2017,12 @@ int[] indices = new int[count]; int counter = 0; - while (current_index < source.length() - 1) - { + while (current_index < source.length() - 1) { substring_index = source_lookup_reference.indexOf(substring, current_index); - if (-1 == substring_index) - { + if (-1 == substring_index) { break; - } else - { + } else { current_index = substring_index + substring.length(); indices[counter] = substring_index; counter++; @@ -2276,19 +2043,15 @@ * <p><code>null</code> if no match could be found. * @since 1.0 */ - public static Matcher getMatchingRegexp(String value, Collection<Pattern> regexps) - { + public static Matcher getMatchingRegexp(String value, Collection<Pattern> regexps) { if (value != null && - value.length() > 0 && - regexps != null && - regexps.size() > 0) - { + value.length() > 0 && + regexps != null && + regexps.size() > 0) { Matcher matcher = null; - for (Pattern regexp : regexps) - { + for (Pattern regexp : regexps) { matcher = regexp.matcher(value); - if (matcher.matches()) - { + if (matcher.matches()) { return matcher; } } @@ -2309,18 +2072,14 @@ * <p><code>null</code> if no match could be found. * @since 1.0 */ - public static Matcher getRegexpMatch(Collection<String> values, Pattern regexp) - { + public static Matcher getRegexpMatch(Collection<String> values, Pattern regexp) { if (values != null && - values.size() > 0 && - regexp != null) - { + values.size() > 0 && + regexp != null) { Matcher matcher = null; - for (String value : values) - { + for (String value : values) { matcher = regexp.matcher(value); - if (matcher.matches()) - { + if (matcher.matches()) { return matcher; } } @@ -2340,17 +2099,14 @@ * <p><code>false</code> otherwise. * @since 1.0 */ - public static boolean filter(String name, Pattern included, Pattern excluded) - { + public static boolean filter(String name, Pattern included, Pattern excluded) { Pattern[] included_array = null; - if (included != null) - { + if (included != null) { included_array = new Pattern[]{included}; } Pattern[] excluded_array = null; - if (excluded != null) - { + if (excluded != null) { excluded_array = new Pattern[]{excluded}; } @@ -2368,26 +2124,20 @@ * <p><code>false</code> otherwise. * @since 1.0 */ - public static boolean filter(String name, Pattern[] included, Pattern[] excluded) - { - if (null == name) - { + public static boolean filter(String name, Pattern[] included, Pattern[] excluded) { + if (null == name) { return false; } boolean accepted = false; // retain only the includes - if (null == included) - { + if (null == included) { accepted = true; - } else - { - for (Pattern pattern : included) - { + } else { + for (Pattern pattern : included) { if (pattern != null && - pattern.matcher(name).matches()) - { + pattern.matcher(name).matches()) { accepted = true; break; } @@ -2396,13 +2146,10 @@ // remove the excludes if (accepted && - excluded != null) - { - for (Pattern pattern : excluded) - { + excluded != null) { + for (Pattern pattern : excluded) { if (pattern != null && - pattern.matcher(name).matches()) - { + pattern.matcher(name).matches()) { accepted = false; break; } @@ -2419,16 +2166,13 @@ * @return The capitalized <code>String</code>. * @since 1.0 */ - public static String capitalize(String source) - { - if (source == null || source.length() == 0) - { + public static String capitalize(String source) { + if (source == null || source.length() == 0) { return source; } if (source.length() > 1 && - Character.isUpperCase(source.charAt(0))) - { + Character.isUpperCase(source.charAt(0))) { return source; } @@ -2444,16 +2188,13 @@ * @return The uncapitalized <code>String</code>. * @since 1.5 */ - public static String uncapitalize(String source) - { - if (source == null || source.length() == 0) - { + public static String uncapitalize(String source) { + if (source == null || source.length() == 0) { return source; } if (source.length() > 1 && - Character.isLowerCase(source.charAt(0))) - { + Character.isLowerCase(source.charAt(0))) { return source; } @@ -2462,86 +2203,70 @@ return new String(chars); } - private static String convertUrl(String source, Pattern pattern, boolean shorten, boolean sanitize, boolean no_follow) - { + private static String convertUrl(String source, Pattern pattern, boolean shorten, boolean sanitize, boolean no_follow) { int max_length = 1024; String result = source; Matcher url_matcher = pattern.matcher(source); boolean found = url_matcher.find(); - if (found) - { + if (found) { String visual_url = null; String actual_url = null; int last = 0; StringBuilder sb = new StringBuilder(); - do - { + do { actual_url = url_matcher.group(1); - if (url_matcher.groupCount() > 1) - { + if (url_matcher.groupCount() > 1) { visual_url = url_matcher.group(2); - } else - { + } else { visual_url = actual_url; } - if (sanitize) - { + if (sanitize) { // defang javascript actual_url = StringUtils.replace(actual_url, "javascript:", ""); // fill in http:// for URLs that don't begin with / if ((actual_url.indexOf("://") == -1) && - (!actual_url.startsWith("/"))) - { + (!actual_url.startsWith("/"))) { actual_url = "http://" + actual_url; } } - if (pattern.equals(BBCODE_BAREURL)) - { + if (pattern.equals(BBCODE_BAREURL)) { sb.append(source.substring(last, url_matcher.start(1))); - } else - { + } else { sb.append(source.substring(last, url_matcher.start(0))); } sb.append("<a href=\""); sb.append(actual_url); sb.append("\""); if (actual_url.startsWith("http://") || - actual_url.startsWith("https://")) - { + actual_url.startsWith("https://")) { sb.append(" target=\"_blank\""); } - if (no_follow) - { + if (no_follow) { sb.append(" rel=\"nofollow\""); } sb.append(">"); - if (visual_url.length() <= max_length || !shorten) - { + if (visual_url.length() <= max_length || !shorten) { sb.append(visual_url); - } else - { + } else { String ellipsis = "..."; int query_index = visual_url.indexOf("?"); // hack query string off // keep '?' - if (query_index != -1) - { + if (query_index != -1) { visual_url = visual_url.substring(0, query_index + 1) + ellipsis; } - if (visual_url.length() >= max_length) - { + if (visual_url.length() >= max_length) { int last_slash = visual_url.lastIndexOf("/"); int start_slash = visual_url.indexOf("/", visual_url.indexOf("://") + 3); - if (last_slash != start_slash) - { + if (last_slash != start_slash) { visual_url = visual_url.substring(0, start_slash + 1) + ellipsis + visual_url.substring(last_slash); } } @@ -2550,11 +2275,9 @@ } sb.append("</a>"); - if (pattern.equals(BBCODE_BAREURL)) - { + if (pattern.equals(BBCODE_BAREURL)) { last = url_matcher.end(1); - } else - { + } else { last = url_matcher.end(0); } @@ -2569,8 +2292,7 @@ return result; } - private static String parseBBCode(String source, boolean shorten, boolean sanitize, boolean convert_bare, boolean no_follow) - { + private static String parseBBCode(String source, boolean shorten, boolean sanitize, boolean convert_bare, boolean no_follow) { String result = source; result = StringUtils.replace(result, "[b]", "<b>", false); @@ -2587,46 +2309,38 @@ StringBuilder buffer = new StringBuilder(); int startIndex; int endIndex; - while (-1 != (startIndex = resultLowerCopy.indexOf("[*]"))) - { + while (-1 != (startIndex = resultLowerCopy.indexOf("[*]"))) { int begin = resultLowerCopy.indexOf("[list]", startIndex + 3); int end = resultLowerCopy.indexOf("[/list]", startIndex + 3); int next = resultLowerCopy.indexOf("[*]", startIndex + 3); // 3 == sizeof [*] - if (begin == -1) - { + if (begin == -1) { begin = Integer.MAX_VALUE; } - if (end == -1) - { + if (end == -1) { end = Integer.MAX_VALUE; } - if (next == -1) - { + if (next == -1) { next = Integer.MAX_VALUE; } - if (next < begin && next < end) - { + if (next < begin && next < end) { endIndex = next; - } else if (begin < next && begin < end) - { + } else if (begin < next && begin < end) { endIndex = begin; - } else if (end < next && end < begin) - { + } else if (end < next && end < begin) { endIndex = end; - } else - { + } else { endIndex = resultLowerCopy.length(); } buffer - .append(resultCopy.substring(0, startIndex)) - .append("<li>") - .append(resultCopy.substring(startIndex + 3, endIndex)) // 3 == sizeof [*] - .append("</li>"); + .append(resultCopy.substring(0, startIndex)) + .append("<li>") + .append(resultCopy.substring(startIndex + 3, endIndex)) // 3 == sizeof [*] + .append("</li>"); resultCopy = resultCopy.substring(endIndex); resultLowerCopy = resultLowerCopy.substring(endIndex); @@ -2649,8 +2363,7 @@ result = convertUrl(result, BBCODE_URL_SHORT, shorten, sanitize, no_follow); result = convertUrl(result, BBCODE_URL_LONG, shorten, sanitize, no_follow); - if (convert_bare) - { + if (convert_bare) { result = convertUrl(result, BBCODE_BAREURL, shorten, sanitize, no_follow); } @@ -2681,20 +2394,17 @@ * @return The corresponding <code>boolean</code> value. * @since 1.0 */ - public static boolean convertToBoolean(String value) - { - if (null == value) - { + public static boolean convertToBoolean(String value) { + if (null == value) { return false; } if (value.equals("1") || - value.equalsIgnoreCase("t") || - value.equalsIgnoreCase("true") || - value.equalsIgnoreCase("y") || - value.equalsIgnoreCase("yes") || - value.equalsIgnoreCase("on")) - { + value.equalsIgnoreCase("t") || + value.equalsIgnoreCase("true") || + value.equalsIgnoreCase("y") || + value.equalsIgnoreCase("yes") || + value.equalsIgnoreCase("on")) { return true; } @@ -2711,18 +2421,15 @@ * replaced tabs. * @since 1.0 */ - public static String convertTabsToSpaces(String line, int tabWidth) - { + public static String convertTabsToSpaces(String line, int tabWidth) { StringBuilder result = new StringBuilder(); int tab_index = -1; int last_tab_index = 0; int added_chars = 0; int tab_size; - while ((tab_index = line.indexOf("\t", last_tab_index)) != -1) - { + while ((tab_index = line.indexOf("\t", last_tab_index)) != -1) { tab_size = tabWidth - ((tab_index + added_chars) % tabWidth); - if (0 == tab_size) - { + if (0 == tab_size) { tab_size = tabWidth; } added_chars += tab_size - 1; @@ -2730,11 +2437,9 @@ result.append(StringUtils.repeat(" ", tab_size)); last_tab_index = tab_index + 1; } - if (0 == last_tab_index) - { + if (0 == last_tab_index) { return line; - } else - { + } else { result.append(line.substring(last_tab_index)); } @@ -2749,10 +2454,8 @@ * @return The trimmed <code>String</code>. * @since 1.0 */ - public static String trim(String source) - { - if (source == null || source.length() == 0) - { + public static String trim(String source) { + if (source == null || source.length() == 0) { return source; } @@ -2772,23 +2475,18 @@ * @param width the maximum length of any one line. * @return a new String with reformatted as needed. */ - public static String wordWrap(String input, int width, Locale locale) - { + public static String wordWrap(String input, int width, Locale locale) { // handle invalid input - if (input == null) - { + if (input == null) { return ""; - } else if (width < 5) - { + } else if (width < 5) { return input; - } else if (width >= input.length()) - { + } else if (width >= input.length()) { return input; } // default locale - if (locale == null) - { + if (locale == null) { locale = Locale.US; } @@ -2799,87 +2497,73 @@ String line; // go over the input string and jump from line to line - while (current_index <= input.length()) - { + while (current_index <= input.length()) { // look for the next linebreak delimiter_index = input.indexOf(seperator, current_index); // get the line that corresponds to it - if (-1 == delimiter_index) - { - line = new String(input.substring(current_index, input.length())); - current_index = input.length() + 1; - } - else - { - line = new String(input.substring(current_index, delimiter_index)); - current_index = delimiter_index + seperator.length(); - } + if (-1 == delimiter_index) { + line = new String(input.substring(current_index, input.length())); + current_index = input.length() + 1; + } else { + line = new String(input.substring(current_index, delimiter_index)); + current_index = delimiter_index + seperator.length(); + } - // handle the wrapping of the line - BreakIterator breaks = BreakIterator.getLineInstance(locale); - breaks.setText(line); + // handle the wrapping of the line + BreakIterator breaks = BreakIterator.getLineInstance(locale); + breaks.setText(line); - int line_start = 0; - int start = breaks.first(); - int end = breaks.next(); - while (end != BreakIterator.DONE) - { - // check if the width has been exceeded - if (end - 1 - line_start >= width) - { - boolean break_line = true; + int line_start = 0; + int start = breaks.first(); + int end = breaks.next(); + while (end != BreakIterator.DONE) { + // check if the width has been exceeded + if (end - 1 - line_start >= width) { + boolean break_line = true; - // first check if the last characters were spaces, - // if they were and by removing them the width is not - // exceeded, just continue - if (Character.isWhitespace(line.charAt(end - 1))) - { - for (int j = end - 1; j >= 0; j--) - { - if (!Character.isWhitespace(line.charAt(j))) - { - if (j - line_start < width) - { - break_line = false; - } + // first check if the last characters were spaces, + // if they were and by removing them the width is not + // exceeded, just continue + if (Character.isWhitespace(line.charAt(end - 1))) { + for (int j = end - 1; j >= 0; j--) { + if (!Character.isWhitespace(line.charAt(j))) { + if (j - line_start < width) { + break_line = false; + } - break; - } - } - } + break; + } + } + } - if (break_line) - { - String line_breaked = line.substring(line_start, start); - // this can happen with trailing whitespace - if (line_breaked.length() > width) - { - line_breaked = line_breaked.substring(0, width); - } - buffer.append(line_breaked); + if (break_line) { + String line_breaked = line.substring(line_start, start); + // this can happen with trailing whitespace + if (line_breaked.length() > width) { + line_breaked = line_breaked.substring(0, width); + } + buffer.append(line_breaked); - buffer.append("\n"); + buffer.append("\n"); - line_start = start; - } - } + line_start = start; + } + } - start = end; - end = breaks.next(); - } + start = end; + end = breaks.next(); + } - if (line_start < line.length()) - { - buffer.append(line.substring(line_start)); - } + if (line_start < line.length()) { + buffer.append(line.substring(line_start)); + } - if (delimiter_index != -1) - { - buffer.append("\n"); - } - } + if (delimiter_index != -1) { + buffer.append("\n"); + } + } - return buffer.toString(); + return buffer.toString(); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/TPCLIDConverter.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/TPCLIDConverter.java index 2a45c96..907cc5c 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/TPCLIDConverter.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/TPCLIDConverter.java @@ -3,43 +3,38 @@ import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Envelope; -public abstract class TPCLIDConverter -{ +public abstract class TPCLIDConverter { public final static int SX1200 = 800; public final static int SY1200 = 500; public final static int SX600 = 400; public final static int SY600 = 250; - public static String CoordinateToTpclId(Coordinate dp) - { + public static String CoordinateToTpclId(Coordinate dp) { long orgX, orgY; int mapX, mapY; int shiftX, shiftY; int dx1, dy1; int dx2, dy2; - if (dp == null) - { + if (dp == null) { return null; } double X = dp.x; double Y = dp.y; - String CoordToTPCLID = ""; + String coordToTPCLID = ""; char mapID = coordinateToSingleMapID(dp); - if (mapID == 'w') - { + if (mapID == 'w') { return ""; } /* get the origin point of mapID */ Coordinate Point = getOriginPoint("" + mapID, Integer.MAX_VALUE); - if (Point == null) - { + if (Point == null) { return null; } @@ -48,8 +43,7 @@ mapX = intDivision((X - orgX), SX1200); - if (mapID == 'Z' && mapX >= 100) - { + if (mapID == 'Z' && mapX >= 100) { mapX = mapX - 100; } mapY = intDivision((Y - orgY), SY1200); @@ -61,18 +55,17 @@ dy2 = (shiftY % 100) % 10; - CoordToTPCLID = "" + mapID; - CoordToTPCLID = CoordToTPCLID + dataFormat(mapX); - CoordToTPCLID = CoordToTPCLID + dataFormat(mapY); - CoordToTPCLID = CoordToTPCLID + intToAscii(shiftX / 100 + asciiToInt("A")); - CoordToTPCLID = CoordToTPCLID + intToAscii(shiftY / 100 + asciiToInt("A")); - CoordToTPCLID = CoordToTPCLID + dx1 + dy1 + dx2 + dy2; + coordToTPCLID = "" + mapID; + coordToTPCLID = coordToTPCLID + dataFormat(mapX); + coordToTPCLID = coordToTPCLID + dataFormat(mapY); + coordToTPCLID = coordToTPCLID + intToAscii(shiftX / 100 + asciiToInt("A")); + coordToTPCLID = coordToTPCLID + intToAscii(shiftY / 100 + asciiToInt("A")); + coordToTPCLID = coordToTPCLID + dx1 + dy1 + dx2 + dy2; - return CoordToTPCLID; + return coordToTPCLID; } - public static char coordinateToSingleMapID(Coordinate dp) - { + public static char coordinateToSingleMapID(Coordinate dp) { char mapID = 'w'; String[] strY = StringUtils.splitToArray(Double.toString(dp.y), "."); @@ -81,209 +74,164 @@ int intY = Integer.parseInt(strY[0]); int intX = Integer.parseInt(strX[0]); - if (intY > 2944000) - { + if (intY > 2944000) { return mapID; } - if (intY >= 2894000 && intY <= 2944000 && intX >= 10000 && intX <= 90000) - { + if (intY >= 2894000 && intY <= 2944000 && intX >= 10000 && intX <= 90000) { mapID = 'S'; return mapID; } - if (intY >= 2614000 && intY <= 2664000 && intX >= 10000 && intX <= 66000) - { + if (intY >= 2614000 && intY <= 2664000 && intX >= 10000 && intX <= 66000) { mapID = 'X'; return mapID; } - if (intY >= 2564000 && intY <= 2614000 && intX >= 10000 && intX <= 66000) - { + if (intY >= 2564000 && intY <= 2614000 && intX >= 10000 && intX <= 66000) { mapID = 'Y'; return mapID; } - if (intY >= 2675800 && intY <= 2725800 && intX >= 10000 && intX <= 170000) - { + if (intY >= 2675800 && intY <= 2725800 && intX >= 10000 && intX <= 170000) { mapID = 'Z'; return mapID; } - if (intY > 2800000) - { + if (intY > 2800000) { return mapID; } - if (intY >= 2750000) - { - if (intX < 170000) - { + if (intY >= 2750000) { + if (intX < 170000) { return mapID; } - if (intX < 250000) - { + if (intX < 250000) { mapID = 'A'; return mapID; } - if (intX < 330000) - { + if (intX < 330000) { mapID = 'B'; return mapID; } - if (intX < 410000) - { + if (intX < 410000) { mapID = 'C'; return mapID; } return mapID; } - if (intY >= 2700000) - { - if (intX < 170000) - { + if (intY >= 2700000) { + if (intX < 170000) { return mapID; } - if (intX < 250000) - { + if (intX < 250000) { mapID = 'D'; return mapID; } - if (intX < 330000) - { + if (intX < 330000) { mapID = 'E'; return mapID; } - if (intX < 410000) - { + if (intX < 410000) { mapID = 'F'; return mapID; } return mapID; } - if (intY >= 2650000) - { - if (intX < 170000) - { + if (intY >= 2650000) { + if (intX < 170000) { return mapID; } - if (intX < 250000) - { + if (intX < 250000) { mapID = 'G'; return mapID; } - if (intX < 330000) - { + if (intX < 330000) { mapID = 'H'; return mapID; } - if (intX < 410000) - { + if (intX < 410000) { mapID = 'I'; return mapID; } return mapID; } - if (intY >= 2600000) - { - if (intX < 90000) - { + if (intY >= 2600000) { + if (intX < 90000) { return mapID; } - if (intX < 170000) - { + if (intX < 170000) { mapID = 'J'; return mapID; } - if (intX < 250000) - { + if (intX < 250000) { mapID = 'K'; return mapID; } - if (intX < 330000) - { + if (intX < 330000) { mapID = 'L'; return mapID; } return mapID; } - if (intY >= 2550000) - { - if (intX < 90000) - { + if (intY >= 2550000) { + if (intX < 90000) { return mapID; } - if (intX < 170000) - { + if (intX < 170000) { mapID = 'M'; return mapID; } - if (intX < 250000) - { + if (intX < 250000) { mapID = 'N'; return mapID; } - if (intX < 330000) - { + if (intX < 330000) { mapID = 'O'; return mapID; } return mapID; } - if (intY >= 2500000) - { - if (intX < 90000) - { + if (intY >= 2500000) { + if (intX < 90000) { return mapID; } - if (intX < 170000) - { + if (intX < 170000) { mapID = 'P'; return mapID; } - if (intX < 250000) - { + if (intX < 250000) { mapID = 'Q'; return mapID; } - if (intX < 330000) - { + if (intX < 330000) { mapID = 'R'; return mapID; } return mapID; } - if (intY >= 2450000) - { - if (intX < 90000) - { + if (intY >= 2450000) { + if (intX < 90000) { return mapID; } - if (intX < 170000) - { + if (intX < 170000) { mapID = 'S'; return mapID; } - if (intX < 250000) - { + if (intX < 250000) { mapID = 'T'; return mapID; } - if (intX < 330000) - { + if (intX < 330000) { mapID = 'U'; return mapID; } return mapID; } - if (intY >= 2400000) - { - if (intX < 170000) - { + if (intY >= 2400000) { + if (intX < 170000) { return mapID; } - if (intX < 250000) - { + if (intX < 250000) { mapID = 'V'; return mapID; } - if (intX < 330000) - { + if (intX < 330000) { mapID = 'W'; return mapID; } @@ -292,16 +240,14 @@ return mapID; } - public static Envelope convertTpclIdToEnvelope(String tpclid) - { + public static Envelope convertTpclIdToEnvelope(String tpclid) { String tempString = ""; Coordinate point = null; Coordinate tempPoint = null; double width, height; - if (tpclid.length() < 5) - { + if (tpclid.length() < 5) { return null; } @@ -311,8 +257,7 @@ // Get the origin point point = getOriginPoint(tempString, xmapid); - if (point == null) - { + if (point == null) { return null; } @@ -322,18 +267,15 @@ height = SY1200; tempPoint = twoNumberScale(tempString, 800, 500); - if (tempPoint != null) - { + if (tempPoint != null) { point.x = (point.x + tempPoint.x); point.y = (point.y + tempPoint.y); } - if (tpclid.length() >= 7) - { + if (tpclid.length() >= 7) { tempString = (asciiToInt(tpclid.substring(5, 6)) - 65) + "" + (asciiToInt(tpclid.substring(6, 7)) - 65); tempPoint = twoNumberScale(tempString, 100); - if (tempPoint != null) - { + if (tempPoint != null) { point.x = point.x + tempPoint.x; point.y = point.y + tempPoint.y; } @@ -341,12 +283,10 @@ height = 100.0; } - if (tpclid.length() >= 9) - { + if (tpclid.length() >= 9) { tempString = tpclid.substring(7, 8); tempPoint = twoNumberScale(tempString, 10); - if (tempPoint != null) - { + if (tempPoint != null) { point.x = point.x + tempPoint.x; point.y = point.y + tempPoint.y; } @@ -354,12 +294,10 @@ height = 10.0; } - if (tpclid.length() >= 11) - { + if (tpclid.length() >= 11) { tempString = tpclid.substring(10); tempPoint = twoNumberScale(tempString, 1); - if (tempPoint != null) - { + if (tempPoint != null) { point.x = point.x + tempPoint.x; point.y = point.y + tempPoint.y; } @@ -373,15 +311,13 @@ return new Envelope(point, pt2); } - public static Coordinate convertTpclIdToCoordinate(String tpclid) - { + public static Coordinate convertTpclIdToCoordinate(String tpclid) { String tempString = ""; Coordinate point = null; Coordinate tempPoint = null; - if (tpclid.length() < 5) - { + if (tpclid.length() < 5) { return null; } @@ -391,8 +327,7 @@ // Get the origin point point = getOriginPoint(tempString, xmapid); - if (point == null) - { + if (point == null) { return null; } @@ -400,40 +335,33 @@ tempString = tpclid.substring(1, 5); tempPoint = twoNumberScale(tempString, 800, 500); - if (tempPoint != null) - { + if (tempPoint != null) { point.x = (point.x + tempPoint.x); point.y = (point.y + tempPoint.y); } - if (tpclid.length() >= 7) - { + if (tpclid.length() >= 7) { tempString = (asciiToInt(tpclid.substring(5, 6)) - 65) + "" + (asciiToInt(tpclid.substring(6, 7)) - 65); tempPoint = twoNumberScale(tempString, 100); - if (tempPoint != null) - { + if (tempPoint != null) { point.x = point.x + tempPoint.x; point.y = point.y + tempPoint.y; } } - if (tpclid.length() >= 9) - { + if (tpclid.length() >= 9) { tempString = tpclid.substring(7, 9); tempPoint = twoNumberScale(tempString, 10); - if (tempPoint != null) - { + if (tempPoint != null) { point.x = point.x + tempPoint.x; point.y = point.y + tempPoint.y; } } - if (tpclid.length() >= 11) - { + if (tpclid.length() >= 11) { tempString = tpclid.substring(10); tempPoint = twoNumberScale(tempString, 1); - if (tempPoint != null) - { + if (tempPoint != null) { point.x = point.x + tempPoint.x; point.y = point.y + tempPoint.y; } @@ -442,8 +370,7 @@ } - private static int intDivision(double p1, int p2) - { + private static int intDivision(double p1, int p2) { double resultValue = 0.0; String result; resultValue = p1 / p2; @@ -454,24 +381,19 @@ } - private static Coordinate twoNumberScale(String number, int scaleX, int scaleY) - { + private static Coordinate twoNumberScale(String number, int scaleX, int scaleY) { Coordinate tempPoint = new Coordinate(); - if (number.length() == 2) - { + if (number.length() == 2) { tempPoint.x = Double.parseDouble(number.substring(0, 1)) * scaleX; tempPoint.y = Double.parseDouble(number.substring(1, 2)) * scaleY; - } else if (number.length() == 1) - { + } else if (number.length() == 1) { tempPoint.x = Double.parseDouble(number.substring(0, 1)) * scaleX; tempPoint.y = 0; - } else if (number.length() == 4) - { + } else if (number.length() == 4) { tempPoint.x = Double.parseDouble(number.substring(0, 2)) * scaleX; tempPoint.y = Double.parseDouble(number.substring(2, 4)) * scaleY; - } else - { + } else { tempPoint.x = 0; tempPoint.y = 0; } @@ -479,8 +401,7 @@ } - public static int asciiToInt(String p1) - { + public static int asciiToInt(String p1) { if (p1.endsWith("A")) return 65; if (p1.endsWith("B")) return 66; if (p1.endsWith("C")) return 67; @@ -511,10 +432,8 @@ } - public static char intToAscii(int p1) - { - switch (p1) - { + public static char intToAscii(int p1) { + switch (p1) { case 65: return 'A'; case 66: @@ -573,12 +492,10 @@ } - private static Coordinate getOriginPoint(String letter, int xMapId) - { + private static Coordinate getOriginPoint(String letter, int xMapId) { int aSwitch = asciiToInt(letter); Coordinate Point = new Coordinate(); - switch (aSwitch) - { + switch (aSwitch) { case 65: //A { Point.x = 170000; @@ -687,7 +604,7 @@ Point.y = 2500000; break; } - case 83: //���� S + case 83: // S { Point.x = 10000; Point.y = 2894000; @@ -717,26 +634,25 @@ Point.y = 2400000; break; } - case 88: //��� X + case 88: //X { Point.x = 10000; Point.y = 2614000; break; } - case 89: //��� Y + case 89: //Y { Point.x = 10000; Point.y = 2564000; break; } - case 90: //���� ��Z + case 90: //Z { Point.x = (xMapId < 51) ? 90000 : 10000; Point.y = 2675800; break; } - default: - { + default: { return null; } } @@ -744,14 +660,12 @@ } - private static Coordinate twoNumberScale(String number, int scale) - { + private static Coordinate twoNumberScale(String number, int scale) { return twoNumberScale(number, scale, scale); } - private static String dataFormat(int p1) - { + private static String dataFormat(int p1) { String s1 = Integer.toString(p1); if (s1.length() < 2) s1 = "0" + s1; diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/TWDDatumConverter.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/TWDDatumConverter.java index 0971069..9630267 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/TWDDatumConverter.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/TWDDatumConverter.java @@ -6,11 +6,9 @@ * TWDDatumConverter * User: Ulysses * Date: 2007/10/8 - * Time: �U�� 01:35:03 * To change this template use File | Settings | File Templates. */ -public abstract class TWDDatumConverter -{ +public abstract class TWDDatumConverter { /* * Definition of math related value */ @@ -51,8 +49,7 @@ /* * datum convert function */ - public static Coordinate toTWD97(Coordinate pt) - { + public static Coordinate toTWD97(Coordinate pt) { double newX, newY, newZ; double r, pole, sin_lat, cos_lat; double lat, lon, height; @@ -63,19 +60,15 @@ lat = pt.y * DEG_RAD; height = pt.z * DEG_RAD; - if ((lat < -HALF_PI) && (lat > -1.001 * HALF_PI)) - { + if ((lat < -HALF_PI) && (lat > -1.001 * HALF_PI)) { lat = -HALF_PI; - } else if ((lat > HALF_PI) && (lat < 1.001 * HALF_PI)) - { + } else if ((lat > HALF_PI) && (lat < 1.001 * HALF_PI)) { lat = HALF_PI; - } else if ((lat < -HALF_PI) || (lat > HALF_PI)) - { + } else if ((lat < -HALF_PI) || (lat > HALF_PI)) { return null; } - if (lon > PI) - { + if (lon > PI) { lon -= (2 * PI); } @@ -90,30 +83,22 @@ z2 = z1 + TWD67_DZ + TWD67_S * (TWD67_RY * lon - TWD67_RX * lat + height); pole = 0.0; - if (x2 != 0.0) - { + if (x2 != 0.0) { lon = Math.atan2(y2, x2); - } else - { - if (y2 > 0) - { + } else { + if (y2 > 0) { lon = HALF_PI; - } else if (y2 < 0) - { + } else if (y2 < 0) { lon = -HALF_PI; - } else - { + } else { pole = 1; lon = 0; - if (z2 > 0) - { + if (z2 > 0) { lat = HALF_PI; - } else if (z2 < 0) - { + } else if (z2 < 0) { lat = -HALF_PI; - } else - { + } else { lat = HALF_PI; newX = lon * RAD_DEG; newY = lat * RAD_DEG; @@ -137,19 +122,15 @@ cos_p = sum / s1; r = TWD97_A / Math.sqrt(1.0 - TWD97_ECC * sin_p * sin_p); - if (cos_p >= COS67_5) - { + if (cos_p >= COS67_5) { height = q / cos_p - r; - } else if (cos_p <= -COS67_5) - { + } else if (cos_p <= -COS67_5) { height = q / -cos_p - r; - } else - { + } else { height = z2 / sin_p + r * (TWD97_ECC - 1.0); } - if (pole != 0.0) - { + if (pole != 0.0) { lat = Math.atan(sin_p / cos_p); } @@ -159,8 +140,7 @@ return new Coordinate(newX, newY, newZ); } - public static Coordinate toTWD67(Coordinate pt) - { + public static Coordinate toTWD67(Coordinate pt) { double newX, newY, newZ; double r, pole, sin_lat, cos_lat; double lat, lon, height; @@ -171,19 +151,15 @@ lat = pt.y * DEG_RAD; height = pt.z * DEG_RAD; - if ((lat < -HALF_PI) && (lat > -1.001 * HALF_PI)) - { + if ((lat < -HALF_PI) && (lat > -1.001 * HALF_PI)) { lat = -HALF_PI; - } else if ((lat > HALF_PI) && (lat < 1.001 * HALF_PI)) - { + } else if ((lat > HALF_PI) && (lat < 1.001 * HALF_PI)) { lat = HALF_PI; - } else if ((lat < -HALF_PI) || (lat > HALF_PI)) - { + } else if ((lat < -HALF_PI) || (lat > HALF_PI)) { return null; } - if (lon > PI) - { + if (lon > PI) { lon -= (2 * PI); } @@ -198,30 +174,22 @@ z2 = z1 - TWD67_DZ - TWD67_S * (TWD67_RY * lon - TWD67_RX * lat + height); pole = 0; - if (x2 != 0.0) - { + if (x2 != 0.0) { lon = Math.atan2(y2, x2); - } else - { - if (y2 > 0) - { + } else { + if (y2 > 0) { lon = HALF_PI; - } else if (y2 < 0) - { + } else if (y2 < 0) { lon = -HALF_PI; - } else - { + } else { pole = 1; lon = 0; - if (z2 > 0) - { + if (z2 > 0) { lat = HALF_PI; - } else if (z2 < 0) - { + } else if (z2 < 0) { lat = -HALF_PI; - } else - { + } else { lat = HALF_PI; newX = lon * RAD_DEG; newY = lat * RAD_DEG; @@ -245,19 +213,15 @@ cos_p = sum / s1; r = TWD67_A / Math.sqrt(1.0 - TWD67_ECC * sin_p * sin_p); - if (cos_p >= COS67_5) - { + if (cos_p >= COS67_5) { height = q / cos_p - r; - } else if (cos_p <= -COS67_5) - { + } else if (cos_p <= -COS67_5) { height = q / -cos_p - r; - } else - { + } else { height = z2 / sin_p + r * (TWD67_ECC - 1.0); } - if (pole != 0.0) - { + if (pole != 0.0) { lat = Math.atan(sin_p / cos_p); } @@ -267,8 +231,7 @@ return new Coordinate(newX, newY, newZ); } - public static Coordinate 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; double newX, newY; @@ -284,18 +247,17 @@ c = ecc2 * Math.pow(Math.cos(y0), 2.0); A = (x0 - x1) * Math.cos(y0); newX = scale * n - * (A + (1.0 - t + c) * A * A * A / 6.0 - + (5.0 - 18.0 * t + t * t + 72.0 * c - 58.0 * ecc2) * Math.pow(A, 5.0) / 120.0); + * (A + (1.0 - t + c) * A * A * A / 6.0 + + (5.0 - 18.0 * t + t * t + 72.0 * c - 58.0 * ecc2) * Math.pow(A, 5.0) / 120.0); newY = scale - * (m1 - m0 - + 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)); + * (m1 - m0 + + 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 Coordinate 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; double c1, t1, n1, r1, d; @@ -309,35 +271,32 @@ e1 = (1.0 - Math.sqrt(1.0 - ecc)) / (1.0 + Math.sqrt(1.0 - ecc)); mu = m / (a * (1.0 - ecc / 4.0 - 3.0 * ecc * ecc / 64.0 - 5.0 * ecc * ecc * ecc / 256.0)); phi = mu + (3.0 * e1 / 2.0 - 27.0 * Math.pow(e1, 3.0) / 32.0) * Math.sin(2.0 * mu) - + (21.0 * e1 * e1 / 16.0 - 55.0 * Math.pow(e1, 4.0) / 32.0) * Math.sin(4.0 * mu) - + 151.0 * Math.pow(e1, 3.0) / 96.0 * Math.sin(6.0 * mu) + 1097.0 * Math.pow(e1, 4.0) / 512.0 * Math.sin(8.0 * mu); + + (21.0 * e1 * e1 / 16.0 - 55.0 * Math.pow(e1, 4.0) / 32.0) * Math.sin(4.0 * mu) + + 151.0 * Math.pow(e1, 3.0) / 96.0 * Math.sin(6.0 * mu) + 1097.0 * Math.pow(e1, 4.0) / 512.0 * Math.sin(8.0 * mu); c1 = ecc2 * Math.pow(Math.cos(phi), 2.0); t1 = Math.pow(Math.tan(phi), 2.0); n1 = a / Math.sqrt(1 - ecc * Math.pow(Math.sin(phi), 2.0)); r1 = a * (1.0 - ecc) / Math.pow(1.0 - ecc * Math.pow(Math.sin(phi), 2.0), 1.5); d = x0 / (n1 * scale); newX = (x1 + (d - (1.0 + 2.0 * t1 + c1) * Math.pow(d, 3.0) / 6.0 - + (5.0 - 2.0 * c1 + 28.0 * t1 - 3.0 * c1 * c1 + 8.0 * ecc2 + 24.0 * t1 * t1) * Math.pow(d, 5.0) - / 120.0) / Math.cos(phi)) * RAD_DEG; + + (5.0 - 2.0 * c1 + 28.0 * t1 - 3.0 * c1 * c1 + 8.0 * ecc2 + 24.0 * t1 * t1) * Math.pow(d, 5.0) + / 120.0) / Math.cos(phi)) * RAD_DEG; newY = (phi - - n1 * Math.tan(phi) / r1 - * (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; + - n1 * Math.tan(phi) / r1 + * (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) - { - if (y == 0.0) - { + private static double mercator(double y, double a, double ecc) { + if (y == 0.0) { return 0.0; - } else - { + } else { return a * ((1.0 - ecc / 4.0 - 3.0 * ecc * ecc / 64.0 - 5.0 * ecc * ecc * ecc / 256.0) * y - - (3.0 * ecc / 8.0 + 3.0 * ecc * ecc / 32.0 + 45.0 * ecc * ecc * ecc / 1024.0) * Math.sin(2.0 * y) - + (15.0 * ecc * ecc / 256.0 + 45.0 * ecc * ecc * ecc / 1024.0) * Math.sin(4.0 * y) - - (35.0 * ecc * ecc * ecc / 3072.0) * Math.sin(6.0 * y)); + - (3.0 * ecc / 8.0 + 3.0 * ecc * ecc / 32.0 + 45.0 * ecc * ecc * ecc / 1024.0) * Math.sin(2.0 * y) + + (15.0 * ecc * ecc / 256.0 + 45.0 * ecc * ecc * ecc / 1024.0) * Math.sin(4.0 * y) + - (35.0 * ecc * ecc * ecc / 3072.0) * Math.sin(6.0 * y)); } } @@ -490,14 +449,7 @@ * } */ - /** - * ��TM2�y���ഫ��TWD97�y�� - * - * @param pt TM2��m - * @return �s��TWD97�y�� - */ - public static Coordinate fromTM2ToTWD97(Coordinate pt) - { + public static Coordinate fromTM2ToEPSG3826(Coordinate pt) { Coordinate ptTWD67 = fromTM2(TWD67_A, TWD67_ECC, TWD67_ECC2, 0, 121, TWD67_TM2, pt.x - 250000.0, pt.y); ptTWD67.z = 0; Coordinate ptTWD97 = toTWD97(ptTWD67); @@ -506,4 +458,14 @@ pt97TM2.y -= 200.0; return pt97TM2; } + + public static Coordinate fromTM2ToEPSG3825(Coordinate pt) { + Coordinate ptTWD67 = fromTM2(TWD67_A, TWD67_ECC, TWD67_ECC2, 0, 191, TWD67_TM2, pt.x - 250000.0, pt.y); + ptTWD67.z = 0; + Coordinate ptTWD97 = toTWD97(ptTWD67); + Coordinate pt97TM2 = toTM2(TWD97_A, TWD97_ECC, TWD97_ECC2, 0, 191, TWD97_TM2, ptTWD97.x, ptTWD97.y); + pt97TM2.x += 250000.0; + pt97TM2.y -= 200.0; + return pt97TM2; + } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/XGeosConfigDigesterUtils.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/XGeosConfigDigesterUtils.java new file mode 100644 index 0000000..a89e7c8 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/XGeosConfigDigesterUtils.java @@ -0,0 +1,27 @@ +package com.ximple.eofms.util; + +import com.ximple.eofms.geoserver.config.XGeosDataConfigMapping; +import org.apache.commons.digester3.Digester; +import org.apache.commons.digester3.binder.DigesterLoader; +import org.apache.commons.digester3.xmlrules.FromXmlRulesModule; + +public class XGeosConfigDigesterUtils { + private static final String XGEOSRULES_NAME = "DefaultXGeosDataConfigRules.xml"; + + protected static Digester digester = null; + protected static DigesterLoader loader = DigesterLoader.newLoader( new FromXmlRulesModule() { + @Override + protected void loadRules() { + loadXMLRules(XGeosDataConfigMapping.class.getResource(XGEOSRULES_NAME)); + } + + } ); + + static { + digester = loader.newDigester(); + } + + public static Digester getXGeosConfigDigester() { + return digester; + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JTSShape.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JTSShape.java index ebbcd74..13b7d5a 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JTSShape.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JTSShape.java @@ -18,145 +18,119 @@ import com.vividsolutions.jts.geom.Point; import com.vividsolutions.jts.geom.Polygon; import com.vividsolutions.jts.geom.impl.PackedCoordinateSequence; +import org.geotools.geometry.jts.JTSFactoryFinder; -public class JTSShape implements Shape -{ - static GeometryFactory fac = new GeometryFactory(); +public class JTSShape implements Shape { + static GeometryFactory fac = JTSFactoryFinder.getGeometryFactory(null); Geometry geom; final static LinearRing[] NOSHELLS = {}; - public JTSShape(Geometry _geom) - { + public JTSShape(Geometry _geom) { this.geom = _geom; } - public JTSShape(JtsGeometry _geom) - { + public JTSShape(JtsGeometry _geom) { this(_geom.getGeometry()); } - public boolean contains(Point2D p) - { + public boolean contains(Point2D p) { return contains(p.getX(), p.getY()); } - public boolean contains(double x, double y) - { + public boolean contains(double x, double y) { Coordinate c = new Coordinate(x, y); Point p = fac.createPoint(c); return geom.contains(p); } - public boolean contains(Rectangle2D r) - { + public boolean contains(Rectangle2D r) { return contains(r.getMinX(), r.getMinY(), r.getWidth(), r.getHeight()); } - public boolean contains(double x, double y, double w, double h) - { + public boolean contains(double x, double y, double w, double h) { Polygon p = createRect(x, y, w, h); return geom.contains(p); } - protected Polygon createRect(double x, double y, double w, double h) - { + protected Polygon createRect(double x, double y, double w, double h) { double[] arr = {x, y, x + w, y, x + w, y + h, x, y + h, x, y}; PackedCoordinateSequence shell = new PackedCoordinateSequence.Double(arr, 2); Polygon p = fac.createPolygon(fac.createLinearRing(shell), NOSHELLS); return p; } - public Rectangle2D getBounds2D() - { + public Rectangle2D getBounds2D() { Envelope env = geom.getEnvelopeInternal(); return new Rectangle2D.Double(env.getMinX(), env.getMaxX(), env.getWidth(), env.getHeight()); } - public Rectangle getBounds() - { + public Rectangle getBounds() { // We deal simple code for efficiency here, the getBounds() rounding // rules are ugly... return getBounds2D().getBounds(); } - public PathIterator getPathIterator(AffineTransform at) - { + public PathIterator getPathIterator(AffineTransform at) { return getPathIterator(geom, at); } - public PathIterator getPathIterator(AffineTransform at, double flatness) - { + public PathIterator getPathIterator(AffineTransform at, double flatness) { // we don't have much work here, as we only have linear segments, no // "flattening" necessary. return getPathIterator(at); } - public boolean intersects(Rectangle2D r) - { + public boolean intersects(Rectangle2D r) { return intersects(r.getMinX(), r.getMinY(), r.getWidth(), r.getHeight()); } - public boolean intersects(double x, double y, double w, double h) - { + public boolean intersects(double x, double y, double w, double h) { Polygon p = createRect(x, y, w, h); return geom.intersects(p); } - public static GeometryPathIterator getPathIterator(Geometry geometry, AffineTransform _at) - { - if (geometry instanceof Point) - { + public static GeometryPathIterator getPathIterator(Geometry geometry, AffineTransform _at) { + if (geometry instanceof Point) { return new PointPathIterator((Point) geometry, _at); - } else if (geometry instanceof LineString) - { + } else if (geometry instanceof LineString) { return new LineStringPathIterator((LineString) geometry, _at); - } else if (geometry instanceof Polygon) - { + } else if (geometry instanceof Polygon) { return new PolygonPathIterator((Polygon) geometry, _at); - } else - { + } else { return new GeometryCollectionPathIterator((GeometryCollection) geometry, _at); } } - public static abstract class GeometryPathIterator implements PathIterator - { + public static abstract class GeometryPathIterator implements PathIterator { protected final AffineTransform at; protected int index = 0; - GeometryPathIterator(AffineTransform _at) - { + GeometryPathIterator(AffineTransform _at) { this.at = _at; } - public final int getWindingRule() - { + public final int getWindingRule() { return PathIterator.WIND_EVEN_ODD; } - public void next() - { + public void next() { index++; } } - public static class PointPathIterator extends GeometryPathIterator - { + public static class PointPathIterator extends GeometryPathIterator { final Point p; - public PointPathIterator(Point _p, AffineTransform _at) - { + public PointPathIterator(Point _p, AffineTransform _at) { super(_at); p = _p; } - public int currentSegment(float[] coords) - { - switch (index) - { + public int currentSegment(float[] coords) { + switch (index) { case 0: coords[0] = (float) p.getX(); coords[1] = (float) p.getY(); @@ -169,10 +143,8 @@ } } - public int currentSegment(double[] coords) - { - switch (index) - { + public int currentSegment(double[] coords) { + switch (index) { case 0: coords[0] = p.getX(); coords[1] = p.getY(); @@ -185,20 +157,17 @@ } } - public boolean isDone() - { + public boolean isDone() { return index > 1; } } - public static class LineStringPathIterator extends GeometryPathIterator - { + public static class LineStringPathIterator extends GeometryPathIterator { CoordinateSequence cs; final boolean isRing; - public LineStringPathIterator(LineString ls, AffineTransform _at) - { + public LineStringPathIterator(LineString ls, AffineTransform _at) { super(_at); cs = ls.getCoordinateSequence(); isRing = ls instanceof LinearRing; @@ -207,132 +176,106 @@ /** * only to be called from PolygonPathIterator subclass */ - protected void reInit(CoordinateSequence _cs) - { + protected void reInit(CoordinateSequence _cs) { cs = _cs; index = 0; } - public int currentSegment(float[] coords) - { - if (index == 0) - { + public int currentSegment(float[] coords) { + if (index == 0) { coords[0] = (float) cs.getOrdinate(index, 0); coords[1] = (float) cs.getOrdinate(index, 1); at.transform(coords, 0, coords, 0, 1); return PathIterator.SEG_MOVETO; - } else if (index < cs.size()) - { + } else if (index < cs.size()) { coords[0] = (float) cs.getOrdinate(index, 0); coords[1] = (float) cs.getOrdinate(index, 1); at.transform(coords, 0, coords, 0, 1); return PathIterator.SEG_LINETO; - } else if (isRing && index == cs.size()) - { + } else if (isRing && index == cs.size()) { return PathIterator.SEG_CLOSE; - } else - { + } else { throw new IllegalStateException(); } } - public int currentSegment(double[] coords) - { - if (index == 0) - { + public int currentSegment(double[] coords) { + if (index == 0) { coords[0] = cs.getOrdinate(index, 0); coords[1] = cs.getOrdinate(index, 1); at.transform(coords, 0, coords, 0, 1); return PathIterator.SEG_MOVETO; - } else if (index < cs.size()) - { + } else if (index < cs.size()) { coords[0] = cs.getOrdinate(index, 0); coords[1] = cs.getOrdinate(index, 1); at.transform(coords, 0, coords, 0, 1); return PathIterator.SEG_LINETO; - } else if (isRing && index == cs.size()) - { + } else if (isRing && index == cs.size()) { return PathIterator.SEG_CLOSE; - } else - { + } else { throw new IllegalStateException(); } } - public boolean isDone() - { + public boolean isDone() { return isRing ? index > cs.size() : index >= cs.size(); } } - public static class PolygonPathIterator extends LineStringPathIterator - { + public static class PolygonPathIterator extends LineStringPathIterator { final Polygon pg; int outerindex = -1; - public PolygonPathIterator(Polygon _pg, AffineTransform _at) - { + public PolygonPathIterator(Polygon _pg, AffineTransform _at) { super(_pg.getExteriorRing(), _at); pg = _pg; index = -1; } - public boolean isDone() - { + public boolean isDone() { return outerindex >= pg.getNumInteriorRing(); } - public void next() - { + public void next() { super.next(); - if (super.isDone()) - { + if (super.isDone()) { outerindex++; - if (outerindex < pg.getNumInteriorRing()) - { + if (outerindex < pg.getNumInteriorRing()) { super.reInit(pg.getInteriorRingN(outerindex).getCoordinateSequence()); } } } } - public static class GeometryCollectionPathIterator extends GeometryPathIterator - { + public static class GeometryCollectionPathIterator extends GeometryPathIterator { final GeometryCollection coll; GeometryPathIterator current; - public GeometryCollectionPathIterator(GeometryCollection _coll, AffineTransform _at) - { + public GeometryCollectionPathIterator(GeometryCollection _coll, AffineTransform _at) { super(_at); coll = _coll; current = getPathIterator(coll.getGeometryN(index), _at); } - public boolean isDone() - { + public boolean isDone() { return index > coll.getNumGeometries(); } - public void next() - { + public void next() { current.next(); - if (current.isDone()) - { + if (current.isDone()) { index++; - if (index < coll.getNumGeometries()) - { + if (index < coll.getNumGeometries()) { current = getPathIterator(coll.getGeometryN(index), at); } } } - public int currentSegment(float[] coords) - { + public int currentSegment(float[] coords) { return current.currentSegment(coords); } - public int currentSegment(double[] coords) - { + public int currentSegment(double[] coords) { return current.currentSegment(coords); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsBinaryParser.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsBinaryParser.java index 1ee359a..dbdbf24 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsBinaryParser.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsBinaryParser.java @@ -55,8 +55,7 @@ * * @author Markus Schaber, markus.schaber@logix-tt.com */ -public class JtsBinaryParser -{ +public class JtsBinaryParser { /** * Get the appropriate ValueGetter for my endianness @@ -64,16 +63,12 @@ * @param bytes The appropriate Byte Getter * @return the ValueGetter */ - public static ValueGetter valueGetterForEndian(ByteGetter bytes) - { - if (bytes.get(0) == ValueGetter.XDR.NUMBER) - { // XDR + public static ValueGetter valueGetterForEndian(ByteGetter bytes) { + if (bytes.get(0) == ValueGetter.XDR.NUMBER) { // XDR return new ValueGetter.XDR(bytes); - } else if (bytes.get(0) == ValueGetter.NDR.NUMBER) - { + } else if (bytes.get(0) == ValueGetter.NDR.NUMBER) { return new ValueGetter.NDR(bytes); - } else - { + } else { throw new IllegalArgumentException("Unknown Endian type:" + bytes.get(0)); } } @@ -81,8 +76,7 @@ /** * Parse a hex encoded geometry */ - public Geometry parse(String value) - { + public Geometry parse(String value) { StringByteGetter bytes = new ByteGetter.StringByteGetter(value); return parseGeometry(valueGetterForEndian(bytes)); } @@ -90,8 +84,7 @@ /** * Parse a binary encoded geometry. */ - public Geometry parse(byte[] value) - { + public Geometry parse(byte[] value) { BinaryByteGetter bytes = new ByteGetter.BinaryByteGetter(value); return parseGeometry(valueGetterForEndian(bytes)); } @@ -99,19 +92,16 @@ /** * Parse a geometry starting at offset. */ - protected Geometry parseGeometry(ValueGetter data) - { + protected Geometry parseGeometry(ValueGetter data) { return parseGeometry(data, 0, false); } /** * Parse with a known geometry factory */ - protected Geometry parseGeometry(ValueGetter data, int srid, boolean inheritSrid) - { + protected Geometry parseGeometry(ValueGetter data, int srid, boolean inheritSrid) { byte endian = data.getByte(); // skip and test endian flag - if (endian != data.endian) - { + if (endian != data.endian) { throw new IllegalArgumentException("Endian inconsistency!"); } int typeword = data.getInt(); @@ -122,24 +112,19 @@ boolean haveM = (typeword & 0x40000000) != 0; boolean haveS = (typeword & 0x20000000) != 0; - if (haveS) - { + if (haveS) { int newsrid = data.getInt(); - if (inheritSrid && newsrid != srid) - { + if (inheritSrid && newsrid != srid) { throw new IllegalArgumentException("Inconsistent srids in complex geometry: " + srid + ", " + newsrid); - } else - { + } else { srid = newsrid; } - } else if (!inheritSrid) - { + } else if (!inheritSrid) { srid = -1; } Geometry result; - switch (realtype) - { + switch (realtype) { case org.postgis.Geometry.POINT: result = parsePoint(data, haveZ, haveM); break; @@ -170,22 +155,18 @@ return result; } - private Point parsePoint(ValueGetter data, boolean haveZ, boolean haveM) - { + private Point parsePoint(ValueGetter data, boolean haveZ, boolean haveM) { double X = data.getDouble(); double Y = data.getDouble(); Point result; - if (haveZ) - { + if (haveZ) { double Z = data.getDouble(); result = JtsGeometry.geofac.createPoint(new Coordinate(X, Y, Z)); - } else - { + } else { result = JtsGeometry.geofac.createPoint(new Coordinate(X, Y)); } - if (haveM) - { // skip M value + if (haveM) { // skip M value data.getDouble(); } @@ -195,10 +176,8 @@ /** * Parse an Array of "full" Geometries */ - private void parseGeometryArray(ValueGetter data, Geometry[] container, int srid) - { - for (int i = 0; i < container.length; i++) - { + private void parseGeometryArray(ValueGetter data, Geometry[] container, int srid) { + for (int i = 0; i < container.length; i++) { container[i] = parseGeometry(data, srid, true); } } @@ -210,75 +189,63 @@ * @param haveZ * @param haveM */ - private CoordinateSequence parseCS(ValueGetter data, boolean haveZ, boolean haveM) - { + private CoordinateSequence parseCS(ValueGetter data, boolean haveZ, boolean haveM) { int count = data.getInt(); int dims = haveZ ? 3 : 2; CoordinateSequence cs = new PackedCoordinateSequence.Double(count, dims); - for (int i = 0; i < count; i++) - { - for (int d = 0; d < dims; d++) - { + for (int i = 0; i < count; i++) { + for (int d = 0; d < dims; d++) { cs.setOrdinate(i, d, data.getDouble()); } - if (haveM) - { // skip M value + if (haveM) { // skip M value data.getDouble(); } } return cs; } - private MultiPoint parseMultiPoint(ValueGetter data, int srid) - { + private MultiPoint parseMultiPoint(ValueGetter data, int srid) { Point[] points = new Point[data.getInt()]; parseGeometryArray(data, points, srid); return JtsGeometry.geofac.createMultiPoint(points); } - private LineString parseLineString(ValueGetter data, boolean haveZ, boolean haveM) - { + private LineString parseLineString(ValueGetter data, boolean haveZ, boolean haveM) { return JtsGeometry.geofac.createLineString(parseCS(data, haveZ, haveM)); } - private LinearRing parseLinearRing(ValueGetter data, boolean haveZ, boolean haveM) - { + private LinearRing parseLinearRing(ValueGetter data, boolean haveZ, boolean haveM) { return JtsGeometry.geofac.createLinearRing(parseCS(data, haveZ, haveM)); } - private Polygon parsePolygon(ValueGetter data, boolean haveZ, boolean haveM, int srid) - { + private Polygon parsePolygon(ValueGetter data, boolean haveZ, boolean haveM, int srid) { int holecount = data.getInt() - 1; LinearRing[] rings = new LinearRing[holecount]; LinearRing shell = parseLinearRing(data, haveZ, haveM); shell.setSRID(srid); - for (int i = 0; i < holecount; i++) - { + for (int i = 0; i < holecount; i++) { rings[i] = parseLinearRing(data, haveZ, haveM); rings[i].setSRID(srid); } return JtsGeometry.geofac.createPolygon(shell, rings); } - private MultiLineString parseMultiLineString(ValueGetter data, int srid) - { + private MultiLineString parseMultiLineString(ValueGetter data, int srid) { int count = data.getInt(); LineString[] strings = new LineString[count]; parseGeometryArray(data, strings, srid); return JtsGeometry.geofac.createMultiLineString(strings); } - private MultiPolygon parseMultiPolygon(ValueGetter data, int srid) - { + private MultiPolygon parseMultiPolygon(ValueGetter data, int srid) { int count = data.getInt(); Polygon[] polys = new Polygon[count]; parseGeometryArray(data, polys, srid); return JtsGeometry.geofac.createMultiPolygon(polys); } - private GeometryCollection parseCollection(ValueGetter data, int srid) - { + private GeometryCollection parseCollection(ValueGetter data, int srid) { int count = data.getInt(); Geometry[] geoms = new Geometry[count]; parseGeometryArray(data, geoms, srid); diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsBinaryWriter.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsBinaryWriter.java index 36a9d7b..3b0b584 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsBinaryWriter.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsBinaryWriter.java @@ -50,8 +50,7 @@ * * @author markus.schaber@logi-track.com */ -public class JtsBinaryWriter -{ +public class JtsBinaryWriter { /** * Get the appropriate ValueGetter for my endianness @@ -59,16 +58,12 @@ * @param bytes The appropriate Byte Getter * @return the ValueGetter */ - public static ValueSetter valueSetterForEndian(ByteSetter bytes, byte endian) - { - if (endian == ValueSetter.XDR.NUMBER) - { // XDR + public static ValueSetter valueSetterForEndian(ByteSetter bytes, byte endian) { + if (endian == ValueSetter.XDR.NUMBER) { // XDR return new ValueSetter.XDR(bytes); - } else if (endian == ValueSetter.NDR.NUMBER) - { + } else if (endian == ValueSetter.NDR.NUMBER) { return new ValueSetter.NDR(bytes); - } else - { + } else { throw new IllegalArgumentException("Unknown Endian type:" + endian); } } @@ -79,16 +74,14 @@ * Currently, geometries with more than 2 dimensions and measures are not * cleanly supported, but SRID is honored. */ - public String writeHexed(Geometry geom, byte REP) - { + public String writeHexed(Geometry geom, byte REP) { int length = estimateBytes(geom); ByteSetter.StringByteSetter bytes = new ByteSetter.StringByteSetter(length); writeGeometry(geom, valueSetterForEndian(bytes, REP)); return bytes.result(); } - public String writeHexed(Geometry geom) - { + public String writeHexed(Geometry geom) { return writeHexed(geom, ValueSetter.NDR.NUMBER); } @@ -98,37 +91,30 @@ * Currently, geometries with more than 2 dimensions and measures are not * cleanly supported, but SRID is honored. */ - public byte[] writeBinary(Geometry geom, byte REP) - { + public byte[] writeBinary(Geometry geom, byte REP) { int length = estimateBytes(geom); ByteSetter.BinaryByteSetter bytes = new ByteSetter.BinaryByteSetter(length); writeGeometry(geom, valueSetterForEndian(bytes, REP)); return bytes.result(); } - public byte[] writeBinary(Geometry geom) - { + public byte[] writeBinary(Geometry geom) { return writeBinary(geom, ValueSetter.NDR.NUMBER); } /** * Parse a geometry starting at offset. */ - protected void writeGeometry(Geometry geom, ValueSetter dest) - { + protected void writeGeometry(Geometry geom, ValueSetter dest) { final int dimension; - if (geom == null) - { + if (geom == null) { throw new NullPointerException(); - } else if (geom.isEmpty()) - { + } else if (geom.isEmpty()) { // don't set any flag bits dimension = 0; - } else - { + } else { dimension = getCoordDim(geom); - if (dimension < 2 || dimension > 4) - { + if (dimension < 2 || dimension > 4) { throw new IllegalArgumentException("Unsupported geometry dimensionality: " + dimension); } } @@ -138,30 +124,25 @@ // write typeword final int plaintype = getWKBType(geom); int typeword = plaintype; - if (dimension == 3 || dimension == 4) - { + if (dimension == 3 || dimension == 4) { typeword |= 0x80000000; } - if (dimension == 4) - { + if (dimension == 4) { typeword |= 0x40000000; } final boolean haveSrid = checkSrid(geom); - if (haveSrid) - { + if (haveSrid) { typeword |= 0x20000000; } dest.setInt(typeword); - if (haveSrid) - { + if (haveSrid) { dest.setInt(geom.getSRID()); } - switch (plaintype) - { + switch (plaintype) { case org.postgis.Geometry.POINT: writePoint((Point) geom, dest); break; @@ -188,37 +169,27 @@ } } - public static int getWKBType(Geometry geom) - { + public static int getWKBType(Geometry geom) { // We always write emtpy geometries as emtpy collections - for OpenGIS // conformance - if (geom.isEmpty()) - { + if (geom.isEmpty()) { return org.postgis.Geometry.GEOMETRYCOLLECTION; - } else if (geom instanceof Point) - { + } else if (geom instanceof Point) { return org.postgis.Geometry.POINT; - } else if (geom instanceof com.vividsolutions.jts.geom.LineString) - { + } else if (geom instanceof com.vividsolutions.jts.geom.LineString) { return org.postgis.Geometry.LINESTRING; - } else if (geom instanceof com.vividsolutions.jts.geom.Polygon) - { + } else if (geom instanceof com.vividsolutions.jts.geom.Polygon) { return org.postgis.Geometry.POLYGON; - } else if (geom instanceof MultiPoint) - { + } else if (geom instanceof MultiPoint) { return org.postgis.Geometry.MULTIPOINT; - } else if (geom instanceof MultiLineString) - { + } else if (geom instanceof MultiLineString) { return org.postgis.Geometry.MULTILINESTRING; - } else if (geom instanceof com.vividsolutions.jts.geom.MultiPolygon) - { + } else if (geom instanceof com.vividsolutions.jts.geom.MultiPolygon) { return org.postgis.Geometry.MULTIPOLYGON; } - if (geom instanceof com.vividsolutions.jts.geom.GeometryCollection) - { + if (geom instanceof com.vividsolutions.jts.geom.GeometryCollection) { return org.postgis.Geometry.GEOMETRYCOLLECTION; - } else - { + } else { throw new IllegalArgumentException("Unknown Geometry Type: " + geom.getClass().getName()); } } @@ -227,8 +198,7 @@ * Writes a "slim" Point (without endiannes, srid ant type, only the * ordinates and measure. Used by writeGeometry. */ - private void writePoint(Point geom, ValueSetter dest) - { + private void writePoint(Point geom, ValueSetter dest) { writeCoordinates(geom.getCoordinateSequence(), getCoordDim(geom), dest); } @@ -236,62 +206,49 @@ * Write a Coordinatesequence, part of LinearRing and Linestring, but not * MultiPoint! */ - private void writeCoordinates(CoordinateSequence seq, int dims, ValueSetter dest) - { - for (int i = 0; i < seq.size(); i++) - { - for (int d = 0; d < dims; d++) - { + private void writeCoordinates(CoordinateSequence seq, int dims, ValueSetter dest) { + for (int i = 0; i < seq.size(); i++) { + for (int d = 0; d < dims; d++) { dest.setDouble(seq.getOrdinate(i, d)); } } } - private void writeMultiPoint(MultiPoint geom, ValueSetter dest) - { + private void writeMultiPoint(MultiPoint geom, ValueSetter dest) { dest.setInt(geom.getNumPoints()); - for (int i = 0; i < geom.getNumPoints(); i++) - { + for (int i = 0; i < geom.getNumPoints(); i++) { writeGeometry(geom.getGeometryN(i), dest); } } - private void writeLineString(LineString geom, ValueSetter dest) - { + private void writeLineString(LineString geom, ValueSetter dest) { dest.setInt(geom.getNumPoints()); writeCoordinates(geom.getCoordinateSequence(), getCoordDim(geom), dest); } - private void writePolygon(Polygon geom, ValueSetter dest) - { + private void writePolygon(Polygon geom, ValueSetter dest) { dest.setInt(geom.getNumInteriorRing() + 1); writeLineString(geom.getExteriorRing(), dest); - for (int i = 0; i < geom.getNumInteriorRing(); i++) - { + for (int i = 0; i < geom.getNumInteriorRing(); i++) { writeLineString(geom.getInteriorRingN(i), dest); } } - private void writeMultiLineString(MultiLineString geom, ValueSetter dest) - { + private void writeMultiLineString(MultiLineString geom, ValueSetter dest) { writeGeometryArray(geom, dest); } - private void writeMultiPolygon(MultiPolygon geom, ValueSetter dest) - { + private void writeMultiPolygon(MultiPolygon geom, ValueSetter dest) { writeGeometryArray(geom, dest); } - private void writeCollection(GeometryCollection geom, ValueSetter dest) - { + private void writeCollection(GeometryCollection geom, ValueSetter dest) { writeGeometryArray(geom, dest); } - private void writeGeometryArray(Geometry geom, ValueSetter dest) - { + private void writeGeometryArray(Geometry geom, ValueSetter dest) { dest.setInt(geom.getNumGeometries()); - for (int i = 0; i < geom.getNumGeometries(); i++) - { + for (int i = 0; i < geom.getNumGeometries(); i++) { writeGeometry(geom.getGeometryN(i), dest); } } @@ -299,8 +256,7 @@ /** * Estimate how much bytes a geometry will need in WKB. */ - protected int estimateBytes(Geometry geom) - { + protected int estimateBytes(Geometry geom) { int result = 0; // write endian flag @@ -309,13 +265,11 @@ // write typeword result += 4; - if (checkSrid(geom)) - { + if (checkSrid(geom)) { result += 4; } - switch (getWKBType(geom)) - { + switch (getWKBType(geom)) { case org.postgis.Geometry.POINT: result += estimatePoint((Point) geom); break; @@ -343,26 +297,22 @@ return result; } - private boolean checkSrid(Geometry geom) - { + private boolean checkSrid(Geometry geom) { final int srid = geom.getSRID(); // SRID is default 0 with jts geometries return (srid != -1) && (srid != 0); } - private int estimatePoint(Point geom) - { + private int estimatePoint(Point geom) { return 8 * getCoordDim(geom); } /** * Write an Array of "full" Geometries */ - private int estimateGeometryArray(Geometry container) - { + private int estimateGeometryArray(Geometry container) { int result = 0; - for (int i = 0; i < container.getNumGeometries(); i++) - { + for (int i = 0; i < container.getNumGeometries(); i++) { result += estimateBytes(container.getGeometryN(i)); } return result; @@ -371,12 +321,10 @@ /** * Estimate an array of "fat" Points */ - private int estimateMultiPoint(MultiPoint geom) - { + private int estimateMultiPoint(MultiPoint geom) { // int size int result = 4; - if (geom.getNumGeometries() > 0) - { + if (geom.getNumGeometries() > 0) { // We can shortcut here, compared to estimateGeometryArray, as all // subgeoms have the same fixed size result += geom.getNumGeometries() * estimateBytes(geom.getGeometryN(0)); @@ -384,85 +332,68 @@ return result; } - private int estimateLineString(LineString geom) - { - if (geom == null || geom.getNumGeometries() == 0) - { + private int estimateLineString(LineString geom) { + if (geom == null || geom.getNumGeometries() == 0) { return 0; - } else - { + } else { return 4 + 8 * getCoordSequenceDim(geom.getCoordinateSequence()) * geom.getCoordinateSequence().size(); } } - private int estimatePolygon(Polygon geom) - { + private int estimatePolygon(Polygon geom) { // int length int result = 4; result += estimateLineString(geom.getExteriorRing()); - for (int i = 0; i < geom.getNumInteriorRing(); i++) - { + for (int i = 0; i < geom.getNumInteriorRing(); i++) { result += estimateLineString(geom.getInteriorRingN(i)); } return result; } - private int estimateMultiLineString(MultiLineString geom) - { + private int estimateMultiLineString(MultiLineString geom) { // 4-byte count + subgeometries return 4 + estimateGeometryArray(geom); } - private int estimateMultiPolygon(MultiPolygon geom) - { + private int estimateMultiPolygon(MultiPolygon geom) { // 4-byte count + subgeometries return 4 + estimateGeometryArray(geom); } - private int estimateCollection(GeometryCollection geom) - { + private int estimateCollection(GeometryCollection geom) { // 4-byte count + subgeometries return 4 + estimateGeometryArray(geom); } - public static final int getCoordDim(Geometry geom) - { - if (geom.isEmpty()) - { + public static final int getCoordDim(Geometry geom) { + if (geom.isEmpty()) { return 0; } - if (geom instanceof Point) - { + if (geom instanceof Point) { return getCoordSequenceDim(((Point) geom).getCoordinateSequence()); - } else if (geom instanceof LineString) - { + } else if (geom instanceof LineString) { return getCoordSequenceDim(((LineString) geom).getCoordinateSequence()); - } else if (geom instanceof Polygon) - { + } else if (geom instanceof Polygon) { return getCoordSequenceDim(((Polygon) geom).getExteriorRing().getCoordinateSequence()); - } else - { + } else { return getCoordDim(geom.getGeometryN(0)); } } - public static final int getCoordSequenceDim(CoordinateSequence coords) - { + public static final int getCoordSequenceDim(CoordinateSequence coords) { if (coords == null || coords.size() == 0) return 0; // JTS has a really strange way to handle dimensions! // Just have a look at PackedCoordinateSequence and // CoordinateArraySequence int dimensions = coords.getDimension(); - if (dimensions == 3) - { + if (dimensions == 3) { // CoordinateArraySequence will always return 3, so we have to // check, if // the third ordinate contains NaN, then the geom is actually // 2-dimensional return Double.isNaN(coords.getOrdinate(0, CoordinateSequence.Z)) ? 2 : 3; - } else - { + } else { return dimensions; } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsGeometry.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsGeometry.java index 18a6295..74ed0c9 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsGeometry.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsGeometry.java @@ -45,8 +45,7 @@ * @author Markus Schaber */ -public class JtsGeometry extends PGobject -{ +public class JtsGeometry extends PGobject { /* JDK 1.5 Serialization */ private static final long serialVersionUID = 0x100; @@ -67,44 +66,35 @@ /** * Constructor called by JDBC drivers */ - public JtsGeometry() - { + public JtsGeometry() { setType("geometry"); } - public JtsGeometry(Geometry geom) - { + public JtsGeometry(Geometry geom) { this(); this.geom = geom; } - public JtsGeometry(String value) throws SQLException - { + public JtsGeometry(String value) throws SQLException { this(); setValue(value); } - public void setValue(String value) throws SQLException - { + public void setValue(String value) throws SQLException { geom = geomFromString(value); } - public static Geometry geomFromString(String value) throws SQLException - { - try - { + public static Geometry geomFromString(String value) throws SQLException { + try { value = value.trim(); - if (value.startsWith("00") || value.startsWith("01")) - { + if (value.startsWith("00") || value.startsWith("01")) { return bp.parse(value); - } else - { + } else { Geometry result; // no srid := 0 in JTS world int srid = 0; // break up geometry into srid and wkt - if (value.startsWith("SRID=")) - { + if (value.startsWith("SRID=")) { String[] temp = value.split(";"); value = temp[1].trim(); srid = Integer.parseInt(temp[0].substring(5)); @@ -114,8 +104,7 @@ setSridRecurse(result, srid); return result; } - } catch (Exception E) - { + } catch (Exception E) { E.printStackTrace(); throw new SQLException("Error parsing SQL data:" + E); } @@ -124,61 +113,48 @@ /** * Recursively set a srid for the geometry and all subgeometries */ - public static void setSridRecurse(final Geometry geom, final int srid) - { + public static void setSridRecurse(final Geometry geom, final int srid) { geom.setSRID(srid); - if (geom instanceof GeometryCollection) - { + if (geom instanceof GeometryCollection) { final int subcnt = geom.getNumGeometries(); - for (int i = 0; i < subcnt; i++) - { + for (int i = 0; i < subcnt; i++) { setSridRecurse(geom.getGeometryN(i), srid); } - } else if (geom instanceof Polygon) - { + } else if (geom instanceof Polygon) { Polygon poly = (Polygon) geom; poly.getExteriorRing().setSRID(srid); final int subcnt = poly.getNumInteriorRing(); - for (int i = 0; i < subcnt; i++) - { + for (int i = 0; i < subcnt; i++) { poly.getInteriorRingN(i).setSRID(srid); } } } - public Geometry getGeometry() - { + public Geometry getGeometry() { return geom; } - public String toString() - { + public String toString() { return geom.toString(); } - public String getValue() - { + public String getValue() { return bw.writeHexed(getGeometry()); } - public Object clone() - { + public Object clone() { JtsGeometry obj = new JtsGeometry(geom); obj.setType(type); return obj; } - public boolean equals(Object obj) - { - if ((obj != null) && (obj instanceof JtsGeometry)) - { + public boolean equals(Object obj) { + if ((obj != null) && (obj instanceof JtsGeometry)) { Geometry other = ((JtsGeometry) obj).geom; - if (this.geom == other) - { // handles identity as well as both + if (this.geom == other) { // handles identity as well as both // ==null return true; - } else if (this.geom != null && other != null) - { + } else if (this.geom != null && other != null) { return other.equals(this.geom); } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsGisWrapper.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsGisWrapper.java index 1af43b4..92809a0 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsGisWrapper.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsGisWrapper.java @@ -27,7 +27,9 @@ import java.sql.Connection; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.util.Properties; +import java.util.logging.Logger; import org.postgresql.Driver; import org.postgresql.PGConnection; @@ -45,26 +47,21 @@ * * @author markus.schaber@logix-tt.com */ -public class JtsGisWrapper extends Driver -{ +public class JtsGisWrapper extends Driver { private static final String POSTGRES_PROTOCOL = "jdbc:postgresql:"; private static final String POSTGIS_PROTOCOL = "jdbc:postgresql_JTS:"; public static final String REVISION = "$Revision: 1977 $"; - public JtsGisWrapper() - { + public JtsGisWrapper() { super(); } - static - { - try - { + static { + try { // Analogy to org.postgresql.Driver java.sql.DriverManager.registerDriver(new JtsGisWrapper()); - } catch (SQLException e) - { + } catch (SQLException e) { e.printStackTrace(); } } @@ -80,8 +77,7 @@ * @see java.sql.Driver#connect * @see org.postgresql.Driver */ - public java.sql.Connection connect(String url, Properties info) throws SQLException - { + public java.sql.Connection connect(String url, Properties info) throws SQLException { url = mangleURL(url); Connection result = super.connect(url, info); addGISTypes((PGConnection) result); @@ -94,8 +90,7 @@ * @param pgconn * @throws SQLException */ - public static void addGISTypes(PGConnection pgconn) throws SQLException - { + public static void addGISTypes(PGConnection pgconn) throws SQLException { pgconn.addDataType("geometry", JtsGeometry.class); pgconn.addDataType("box3d", org.postgis.PGbox3d.class); pgconn.addDataType("box2d", org.postgis.PGbox2d.class); @@ -103,17 +98,15 @@ /** * Mangles the PostGIS URL to return the original PostGreSQL URL + * * @param url url * @return string * @throws java.sql.SQLException error */ - public static String mangleURL(String url) throws SQLException - { - if (url.startsWith(POSTGIS_PROTOCOL)) - { + public static String mangleURL(String url) throws SQLException { + if (url.startsWith(POSTGIS_PROTOCOL)) { return POSTGRES_PROTOCOL + url.substring(POSTGIS_PROTOCOL.length()); - } else - { + } else { throw new SQLException("Unknown protocol or subprotocol in url " + url); } } @@ -130,13 +123,10 @@ * it would *shrug*) * @see java.sql.Driver#acceptsURL */ - public boolean acceptsURL(String url) throws SQLException - { - try - { + public boolean acceptsURL(String url) throws SQLException { + try { url = mangleURL(url); - } catch (SQLException e) - { + } catch (SQLException e) { return false; } return super.acceptsURL(url); @@ -148,8 +138,7 @@ * @return the drivers major version number */ - public int getMajorVersion() - { + public int getMajorVersion() { return super.getMajorVersion(); } @@ -158,16 +147,18 @@ * * @return the drivers minor version number */ - public int getMinorVersion() - { + public int getMinorVersion() { return super.getMinorVersion(); } /** * Returns our own CVS version plus postgres Version */ - public static String getVersion() - { + public static String getVersion() { return "JtsGisWrapper " + REVISION + ", wrapping " + Driver.getVersion(); } + + public Logger getParentLogger() throws SQLFeatureNotSupportedException { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsWrapper.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsWrapper.java index b87f551..6720216 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsWrapper.java +++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/postjts/JtsWrapper.java @@ -27,6 +27,7 @@ import java.sql.Connection; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.util.Properties; import java.util.logging.Level; import java.util.logging.Logger; @@ -54,8 +55,7 @@ * * @author markus.schaber@logix-tt.com */ -public class JtsWrapper extends Driver -{ +public class JtsWrapper extends Driver { protected static final Logger logger = Logger.getLogger("org.postgis.DriverWrapper"); @@ -63,19 +63,15 @@ private static final String POSTGIS_PROTOCOL = "jdbc:postgres_jts:"; public static final String REVISION = "$Revision: 2570 $"; - public JtsWrapper() - { + public JtsWrapper() { super(); } - static - { - try - { + static { + try { // Try to register ourself to the DriverManager java.sql.DriverManager.registerDriver(new JtsWrapper()); - } catch (SQLException e) - { + } catch (SQLException e) { logger.log(Level.WARNING, "Error registering PostgreSQL Jts Wrapper Driver", e); } } @@ -91,8 +87,7 @@ * @see java.sql.Driver#connect * @see org.postgresql.Driver */ - public java.sql.Connection connect(String url, Properties info) throws SQLException - { + public java.sql.Connection connect(String url, Properties info) throws SQLException { url = mangleURL(url); Connection result = super.connect(url, info); addGISTypes((PGConnection) result); @@ -102,27 +97,24 @@ /** * adds the JTS/PostGIS Data types to a PG Connection. * - * @param pgconn postgres connection + * @param pgconn postgres connection * @throws SQLException error */ - public static void addGISTypes(PGConnection pgconn) throws SQLException - { + public static void addGISTypes(PGConnection pgconn) throws SQLException { pgconn.addDataType("geometry", JtsGeometry.class); } /** * Mangles the PostGIS URL to return the original PostGreSQL URL + * * @param url url * @return string * @throws java.sql.SQLException erroe */ - public static String mangleURL(String url) throws SQLException - { - if (url.startsWith(POSTGIS_PROTOCOL)) - { + public static String mangleURL(String url) throws SQLException { + if (url.startsWith(POSTGIS_PROTOCOL)) { return POSTGRES_PROTOCOL + url.substring(POSTGIS_PROTOCOL.length()); - } else - { + } else { throw new SQLException("Unknown protocol or subprotocol in url " + url); } } @@ -136,13 +128,10 @@ * driver, should not happen. * @see java.sql.Driver#acceptsURL */ - public boolean acceptsURL(String url) throws SQLException - { - try - { + public boolean acceptsURL(String url) throws SQLException { + try { url = mangleURL(url); - } catch (SQLException e) - { + } catch (SQLException e) { return false; } return super.acceptsURL(url); @@ -154,8 +143,7 @@ * @return the drivers major version number */ - public int getMajorVersion() - { + public int getMajorVersion() { return super.getMajorVersion(); } @@ -164,17 +152,20 @@ * * @return the drivers minor version number */ - public int getMinorVersion() - { + public int getMinorVersion() { return super.getMinorVersion(); } /** * Returns our own CVS version plus postgres Version + * * @return version */ - public static String getVersion() - { + public static String getVersion() { return "JtsGisWrapper " + REVISION + ", wrapping " + Driver.getVersion(); } + + public Logger getParentLogger() throws SQLFeatureNotSupportedException { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/ElementDispatcherRules.xml b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/ElementDispatcherRules.xml index 6719421..72c6ad4 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/ElementDispatcherRules.xml +++ b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/ElementDispatcherRules.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding="big5"?> -<!DOCTYPE digester-rules PUBLIC "-//Jakarta Apache //DTD digester-rules XML V1.0//EN" "digester-rules.dtd"> +<!DOCTYPE digester-rules PUBLIC "-//Apache Commons //DTD digester-rules XML V1.0//EN" "digester-rules-3.0.dtd"> <digester-rules> <pattern value="ElementDispatcherRules"> <object-create-rule classname="com.ximple.eofms.filter.ElementDispatcher"/> diff --git a/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/FeatureClassificationRules.xml b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/FeatureClassificationRules.xml index e925ce6..ea1e91b 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/FeatureClassificationRules.xml +++ b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/FeatureClassificationRules.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding="big5"?> -<!DOCTYPE digester-rules PUBLIC "-//Jakarta Apache //DTD digester-rules XML V1.0//EN" "digester-rules.dtd"> +<!DOCTYPE digester-rules PUBLIC "-//Apache Commons //DTD digester-rules XML V1.0//EN" "http://commons.apache.org/digester/dtds/digester-rules-3.0.dtd"> <digester-rules> <pattern value="FeatureClassificationRules"> <object-create-rule classname="com.ximple.eofms.collector.FeatureClassification"/> diff --git a/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/digester-rules-3.0.dtd b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/digester-rules-3.0.dtd new file mode 100644 index 0000000..34668aa --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/digester-rules-3.0.dtd @@ -0,0 +1,244 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<!-- $Id: digester-rules-3.0.dtd 1209995 2011-12-03 20:23:25Z simonetripodi $ + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- + "Digester" component of the Commons Subproject + DTD for the definition of Digester rules in XML. + $Id: digester-rules-3.0.dtd 1209995 2011-12-03 20:23:25Z simonetripodi $ + + Applications wishing to reference this DTD in their own documents + should use the following DOCTYPE declaration: + + <!DOCTYPE digester-rules PUBLIC + "-//Apache Commons //DTD digester-rules XML V1.0//EN" + "http://commons.apache.org/digester/dtds/digester-rules-3.0.dtd"> + +--> + +<!-- This document type defines an XML format for defining Digester rules. + Digester is a framework for pattern-matching-based parsing of XML into + Java objects. See http://commons.apache.org/digester/. --> + +<!ENTITY % rule-elements "bean-property-setter-rule | call-method-rule | + call-param-rule | object-param-rule | node-create-rule | + factory-create-rule | object-create-rule | + set-properties-rule | set-nested-properties-rule | + set-property-rule | set-top-rule | + set-next-rule | set-root-rule" > + +<!-- digester-rules is the root element. --> +<!ELEMENT digester-rules (pattern | include | %rule-elements; )*> +<!ATTLIST digester-rules + namespaceURI CDATA #IMPLIED> + +<!-- <pattern> defines a matching pattern, or part of a matching pattern. Any + rule nested in a pattern element prepends its parent's to its pattern. + Patterns may be recursively nested. + Example: + <pattern value="foo"> + <pattern value="bar"> + <object-create-rule pattern="baz" classname="Fubar" /> + </pattern> + </pattern> + + The above sample fragment defines an ObjectCreateRule associated + with the pattern "foo/bar/baz". + + Note that the use of pattern elements is optional; an alternative is for + each rule element to contain a 'pattern' attribute. --> +<!ELEMENT pattern (pattern | include | %rule-elements; )*> +<!ATTLIST pattern + value CDATA #REQUIRED> + + +<!-- + <include> allows one set of digester rules to be included inside + another. The 'path' attribute contains the URI of the document to + include. Inclusion behaves as if the included rules document is + 'macro-expanded' within the outer document. + Programmatically initialized rules can be included as well, via the + 'class' attribute. The 'class' attribute should contain the name + of a class that implements + org.apache.commons.digester.xmlrules.DigesterRulesSource. +--> +<!ELEMENT include EMPTY> +<!ATTLIST include + url CDATA #IMPLIED + class CDATA #IMPLIED> + + +<!-- Each 'rule' element below corresponds to a concrete subclass + of org.apache.framework.digester.Rule. + Each 'rule' element has an optional 'pattern' attribute, which + defines the pattern for that rule instance. If the rule element + is nested inside one or more <pattern> elements, those patterns + will be prepended to the pattern specified in the rule's 'pattern' + attribute. --> + +<!-- Bean Property Setter Rule --> +<!ELEMENT bean-property-setter-rule EMPTY> +<!ATTLIST bean-property-setter-rule + pattern CDATA #IMPLIED + propertyname CDATA #IMPLIED + propertynameFromAttribute CDATA #IMPLIED> + +<!-- CallMethodRule + - + - Note that paramtypes is ignored unless paramcount is defined. + --> +<!ELEMENT call-method-rule EMPTY> +<!ATTLIST call-method-rule + pattern CDATA #IMPLIED + targetoffset CDATA #IMPLIED + methodname CDATA #REQUIRED + paramcount CDATA #IMPLIED + paramtypes CDATA #IMPLIED + usingElementBodyAsArgument CDATA #IMPLIED + useExactMatch CDATA #IMPLIED> + +<!-- + CallParamRule + attrname + - set param from attribute value (cannot be combined with from-stack or + stack-index) + from-stack + - select an object from the current digester stack to pass as the + parameter value. + stack-index + - select an object from the current digester stack to pass as a + parameter value. If this is defined then from-stack is implicitly + true. If from-stack is defined but this is not defined then this + has an implicit value of zero, ie the top object on the stack is + passed as the parameter. + --> +<!ELEMENT call-param-rule EMPTY> +<!ATTLIST call-param-rule + pattern CDATA #IMPLIED + paramnumber CDATA #REQUIRED + attrname CDATA #IMPLIED + from-stack CDATA #IMPLIED + stack-index CDATA #IMPLIED> + +<!-- + ObjectParamRule + attrname + - Optional. This attribute is not normally specified. If it is provided, + then this rule is executed *only* if the matched element has an attribute + with this name. + type + - The type of the object to be passed to the target method. + Mandatory. + value + - Initial value for the object. The BeanUtils converter module will + be used to convert this to the type specified by the type attribute. + Optional; if no value is provided then the converter will be invoked + to convert NULL to the target type. For most (but not all) converters, + NULL input results in NULL output. + --> +<!ELEMENT object-param-rule EMPTY> +<!ATTLIST object-param-rule + pattern CDATA #IMPLIED + paramnumber CDATA #REQUIRED + attrname CDATA #IMPLIED + type CDATA #REQUIRED + value CDATA #IMPLIED> + +<!-- + NodeCreateRule + type + - node type: either 'element' or 'fragment'. this is optional, default is 'element' + --> +<!ELEMENT node-create-rule EMPTY> +<!ATTLIST node-create-rule + pattern CDATA #IMPLIED + type CDATA #IMPLIED> + +<!-- + FactoryCreateRule + + ignore-exceptions - if this attribute is (ignore case) 'true' then any exceptions + thrown by the object create rule will be ignore. + This will allow processing to continue. + --> +<!ELEMENT factory-create-rule EMPTY> +<!ATTLIST factory-create-rule + pattern CDATA #IMPLIED + classname CDATA #REQUIRED + attrname CDATA #IMPLIED + ignore-exceptions CDATA #IMPLIED> + +<!-- ObjectCreateRule --> +<!ELEMENT object-create-rule EMPTY> +<!ATTLIST object-create-rule + pattern CDATA #IMPLIED + classname CDATA #REQUIRED + attrname CDATA #IMPLIED + paramtypes CDATA #IMPLIED> + +<!-- SetPropertiesRule --> +<!ELEMENT set-properties-rule (alias)*> +<!ATTLIST set-properties-rule + pattern CDATA #IMPLIED> + +<!-- SetNestedPropertiesRule --> +<!ELEMENT set-nested-properties-rule (alias)*> +<!ATTLIST set-nested-properties-rule + pattern CDATA #IMPLIED + allow-unknown-child-elements CDATA #IMPLIED> + +<!-- An alias is a custom attribute->property name mapping --> +<!ELEMENT alias EMPTY> +<!ATTLIST alias + attr-name CDATA #REQUIRED + prop-name CDATA #IMPLIED> + +<!-- SetPropertyRule --> +<!ELEMENT set-property-rule EMPTY> +<!ATTLIST set-property-rule + pattern CDATA #IMPLIED + name CDATA #IMPLIED + value CDATA #IMPLIED> + +<!-- SetTopRule --> +<!ELEMENT set-top-rule EMPTY> +<!ATTLIST set-top-rule + pattern CDATA #IMPLIED + methodname CDATA #REQUIRED + paramtype CDATA #IMPLIED + exactMatch CDATA #IMPLIED + fireOnBegin CDATA #IMPLIED> + +<!-- SetNextRule --> +<!ELEMENT set-next-rule EMPTY> +<!ATTLIST set-next-rule + pattern CDATA #IMPLIED + methodname CDATA #REQUIRED + paramtype CDATA #IMPLIED + exactMatch CDATA #IMPLIED + fireOnBegin CDATA #IMPLIED> + +<!-- SetRootRule --> +<!ELEMENT set-root-rule EMPTY> +<!ATTLIST set-root-rule + pattern CDATA #IMPLIED + methodname CDATA #REQUIRED + paramtype CDATA #IMPLIED + exactMatch CDATA #IMPLIED + fireOnBegin CDATA #IMPLIED> diff --git a/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/DefaultXGeosDataConfigRules.xml b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/DefaultXGeosDataConfigRules.xml new file mode 100644 index 0000000..3674334 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/DefaultXGeosDataConfigRules.xml @@ -0,0 +1,19 @@ +<?xml version='1.0' encoding="big5"?> +<!DOCTYPE digester-rules PUBLIC "-//Apache Commons //DTD digester-rules XML V1.0//EN" "digester-rules-3.0.dtd"> +<digester-rules> + <pattern value="dataroot"> + <object-create-rule classname="com.ximple.eofms.geoserver.config.XGeosDataConfigMapping"/> + <set-properties-rule/> + <pattern value="XGeosDataConfig"> + <object-create-rule classname="com.ximple.eofms.geoserver.config.XGeosDataConfig"/> + <set-next-rule methodname="addConfig" paramtype="com.ximple.eofms.geoserver.config.XGeosDataConfig"/> + <set-properties-rule/> + <bean-property-setter-rule pattern="PG"/> + <bean-property-setter-rule pattern="FSC"/> + <bean-property-setter-rule pattern="COMP"/> + <bean-property-setter-rule pattern="LEV"/> + <bean-property-setter-rule pattern="WEIGHT"/> + <bean-property-setter-rule pattern="FTYPE"/> + </pattern> + </pattern> +</digester-rules> \ No newline at end of file diff --git a/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/digester-rules-3.0.dtd b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/digester-rules-3.0.dtd new file mode 100644 index 0000000..34668aa --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/digester-rules-3.0.dtd @@ -0,0 +1,244 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<!-- $Id: digester-rules-3.0.dtd 1209995 2011-12-03 20:23:25Z simonetripodi $ + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- + "Digester" component of the Commons Subproject + DTD for the definition of Digester rules in XML. + $Id: digester-rules-3.0.dtd 1209995 2011-12-03 20:23:25Z simonetripodi $ + + Applications wishing to reference this DTD in their own documents + should use the following DOCTYPE declaration: + + <!DOCTYPE digester-rules PUBLIC + "-//Apache Commons //DTD digester-rules XML V1.0//EN" + "http://commons.apache.org/digester/dtds/digester-rules-3.0.dtd"> + +--> + +<!-- This document type defines an XML format for defining Digester rules. + Digester is a framework for pattern-matching-based parsing of XML into + Java objects. See http://commons.apache.org/digester/. --> + +<!ENTITY % rule-elements "bean-property-setter-rule | call-method-rule | + call-param-rule | object-param-rule | node-create-rule | + factory-create-rule | object-create-rule | + set-properties-rule | set-nested-properties-rule | + set-property-rule | set-top-rule | + set-next-rule | set-root-rule" > + +<!-- digester-rules is the root element. --> +<!ELEMENT digester-rules (pattern | include | %rule-elements; )*> +<!ATTLIST digester-rules + namespaceURI CDATA #IMPLIED> + +<!-- <pattern> defines a matching pattern, or part of a matching pattern. Any + rule nested in a pattern element prepends its parent's to its pattern. + Patterns may be recursively nested. + Example: + <pattern value="foo"> + <pattern value="bar"> + <object-create-rule pattern="baz" classname="Fubar" /> + </pattern> + </pattern> + + The above sample fragment defines an ObjectCreateRule associated + with the pattern "foo/bar/baz". + + Note that the use of pattern elements is optional; an alternative is for + each rule element to contain a 'pattern' attribute. --> +<!ELEMENT pattern (pattern | include | %rule-elements; )*> +<!ATTLIST pattern + value CDATA #REQUIRED> + + +<!-- + <include> allows one set of digester rules to be included inside + another. The 'path' attribute contains the URI of the document to + include. Inclusion behaves as if the included rules document is + 'macro-expanded' within the outer document. + Programmatically initialized rules can be included as well, via the + 'class' attribute. The 'class' attribute should contain the name + of a class that implements + org.apache.commons.digester.xmlrules.DigesterRulesSource. +--> +<!ELEMENT include EMPTY> +<!ATTLIST include + url CDATA #IMPLIED + class CDATA #IMPLIED> + + +<!-- Each 'rule' element below corresponds to a concrete subclass + of org.apache.framework.digester.Rule. + Each 'rule' element has an optional 'pattern' attribute, which + defines the pattern for that rule instance. If the rule element + is nested inside one or more <pattern> elements, those patterns + will be prepended to the pattern specified in the rule's 'pattern' + attribute. --> + +<!-- Bean Property Setter Rule --> +<!ELEMENT bean-property-setter-rule EMPTY> +<!ATTLIST bean-property-setter-rule + pattern CDATA #IMPLIED + propertyname CDATA #IMPLIED + propertynameFromAttribute CDATA #IMPLIED> + +<!-- CallMethodRule + - + - Note that paramtypes is ignored unless paramcount is defined. + --> +<!ELEMENT call-method-rule EMPTY> +<!ATTLIST call-method-rule + pattern CDATA #IMPLIED + targetoffset CDATA #IMPLIED + methodname CDATA #REQUIRED + paramcount CDATA #IMPLIED + paramtypes CDATA #IMPLIED + usingElementBodyAsArgument CDATA #IMPLIED + useExactMatch CDATA #IMPLIED> + +<!-- + CallParamRule + attrname + - set param from attribute value (cannot be combined with from-stack or + stack-index) + from-stack + - select an object from the current digester stack to pass as the + parameter value. + stack-index + - select an object from the current digester stack to pass as a + parameter value. If this is defined then from-stack is implicitly + true. If from-stack is defined but this is not defined then this + has an implicit value of zero, ie the top object on the stack is + passed as the parameter. + --> +<!ELEMENT call-param-rule EMPTY> +<!ATTLIST call-param-rule + pattern CDATA #IMPLIED + paramnumber CDATA #REQUIRED + attrname CDATA #IMPLIED + from-stack CDATA #IMPLIED + stack-index CDATA #IMPLIED> + +<!-- + ObjectParamRule + attrname + - Optional. This attribute is not normally specified. If it is provided, + then this rule is executed *only* if the matched element has an attribute + with this name. + type + - The type of the object to be passed to the target method. + Mandatory. + value + - Initial value for the object. The BeanUtils converter module will + be used to convert this to the type specified by the type attribute. + Optional; if no value is provided then the converter will be invoked + to convert NULL to the target type. For most (but not all) converters, + NULL input results in NULL output. + --> +<!ELEMENT object-param-rule EMPTY> +<!ATTLIST object-param-rule + pattern CDATA #IMPLIED + paramnumber CDATA #REQUIRED + attrname CDATA #IMPLIED + type CDATA #REQUIRED + value CDATA #IMPLIED> + +<!-- + NodeCreateRule + type + - node type: either 'element' or 'fragment'. this is optional, default is 'element' + --> +<!ELEMENT node-create-rule EMPTY> +<!ATTLIST node-create-rule + pattern CDATA #IMPLIED + type CDATA #IMPLIED> + +<!-- + FactoryCreateRule + + ignore-exceptions - if this attribute is (ignore case) 'true' then any exceptions + thrown by the object create rule will be ignore. + This will allow processing to continue. + --> +<!ELEMENT factory-create-rule EMPTY> +<!ATTLIST factory-create-rule + pattern CDATA #IMPLIED + classname CDATA #REQUIRED + attrname CDATA #IMPLIED + ignore-exceptions CDATA #IMPLIED> + +<!-- ObjectCreateRule --> +<!ELEMENT object-create-rule EMPTY> +<!ATTLIST object-create-rule + pattern CDATA #IMPLIED + classname CDATA #REQUIRED + attrname CDATA #IMPLIED + paramtypes CDATA #IMPLIED> + +<!-- SetPropertiesRule --> +<!ELEMENT set-properties-rule (alias)*> +<!ATTLIST set-properties-rule + pattern CDATA #IMPLIED> + +<!-- SetNestedPropertiesRule --> +<!ELEMENT set-nested-properties-rule (alias)*> +<!ATTLIST set-nested-properties-rule + pattern CDATA #IMPLIED + allow-unknown-child-elements CDATA #IMPLIED> + +<!-- An alias is a custom attribute->property name mapping --> +<!ELEMENT alias EMPTY> +<!ATTLIST alias + attr-name CDATA #REQUIRED + prop-name CDATA #IMPLIED> + +<!-- SetPropertyRule --> +<!ELEMENT set-property-rule EMPTY> +<!ATTLIST set-property-rule + pattern CDATA #IMPLIED + name CDATA #IMPLIED + value CDATA #IMPLIED> + +<!-- SetTopRule --> +<!ELEMENT set-top-rule EMPTY> +<!ATTLIST set-top-rule + pattern CDATA #IMPLIED + methodname CDATA #REQUIRED + paramtype CDATA #IMPLIED + exactMatch CDATA #IMPLIED + fireOnBegin CDATA #IMPLIED> + +<!-- SetNextRule --> +<!ELEMENT set-next-rule EMPTY> +<!ATTLIST set-next-rule + pattern CDATA #IMPLIED + methodname CDATA #REQUIRED + paramtype CDATA #IMPLIED + exactMatch CDATA #IMPLIED + fireOnBegin CDATA #IMPLIED> + +<!-- SetRootRule --> +<!ELEMENT set-root-rule EMPTY> +<!ATTLIST set-root-rule + pattern CDATA #IMPLIED + methodname CDATA #REQUIRED + paramtype CDATA #IMPLIED + exactMatch CDATA #IMPLIED + fireOnBegin CDATA #IMPLIED> diff --git a/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/xgeosdataconfig-1.xml b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/xgeosdataconfig-1.xml new file mode 100644 index 0000000..676c1e9 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/xgeosdataconfig-1.xml @@ -0,0 +1,11546 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dataroot> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>100</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>54</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>44</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>3</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>49</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>61</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <FTYPE>xtpc-symbol_circle</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>54</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>44</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>113</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>49</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>61</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>52</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>52</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>52</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>52</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>2</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>17</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>17</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>100</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>2</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>2</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>2</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>54</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>44</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>57</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>49</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>61</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol_circle</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>17</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>57</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol_circle</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>409</FSC> + <COMP>10</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>17</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>100</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>55</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>56</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>53</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>53</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>53</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>53</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>53</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>55</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>113</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>113</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>48</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol_circle</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol_circle</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>54</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>54</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>54</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>54</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>2</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>18</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>8</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>100</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>3</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>3</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>4</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>4</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>55</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>58</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol_circle</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>8</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>18</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>58</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol_circle</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>18</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>311</FSC> + <COMP>1</COMP> + <LEV>45</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>311</FSC> + <COMP>1</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>311</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>300</FSC> + <COMP>3</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>300</FSC> + <COMP>2</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>300</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>319</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>320</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>323</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>324</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>324</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>403</FSC> + <COMP>6</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>403</FSC> + <COMP>7</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>0</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>202</FSC> + <COMP>1</COMP> + <LEV>35</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>202</FSC> + <COMP>0</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>206</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>206</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>206</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>207</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>207</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>209</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>216</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>216</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>216</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dottedLine</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>3</COMP> + <LEV>4</LEV> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>2</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>3</COMP> + <LEV>11</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>5</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>2</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>5</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>18</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>18</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>17</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>17</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>8</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>418</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>418</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>418</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>420</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>420</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>3</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>421</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>3</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>421</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>4</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>2</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>4</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>3</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>2</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>4</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>3</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>2</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>3</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>1</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>424</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>424</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>424</FSC> + <COMP>1</COMP> + <LEV>5</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>424</FSC> + <COMP>1</COMP> + <LEV>5</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>401</FSC> + <COMP>5</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>401</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>401</FSC> + <COMP>2</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>401</FSC> + <COMP>3</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>401</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>8</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>17</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>17</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>18</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>18</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>418</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>420</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>3</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>420</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>421</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>421</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>423</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>423</FSC> + <COMP>2</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>423</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>423</FSC> + <COMP>4</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>423</FSC> + <COMP>3</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>424</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>424</FSC> + <COMP>1</COMP> + <LEV>5</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>48</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>56</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>5</COMP> + <LEV>50</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>4</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>57</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>2</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>3</COMP> + <LEV>50</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>7</COMP> + <LEV>58</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>200</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>200</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>202</FSC> + <COMP>1</COMP> + <LEV>36</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>202</FSC> + <COMP>0</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>204</FSC> + <COMP>0</COMP> + <LEV>49</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>205</FSC> + <COMP>2</COMP> + <LEV>41</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>205</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dottedLine</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>206</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>206</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>206</FSC> + <COMP>2</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>207</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>207</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>208</FSC> + <COMP>0</COMP> + <LEV>44</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>209</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>211</FSC> + <COMP>0</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dottedLine</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>211</FSC> + <COMP>2</COMP> + <LEV>34</LEV> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>211</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>212</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>212</FSC> + <COMP>0</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>216</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>216</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>216</FSC> + <COMP>2</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>303</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>305</FSC> + <COMP>0</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>306</FSC> + <COMP>0</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>308</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>314</FSC> + <COMP>1</COMP> + <LEV>28</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>314</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>315</FSC> + <COMP>1</COMP> + <LEV>28</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>315</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>316</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>317</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>317</FSC> + <COMP>0</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>318</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>4</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>202</FSC> + <COMP>1</COMP> + <LEV>35</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>202</FSC> + <COMP>0</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>206</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>206</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>206</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>207</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>207</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>209</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>216</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>216</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>216</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>401</FSC> + <COMP>5</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>401</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>401</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dottedLine</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>401</FSC> + <COMP>2</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>401</FSC> + <COMP>3</COMP> + <LEV>11</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>18</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>18</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>8</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>17</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>17</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>418</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>418</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>420</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>420</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>3</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>421</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>421</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>3</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>3</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>2</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>4</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>2</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>4</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>424</FSC> + <COMP>1</COMP> + <LEV>5</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>8</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>8</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>5</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>8</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>3</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>7</COMP> + <LEV>55</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>4</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>200</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>200</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>201</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>201</FSC> + <COMP>0</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dottedLine</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>202</FSC> + <COMP>1</COMP> + <LEV>35</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>202</FSC> + <COMP>0</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>206</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>206</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>206</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>207</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>207</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>208</FSC> + <COMP>0</COMP> + <LEV>43</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>209</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>210</FSC> + <COMP>3</COMP> + <LEV>42</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>210</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dottedLine</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>210</FSC> + <COMP>4</COMP> + <LEV>42</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>213</FSC> + <COMP>0</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dottedLine</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>213</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>215</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>216</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>216</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>216</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>217</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>217</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>301</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>301</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>301</FSC> + <COMP>3</COMP> + <LEV>23</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>301</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>302</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>302</FSC> + <COMP>1</COMP> + <LEV>27</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>303</FSC> + <COMP>1</COMP> + <LEV>43</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>303</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>303</FSC> + <COMP>3</COMP> + <LEV>43</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>305</FSC> + <COMP>0</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>306</FSC> + <COMP>0</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>308</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>316</FSC> + <COMP>0</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>317</FSC> + <COMP>0</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>317</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>318</FSC> + <COMP>0</COMP> + <LEV>53</LEV> + <WEIGHT>4</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>2</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>100</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>100</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>3</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>7</COMP> + <LEV>58</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>3</COMP> + <LEV>50</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>3</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>2</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>7</COMP> + <LEV>55</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>57</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>4</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>5</COMP> + <LEV>50</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>56</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>49</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol_circle</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol_circle</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol_circle</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol_circle</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>53</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>53</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>53</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>53</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>200</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>200</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>202</FSC> + <COMP>0</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>202</FSC> + <COMP>1</COMP> + <LEV>36</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>205</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dottedLine</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>205</FSC> + <COMP>2</COMP> + <LEV>41</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>206</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>206</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>206</FSC> + <COMP>2</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>207</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>207</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>208</FSC> + <COMP>0</COMP> + <LEV>44</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>209</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>211</FSC> + <COMP>0</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dottedLine</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>211</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>211</FSC> + <COMP>2</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>212</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>212</FSC> + <COMP>0</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>216</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>216</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>216</FSC> + <COMP>2</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>303</FSC> + <COMP>1</COMP> + <LEV>43</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>303</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>303</FSC> + <COMP>3</COMP> + <LEV>43</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>305</FSC> + <COMP>0</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>306</FSC> + <COMP>0</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>308</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>314</FSC> + <COMP>1</COMP> + <LEV>28</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>314</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>315</FSC> + <COMP>1</COMP> + <LEV>28</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>315</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>316</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>317</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>317</FSC> + <COMP>0</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>318</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>4</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>54</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>44</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>55</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>3</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>56</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>48</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>49</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>61</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol_circle</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol_circle</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>18</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>18</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>17</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>17</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>8</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>7</COMP> + <LEV>58</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>3</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>3</COMP> + <LEV>50</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>2</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>7</COMP> + <LEV>55</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>301</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>301</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>301</FSC> + <COMP>3</COMP> + <LEV>23</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>302</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>302</FSC> + <COMP>1</COMP> + <LEV>27</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>303</FSC> + <COMP>3</COMP> + <LEV>43</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>303</FSC> + <COMP>1</COMP> + <LEV>43</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>303</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>305</FSC> + <COMP>0</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>305</FSC> + <COMP>0</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>306</FSC> + <COMP>0</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>306</FSC> + <COMP>0</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>308</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>308</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>314</FSC> + <COMP>1</COMP> + <LEV>28</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>314</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>315</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>315</FSC> + <COMP>1</COMP> + <LEV>28</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>316</FSC> + <COMP>0</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>316</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>317</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>317</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>317</FSC> + <COMP>0</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>317</FSC> + <COMP>0</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>318</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>4</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>318</FSC> + <COMP>0</COMP> + <LEV>53</LEV> + <WEIGHT>4</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>403</FSC> + <COMP>4</COMP> + <LEV>44</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>403</FSC> + <COMP>5</COMP> + <LEV>44</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> +</dataroot> diff --git a/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/xgeosdataconfig.xml b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/xgeosdataconfig.xml new file mode 100755 index 0000000..c5d7b90 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/xgeosdataconfig.xml @@ -0,0 +1,16563 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dataroot> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>100</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>3</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>3</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>44</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>54</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>3</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>49</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>118</FSC> + <COMP>1</COMP> + <LEV>59</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>118</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>118</FSC> + <COMP>2</COMP> + <LEV>40</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>118</FSC> + <COMP>2</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>118</FSC> + <COMP>3</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>61</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>5</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>5</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>5</COMP> + <LEV>53</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>140</FSC> + <COMP>5</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVOH</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>44</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>54</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>113</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>49</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>118</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>118</FSC> + <COMP>1</COMP> + <LEV>59</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>118</FSC> + <COMP>2</COMP> + <LEV>40</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>118</FSC> + <COMP>2</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>118</FSC> + <COMP>3</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>61</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>52</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>52</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>52</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>52</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>5</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>140</FSC> + <COMP>5</COMP> + <LEV>52</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>150</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>150</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>150</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>150</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>150</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>150</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>150</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>150</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>2</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>403</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>17</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>17</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>417</FSC> + <COMP>2</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>417</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>417</FSC> + <COMP>3</COMP> + <LEV>15</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>417</FSC> + <COMP>3</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>418</FSC> + <COMP>2</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>418</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>418</FSC> + <COMP>3</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>418</FSC> + <COMP>3</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>419</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>419</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>419</FSC> + <COMP>2</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>419</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>419</FSC> + <COMP>3</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>419</FSC> + <COMP>3</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>503</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVHVUG</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>100</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>2</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>2</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>3</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>3</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>2</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>2</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>44</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>54</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>57</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>49</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>118</FSC> + <COMP>1</COMP> + <LEV>59</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>118</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>118</FSC> + <COMP>2</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>118</FSC> + <COMP>2</COMP> + <LEV>40</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>118</FSC> + <COMP>3</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>118</FSC> + <COMP>3</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>61</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>151</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>17</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVMAINHV</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>3</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>3</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>57</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>151</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>17</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg11KVSUBHV</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>100</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>55</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>56</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>118</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>53</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>53</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>53</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>53</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>53</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVOH</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>55</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>113</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>48</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>118</FSC> + <COMP>1</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>118</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>118</FSC> + <COMP>2</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>118</FSC> + <COMP>2</COMP> + <LEV>40</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>118</FSC> + <COMP>3</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>118</FSC> + <COMP>3</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>54</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>54</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>54</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>54</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>5</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>140</FSC> + <COMP>5</COMP> + <LEV>54</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>150</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>150</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>150</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>150</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>150</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>150</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>150</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>150</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>151</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>151</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>403</FSC> + <COMP>2</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>8</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>18</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>417</FSC> + <COMP>2</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>417</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>417</FSC> + <COMP>3</COMP> + <LEV>15</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>417</FSC> + <COMP>3</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>418</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>418</FSC> + <COMP>2</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>418</FSC> + <COMP>3</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>418</FSC> + <COMP>3</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>419</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>419</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>419</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>419</FSC> + <COMP>2</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>419</FSC> + <COMP>3</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>419</FSC> + <COMP>3</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>503</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVHVUG</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>100</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>4</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>3</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>3</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>3</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>3</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>4</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>4</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>3</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>55</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>58</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>16</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>16</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>93</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>115</FSC> + <COMP>93</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>118</FSC> + <COMP>1</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>118</FSC> + <COMP>2</COMP> + <LEV>40</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>118</FSC> + <COMP>3</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>151</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>8</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>18</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVMAINHV</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>104</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>105</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>3</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>3</COMP> + <LEV>4</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>3</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>4</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>110</FSC> + <COMP>1</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>110</FSC> + <COMP>1</COMP> + <LEV>28</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>110</FSC> + <COMP>1</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>110</FSC> + <COMP>2</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>110</FSC> + <COMP>2</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>58</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>16</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>16</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>93</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>115</FSC> + <COMP>93</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>58</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>151</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>151</FSC> + <COMP>6</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>18</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pg22KVSUBHV</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgAMI</PG> + <FSC>112</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>310</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>310</FSC> + <COMP>1</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>311</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>311</FSC> + <COMP>1</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>311</FSC> + <COMP>1</COMP> + <LEV>45</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>312</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>312</FSC> + <COMP>1</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>313</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>313</FSC> + <COMP>1</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgCLS</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>300</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>300</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>300</FSC> + <COMP>2</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>300</FSC> + <COMP>3</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>300</FSC> + <COMP>4</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>319</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>320</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>321</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>321</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>321</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>321</FSC> + <COMP>3</COMP> + <LEV>15</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>322</FSC> + <COMP>0</COMP> + <LEV>16</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>322</FSC> + <COMP>2</COMP> + <LEV>17</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>322</FSC> + <COMP>3</COMP> + <LEV>17</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>322</FSC> + <COMP>3</COMP> + <LEV>17</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>323</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>323</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>324</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>324</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>325</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>325</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>403</FSC> + <COMP>6</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>403</FSC> + <COMP>7</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>411</FSC> + <COMP>6</COMP> + <LEV>57</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgFIBER</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>0</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHICUSTOMER</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>202</FSC> + <COMP>0</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>202</FSC> + <COMP>0</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>202</FSC> + <COMP>1</COMP> + <LEV>35</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>202</FSC> + <COMP>1</COMP> + <LEV>36</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>206</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>206</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>206</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>207</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>207</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>209</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>216</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>216</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>216</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>218</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>218</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>218</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dotted-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>2</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>2</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>3</COMP> + <LEV>11</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>3</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>4</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>4</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>5</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>5</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>6</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>401</FSC> + <COMP>6</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>8</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>18</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>18</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>17</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>17</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>416</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>416</FSC> + <COMP>1</COMP> + <LEV>62</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>416</FSC> + <COMP>2</COMP> + <LEV>62</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>417</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>417</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>417</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>417</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>417</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>417</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>417</FSC> + <COMP>2</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>417</FSC> + <COMP>2</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>417</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>417</FSC> + <COMP>3</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>417</FSC> + <COMP>3</COMP> + <LEV>15</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>417</FSC> + <COMP>3</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>418</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>418</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>418</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>419</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>419</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>419</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>419</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>419</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>419</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>420</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>3</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>420</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>3</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>420</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>420</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>421</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>3</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>421</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>1</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>2</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>2</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>2</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>3</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>3</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>3</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>4</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>4</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>423</FSC> + <COMP>4</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>424</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>424</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>424</FSC> + <COMP>1</COMP> + <LEV>5</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>424</FSC> + <COMP>1</COMP> + <LEV>5</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>503</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHLVPIPE</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>401</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>401</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>401</FSC> + <COMP>2</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>401</FSC> + <COMP>3</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>401</FSC> + <COMP>4</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>401</FSC> + <COMP>5</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>401</FSC> + <COMP>6</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>20</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>20</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>8</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>18</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>18</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>17</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>17</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>417</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>417</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>417</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>417</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>418</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>418</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>419</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>419</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>419</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>419</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>420</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>3</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>420</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>421</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>421</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>423</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>423</FSC> + <COMP>1</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>423</FSC> + <COMP>2</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>423</FSC> + <COMP>3</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>423</FSC> + <COMP>4</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>424</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>424</FSC> + <COMP>1</COMP> + <LEV>5</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>503</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgHVPIPE</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>58</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>58</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>57</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>57</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>56</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>48</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLINEFEATURE</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>12</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>14</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>2</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>3</COMP> + <LEV>50</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>4</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>5</COMP> + <LEV>50</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>57</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>7</COMP> + <LEV>58</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>115</FSC> + <COMP>92</COMP> + <LEV>50</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>200</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>200</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>202</FSC> + <COMP>0</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>202</FSC> + <COMP>1</COMP> + <LEV>36</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>204</FSC> + <COMP>0</COMP> + <LEV>49</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>205</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dotted-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>205</FSC> + <COMP>1</COMP> + <LEV>41</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>205</FSC> + <COMP>2</COMP> + <LEV>41</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>206</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>206</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>206</FSC> + <COMP>2</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>207</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>207</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>208</FSC> + <COMP>0</COMP> + <LEV>44</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>209</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>211</FSC> + <COMP>0</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dotted_polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>211</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>211</FSC> + <COMP>2</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>212</FSC> + <COMP>0</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>212</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>212</FSC> + <COMP>2</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>214</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>214</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>216</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>216</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>216</FSC> + <COMP>2</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>218</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>218</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>218</FSC> + <COMP>2</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>303</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>304</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>304</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>305</FSC> + <COMP>0</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>306</FSC> + <COMP>0</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>308</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>309</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>314</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>314</FSC> + <COMP>1</COMP> + <LEV>28</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>314</FSC> + <COMP>2</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>315</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>315</FSC> + <COMP>1</COMP> + <LEV>28</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>315</FSC> + <COMP>2</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>316</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>317</FSC> + <COMP>0</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>317</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>318</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>4</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVOH</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>202</FSC> + <COMP>0</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>202</FSC> + <COMP>1</COMP> + <LEV>35</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>206</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>206</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>206</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>207</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>207</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>209</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>216</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>216</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>216</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>218</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>218</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>218</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>401</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dotted-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>401</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>401</FSC> + <COMP>2</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>401</FSC> + <COMP>3</COMP> + <LEV>11</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>401</FSC> + <COMP>4</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>401</FSC> + <COMP>5</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>401</FSC> + <COMP>6</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>405</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>405</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>8</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>18</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>18</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>17</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>3</COMP> + <LEV>17</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>416</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>416</FSC> + <COMP>1</COMP> + <LEV>62</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>416</FSC> + <COMP>2</COMP> + <LEV>62</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>417</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>417</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>417</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>417</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>418</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>418</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>418</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>419</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>419</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>419</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>419</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>420</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>3</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>420</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>421</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>3</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>421</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>2</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>2</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>3</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>3</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>4</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>423</FSC> + <COMP>4</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>424</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>424</FSC> + <COMP>1</COMP> + <LEV>5</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>503</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVPIPE</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>12</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>14</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>3</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>4</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>4</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>5</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>50</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>7</COMP> + <LEV>55</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>8</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>8</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>8</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>92</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>93</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>115</FSC> + <COMP>93</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>200</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>200</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>201</FSC> + <COMP>0</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dotted-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>201</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>201</FSC> + <COMP>2</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>201</FSC> + <COMP>3</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>202</FSC> + <COMP>0</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>202</FSC> + <COMP>1</COMP> + <LEV>35</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>206</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>206</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>206</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>207</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>207</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>208</FSC> + <COMP>0</COMP> + <LEV>43</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>209</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>210</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dotted-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>210</FSC> + <COMP>1</COMP> + <LEV>42</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>210</FSC> + <COMP>2</COMP> + <LEV>42</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>210</FSC> + <COMP>3</COMP> + <LEV>42</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>210</FSC> + <COMP>4</COMP> + <LEV>42</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>213</FSC> + <COMP>0</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dotted-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>213</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>213</FSC> + <COMP>2</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>214</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>214</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>215</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>216</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>216</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>216</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>217</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>217</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>218</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>218</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>218</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>301</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>301</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>301</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>301</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>301</FSC> + <COMP>3</COMP> + <LEV>23</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>301</FSC> + <COMP>4</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>302</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>302</FSC> + <COMP>1</COMP> + <LEV>27</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>303</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>303</FSC> + <COMP>1</COMP> + <LEV>43</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>303</FSC> + <COMP>2</COMP> + <LEV>43</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>303</FSC> + <COMP>3</COMP> + <LEV>43</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>303</FSC> + <COMP>4</COMP> + <LEV>43</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>304</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>304</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>305</FSC> + <COMP>0</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>306</FSC> + <COMP>0</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>308</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>309</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>316</FSC> + <COMP>0</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>317</FSC> + <COMP>0</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>317</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>318</FSC> + <COMP>0</COMP> + <LEV>53</LEV> + <WEIGHT>4</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>1</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>2</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>403</FSC> + <COMP>3</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>2</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>3</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>7</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>411</FSC> + <COMP>7</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>416</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>416</FSC> + <COMP>1</COMP> + <LEV>62</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>416</FSC> + <COMP>2</COMP> + <LEV>62</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>417</FSC> + <COMP>2</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>417</FSC> + <COMP>2</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>417</FSC> + <COMP>3</COMP> + <LEV>15</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>417</FSC> + <COMP>3</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>418</FSC> + <COMP>2</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>418</FSC> + <COMP>2</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>418</FSC> + <COMP>3</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>418</FSC> + <COMP>3</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>419</FSC> + <COMP>2</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>419</FSC> + <COMP>2</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>419</FSC> + <COMP>3</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>419</FSC> + <COMP>3</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgLVUG</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>100</FSC> + <COMP>0</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>100</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>103</FSC> + <COMP>0</COMP> + <LEV>59</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>1</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>2</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>3</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>3</COMP> + <LEV>1</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>3</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>3</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>4</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>3</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>110</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>110</FSC> + <COMP>1</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>110</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>110</FSC> + <COMP>2</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>110</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>110</FSC> + <COMP>2</COMP> + <LEV>28</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>110</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>1</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>12</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>14</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>2</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>3</COMP> + <LEV>50</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>3</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>4</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>5</COMP> + <LEV>50</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>6</COMP> + <LEV>57</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>7</COMP> + <LEV>58</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>7</COMP> + <LEV>55</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>56</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>46</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>92</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>115</FSC> + <COMP>92</COMP> + <LEV>50</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>15</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>49</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>53</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>53</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>1</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>53</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>53</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>3</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>53</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>4</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>5</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>5</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>5</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>140</FSC> + <COMP>5</COMP> + <LEV>53</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>151</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>151</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>200</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>200</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>202</FSC> + <COMP>0</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>202</FSC> + <COMP>1</COMP> + <LEV>36</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>205</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dotted-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>205</FSC> + <COMP>1</COMP> + <LEV>41</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>205</FSC> + <COMP>2</COMP> + <LEV>41</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>206</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>206</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>206</FSC> + <COMP>2</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>207</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>207</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>208</FSC> + <COMP>0</COMP> + <LEV>44</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>209</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>211</FSC> + <COMP>0</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-dotted-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>211</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>211</FSC> + <COMP>2</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>212</FSC> + <COMP>0</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>212</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>212</FSC> + <COMP>2</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>216</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>216</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>216</FSC> + <COMP>2</COMP> + <LEV>2</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>303</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>303</FSC> + <COMP>1</COMP> + <LEV>43</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>303</FSC> + <COMP>2</COMP> + <LEV>43</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>303</FSC> + <COMP>3</COMP> + <LEV>43</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>303</FSC> + <COMP>4</COMP> + <LEV>43</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>304</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>305</FSC> + <COMP>0</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>306</FSC> + <COMP>0</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>308</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>309</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>314</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>314</FSC> + <COMP>1</COMP> + <LEV>28</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>314</FSC> + <COMP>2</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>315</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>315</FSC> + <COMP>1</COMP> + <LEV>28</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>315</FSC> + <COMP>2</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>316</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>317</FSC> + <COMP>0</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>317</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>318</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>4</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>10</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>11</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>407</FSC> + <COMP>9</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOHS</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>101</FSC> + <COMP>0</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>30</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>102</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>3</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>4</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>4</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>3</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>106</FSC> + <COMP>5</COMP> + <LEV>2</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>28</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>38</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>107</FSC> + <COMP>2</COMP> + <LEV>35</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>45</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>108</FSC> + <COMP>0</COMP> + <LEV>44</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>55</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>108</FSC> + <COMP>1</COMP> + <LEV>54</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>3</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>109</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>22</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>2</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>114</FSC> + <COMP>3</COMP> + <LEV>60</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>0</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>48</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>56</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>10</COMP> + <LEV>47</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>48</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>47</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>115</FSC> + <COMP>91</COMP> + <LEV>56</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>15</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>116</FSC> + <COMP>0</COMP> + <LEV>14</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>117</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>49</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>118</FSC> + <COMP>0</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>61</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>119</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>120</FSC> + <COMP>0</COMP> + <LEV>52</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>24</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>122</FSC> + <COMP>0</COMP> + <LEV>23</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>33</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>122</FSC> + <COMP>1</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>130</FSC> + <COMP>0</COMP> + <LEV>11</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>13</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>131</FSC> + <COMP>0</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>151</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>8</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>7</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>18</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>18</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>17</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>411</FSC> + <COMP>1</COMP> + <LEV>17</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgOMS</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLE</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLENUM</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLENUM</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLENUM</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLENUM</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLENUM</PG> + <FSC>407</FSC> + <COMP>13</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLENUM</PG> + <FSC>407</FSC> + <COMP>13</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLENUM</PG> + <FSC>407</FSC> + <COMP>13</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgPOLENUM</PG> + <FSC>407</FSC> + <COMP>13</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>12</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>12</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>2</COMP> + <LEV>50</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>2</COMP> + <LEV>51</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>3</COMP> + <LEV>51</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>3</COMP> + <LEV>50</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>7</COMP> + <LEV>58</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>7</COMP> + <LEV>55</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>92</COMP> + <LEV>50</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>115</FSC> + <COMP>92</COMP> + <LEV>51</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>203</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>203</FSC> + <COMP>1</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>301</FSC> + <COMP>0</COMP> + <LEV>21</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>301</FSC> + <COMP>1</COMP> + <LEV>23</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>301</FSC> + <COMP>3</COMP> + <LEV>23</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>302</FSC> + <COMP>0</COMP> + <LEV>25</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>302</FSC> + <COMP>1</COMP> + <LEV>27</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>303</FSC> + <COMP>0</COMP> + <LEV>29</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>303</FSC> + <COMP>1</COMP> + <LEV>43</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-polyline2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>303</FSC> + <COMP>3</COMP> + <LEV>43</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>303</FSC> + <COMP>4</COMP> + <LEV>43</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>304</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>304</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>304</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>305</FSC> + <COMP>0</COMP> + <LEV>33</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>305</FSC> + <COMP>0</COMP> + <LEV>34</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>306</FSC> + <COMP>0</COMP> + <LEV>35</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>306</FSC> + <COMP>0</COMP> + <LEV>36</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>46</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>37</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>307</FSC> + <COMP>0</COMP> + <LEV>38</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>308</FSC> + <COMP>0</COMP> + <LEV>40</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>308</FSC> + <COMP>0</COMP> + <LEV>39</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>309</FSC> + <COMP>0</COMP> + <LEV>41</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>309</FSC> + <COMP>0</COMP> + <LEV>42</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>314</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>314</FSC> + <COMP>1</COMP> + <LEV>28</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>314</FSC> + <COMP>2</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>315</FSC> + <COMP>0</COMP> + <LEV>26</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>315</FSC> + <COMP>1</COMP> + <LEV>28</LEV> + <WEIGHT>0</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>315</FSC> + <COMP>2</COMP> + <LEV>28</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>316</FSC> + <COMP>0</COMP> + <LEV>53</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>316</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>317</FSC> + <COMP>0</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>317</FSC> + <COMP>0</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>317</FSC> + <COMP>0</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>317</FSC> + <COMP>0</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>317</FSC> + <COMP>1</COMP> + <LEV>32</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>317</FSC> + <COMP>1</COMP> + <LEV>31</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>318</FSC> + <COMP>0</COMP> + <LEV>54</LEV> + <WEIGHT>4</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>318</FSC> + <COMP>0</COMP> + <LEV>53</LEV> + <WEIGHT>4</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>5</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>6</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>0</COMP> + <LEV>27</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>1</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>2</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>15</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>16</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>402</FSC> + <COMP>3</COMP> + <LEV>37</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>403</FSC> + <COMP>4</COMP> + <LEV>44</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>403</FSC> + <COMP>5</COMP> + <LEV>44</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>0</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>1</COMP> + <LEV>19</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>12</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>10</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>407</FSC> + <COMP>8</COMP> + <LEV>9</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>411</FSC> + <COMP>5</COMP> + <LEV>55</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>417</FSC> + <COMP>2</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>417</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>417</FSC> + <COMP>3</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>417</FSC> + <COMP>3</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>418</FSC> + <COMP>2</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>418</FSC> + <COMP>2</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>418</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>418</FSC> + <COMP>3</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>418</FSC> + <COMP>3</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>418</FSC> + <COMP>3</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>419</FSC> + <COMP>2</COMP> + <LEV>20</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>419</FSC> + <COMP>2</COMP> + <LEV>7</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>419</FSC> + <COMP>2</COMP> + <LEV>14</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-symbol</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>419</FSC> + <COMP>3</COMP> + <LEV>8</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>419</FSC> + <COMP>3</COMP> + <LEV>10</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>419</FSC> + <COMP>3</COMP> + <LEV>12</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>501</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>501</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>502</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>502</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>503</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>2</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>504</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>504</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>505</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>505</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>507</FSC> + <COMP>0</COMP> + <LEV>1</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-polyline</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>507</FSC> + <COMP>1</COMP> + <LEV>2</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> + <XGeosDataConfig> + <PG>pgSLS</PG> + <FSC>999</FSC> + <COMP>0</COMP> + <LEV>62</LEV> + <WEIGHT>1</WEIGHT> + <FTYPE>xtpc-text2</FTYPE> + </XGeosDataConfig> +</dataroot> diff --git a/xdgnjobs/ximple-spatialjob/src/main/resources/conf/DefaultConvertShpFilter.xml b/xdgnjobs/ximple-spatialjob/src/main/resources/conf/DefaultConvertShpFilter.xml index 1b27c51..0d281a0 100644 --- a/xdgnjobs/ximple-spatialjob/src/main/resources/conf/DefaultConvertShpFilter.xml +++ b/xdgnjobs/ximple-spatialjob/src/main/resources/conf/DefaultConvertShpFilter.xml @@ -39,6 +39,15 @@ </elementCriterion> <TextCreateStrategy/> </TypeCompFilter> + <TypeCompFilter name="FSC-106.C-5"> + <tid>106</tid> + <cid>5</cid> + <description>�u���ۧ�</description> + <elementCriterion> + <elementType>17</elementType> + </elementCriterion> + <TextCreateStrategy/> + </TypeCompFilter> <TypeCompFilter name="FSC-402.C-0"> <tid>402</tid> <cid>0</cid> @@ -106,6 +115,36 @@ </elementCriterion> <TextCreateStrategy/> </TypeCompFilter> + <TypeCompFilter name="FSC-411.C-4"> + <tid>411</tid> + <cid>3</cid> + <description>�C���t�ι�-�t�q�Ǯy�е��O</description> + <elementCriterion> + <elementType>17</elementType> + <elementType>7</elementType> + </elementCriterion> + <TextCreateStrategy/> + </TypeCompFilter> + <TypeCompFilter name="FSC-411.C-5"> + <tid>411</tid> + <cid>3</cid> + <description>���O�t�ι�-�t�q�Ǯy�е��O</description> + <elementCriterion> + <elementType>17</elementType> + <elementType>7</elementType> + </elementCriterion> + <TextCreateStrategy/> + </TypeCompFilter> + <TypeCompFilter name="FSC-411.C-6"> + <tid>411</tid> + <cid>3</cid> + <description>���l�t�ι�-�t�q�Ǯy�е��O</description> + <elementCriterion> + <elementType>17</elementType> + <elementType>7</elementType> + </elementCriterion> + <TextCreateStrategy/> + </TypeCompFilter> <TypeCompFilter name="FSC-411.C-7"> <tid>411</tid> <cid>7</cid> diff --git a/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/filter/ElementDispatcherTest.java b/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/filter/ElementDispatcherTest.java index 185f770..21508da 100644 --- a/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/filter/ElementDispatcherTest.java +++ b/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/filter/ElementDispatcherTest.java @@ -3,37 +3,34 @@ import java.io.File; import java.io.IOException; -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.xmlrules.DigesterLoader; +import com.ximple.eofms.util.ElementDigesterUtils; +import org.apache.commons.digester3.Digester; import org.geotools.TestData; import org.testng.Assert; import org.testng.annotations.Test; import org.xml.sax.SAXException; -public class ElementDispatcherTest -{ +public class ElementDispatcherTest { private static final String TestRulesName = "testRules.xml"; private static final String TestConfigName = "testElementFilter.xml"; @Test - public void testLoadRules() throws IOException - { + public void testLoadRules() throws IOException { File rules = TestData.file(this, TestRulesName); - Digester digester = DigesterLoader.createDigester(rules.toURI().toURL()); + Digester digester = ElementDigesterUtils.getElementDigester(); // File config = TestData.file(this, TestConfigName); // ElementDispatcher ed = (ElementDispatcher) digester.parse(config); Assert.assertNotNull(digester); } @Test - public void testLoadConfig() throws IOException, SAXException - { + public void testLoadConfig() throws IOException, SAXException { File rules = TestData.file(this, TestRulesName); - Digester digester = DigesterLoader.createDigester(rules.toURI().toURL()); + Digester digester = ElementDigesterUtils.getElementDigester(); File config = TestData.file(this, TestConfigName); ElementDispatcher ed = (ElementDispatcher) digester.parse(config); Assert.assertNotNull(ed); - // Assert.assertEquals(ed.getRules().size(), 3); + // Assert.assertEquals(ed.getRules().size(), 3); ElementDispatchableFilter filter = ed.getRules().get(0); diff --git a/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/rest/GeoManagerEncoderTest.java b/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/rest/GeoManagerEncoderTest.java new file mode 100644 index 0000000..45305a0 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/rest/GeoManagerEncoderTest.java @@ -0,0 +1,47 @@ +package com.ximple.eofms.rest; + +import it.geosolutions.geoserver.rest.encoder.GSLayerGroupEncoder; +import it.geosolutions.geoserver.rest.encoder.GSLayerGroupEncoder23; +import org.jdom.Element; +import org.testng.annotations.Test; + +public class GeoManagerEncoderTest { + @Test + public void testLaterGroupEncoder() { + String a = "pgCLS:xtpc:fsc-203-c1-l37-w1,xtpc:fsc-203-c0-l38-w1,xtpc:fsc-203-c1-l38-w1,xtpc:fsc-203-c0-l37-w1,xtpc:fsc-311-c1-l45-w1,xtpc:fsc-311-c1-l45-w0,xtpc:fsc-311-c0-l45-w1,xtpc:fsc-501-c0-l1-w0,xtpc:fsc-501-c1-l2-w0,xtpc:fsc-502-c0-l1-w1,xtpc:fsc-502-c1-l2-w1,xtpc:fsc-503-c0-l1-w2,xtpc:fsc-999-c0-l62-w1"; + GSLayerGroupEncoder groupWriter = new GSLayerGroupEncoder23() { + + @Override + protected void addToRoot(Element... elements) { + for (Element e : elements) { + if (e != null) { + getRoot().addContent(e.cloneContent()); + } + } + } + }; + groupWriter.addLayer("xtpc:fsc-203-c1-l37-w1"); + groupWriter.addLayer("xtpc:fsc-203-c0-l38-w1"); + groupWriter.addLayer("xtpc:fsc-203-c1-l38-w1"); + groupWriter.addLayer("xtpc:fsc-203-c0-l37-w1"); + groupWriter.addLayer("xtpc:fsc-311-c1-l45-w1"); + groupWriter.addLayer("xtpc:fsc-311-c1-l45-w0"); + groupWriter.addLayer("xtpc:fsc-311-c0-l45-w1"); + groupWriter.addLayer("xtpc:fsc-501-c0-l1-w0"); + groupWriter.addLayer("xtpc:fsc-501-c1-l2-w0"); + groupWriter.addLayer("xtpc:fsc-502-c0-l1-w1"); + groupWriter.addLayer("xtpc:fsc-502-c1-l2-w"); + groupWriter.addLayer("xtpc:fsc-503-c0-l1-w2"); + groupWriter.addLayer("xtpc:fsc-999-c0-l62-w1"); + String s = groupWriter.toString(); + System.out.println(s); + } + + @Test + public void testLaterGroupEncoder23() { + String a = "pgCLS:xtpc:fsc-203-c1-l37-w1,xtpc:fsc-203-c0-l38-w1,xtpc:fsc-203-c1-l38-w1,xtpc:fsc-203-c0-l37-w1,xtpc:fsc-311-c1-l45-w1,xtpc:fsc-311-c1-l45-w0,xtpc:fsc-311-c0-l45-w1,xtpc:fsc-501-c0-l1-w0,xtpc:fsc-501-c1-l2-w0,xtpc:fsc-502-c0-l1-w1,xtpc:fsc-502-c1-l2-w1,xtpc:fsc-503-c0-l1-w2,xtpc:fsc-999-c0-l62-w1"; + GSLayerGroupEncoder23 groupWriter = new GSLayerGroupEncoder23(); + groupWriter.addLayer("topp:boundaries"); + String s = groupWriter.toString(); + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/util/FeatureTypeBuilderUtilTest.java b/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/util/FeatureTypeBuilderUtilTest.java new file mode 100644 index 0000000..b7b870f --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/util/FeatureTypeBuilderUtilTest.java @@ -0,0 +1,20 @@ +package com.ximple.eofms.util; + +import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class FeatureTypeBuilderUtilTest { + @Test + public void testLookupCRS() { + CoordinateReferenceSystem crs; + crs = FeatureTypeBuilderUtil.lookupCRS(3825); + Assert.assertNotNull(crs); + crs = FeatureTypeBuilderUtil.lookupCRS(3826); + Assert.assertNotNull(crs); + crs = FeatureTypeBuilderUtil.lookupCRS(3827); + Assert.assertNotNull(crs); + crs = FeatureTypeBuilderUtil.lookupCRS(3828); + Assert.assertNotNull(crs); + } +} diff --git a/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/util/FileUtilsTest.java b/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/util/FileUtilsTest.java new file mode 100644 index 0000000..0034ef1 --- /dev/null +++ b/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/util/FileUtilsTest.java @@ -0,0 +1,35 @@ +package com.ximple.eofms.util; + +import java.io.File; +import java.io.FileFilter; +import java.util.List; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class FileUtilsTest { + @Test + public void testRecurseDir1() { + // List list = FileUtils.recurseDir("C:\\temp"); + String path = "Z:\\projects\\xdcad\\xdgnjobs\\tpcjobs\\jobdata"; + // String path = "."; + // List list = FileUtils.recurseDir(path); + List list = FileUtils.recurseDir(path, ".dgn"); + Assert.assertNotNull(list); + } + + @Test + public void testRecurseDir2() { + // List list = FileUtils.recurseDir("C:\\temp"); + // String pathname = "Z:\\projects\\xdcad\\xdgnjobs\\tpcjobs\\jobdata"; + String pathname = "."; + File path = new File(pathname); + // List list = FileUtils.recurseDir(path); + List list = FileUtils.recurseDir(path, new FileFilter() { + public boolean accept(File pathname) { + return pathname.isDirectory() || pathname.getName().toLowerCase().endsWith("dgn"); + } + }); + Assert.assertNotNull(list); + } +} -- Gitblit v0.0.0-SNAPSHOT