forked from geodmms/xdgnjobs

?? ?
2008-08-07 7dcc5966bdb3dbbaadead05df598f41025e9739d
update for EOFM-141, EOFM-142
3 files modified
85 ■■■■■ changed files
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/AbstractDgnToPostGISJobContext.java 44 ●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/AbstractOracleToPostGISJobContext.java 9 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/resources/conf/DefaultConvertShpFilter.xml 32 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/AbstractDgnToPostGISJobContext.java
@@ -217,7 +217,6 @@
        sb.append("\".\"");
        sb.append(tableName);
        sb.append('\"');
        getLogger().info("Execute-" + sb.toString());
        stmt.execute(sb.toString());
        stmt.close();
        conn.commit();
@@ -232,7 +231,6 @@
        sb.append("\".\"");
        sb.append(tableName);
        sb.append("\" CASCADE");
        getLogger().info("Execute-" + sb.toString());
        stmt.execute(sb.toString());
        stmt.close();
        conn.commit();
@@ -247,7 +245,6 @@
        sb.append("','");
        sb.append(geomField);
        sb.append("')");
        getLogger().info("Execute-" + sb.toString());
        stmt.execute(sb.toString());
        stmt.close();
        conn.commit();
@@ -304,10 +301,22 @@
        Connection con = getConnection();
        boolean shouldDrop = tablePresent(tableName, con);
        boolean shouldDrop = tablePresent(getTargetSchema(), tableName, con);
        if (shouldDrop)
        {
            String sqlStr = "DROP TABLE " + encodeSchemaTableName(tableName) + ";";
            String sqlStr;
            for (AttributeType anAttributeType : attributeType)
            {
                if (!(anAttributeType instanceof GeometryAttributeType))
                {
                    continue;
                }
                GeometryAttributeType geomAttribute = (GeometryAttributeType) anAttributeType;
                sqlStr = dropGeometryColumn(getTargetSchema(), tableName, geomAttribute.getLocalName());
                getLogger().info(sqlStr);
                result.add(sqlStr);
            }
            sqlStr = "DROP TABLE " + encodeSchemaTableName(tableName) + ";";
            getLogger().info(sqlStr);
            result.add(sqlStr);
        }
@@ -319,7 +328,7 @@
        sql.append(");");
        String sqlStr = sql.toString();
        getLogger().info(sqlStr);
        getLogger().debug(sqlStr);
        result.add(sqlStr);
        for (AttributeType anAttributeType : attributeType)
@@ -330,13 +339,6 @@
            }
            GeometryAttributeType geomAttribute = (GeometryAttributeType) anAttributeType;
            if (shouldDrop)
            {
            sqlStr = dropGeometryColumn("", tableName, geomAttribute.getLocalName());
            getLogger().info(sqlStr);
            result.add(sqlStr);
            }
            CoordinateReferenceSystem refSys = geomAttribute.getCoordinateSystem();
            int SRID;
@@ -363,25 +365,25 @@
                SRID = -1;
            }
            sqlStr = addGeometryColumn("", tableName, geomAttribute, SRID);
            getLogger().info(sqlStr);
            sqlStr = addGeometryColumn(getTargetSchema(), tableName, geomAttribute, SRID);
            getLogger().debug(sqlStr);
            result.add(sqlStr);
            String indexName = tableName.replace('-', '_');
            //also build a spatial index on each geometry column.
            sql = new StringBuffer("CREATE INDEX spatial_");
            sql = new StringBuffer("CREATE INDEX \"spatial_");
            sql.append(indexName);
            sql.append("_");
            sql.append(anAttributeType.getLocalName().toLowerCase());
            sql.append(" ON ");
            sql.append("\" ON ");
            sql.append(encodeSchemaTableName(tableName));
            sql.append(" USING GIST (");
            sql.append(encodeSchemaColumnName(anAttributeType.getLocalName()));
            sql.append(" gist_geometry_ops);");
            sqlStr = sql.toString();
            getLogger().info(sqlStr);
            getLogger().debug(sqlStr);
            result.add(sqlStr);
        }
@@ -389,7 +391,7 @@
        return result;
    }
    private boolean tablePresent(String table, Connection conn) throws IOException
    private boolean tablePresent(String schema, String table, Connection conn) throws IOException
    {
        final int TABLE_NAME_COL = 3;
@@ -400,7 +402,7 @@
            DatabaseMetaData meta = conn.getMetaData();
            String[] tableType = {"TABLE"};
            ResultSet tables = meta.getTables(null,
                    targetDataStore.getDatabaseSchemaName(), "%", tableType);
                    schema, "%", tableType);
            while (tables.next())
            {
@@ -771,8 +773,6 @@
                    pstmt.setDate(i + 1, sDate);
                }
            }
        }
    }
}
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/AbstractOracleToPostGISJobContext.java
@@ -216,7 +216,6 @@
        sb.append("\".\"");
        sb.append(tableName);
        sb.append('\"');
        getLogger().info("Execute-" + sb.toString());
        stmt.execute(sb.toString());
        stmt.close();
        conn.commit();
@@ -231,7 +230,6 @@
        sb.append("\".\"");
        sb.append(tableName);
        sb.append("\" CASCADE");
        getLogger().info("Execute-" + sb.toString());
        stmt.execute(sb.toString());
        stmt.close();
        conn.commit();
@@ -248,7 +246,6 @@
        sb.append("','");
        sb.append(geomField);
        sb.append("')");
        getLogger().info("Execute-" + sb.toString());
        stmt.execute(sb.toString());
        stmt.close();
        conn.commit();
@@ -332,7 +329,7 @@
        sql.append(");");
        String sqlStr = sql.toString();
        getLogger().info(sqlStr);
        getLogger().debug(sqlStr);
        result.add(sqlStr);
        for (AttributeType anAttributeType : attributeType)
@@ -370,7 +367,7 @@
            }
            sqlStr = addGeometryColumn(getTargetSchema(), tableName, geomAttribute, SRID);
            getLogger().info(sqlStr);
            getLogger().debug(sqlStr);
            result.add(sqlStr);
@@ -388,7 +385,7 @@
            sql.append(" gist_geometry_ops);");
            sqlStr = sql.toString();
            getLogger().info(sqlStr);
            getLogger().debug(sqlStr);
            result.add(sqlStr);
        }
xdgnjobs/ximple-spatialjob/src/main/resources/conf/DefaultConvertShpFilter.xml
@@ -640,6 +640,7 @@
    <description>¾É½uµù°O(½u¸ô¹Ï¥Î)</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
  </TypeCompFilter>
@@ -657,6 +658,7 @@
    <cid>4</cid>
    <description>õX½u¥N¸¹µù°O(½u¸ô¹Ï¥Î)</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -707,6 +709,7 @@
    <description>±µ¤á½uªø«×µù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
  </TypeCompFilter>
@@ -772,6 +775,7 @@
    <description>§CÀ£¾É½uµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
  </TypeCompFilter>
@@ -798,6 +802,7 @@
    <cid>1</cid>
    <description>§CÀ£»»±±½cµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -807,6 +812,7 @@
    <cid>2</cid>
    <description>§CÀ£»»±±½cªùµPµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -825,6 +831,7 @@
    <cid>1</cid>
    <description>§CÀ£Äµ³ø¾¹µù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -834,6 +841,7 @@
    <cid>2</cid>
    <description>§CÀ£Äµ³ø¾¹ªùµPµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -861,6 +869,7 @@
    <cid>1</cid>
    <description>§CÀ£¥æ³q¸¹»xµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -926,12 +935,12 @@
  <TypeCompFilter name="FSC-211.C-1">
    <tid>211</tid>
    <cid>1</cid>
    <description>§CÀ£¬[ªÅ±µ¤á½u</description>
    <description>§CÀ£¬[ªÅ±µ¤á½uµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <LineCreateStrategy/>
    <TextCreateStrategy/>
  </TypeCompFilter>
  <TypeCompFilter name="FSC-211.C-2">
    <tid>211</tid>
@@ -968,6 +977,7 @@
    <cid>2</cid>
    <description>§CÀ£¬[ªÅ³s±µ±µ¤á½uªø«×µù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -987,6 +997,7 @@
    <cid>1</cid>
    <description>§CÀ£¦a¤U³s±µ±µ¤á½uµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -996,6 +1007,7 @@
    <cid>2</cid>
    <description>§CÀ£¦a¤U³s±µ±µ¤á½uªø«×µù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -1023,6 +1035,7 @@
    <cid>1</cid>
    <description>§CÀ£ºÊµø¾¹µù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -1032,6 +1045,7 @@
    <cid>2</cid>
    <description>§CÀ£ºÊµø¾¹ªùµPµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -1061,6 +1075,7 @@
    <cid>1</cid>
    <description>¥úÅÖ¹qÆl«¬¦¡(ªø«×)µù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -1070,6 +1085,7 @@
    <cid>2</cid>
    <description>¥úÅÖ¹qÆl¤å¦r»¡©úµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -1117,6 +1133,7 @@
    <cid>3</cid>
    <description>¸ô¿O±±¨î½uµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -1126,7 +1143,7 @@
    <cid>0</cid>
    <description>µù°O</description>
    <elementCriterion>
      <elementType>4</elementType>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -1154,6 +1171,7 @@
    <cid>1</cid>
    <description>°ª§CÀ£¤H¤â¤Õ®y¼Ðµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -1181,6 +1199,7 @@
    <cid>5</cid>
    <description>¸ô¿O¤Õ®y¼Ðµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -1199,6 +1218,7 @@
    <cid>7</cid>
    <description>¥úÆl¤Õ®y¼Ðµù°O(¥úÆl¹Ï¥Î)</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -1237,6 +1257,7 @@
    <description>ºÞ¸ô¤å¦r»¡©úµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
  </TypeCompFilter>
@@ -1290,6 +1311,7 @@
    <cid>3</cid>
    <description>¸ô¿O¾Þ§@½uµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -1345,6 +1367,7 @@
    <description>¸ô¿O¥x±b¹Ï¸¹(®e¶q.·ø¼Æ)µù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
  </TypeCompFilter>
@@ -1381,6 +1404,7 @@
    <description>¬[ªÅ¸ô¿O±±¨î½uµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
  </TypeCompFilter>
@@ -1407,6 +1431,7 @@
    <cid>1</cid>
    <description>¸ô¿O±±¨î¶}Ãöµù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>
@@ -1461,6 +1486,7 @@
    <cid>1</cid>
    <description>¦Û°Ê¤Æ»»±±¾¹µù°O</description>
    <elementCriterion>
      <elementType>7</elementType>
      <elementType>17</elementType>
    </elementCriterion>
    <TextCreateStrategy/>