We plan to bike to Seattle's Space Needle and St. James Cathedral. We're looking for the nearest bike stations where we can pick up and drop off our bikes.
The workflow aim is to create a geospatial view which shows the closest bike stations within a 500-meter radius of the selected landmarks (Space Needle and St. James Cathedral).
To use the workflow, download and run it on the KNIME Analytics Platform. For optimal performance using the Geospatial Analytics extension, make sure you are using version 4.7.4 or higher.
As input data, we are using the coordinates of the bike stations and the coordinates of the landmarks in Seattle, Washington.
We have two CSV files that contain the required input data. These files are stored in the workflow data area. The landmarks have been saved as points in the WKT format, while the coordinates of the bike stations are in the form of lat/lon coordinates.
The first step is to transform the input data to geometry data using the WKT to Geometry and the Lat/Lon to Geometry node, respectively.
Next, we perform the main task of the workflow with the help of the "Nearest Join" node. The landmarks table is the top input (aka left table), while the bike stations table is the bottom input (aka right table).
We need to preserve the right table geometry points to plot only the bike stations on the map. We can achieve this by setting the "Join mode" as "Right" in the "Nearest Join" node's configuration window. Additionally, we should apply a 500-meter radius from the left table containing the landmarks.
The Nearest Join output will show all entries from the right table comprising fifty bike stations. However, only three stations are within a 500-meter radius of the landmarks on the left table. As a result, most of the columns from the left table will not have any values.
To narrow down the bike stations to only those within a 500-meter radius of the landmarks, we utilize the "Row Filter" node and remove any rows that have missing values.
The output table will show information from both tables plus the added "Distance" column, but only the geometry points from the right table (Bike stations) will be kept.*
Finally, we display the bike stations nearest the landmarks within a 500-meter range. We provide the landmark name, bike station name, the distance from the landmark, and the landmark address as tooltips.
*To achieve the same outcome, you can use the "Buffer" node on the landmarks and then do a spatial join using the "Spatial Join" node. An example of this method can be found in the External resources section: "Buffer and Spatial Join (POI Search)".
Workflow
Nearest Join
External resources
Used extensions & nodes
Created with KNIME Analytics Platform version 4.7.4
Legal
By using or downloading the workflow, you agree to our terms and conditions.