Live data from Hacker News

Figuring out the best place to live in Helsinki

wanhala.net

41–50 of 50 posts

Re: Figuring out the best place to live in Helsinki

#41

Genius. My only comment is in how you measure the value of an address. It seems very likely that your algorithm would converge to areas that are only centrally located. Perhaps it could be improved if the algorithm took an input of common routes and times, then tried to find an optimal location for these routes. This way the algorithm could be scaled as needed and provide a more realistic scenario. Is this something…

"My only comment is in how you measure the value of an address." This. Having lived in the center (reddish area) and later also in southern Helsinki (bluish green), I strongly prefer the latter due to it's proximity to the sea and as it's way quieter area without busses, trams or general traffic. And judging by housing prices so do many others who live in the city.

Don't get me wrong. I found the map highly interesting but maybe in determining best places to live it's a bit of a stretch. There might more value here for businesses that aim to be easily reachable.

Re: Figuring out the best place to live in Helsinki

#42
post #34

Earlier quoted context omitted.

That's cool. Could I bother you for more information on how to do this? I'd like to try that for where I live. Thanks

I'll dig through the source tomorrow. Check back.

OK: I found the old source and I'll try to outline it (trust me it's a bit one-off since it's not usued in the production so it's easier to explain in english).

The most important bit is the public transit API: it allows returning travel times between addresses or geographic coordinates. For stockholm there is the trafiklab api which is excellent, and free. https://www.trafiklab.se/api/

A naive implementation would just generate the map by taking each map pixel, figuring out the lat/lon on the map, and calling the transit API to get the color of the pixel. That however will be painfully slow (a year?) since the API will throttle/limit the number of calls.

So a better approach is to sample some subset of points and interpolate. Most of the larger city area is not populated so a lot of time would be wasted trying to query transport times from places in water or forrests. The best solution I could come up with was to use a list of addresses, because those say where people live. So I needed a list of addresses either with lat/lon coordinates, or a service that could give me lat/lon from the addresses (Such as openstreetmap). I found a real estate api at Booli that provided a large number of addresses including lat/lon. Perfect. I just made a simple script to dump a large list of many thousand addresses to a little db I had.

So I loop all the addresses in my address list, using a timer to throttle the transit API calls to the allowed rate. The results (coordinate, transit time) I insert into a QuadTree for perf - a list would work just as well but finding the nearest point later would be slow as hell.

After that is done, I generate map tiles. For each pixel of each tile I get the lat/lon, and then do a lookup in the QuadTree for the closest known point within some max_walking_distance (I chose 2km) for which I know public transit (Taking the shortest travel time if there are several). This can now run completely offline so will complete generating maps for all the zoom levels in not many minutes (I chose zoom levels 5..14 which covers the use case nicely).

The app itself is then just a static html with some google maps api calls to serve the overlay map from the static tile images.

Note the demo moved: https://andersforsgren.github.io/commutemap/

Re: Figuring out the best place to live in Helsinki

#43

I did a similar one for Stockholm but for the greater metro area rather than on street level, for the commute time into the city (When I was looking for a place to live outside). I What I really wanted to do was find "underpriced areas" where commutes are faster than house prices indicate. In this case I simply took a large number of addresses, ran them through the API for public transit for a random fixed workday (A…

New url (moved off Azure as the quota was reached)

https://andersforsgren.github.io/commutemap/

Re: Figuring out the best place to live in Helsinki

#44

Genius. My only comment is in how you measure the value of an address. It seems very likely that your algorithm would converge to areas that are only centrally located. Perhaps it could be improved if the algorithm took an input of common routes and times, then tried to find an optimal location for these routes. This way the algorithm could be scaled as needed and provide a more realistic scenario. Is this something…

Isn't his algorithm pretty bluntly designed to do this? So I did my own analysis: I calculated the travel time from every address to every other address in Helsinki around 7:30-8:00am (about 30 billion searches total!). Then I calculated the (weighted) average travel time to anywhere in the city, using amount of jobs in the target area as weight. That would seemingly bias towards centrally-located addresses (travel t…

My thought was to make the algorithm a bit less blunt by sampling routes that are relevant to your lifestyle.

Just might spice it up if you partition the bucket of all routes into spaces defined by your lifestyle too. It would be interesting to see what the best address in Helsinki is for hipsters. Or families. Or athletes. Or business people...

This is so cool because anyone who has moved has faced this problem.

Re: Figuring out the best place to live in Helsinki

#45

I did a similar one for Stockholm but for the greater metro area rather than on street level, for the commute time into the city (When I was looking for a place to live outside). I What I really wanted to do was find "underpriced areas" where commutes are faster than house prices indicate. In this case I simply took a large number of addresses, ran them through the API for public transit for a random fixed workday (A…

For those interested, there is a website that does this for a number of cities, mostly clustered in the US & Europe: http://www.mapnificent.net/

Re: Figuring out the best place to live in Helsinki

#46
post #19

I had actually almost exactly the same problem that is why I created: http://crib.ninja It allows to save apartments across different websites and automatically extracts the information (like rent, size, bedrooms, bathrooms, location, ...). The apartments can then also be displayed on a map with a kind of travel-time heatmap from https://www.route360.net . Additionally is it possible to sort or filter by any of the p…

The heat map integration is nice, I wonder why real-estate listing websites don't provide something like this already. Maybe there is a business opportunity for you there (to integrate this with some of the websites themselves that you support).

Re: Figuring out the best place to live in Helsinki

#47

I did a similar one for Stockholm but for the greater metro area rather than on street level, for the commute time into the city (When I was looking for a place to live outside). I What I really wanted to do was find "underpriced areas" where commutes are faster than house prices indicate. In this case I simply took a large number of addresses, ran them through the API for public transit for a random fixed workday (A…

For those interested, there is a website that does this for a number of cities, mostly clustered in the US & Europe: http://www.mapnificent.net/

Cool, their logo even looks like my map. Nice to see they didn't have Stockholm, I hate it when I make something only to discover theres a nicer one out there already...

Re: Figuring out the best place to live in Helsinki

#48
post #19

I had actually almost exactly the same problem that is why I created: http://crib.ninja It allows to save apartments across different websites and automatically extracts the information (like rent, size, bedrooms, bathrooms, location, ...). The apartments can then also be displayed on a map with a kind of travel-time heatmap from https://www.route360.net . Additionally is it possible to sort or filter by any of the p…

The heat map integration is nice, I wonder why real-estate listing websites don't provide something like this already. Maybe there is a business opportunity for you there (to integrate this with some of the websites themselves that you support).

Agree that there is an opportunity but less for me than for Route360. The integration is quite simple and I am sure their sales people already talk with some of them. So there is not really a need for me anywhere there. Only if pages want to include data from other websites. So on crib.ninja are you for example able to also add your favorite restaurants from Yelp, the sights of your city from Wikipedia, ... and display all of them at once.

Re: Figuring out the best place to live in Helsinki

#49
post #2

Nice work, is the source available? I'd love to do something similar for Sydney, Australia.

Unfortunately not. I created it with various programs I've written for my data visualisation videos ( https://www.youtube.com/user/laurivanhala )

Very nice! Are you importing transit data into a 3D renderer, or did you write the rendering code yourself?

Re: Figuring out the best place to live in Helsinki

#50

I did a similar one for Stockholm but for the greater metro area rather than on street level, for the commute time into the city (When I was looking for a place to live outside). I What I really wanted to do was find "underpriced areas" where commutes are faster than house prices indicate. In this case I simply took a large number of addresses, ran them through the API for public transit for a random fixed workday (A…

For those interested, there is a website that does this for a number of cities, mostly clustered in the US & Europe: http://www.mapnificent.net/

That is a great link! We are just starting to look for a new place outside the city and that will come in very handy.
Post reply on HN