- OS:
- Linux
- OSX
- Windows10
- Docker - Docker Compose
- Java - Maven
- IDE (IntelliJ)
- Download the StreamPipes installer from GitHub
- Open terminal and navigate to the installer directory
- Select the folder according to your operating system:
- Windows: "windows10"
- Linux / OSX: "osx_linux"
- Windows: "windows10"
- Run command
./streampipes start
Create a live monitoring system for the International Space Station (ISS)
- Link für ISS Daten:
- Download ISS adapter template (File: iss_template.json)
- Go to StreamPipes Connect an click on "Upload Adapter Template" (Top right corner)
- Select the adapter in the UI and start it
- Navigate to the Pipeline Editor
- The ISS data source is now listed in the Data Streams tab
- Create a folder and run the following command:
mvn archetype:generate \
-DarchetypeGroupId=org.streampipes \
-DarchetypeArtifactId=streampipes-archetype-pe-processors-jvm \
-DarchetypeVersion=0.61.0
-
Settings:
- Group id: org.streampipes.example
- Artifact id: DistanceCalculation
- Version: Hit Enter
- Package: Hit Enter
- Last Step: Y
-
Open new Project in IDE (IntelliJ)
Copy this code snippet into the class Example:
@Override
public void onEvent(Event event, SpOutputCollector out) {
float latitude = event.getFieldByRuntimeName("latitude").getAsPrimitive().getAsFloat();
float longitude = event.getFieldByRuntimeName("longitude").getAsPrimitive().getAsFloat();
float karlsruhe_latitude = 49.00937f;
float karlsruhe_longitude = 8.40444f;
double distance = CalculateDistance.dist(latitude, longitude, karlsruhe_latitude, karlsruhe_longitude);
event.addField("distance_to_iss", distance);
out.collect(event);
}