ESRI Coordinate Row Filter Workflow

@lelloba If you can still share the code you mention here and how you set it up in kinme I would appreciate it. I am back on this geospatial problem again after taking much time to complete several other tasks, but still need to resolve this. Thanks

1 Like

@lelloba Do you have a functioning workflow you can share? It seems you need two feeds, 1) the shapefiles’ data and their points, and 2) the entities you are testing for inclusion in each polygon (identifier for each and their associated latitude and longitude points)? thanks

1 Like

Hi Creedsmith,

I don’t have a workflow ready right now but I can make one tomorrow. The one I am using is working with sensitive data I cannot share.
Is it ok for you? :slight_smile:

RB

@lelloba Anything you can provide would benefit me greatly. It’s not really your job to create a workflow on my behalf, but if you do it I will certainly take it :slight_smile: It likely will benefit many knime users and may make you famous. Thanks

2 Likes

Hello Creedsmith,

have a look at this workflow:

Description of the columns in input and output is inside the workflow.
I hope it can help. Let me know if it’s working for you or you need something else.

Have a nice Sunday,
RB

2 Likes

@lelloba thanks for the workflow. A couple of questions when you have the time.

  1. This can be any unique identifier I assign?

temp

  1. These are the lat/longs for each entity?

temp1

  1. These are the shapefiles’ (polygon) series of points

  1. The real question: if I have 2,000 properties (houses; unique identifiers) with the latitude and longitude associated to each, and 70 different polygon shapefile point series, how do I test each of 2,000 properties for potential inclusion of 70 different polygons. I don’t know R, but it seems you are testing to see if one entity is within or outside of just one polygon; binary, true or false? I need to test if one entity is within perhaps any of 70 different polygons and do this for perhaps 2,000 entities.

As I stated earlier, my problem is not your problem, so if you don’t easily know, I can perhaps restate all of this as a new question in knime forum. Thanks very much :slight_smile:

Hi Creedsmith,

  1. MITTENTE_COD is the identifier of the stop location
  2. MITTENTE_LATITUDINE and MITTENTE_LONGITUDINE are the results of the geocoding of the stop location address
  3. This is the attribute containing the vertices of the geofences in polygonal form
  4. If you can reconduct your “the_geom” column to the format of my “Punti R”, then it should be easy. You can use a cross joiner node to compute all combinations between property and areas, then identify the correct area for each location by filtering on true values on column “In Poligono”. If it is possible to have properties not belonging to an area you need to make sure to include them in your output file.

Different problems but their core part is the same :grinning:
What do you think about point #4? If you want, we can schedule a meeting call on Monday late afternoon/evening and work on this together.

RB

@lelloba thanks for responding. It’s been several months since I was working on this part of the project. Let me re-construct my data ( a lot has changed in my project since I last worked on the GIS portion of the project). I will create some trials, crash-and-burn a few times, then bother you again when I can precisely explain where I am going wrong.

I did read the information on ray casting, a very smart solution to this problem. If this was all your own idea, brilliant, and you should publish or protect it. If this was you discovering others’ work and applying it, still brilliant. Thanks again!

1 Like

No bother, don’t worry :slight_smile:
The algorythm is not mine, I found it in YouTube and rewrote it R.
Hope that will help more people in the future!

Cheers,
RB

1 Like

@lelloba I’m busy proving to myself how un-smart I am, but came across this article, which I believe is related to the problem(sss…) I am trying to solve and may help you some time in the future Extreme Performance Boost for Knime Spatial Processing - ClearPeaks Blog Thanks

2 Likes

Very useful! Thank you :slight_smile:

@lelloba So here’s the tiny start of a new workflow I expect to reproduce many times for different locations, once I get this running correctly.

temp

I am also attaching the initial data set (with Lat/Long data) and my initial set of polygons in KML.

Where do you suggest I go from here? thanks

QUANT_Historical_DSF.xlsx (375.0 KB)

It looks like I cannot upload KML to KNIME, so here is a dropbox link (I will remove it in a few days. The analyses to determine area took a very long time using proprietary information derived.) Dropbox - Highlands Ranch Colorado.kml - Simplify your life

Hi Creedsmith,

have a look at this:

Seems to work (to be honest, I’ve checked only a couple of rows):

The final output contains both rows with houses inside a geofence and houses not belonging to anything.
I have not used views/visuals nor followed the article you’ve sent me yet.

Hope it’s ok for you, let me know :slight_smile:
RB

@lelloba thank you; I will play with this for awhile.

Along with the other article linked prior, you may wish to also look at this, if you have not already done so read-multiple-shp-files-in-loop — NodePit

Sometimes, it’s a matter of looking at a bunch of different concepts that helps you arrive where you really want to be.

1 Like

@lelloba I’m having a terrible time installing and getting R to work to run your Snippet Node. Are you running an Apple or Windows machine? Is this the link Rtools42 for Windows where I can install all the KNIME Console packages in red text? Thanks

So, ten hours in and I cannot get R (installed latest version of R and Rtools) to work. The R Snippet throws error notices. I’ll have to search out another method. Thanks for your help.

Hi Creedsmith,

I am using Windows. Which is the sequence of steps you have followed for installation?

Maybe this can help:

Otherwise, we need to translate the code into something else.

RB

@smithcreed Getting R to run with KNIME can be tricky to do (took me a while the last time I did it). I may have a different approach to that problem. If all you want is the code snippet, you can get it from the settings.xml of that node:

  1. Save the imported workflow to your workspace
  2. Open your workspace in the Windows Explorer, navigate to the workflow and node.
  3. Find the snippet somewhere within the settings.xml (near the top)
  4. The text is escaped html if I remember correctly, you’ll need to un-escape it.

This doesn’t require you to have the extension installed and/or working, so it’s obviously a read only process. Since the implementation of @lelloba is not R specific, you could use any scripting node (or possibly pure-KNIME?) after translating the syntax.

@Thyme @lelloba I finally got R to function on windows and KNIME, I think. I’m now trying to understand how the results are coming out. I show 60 properties not within any polygon. I would have expected far fewer and will try mapping everything out to see what is going on.

I ended up installing the fully R-Tidyverse libraries to get things running. Thanks

1 Like

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