| | |
| | | Geometry geom = converter.toGeometry(factory); |
| | | if (geom == null) return null; |
| | | geom.apply(coordinatesFilter); |
| | | geom.geometryChanged(); |
| | | return geom; |
| | | } |
| | | |
| | | class TWD97ConvertFilter implements CoordinateSequenceFilter |
| | | { |
| | | private boolean done = false; |
| | | private boolean geometryChanged = false; |
| | | |
| | | public void filter(CoordinateSequence coordinateSequence, int i) |
| | | { |
| | | Coordinate pt = coordinateSequence.getCoordinateCopy(i); |
| | | Coordinate pt =coordinateSequence.getCoordinate(i); |
| | | Coordinate pt97 = TWDDatumConverter.fromTM2ToTWD97(pt); |
| | | pt.x = pt97.x; |
| | | pt.y = pt97.y; |
| | | pt.z = pt97.z; |
| | | done = (i >= coordinateSequence.size()); |
| | | geometryChanged = true; |
| | | } |
| | | |
| | | public boolean isDone() |
| | | { |
| | | return done; |
| | | return false; |
| | | } |
| | | |
| | | public boolean isGeometryChanged() |
| | | { |
| | | return geometryChanged; |
| | | return true; |
| | | } |
| | | |
| | | public void reset() |
| | | { |
| | | done = false; |
| | | geometryChanged = false; |
| | | } |
| | | } |
| | | } |