feature_engine icon indicating copy to clipboard operation
feature_engine copied to clipboard

Geo distance transformer

Open VascoSch92 opened this issue 1 year ago • 4 comments

Hei,

For a project, I created a transformer that given the coordinates of two points on the earth calculates the distance between them. It would be interesting to have in here.

If you are interested I could open a PR with a first draft to discuss it.

Let me know.

VascoSch92 avatar Aug 27 '23 13:08 VascoSch92

Hey @VascoSch92

Yes, I also created distances from coordinates in my work as well. This is a functionality I've been wanting to add to the library for a long time.

It'd be great if you could give it a go and and add that transformer.

How would the transformer work?

What I had in mind is that the transformer takes 2 lat and 2 lon variables, that is 4 input features, and returns the distance. That's how my data looked like in the past. Is this what you do as well? I am happy to hear of alternatives.

Thank you!

solegalli avatar Aug 28 '23 06:08 solegalli

I have a first version of the distance transformer that I will like to share.

What it the etiquette for branch names?

VascoSch92 avatar Aug 30 '23 05:08 VascoSch92

Hey @solegalli , the distance transformer is ready :-) at least a sketch. Can you add me as contributor? Otherwise I can not create a PR

Thanks

VascoSch92 avatar Sep 10 '23 11:09 VascoSch92

Hey @VascoSch92

Thank you so much for the engagement, and super apologies for the delayed response.

Before taking new PRs I wanted to fix all tests that were failing due to the new releases of pandas, sklearn and scipy.

That is now done.

We work with PRs.

So if you fork this repo (make sure you have the latest version of main), and then create a branch where you add the functionaity, you could make a PR from there.

More info in how to contribute here: https://feature-engine.trainindata.com/en/latest/contribute/contribute_code.html

solegalli avatar Sep 12 '23 14:09 solegalli