| | |
| | | import org.apache.commons.collections.map.LinkedMap; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.geotools.feature.Feature; |
| | | import org.quartz.JobDetail; |
| | | import org.quartz.JobExecutionContext; |
| | | import org.quartz.JobExecutionException; |
| | |
| | | OracleConvertJobContext jobContext = prepareJobContext(); |
| | | jobContext.setConnectionInfo(_oracleHost, _oraclePort, _oracleInstance); |
| | | jobContext.setLogin(_username, _password); |
| | | jobContext.setShapeData(_dataPath); |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | |
| | | return dgnElement; |
| | | } |
| | | |
| | | private Feature convertElementToFeature(Element dgnElement) |
| | | { |
| | | |
| | | // typeBuilder.setNamespace(new URI("")); |
| | | /* |
| | | Feature feature = null; |
| | | try |
| | | { |
| | | FeatureType featureType = typeBuilder.getFeatureType(); |
| | | feature = featureType.create(new Object[]{ |
| | | ((LineElement) dgnElement).toGeometry(_geomFactory) |
| | | }); |
| | | |
| | | FeatureCollection features = FeatureCollections.newCollection(); |
| | | features.add(feature); |
| | | |
| | | File sfile = new File(""); |
| | | ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURL()); |
| | | shapefileDataStore.createSchema(featureType); |
| | | FeatureWriter writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT); |
| | | ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); |
| | | |
| | | } catch (SchemaException e) |
| | | { |
| | | logger.warn(e.getMessage(), e); |
| | | } catch (IllegalAttributeException e) |
| | | { |
| | | logger.warn(e.getMessage(), e); |
| | | } catch (MalformedURLException e) |
| | | { |
| | | logger.warn(e.getMessage(), e); |
| | | } catch (IOException e) |
| | | { |
| | | logger.warn(e.getMessage(), e); |
| | | } |
| | | */ |
| | | |
| | | |
| | | return null; |
| | | } |
| | | |
| | | private boolean equalRawData(byte[] rawSrc, byte[] rawDest) |