-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define a streetTalk() function that takes a lat/lng pair and a city name as inputs, and returns a conversational string stating nearest street as well as enclosing streets #5
Comments
I'm going to design the function as below:
Need to confirm:
|
We will still need to add a step to compare the nearest_name to the names of the intersectingStreets in order to know which are the enclosing streets, but looks like a great start. And to be explicit about your questions:
|
One thought I am having for this piece is that if we want to use this function on each record in a dataset, we shouldn't be loading the shapefile on each run if all points in the dataset are in the same city. One way to handle this might be to explicitly create a global variable within the function and check to see if that variable is defined before loading in the shapefile. Something like: Perhaps there is a more elegant solution though. |
David, thanks for insight!!! It really helps to improve the performance! If there are multiple cities in one dataset, then we'd better to set different key for each cities. Here is the code I have. Any advice?
|
Okay, awesome. Let's assume each dataset represents a single city for now. And code looks great to me. My only advice would be to catch the edge cases we saw earlier with something like:
My thinking is let's wrap up a stable version and start a nice write up. The write-up can include thinking creatively about use cases outside of SQUID and/or explaining what is going on technically; or both. Basically the idea with the write-up is to have something for you to show off. We will publish it and push it out into our network, but feel free to take it in whichever direction you feel will be most useful for you. After getting that started, we can circle back to updating the code if we want to add anything additional. (For example, it might be useful to explicitly identify points that are in intersections as opposed to on street segments.) |
Hi David, the code has been updated several days ago. For the write-up, do I need to write the blog post based on the original one, or to write a new one based on what we did? And after the write-up, will we continue to develop an API described in original post? |
Hey Yukun - The plan for this project was to create the open-source streetTalk() function. So I have not scoped out an implementation plan for the other pieces. However, we can hop on a call together next week to sketch that out if you would like. Just let me know. A recommendation for the write-up would be describing motivations for creating this more conversational way of referencing locations--these could come from the original blog post, this repo's README, and/or any applications you have in mind. The write-up would also include approach we took. To reiterate though: at the end of the day, the write-up is for you to present your work. So please feel free to take it in a different direction if you would prefer that. |
This function can use the nearestSegment() and intersectingStreets() functions.
The text was updated successfully, but these errors were encountered: