Cartodb: "Find nearest" analysis lack of support for being applied to source as target

Created on 25 Apr 2017  Â·  16Comments  Â·  Source: CartoDB/cartodb

Context

Let's say you want to apply "Find nearest" to get the 5 closest neighbors of your own kind to make some aggregations. Like "give me the average KPI of my area".

You can't. There is no way to select the source node as target in the UI

Steps to Reproduce

Just try to find nearest features in the same node you're using as source

cc @ivanmalagon @saleiva @noguerol

Frontend enhancement

Most helpful comment

Deployed.

All 16 comments

hi hi,

I am not sure this is the correct analysis for those use cases. BUT, you can still run it agains the dataset (not the layer tho). When you "give me the avg KPI for my area" you mean with a widget, right?

Give us more context! :)

Yep, maybe. Just think on getting the highest value of the "neighborhood" of each feature, being that the current feature plus its 5 closest neighbors. You can even use this as a way of "smoothen" your distribution or finding missing values (your feature may have a null value for that field)

Uhm... for that I'd think on something like "summarize nearby"...

2nd use case: a unique dataset of fast-food restaurants, categorized per brand: I want to know my closest competitor per brand.

IMO those use cases sound pretty uncommon, as clients will almost always get their own data from a different table than competitors, and if there is an exception they can always reconnect the table. That said, because duplicating data is not optimal and from a long term perspective enabling source as target may open some future use cases, I think we should do this but is not a priority by any means.

:+1: That's it. It looks quite simple to enable the source as target, but no rush.

Hey guys, just wanted to let you know that not only Abel and I have been wanting to use this analysis with matching source and target layers. Here's a SB ticket from GSTV (if I'm correct, the guys who sponsored this analysis) where they state that _"For each GSTV station, I want to find the closest other GSTV station"_

I've used this analysis four or five times since it was released and, in all cases except one, I've wanted to do a "Self Nearest" as well. It really isn't that uncommon, and the workaround (which is what GSTV is using) of adding the layer again, then filtering out the results with distance = 0, is really ugly.

Understood and prioritized.

Deployed.

@AbelVM @arredond can you guys give this a try? @jeffkaplan88 AFAIk, the client was interested on doing this, so I think it would be great to communicate with them!

cc/ @kevin-reilly

I've been trying to test this feature with a set of 1500 Best Buy locations in the US. I'm trying to find the nearest location for each and the analysis is not completing.

What information do you need to look into this?

I just ran this for 300 locations, it the analysis returned the target as the nearest location (0 distance) for all 300 records.

Maybe I'm doing something wrong...

Nope. That's right. You may want to find competitors but some of the competitors share the location with yours.

Just ask for 2 nearest, and the apply the "filter by column" analysis and drop the rows with zero distance

You can't do SQL in an analysis, right? How would I drop the rows?

It seems like this isn't useful to visualize. It only works as to create the raw data. Is that right?

You can use the analysis I mentioned above to drop that rows

image

Got it. Sorry, I was jet-lagged yesterday and didn't read your whole note
carefully.

--
Kevin Reilly
SVP Product
CARTO https://carto.com/ | [email protected] kevin@carto.com
(917) 375-2168

On Mon, May 22, 2017 at 11:21 AM, Abel Vázquez Montoro <
[email protected]> wrote:

You can use the analysis I mentioned above to drop that rows

[image: image]
https://cloud.githubusercontent.com/assets/9017165/26315932/f918987a-3f12-11e7-994f-bcbd8fb34d91.png

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/CartoDB/cartodb/issues/12057#issuecomment-303132140,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACy_X8o-D7-t9Tw5GpuCS4PIWHQbT55Sks5r8afqgaJpZM4NHnni
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

piensaenpixel picture piensaenpixel  Â·  4Comments

ivanmalagon picture ivanmalagon  Â·  3Comments

rochoa picture rochoa  Â·  4Comments

saleiva picture saleiva  Â·  4Comments

jesusbotella picture jesusbotella  Â·  4Comments