| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) lineStringElement.getLevelIndex(), |
| | | colorTable.getColorCode(lineStringElement.getColorIndex()), |
| | | (short) lineStringElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) lineStringElement.getLevelIndex(), |
| | | colorTable.getColorCode(lineStringElement.getColorIndex()), |
| | | (short) lineStringElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) complexChain.getLevelIndex(), |
| | | colorTable.getColorCode(complexChain.getColorIndex()), |
| | | (short) complexChain.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) lineElement.getLevelIndex(), |
| | | colorTable.getColorCode(lineElement.getColorIndex()), |
| | | (short) lineElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) lineStringElement.getLevelIndex(), |
| | | colorTable.getColorCode(lineStringElement.getColorIndex()), |
| | | (short) lineStringElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) shapeElement.getLevelIndex(), |
| | | colorTable.getColorCode(shapeElement.getColorIndex()), |
| | | (short) shapeElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) lineStringElement.getLevelIndex(), |
| | | colorTable.getColorCode(lineStringElement.getColorIndex()), |
| | | (short) lineStringElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) complexChain.getLevelIndex(), |
| | | colorTable.getColorCode(complexChain.getColorIndex()), |
| | | (short) complexChain.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) lineElement.getLevelIndex(), |
| | | colorTable.getColorCode(lineElement.getColorIndex()), |
| | | (short) lineElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) lineStringElement.getLevelIndex(), |
| | | colorTable.getColorCode(lineStringElement.getColorIndex()), |
| | | (short) lineStringElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) lineStringElement.getLevelIndex(), |
| | | colorTable.getColorCode(lineStringElement.getColorIndex()), |
| | | (short) lineStringElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) txtElement.getLevelIndex(), |
| | | colorTable.getColorCode(txtElement.getColorIndex()), |
| | | (short) txtElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) complexChain.getLevelIndex(), |
| | | colorTable.getColorCode(complexChain.getColorIndex()), |
| | | (short) complexChain.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) lineElement.getLevelIndex(), |
| | | colorTable.getColorCode(lineElement.getColorIndex()), |
| | | (short) lineElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) txtElement.getLevelIndex(), |
| | | colorTable.getColorCode(txtElement.getColorIndex()), |
| | | (short) txtElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) nodeElement.getLevelIndex(), |
| | | colorTable.getColorCode(nodeElement.getColorIndex()), |
| | | (short) nodeElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) shapeElement.getLevelIndex(), |
| | | colorTable.getColorCode(shapeElement.getColorIndex()), |
| | | (short) shapeElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) complexShape.getLevelIndex(), |
| | | colorTable.getColorCode(complexShape.getColorIndex()), |
| | | (short) complexShape.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) txtElement.getLevelIndex(), |
| | | colorTable.getColorCode(txtElement.getColorIndex()), |
| | | (short) txtElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) txtElement.getLevelIndex(), |
| | | colorTable.getColorCode(txtElement.getColorIndex()), |
| | | (short) txtElement.getWeight(), |
| | |
| | | fLinkage.getFsc(), |
| | | (long) fLinkage.getUfid(), |
| | | (short) fLinkage.getComponentID(), |
| | | (short) 0, |
| | | fLinkage.getOccID(), |
| | | (short) nodeElement.getLevelIndex(), |
| | | colorTable.getColorCode(nodeElement.getColorIndex()), |
| | | (short) nodeElement.getWeight(), |
| | |
| | | GeometryAttributeType geomAttribute = (GeometryAttributeType) anAttributeType; |
| | | |
| | | CoordinateReferenceSystem refSys = geomAttribute.getCoordinateSystem(); |
| | | 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; |
| | | } |
| | | int SRID = getSRID(refSys); |
| | | |
| | | sqlStr = addGeometryColumn(getTargetSchema(), tableName, geomAttribute, SRID); |
| | | getLogger().debug(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 |
| | | { |
| | | conn = getConnection(); |
| | | |
| | | DatabaseMetaData meta = conn.getMetaData(); |
| | | String[] tableType = {"TABLE"}; |
| | | ResultSet tables = meta.getTables(null, |
| | | schema, "%", tableType); |
| | | tables = meta.getTables(null, schema, "%", tableType); |
| | | |
| | | while (tables.next()) |
| | | { |
| | |
| | | if (allowTable(tableName) && (tableName != null) |
| | | && (tableName.equalsIgnoreCase(table))) |
| | | { |
| | | tables.close(); |
| | | return (true); |
| | | } |
| | | } |
| | | |
| | | tables.close(); |
| | | return false; |
| | | } catch (SQLException sqlException) |
| | | { |
| | |
| | | } finally |
| | | { |
| | | // JDBCUtils.close(conn, Transaction.AUTO_COMMIT, null); |
| | | if (tables != null) try { tables.close(); } catch (SQLException e) {} |
| | | } |
| | | } |
| | | |
| | |
| | | GeometryAttributeType geomAttribute = (GeometryAttributeType) anAttributeType; |
| | | |
| | | CoordinateReferenceSystem refSys = geomAttribute.getCoordinateSystem(); |
| | | 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; |
| | | } |
| | | int SRID = getSRID(refSys); |
| | | |
| | | sqlStr = addGeometryColumn(getTargetSchema(), tableName, geomAttribute, SRID); |
| | | getLogger().debug(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 |
| | | { |
| | | conn = getConnection(); |
| | | |
| | | DatabaseMetaData meta = conn.getMetaData(); |
| | | String[] tableType = {"TABLE"}; |
| | | ResultSet tables = meta.getTables(null, |
| | | schema, "%", tableType); |
| | | tables = meta.getTables(null, schema, "%", tableType); |
| | | |
| | | while (tables.next()) |
| | | { |
| | |
| | | if (allowTable(tableName) && (tableName != null) |
| | | && (tableName.equalsIgnoreCase(table))) |
| | | { |
| | | tables.close(); |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | tables.close(); |
| | | return false; |
| | | } catch (SQLException sqlException) |
| | | { |
| | | // JDBCUtils.close(conn, Transaction.AUTO_COMMIT, sqlException); |
| | | // conn = null; |
| | | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | import org.xml.sax.SAXException; |
| | | |
| | | import com.vividsolutions.jts.util.Assert; |
| | | import com.vividsolutions.jts.geom.GeometryFactory; |
| | | import com.vividsolutions.jts.geom.Geometry; |
| | | |
| | | import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; |
| | | import com.ximple.eofms.filter.CreateFeatureTypeEventListener; |
| | |
| | | import com.ximple.io.dgn7.ComplexElement; |
| | | import com.ximple.io.dgn7.Element; |
| | | import com.ximple.io.dgn7.FrammeAttributeData; |
| | | import com.ximple.io.dgn7.ComplexChainElement; |
| | | |
| | | public class OracleConvertPostGISJobContext extends AbstractOracleToPostGISJobContext |
| | | implements CreateFeatureTypeEventListener |
| | |
| | | { |
| | | try |
| | | { |
| | | clearFeatureData(evt.getFeatureType()); |
| | | createOrClearFeatureDataTable(evt.getFeatureType()); |
| | | } catch (SchemaException e) |
| | | { |
| | | logger.warn(e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | protected void clearFeatureData(FeatureType featureType) throws SchemaException |
| | | protected void createOrClearFeatureDataTable(FeatureType featureType) throws SchemaException |
| | | { |
| | | String featureName = featureType.getTypeName(); |
| | | if (isExistFeature(featureType)) |