GithubHelp home page GithubHelp logo

Input waypoints about mapbox-cli-py HOT 5 CLOSED

mapbox avatar mapbox commented on June 16, 2024
Input waypoints

from mapbox-cli-py.

Comments (5)

sgillies avatar sgillies commented on June 16, 2024

Seems to me that we've got to support at least these two inputs:

  • streams of coordinate pairs (either as JSON or comma-delimited pairs), the most abstract input
  • geocoding output, the least abstract input

Let's put other possible inputs (GeoJSON geometries) aside for now.

To generate a list of waypoints from a list of addresses, a user needs to make multiple geocoding requests, select from multiple results for each, and probably ends up with a feature collection containing point-of-interest type features. Agree with your assessment above that this is the most common use case.

In converting those types of features to points, I think the least surprising thing to do is to compute a centroid of the feature geometry instead of exploding them into multiple points. The workflow is something like this, right?

  Geocoding stuff --> FeatureCollection --> list of [x, y] centers --> API

What doesn't exist yet is the utility that merges the best points of interest from every address query into one feature collection. Do we want to provide such glue for users?

from mapbox-cli-py.

perrygeo avatar perrygeo commented on June 16, 2024

utility that merges the best points of interest from every address query into one feature collection

It's a bit funky but cat, jq and fio collect can already do that:

cat <(x-mapbox geocoding "Portland, OR" | jq -c .features[0]) \
    <(x-mapbox geocoding "Bend, OR" | jq -c .features[0]) \
    <(x-mapbox geocoding "Corvallis, OR" | jq -c .features[0]) \
    | fio collect > points_featurecollection.geojson

from mapbox-cli-py.

sgillies avatar sgillies commented on June 16, 2024

Your bash fu is strong, @perrygeo.

from mapbox-cli-py.

perrygeo avatar perrygeo commented on June 16, 2024

So the current supported input options are:

  • Coordinate pair(s) of the form [0, 0] or 0,0 or 0 0
  • An input stream/file(s) containing either a GeoJSON Feature or FeatureCollection.
  • For functions that accept points only, any non-point feature is silently filtered out.

from mapbox-cli-py.

perrygeo avatar perrygeo commented on June 16, 2024

Calling it good for now

from mapbox-cli-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.