# Help With Geo Coordinates / Lat+Long

Hi KNIMErs.

Many geo-coordinate threads on the forum revolve around distances. What I’m interested in is a lil bit different.

Attached herewith is a sample of my data sampledatageo.xlsx (8.3 KB) where you’ll see this simple table:

What I’d like to do is to find a representative lat+long values for each of the location, using the available reference points from Column B.

As you can see, the locations may have 3 different cases:

1. Where each location has two references: The representative point can be calculated by finding a midpoint, and I think I can do this with the Math Formula Node using (X1+X2)/2 , (Y1+Y2)/2 .

2. Where each location has three references: The representative point can be calculated by finding the triangular centroid, using (X1+X2+X3)/3 , (Y1+Y2+Y3)/3 .

3. Where each location has four references: This is where it gets complicated.

I tried to use this node but along with many other nodes from the same Extension, they require the values to be in WKT formats. From a lil bit of Googling, it seems that this could be done with Python, but I need a non-python solution.

Is there a way to convert the geo-coordinates to WKT using a simple, non-coding method?

Or, is there a completely alternative workaround for what I’m looking for? Something like this complex calculation is available on the net, but I don’t know how to implement it in KNIME.

You could use Palladian for that:

1. Parse the strings as Geo cells,
2. use GroupBy with the “Midpoint” or “Center of minimum distance” aggregation operators provided by Palladian.

Would this help?

(note that simply “averaging” X/Y long/lat values will not give you a real Midpoint, the mentioned operators involve quite some more magic)

Here’s an example:

5 Likes

Thanks @qqilihq , I’ll go with the center of minimum distance, since I understand the concept despite not knowing the precise calculation behind it. Also, the solution makes sense on GMap too: