Skip to content

Commit

Permalink
[#1307] misc validation fixes manual tests
Browse files Browse the repository at this point in the history
  • Loading branch information
flomickl committed Feb 19, 2023
1 parent 85565b8 commit 2a89675
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.apache.streampipes.processors.geo.jvm.jts.processor.latlngtojtspoint.LatLngToJtsPointProcessor;
import org.apache.streampipes.processors.geo.jvm.jts.processor.reprojection.ReprojectionProcessor;
import org.apache.streampipes.processors.geo.jvm.jts.processor.trajectory.TrajectoryFromPointsProcessor;
import org.apache.streampipes.processors.geo.jvm.jts.processor.validation.GeometryValidationProcessor;
import org.apache.streampipes.processors.geo.jvm.latlong.processor.distancecalculator.haversine.HaversineDistanceCalculatorProcessor;
import org.apache.streampipes.processors.geo.jvm.latlong.processor.distancecalculator.haversinestatic.HaversineStaticDistanceCalculatorProcessor;
import org.apache.streampipes.processors.geo.jvm.latlong.processor.geocoder.googlemaps.GoogleMapsGeocoderProcessor;
Expand Down Expand Up @@ -70,7 +71,8 @@ public SpServiceDefinition provideServiceDefinition() {
new LatLngToJtsPointProcessor(),
new TrajectoryFromPointsProcessor(),
new SpeedCalculatorProcessor(),
new ReprojectionProcessor())
new ReprojectionProcessor(),
new GeometryValidationProcessor())
.registerMessagingFormats(
new JsonDataFormatFactory(),
new CborDataFormatFactory(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public DataProcessorDescription declareModel() {
ValidationOutput.INVALID.name()
)
)
.requiredMultiValueSelection(
.requiredSingleValueSelection(
Labels.withId(VALIDATION_TYPE_KEY),
Options.from(
ValidationType.IsEmpty.name(),
Expand Down Expand Up @@ -109,9 +109,9 @@ public void onInvocation(ProcessorParams parameters, SpOutputCollector spOutputC
if (readValidationType.equals(ValidationType.IsEmpty.name())) {
this.validationType = ValidationType.IsEmpty.getNumber(); // 1
} else if (readValidationType.equals(ValidationType.IsValid.name())) {
this.validationType = ValidationType.IsValid.getNumber(); // 2
this.validationType = ValidationType.IsSimple.getNumber(); // 2
} else {
this.validationType = ValidationType.IsSimple.getNumber(); // 3
this.validationType = ValidationType.IsValid.getNumber(); // 3
}
}

Expand All @@ -126,7 +126,7 @@ public void onEvent(Event event, SpOutputCollector collector) throws SpRuntimeEx

switch (validationType) {
case 1:
itIsValid = geometry.isEmpty();
itIsValid = !geometry.isEmpty();
break;
case 2:
itIsValid = geometry.isSimple();
Expand All @@ -135,7 +135,7 @@ public void onEvent(Event event, SpOutputCollector collector) throws SpRuntimeEx
IsValidOp validater = new IsValidOp(geometry);
validater.setSelfTouchingRingFormingHoleValid(true);
itIsValid = validater.isValid();
if (itIsValid = false) {
if (!itIsValid) {
validater.getValidationError();
}
}
Expand Down

0 comments on commit 2a89675

Please sign in to comment.