Making Use of Polygon Boundaries Data

@badger101

The issue I’m facing is that the row number doesn’t match, even though I set the component setting to the same number of rows as the input file.

I downloaded you workflow and ran it with my Shapefile and couldn’t find a problem. Which component, where and under what circumstances are you having a problem?

I don’t have the extension installed, is there any particular reason you didn’t use the normal Table View.

The table view is not important to the calculation and can be deleted. It was just there to select the circles column so that it was more visible in the component. As long as you can read that column to get the result of the calculation column you can ignore the component (or replace it with something that works for you).

DiaAzul

Thanks for replying @DiaAzul , didn’t you get the same errors I did when running it? Maybe because you mentioned “ran it with my (= your) Shapefile” and therefore you couldn’t replicate the issue. Can you re-run the workflow as it is (with the data from my Shapefile)?

Please refer to the errors shown in the recording below:

https://youtu.be/LpBO3VGt9xA

Thank you in advance!

(Just in case you’re wondering why the timing of my mouse wasn’t accurate in that recording, it was due to the limitation of the recording system used.)

Hi @DiaAzul

Your posts and solutions in this thread are amazingly great ! Maybe this could become a KNIME blog once @badger101 questions are all answered. I’m impressed ! Thanks for sharing !

Best wishes,
Ael

4 Likes

Hi @badger101

Thanks @badger101 for your kind comments. My pleasure to help on this. It has been tough for me to be proactive at the forum lately but I’m happy to help if I can, even if only a little.

Very interesting question and answers from @takbb, @gonhaddock & @DiaAzul. I’m really curious where this leads and the final solutions.

Good luck!

Best wishes,
Ael

1 Like

Hi @aworker , thanks a lot for participating. I wonder if you can check out my workflow, see if you got the same error as I did in the video too.

Hi @badger101,

When importing your workflow on a just freshly installed 4.6.4 KNIME version, the workflow doesn’t want to open executed and I cannot read the data since it is not in the workflow. Could you please upload here your source data ? If not possible in a Shapefile format, please rename it as a *.txt file so that it can be uploaded. I will rename it back once uploaded.

Thanks in advance :slight_smile:
Best
Ael

@badger101

Maybe because you mentioned “ran it with my (= your) Shapefile” and therefore you couldn’t replicate the issue. Can you re-run the workflow as it is (with the data from my Shapefile)?

Your Shapefile is still on your machine. I can’t access it. :rofl: :rofl: :rofl:

There is a folder (that I created) in the workflow called data. If you put the data file in that folder and then share it on the hub then everyone will have access to your Shapefile.

If you don’t want to do that, then share the file separately and I will let you know when I have downloaded it.

Unfortunately, KNIME has disabled private messaging on the forum (which would be useful in this case for sharing sensitive information).

DiaAzul

1 Like

@aworker @DiaAzul Perhaps it’s something to do with the latest Knime version I’m using. I’ve already exported it without resetting (i.e. executed state).

Anyways, I have just manually uploaded the SHP file into the data folder as @DiaAzul advised:

And here’s the link to the hub:

Sorry for any inconvenience. Let me know if there’s still a problem accessing the data so I can find other ways.

1 Like

Hi @badger101

Thanks for the workflow with data. It imported without problems. Once I try to execute the -Relate Geometries- node, I get the error shown on the snapshot below:

So I can confirm I get the same error as the one you mentioned. Most probably @DiaAzul can better help on this than me since he implemented the workflow :wink:

Best
Ael

1 Like

Thank you! That’s all I ask for :grin: @aworker

Will wait for @DiaAzul :grin:

1 Like

@badger101

Anyways, I have just manually uploaded the SHP file into the data folder.

Ahh, No-one ever said that working with GIS files would be easy. A Shapefile is not one file, but several. If you look in the folder at the Dorset shapefile it comprises several files with extensions (cpg, dbf, prf, qmd, shp, shx, etc…). The full spec for Shapefile is here on the ArcGis web site. Therefore, you need to copy the package of files, not just the shp file.

You also need to check that you have matched the Co-ordinate Reference System (CRS) in the workflow to the CRS in your shapefile. You don’t need a deep understanding of spatial geometry, but some understanding does help, and is useful to understand why different countries/organisation use one reference system compared with another. As described in the earlier description of the workflow, I had to use EPSG:4326 (WGS 84) because the spatial processing nodes wouldn’t work with the input files CRS system.

The reason I mention this is that you may need to do some work to find out which CRS system will work with your file and the spatial processing nodes in KNIME. The KNIME package is old, and doesn’t appear to be supported. It also appears to have some behaviours that generate errors. The two nodes that you need to pay attention to are the first Reproject Geometries node, where you can change the input files CRS to the workflow CRS; and then, within the Create Grid Points components, there is a Create Point from 2D Co-ordinates node in which you need to set the CRS to match your chosen Workflow CRS.

I would suggest:

  1. Find out what CRS is used by your shapefile. If you open the *.prj (projection ) file in a text editor it tells you what the projection is. In the case of Dorset.prj the projection is “British_National_Grid”, OSGB_1936. You can try setting the workflow to match the input file specification.
  2. If that doesn’t work then try setting the workflow CRS to EPSG:4326 (WGS 84). This is the CRS used by GPS system and commonly used on the web (e.g. Google maps). For the view component to work it may require the input data in WGS 84, especially if it is downloading maps from the internet and not transforming them to the same CRS as your workflow. This is what I have set the workflow to for the Dorset file, because the Create Point node didn’t seem to want to work with anything else. As pointed out above, there is no guarantee that these nodes are bug free; and if the developer only used data in WGS 84 format (very common format widely used) then they may not have tested data using a different CRS.

The reason you are having problems is that the number of rows for each input to the Relate Geometries node are different. You need to find out why. It sounds as if there is no data common out of the Create Grid Points component and you, therefore, have one row from the retained geometries/cross-joiner table; and no rows from Create Grid Points. You need to find out how to adjust the input data/ CRS to get points correctly generated so that the rest of the workflow does what you need.

DiaAzul

2 Likes

This is how my .prj file looks like inside, so I’m guessing WGS84 is the one I need to adjust to. I did the adjustments for both the ‘Reproject’ and ‘Create Point from 2D’ nodes as you mentioned above, but it still didn’t solve the error. That only indicates that there are other factors involved. Unfortunately, I lack the knowledge from this field to investigate further.

I am thankful for the efforts from everyone. I am marking the post by @DiaAzul as the solution for other people’s reference. Sadly, for my case, I will still be looking to find an alternative (but still KNIME-based) solution.

Have a good day!

2 Likes

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