| | |
| | | import java.util.TreeMap; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.nio.charset.Charset; |
| | | |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | |
| | | writer = featuresWriterContext.get(featureType.getTypeName()); |
| | | } else |
| | | { |
| | | ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL()); |
| | | // ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL()); |
| | | ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL(), |
| | | true, Charset.forName("UTF-8")); |
| | | shapefileDataStore.createSchema(featureType); |
| | | writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT); |
| | | featuresWriterContext.put(featureType.getTypeName(), writer); |
| | |
| | | |
| | | Geometry geom = convertDecorator.toGeometry(geometryFactory); |
| | | double angle = textElement.getRotationAngle(); |
| | | String content = textElement.getText(); |
| | | angle = BigDecimal.valueOf(angle).setScale(3, RoundingMode.HALF_UP).doubleValue(); |
| | | if (geom != null) |
| | | { |
| | |
| | | textElement.getTextHeight(), |
| | | textElement.getTextWidth(), |
| | | angle, |
| | | textElement.getText() |
| | | content |
| | | }); |
| | | } else |
| | | { |