Details
-
Task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
I just wondering on the example with the 1 class processor here [1] [2].
In the description is mentioned that
Next, we are interested in the fields of the input event stream that contains the latitude and longitude value we would like to compute against the geofence center location as follows:
String latitudeFieldName = extractor.mappingPropertyValue("latitude-field"); String longitudeFieldName = extractor.mappingPropertyValue("longitude-field");
1) Shouldn't it be:
String latitudeFieldName = parameters.extractor().mappingPropertyValue("latitude-field"); String longitudeFieldName = parameters.extractor().mappingPropertyValue("longitude-field");
2) But this code snippet is is missing in "Your controller class should look as follows" example.
3) The latitudeFieldName is used in the onEvent Method as
float latitude = event.getFieldBySelector(latitudeFieldName).getAsPrimitive().getAsFloat(); float longitude = event.getFieldBySelector(longitudeFieldName).getAsPrimitive().getAsFloat();
But the variables can not be resolved.
I but the example code into a file but better overview
GeofencingProcessor.java
[1] https://streampipes.apache.org/docs/docs/extend-tutorial-data-processors.html
[2] https://github.com/apache/streampipes-website/blob/dev/documentation/docs/06_extend-tutorial-data-processors.md