How to get an 'active travel' network on OSMNX? - osmnx

Is it possible to obtain a network in OSMNX that includes both walking and cycling networks as one?
Look at this example (Amsterdam):
Walking network_type='walk'
WalkingNetwork
Cycling network_type='bike'CyclingNetwork
One over the other (to be able to see the differences) BothNetworks
Is it possible to have a "unified, integrated and clean" network with both travel modes?
Thanks

Related

Multiple Depot Vehicle Routing Problem Optaplanner

I am trying to customize Optaplanner for my particular use-case. I have been successful so far but now I am struck at the point where I need to have multiple depot and multiple location. Their main use-case seems to be under the assumption that all the vehicle will start from a particular location called depot/warehouse.
In my use-case the conditions are slightly different, The vehicle can start from their own respective locations, meaning there will be multiple depot and multiple customer locations to visit. {MDVRP problem}
for e.g ->
If I have 5 agent and 10 customer location to provide any service, this algorithm assumes
that all these agent will start from same starting location i.e warehouse/depot.
Thus the algorithm will optimize routes based on this assumption and all routes will
start from warehouse
My use case is somewhat like this
If I have 5 agent and 10 customer location to provide any service. Then the algorithm should
start optimizing the route from their own respective location to all the customer location.
So far I have tried custom input to their algorithm. But it doesn't work in an expected manner. Have anyone tried this tool with multiple depot. Any kind of help is appreciated.
The optaplanner-examples implementation supports multi-depot's and it has datasets with multidepots in its data directory. The OptaWeb implementation is based on that model, so the solver should be able to handle it already, but the UI doesn't support this feature yet.

Mturk: three tasks but only one HIT

How can this be done with Mechanical Turk?
1- Worker fills in an evaluation test
2- The same worker uses an online e-learning site specifically on the topics that he/she failed.
3- The same worker passes again the evaluation test in order to confirm he/she made progress.
The test and the training can both be done online. Results and communications via email.
Thanks.
This sounds like a lot of manual work or custom programming.
You might want to use a Mechanical Turk Partner like TurkPrime.com. They work with many researchers to create customized solutions using what they call Concierge Services".
It sounds like manual work to me as well. If you do not want to program it then the manual option is to split it into three separate HITs and add a custom qualification after the first and second HIT. These qualifications would be required to accept the second and third HIT respectively.

Google Map Directions API Optimize Waypoint and Force Waypoint Order

I am having difficulty in overcoming the situation I am facing. I have a route as follow:
StartPoint
WayPoint A-1 <--- Pickup
WayPoint A-2 <--- Dropoff
WayPoint B-1 <--- Pickup
WayPoint B-2 <--- Dropoff
WayPoint C-1 <--- Pickup
WayPoint C-2 <--- Dropoff
EndPoint
A bus is starting to drive from Start Point and it is supposed to pick 3 passengers up (A, B, C) and drop them off in different locations. The locations are not static and it changes based on passenger.
If I pass all these to google map directions api and set the OptimizeWaypoint option to true the issue that occurs is sometimes the dropoff waypoint occurs before pickup waypoint for a passenger due to route optimization.
Does anyone know a solution to force google map api route optimization to always have pickup before the dropoff for each passenger please?
I appreciate all your help in advance guys.
I have found a solution to my problem after 3 days of research. The solution is not through Google Map API and it's using a third party API called RouteXL. They are providing an API which does such this thing I am looking for. Here is the link to documentation although their documentation is not clearly documented but it has helped me to work it out.
https://www.routexl.nl/blog/api/?lang=en#post-tour
The function which I needed was the Tour Post and that does what I exactly needed.
If anyone needs any help on this I am happy to help.
I hope this helps everyone else.
Thank you all for the help.
The waypoint optimization feature in Google Maps is limited to basic travelling salesmen scenarios in which all the waypoints are re-ordered to find the optimal route. What you are looking to do falls under the category of Vehicle Routing problem, more precisely the Vehicle Routing Problem with pickup and delivery. Google doesn't provide a service for this. However, there are some open source algorithm available for this. Here are a few:
https://github.com/pgRouting/pgrouting/wiki/VRP%20Pickup%20Delivery%20Problem
https://github.com/graphhopper/jsprit
https://github.com/mck-/Open-VRP
Most of these use straight line distances to generate a distance matrix between your locations which are then used within the algorithm. For better accuracy you may want to use a distance matrix service that based on travel time. For even more accuracy you may want to take a look at the Bing Maps distance matrix service which also provides the option to generate a distance matrix over a period of time intervals for a day which would fluctuate based on predictive traffic conditions.

How to get a set of navteq links on a given road

I am using Nokia maps (Navteq, postgis DB).
Given a "link" I want to get all the "links" which belong to a bounding-box that map-match the same highway / route.
How can I do this using DB queries / Postgis?
Just came across this open topic. Do you know that HERE is meanwhile providing an online possibility for requesting linkIds within a boundingBox?
Further information can be sound here: Fleet Telematics Custom Locations
https://developer.here.com/documentation/custom-location/topics/key-concepts.html
And here is an example for a corridor search:
https://developer.here.com/documentation/custom-location/topics/example-search-corridor.html
That might be easier than host a database and then query the needed content.
Hope this helps.

Apply pattern recognition to user authentication for malicious attempts

To strengthen the authentication mechanism (web), I would like to log a user fingerprint for every attempt and apply pattern recognition to distinguish malicious attempts. For example if the user always logs in from European computers and there is an attempt made from China, the user is blocked until the user confirms (via email, for example) to allow logins from China.
I have a very, very small knowledge of pattern recognition from a university course. However, I cannot recall enough to start developing this service. What I know is that you should look at these various features:
Browser agent string, resulting in:
Operating system
Browser vendor
IP address, resulting in:
Location
Time stamp of login
Number of (failed) attempts (within session, or total)
You search for patterns and any extraordinary attempt is marked because it does not follow the average pattern. You probably will apply a threshold, so if a user logs in at night or has a new PC, it still works.
There are also a few requirements: first, the check of an attempt must be made real-time. You cannot block access after 2 minutes if the credentials were OK but you found out later on the attempt could have been malicious. Furthermore, all our apps are written in PHP, but PHP is probably too slow for this. I prefer to use Python then, but subsequently there is also a binding to Python required.
So the question is: where to start? What is the best approach to accomplish this? I can log all data in a key storage like Redis or document based like Mongo. How would I design a service which allows to validate a new attempt with certain features against a bulk of known other attempts? And return whether the attempt matches the average within a timely fashion, say 250ms.
What you want to do is called anomaly detection- wikipedia is a good place to start. As a first stab, you might want to try clustering:
you will need a data set. The good news is clustering is unsupervised, so you will not have to mark up a ton of login attempts as regular or malicious.
For a given user, keep a history of their past N logins (big brother warning!) and features of those logins. The features you have listed are a good start, but you can think of more.
apply a clustering algorithm to estimate what the average login is like. For every new attempt you can calculate the distance from the average and decide if it look malicious or not.
As a side not, you can go a long way without learning. My intuition is the location of the login and the number of failed attempts will get you most of the way there. A simple if-else might be good enough.