{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-cli-py/issues/11","labels_url":"https://api.github.com/repos/mapbox/mapbox-cli-py/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-cli-py/issues/11/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-cli-py/issues/11/events","html_url":"https://github.com/mapbox/mapbox-cli-py/issues/11","id":118841755,"number":11,"title":"Input waypoints","user":{"login":"perrygeo","id":1151287,"avatar_url":"https://avatars.githubusercontent.com/u/1151287?v=3","gravatar_id":"","url":"https://api.github.com/users/perrygeo","html_url":"https://github.com/perrygeo","followers_url":"https://api.github.com/users/perrygeo/followers","following_url":"https://api.github.com/users/perrygeo/following{/other_user}","gists_url":"https://api.github.com/users/perrygeo/gists{/gist_id}","starred_url":"https://api.github.com/users/perrygeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perrygeo/subscriptions","organizations_url":"https://api.github.com/users/perrygeo/orgs","repos_url":"https://api.github.com/users/perrygeo/repos","events_url":"https://api.github.com/users/perrygeo/events{/privacy}","received_events_url":"https://api.github.com/users/perrygeo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-25T13:59:02Z","updated_at":"2015-12-03T18:18:46Z","closed_at":null,"body":"The directions, distance and surface APIs all require *input waypoints*. Let's specify this in more detail...\r\n\r\nAt the python SDK level, all of the services take an iterable/list of GeoJSON-like feature mappings. At the command line, it's not clear to me exactly what the inputs will be.\r\n\r\nThe CLI will take `x` and normalize it to a list of features where `x` could potentially be\r\n\r\n- line-delimited GeoJSON features on the stdin stream (output of fio cat)\r\n- path to a GeoJSON file containing a featurecollection of points (probably the most common case?)\r\n- paths to GeoJSON files each containing point features (makes interop with geocoding easier since you're likely to get one feature per call)\r\n- stream or file of GeoJSON geometries\r\n- stream or multiple args with JSON arrays of coordinate pairs `\"[lat, lon]\"` (ala the input to reverse geocoder)\r\n- ... others? ...\r\n\r\nSo the question is, **What types of inputs will we support for waypoints?** On one hand I want to support the most common workflows even if that means accepting a bunch of different input formats. On the other hand, unix design principles - let other tools do the lifting to get data into our expected format.\r\n\r\nAnd on a related note, if we're accepting GeoJSON and the service requires points, how should we handle other geometry types? Automatically explode multipoints and lines to points? Skip them? Be strict? Most of these validation decisions will likely be implemented at the SDK level but it might be useful to discuss them in this context.\r\n\r\ncc @sgillies "},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-cli-py/issues/comments/161737233","html_url":"https://github.com/mapbox/mapbox-cli-py/issues/11#issuecomment-161737233","issue_url":"https://api.github.com/repos/mapbox/mapbox-cli-py/issues/11","id":161737233,"user":{"login":"perrygeo","id":1151287,"avatar_url":"https://avatars.githubusercontent.com/u/1151287?v=3","gravatar_id":"","url":"https://api.github.com/users/perrygeo","html_url":"https://github.com/perrygeo","followers_url":"https://api.github.com/users/perrygeo/followers","following_url":"https://api.github.com/users/perrygeo/following{/other_user}","gists_url":"https://api.github.com/users/perrygeo/gists{/gist_id}","starred_url":"https://api.github.com/users/perrygeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perrygeo/subscriptions","organizations_url":"https://api.github.com/users/perrygeo/orgs","repos_url":"https://api.github.com/users/perrygeo/repos","events_url":"https://api.github.com/users/perrygeo/events{/privacy}","received_events_url":"https://api.github.com/users/perrygeo/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T18:18:46Z","updated_at":"2015-12-03T18:18:46Z","body":"So the current supported input options are:\r\n\r\n* Coordinate pair(s) of the form `[0, 0]`, `0,0` or `0 0`\r\n* An input stream/file containing either a GeoJSON feature or feature collection.\r\n* For functions that accept points only, any non-point feature is silently filtered out."}}