Convert Lat/Lon to geometry and write to a SQL database as WKB.

Hello,

Unfortunately, I am once again—or rather, still—facing the problem that it is either impossible, or requires cumbersome workarounds, to directly import geospatial data (WKB) from an SQL Server into KNIME. Likewise, I still do not understand how to write results back into the SQL Server (in WKB format).

The specific problem is as follows:

  • PostgreSQL database
  • Tables containing sensor data are written into the database from a REST API using KNIME ETL workflows.
  • This process is intended to occur at regular intervals.
  • There is a separate table for each type of sensor.

When new data arrives, it includes latitude and longitude coordinates. Upon writing this data to the table, these coordinates need to be converted into a `geometry` object and stored in the `geometry` column. This is required for subsequent processing using a GIS application.

Apparently, this still cannot be done directly—a limitation I previously pointed out in 2023.

Or perhaps I simply haven’t found the right method yet.

The attached image illustrates one possible solution using the “DB SQL Executor” node. However, there are five “DB Merger” endpoints involved.

I cannot find a node that can be attached to the “DB Merger” endpoints to perform the same function as the “DB SQL Executor.”

The “DB SQL Executor” must be executed as the very last step—only after all sensor data has been successfully loaded into the database.

And, naturally, the geometry generation process should apply only to the *new* data entries.

Essentially, I am looking for a mechanism to “execute SQL after execution” (i.e., as a post-processing step).

Would “DB Connection Extractor” help?