&& toMeasure >= featureToMeasure) {
lineMerger.add((Geometry) feature.getDefaultGeometryProperty()
.getValue());
} else if (fromMeasure > featureFromMeasure
&& toMeasure < featureToMeasure) {
LengthIndexedLine lengthIndexedLine = new LengthIndexedLine(
(Geometry) feature.getDefaultGeometryProperty()
.getValue());
double featureLength = featureToMeasure - featureFromMeasure;
double startOffset = fromMeasure - featureFromMeasure;
double stopOffset = toMeasure - featureFromMeasure;
double calcLength = ((Geometry) feature
.getDefaultGeometryProperty().getValue()).getLength();
if (calcLength == 0 || featureLength == 0)
continue;
Geometry extracted = lengthIndexedLine.extractLine(startOffset
* calcLength / featureLength, stopOffset * calcLength
/ featureLength);
if (!extracted.isEmpty())
lineMerger.add(extracted);
} else if (fromMeasure > featureFromMeasure) {
LengthIndexedLine lengthIndexedLine = new LengthIndexedLine(
(Geometry) feature.getDefaultGeometryProperty()
.getValue());
double featureLength = featureToMeasure - featureFromMeasure;
double startOffset = fromMeasure - featureFromMeasure;
double calcLength = ((Geometry) feature
.getDefaultGeometryProperty().getValue()).getLength();
if (calcLength == 0 || featureLength == 0)
continue;
Geometry extracted = lengthIndexedLine.extractLine(startOffset
* calcLength / featureLength, calcLength);
if (!extracted.isEmpty())
lineMerger.add(extracted);
} else {
LengthIndexedLine lengthIndexedLine = new LengthIndexedLine(
(Geometry) feature.getDefaultGeometryProperty()
.getValue());
double featureLength = featureToMeasure - featureFromMeasure;
double stopOffset = toMeasure - featureFromMeasure;
double calcLength = ((Geometry) feature
.getDefaultGeometryProperty().getValue()).getLength();
if (calcLength == 0 || featureLength == 0)
continue;
Geometry extracted = lengthIndexedLine.extractLine(0,
stopOffset * calcLength / featureLength);
if (extracted.isEmpty() || extracted.getLength() == 0.0) {
LOGGER.info("Empty segment: featureFromMeasure="
+ featureFromMeasure + " featureToMeasure:"
+ featureToMeasure + " toMeasure:" + toMeasure