Read from Shapefile node will no longer be supported?

Hi, in https://nodepit.com/node/ch.res_ear.samthiriot.knime.shapefilesaswkt.read.read_from_shapefile.ReadShapefileAsWKTNodeFactory?numSuccessors=999999
it is clearly stated that this node only works with version 4.7.
I would need it because the Shapefile Polygon Reader and Shapefile Point Reader nodes do not extract the other existing columns which I need to identify the polygons or points.
I tried to upload these files but it seems not possible.
Thanks,
Alfredo

Have you tried GeoFile Reader node in Geospatial Analytics Extension for KNIME?

If you did, why does this not work for you?

Hi @XiozTzu,
Thanks for the reply! I had already tried this node and received this error message:

ERROR GeoFile Reader 3:839 Execute failed: Unable to open C:.…\NIL_WM.shx or C:.…\NIL_WM.SHX. Set SHAPE_RESTORE_SHX config option to YES to restore or create it.

Ciao,
Alfredo

A Shapefile has three mandatory files .shp , .shx , and .dbf .

If any of those are missing or corrupt the tools will not work. It seems the node will try to regenerate on of them so I would give it a try.

Start rant, Shapefiles are a garbage spatial format. Use GeoPackage or GeoJSON if you can.

The strange thing is that in R everything works fine. I tried to replicate the process in KNIME to deploy it without necessarily having R installed.
Here is part of the R console. As you can see, the shapefile is not corrupted or with any other problems.

library(tmap)
library(sf)

st2 ← st_read(“C:/…/NIL_WM.shp”)

Reading layer NIL_WM' from data source C:.…\NIL_WM.shp’ using driver `ESRI Shapefile’
Simple feature collection with 88 features and 8 fields
Geometry type: POLYGON
Dimension: XY
Bounding box: xmin: 9.040602 ymin: 45.38672 xmax: 9.277981 ymax: 45.53594
Geodetic CRS: WGS 84

st2 ← st2[,c(“ID_NIL”,“Shape_Area”,“geometry”)]

st2
Simple feature collection with 88 features and 2 fields
Geometry type: POLYGON
Dimension: XY
Bounding box: xmin: 9.040602 ymin: 45.38672 xmax: 9.277981 ymax: 45.53594
Geodetic CRS: WGS 84
First 10 features:
ID_NIL Shape_Area geometry
1 48 2406306.1 POLYGON ((9.154221 45.43775…
2 64 489692.1 POLYGON ((9.106227 45.49016…
3 67 909602.2 POLYGON ((9.156362 45.48785…
4 81 1578027.6 POLYGON ((9.168035 45.52234…
5 84 1532331.0 POLYGON ((9.200403 45.52848…
6 63 1424660.1 POLYGON ((9.083754 45.48485…
7 20 1747499.5 POLYGON ((9.230444 45.4925,…
8 76 2776872.2 POLYGON ((9.134807 45.52095…
9 11 1322887.1 POLYGON ((9.201165 45.48963…
10 61 986354.2 POLYGON ((9.111432 45.4764,…

Can you post your workflow or the shapefile?

Yes, sure, thank you very much for your support!

Air_Quality_Monitoring_Stations_Milan.knwf (577.5 KB)

and this is what I get in R:

After importing the workflow, use this path for the shapefile reader nodes:
knime://knime.mountpoint/Air_Quality_Monitoring_Stations_Milan/data/
e.g. knime://knime.mountpoint/Air_Quality_Monitoring_Stations_Milan/data/NIL_WM.shp

As I suspected you are missing 2 of the 3 manditory files that go with a shpaefile. Somehow your R has access to the other 2. I don’t know how else it would be working. The .dbf file contains all the data for a shapefile.

Shapefile - Wikipedia

1 Like

Hi @XiozTzu,
You are right! I actually missed the other files you mentioned…sorry and thanks for your kind support!
Alfredo

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.