Giter Site home page Giter Site logo

Comments (14)

vivet avatar vivet commented on August 19, 2024

Hi again
Sorry i haven't worked that much with Roads api
Try check the Response.RawJson. That shows what google returns.

from googleapi.

ericbrunner avatar ericbrunner commented on August 19, 2024

response.RawJson

"{\n  \"snappedPoints\": [\n    {\n      \"location\": {\n        \"latitude\": 48.160701920080641,\n        \"longitude\": 15.615951312026901\n      },\n      \"originalIndex\": 0,\n      \"placeId\": \"ChIJdb0ylo6HbUcRhty45O33OIc\"\n    },\n    {\n      \"location\": {\n        \"latitude\": 48.163834926702592,\n        \"longitude\": 15.615102852000513\n      },\n      \"originalIndex\": 1,\n      \"placeId\": \"ChIJY-KcuIiHbUcRcLXeMxGzJlw\"\n    },\n    {\n      \"location\": {\n        \"latitude\": 48.162118789614105,\n        \"longitude\": 16.483688015927697\n      },\n      \"originalIndex\": 45,\n      \"placeId\": \"ChIJg46bP5CqbUcRK07KzaXoyRs\"\n    },\n    {\n      \"location\": {\n        \"latitude\": 48.16213290222106,\n        \"longitude\": 16.483567306372223\n      },\n      \"originalIndex\": 46,\n      \"placeId\": \"ChIJg46bP5CqbUcRK07KzaXoyRs\"\n    },\n    {\n      \"location\": {\n        \"latitude\": 48.162141252774212,\n        \"longitude\": 16.483495880930516\n      },\n      \"or
iginalIndex\": 47,\n      \"placeId\": \"ChIJg46bP5CqbUcRK07KzaXoyRs\"\n    }\n  ],\n  \"warningMessage\": \"Input path is too sparse. You should provide a path where consecutive points are closer to each other. Refer to the 'path' parameter in Google Roads API documentation.\"\n}\n"

I put my Path here (what I pass to the SnapToRoadsRequest.Path)

from googleapi.

vivet avatar vivet commented on August 19, 2024

But that is what google returns, which seems du be the same as the deserialized response

from googleapi.

ericbrunner avatar ericbrunner commented on August 19, 2024

image

from googleapi.

vivet avatar vivet commented on August 19, 2024

Could be...
But the RawJson and the RawQueryString is good properties to check if you suspect my Api does something wrong.

from googleapi.

ericbrunner avatar ericbrunner commented on August 19, 2024

Good to know. Thanks.

from googleapi.

ericbrunner avatar ericbrunner commented on August 19, 2024

Would I have another option to snap the gps points to a road if I don't get as much points as google would need ? my drivers are often in areas with no or less connectivity and it occurs that I get only every few minutes gps coordinates. thanks in advance.

from googleapi.

vivet avatar vivet commented on August 19, 2024

Not through Google.
You would need to use compass or similar to track the direction and add fake coordinates.
What is your business goal? you need the route or the distance?

from googleapi.

ericbrunner avatar ericbrunner commented on August 19, 2024

My goal is a realistic route visualization along the real way my drivers drove. From above screenshot you can see that the polylines are straight connections between each point which is by design and d o n t snap on the road. That's what I want to achieve: Snao that polyline on the real road

from googleapi.

ericbrunner avatar ericbrunner commented on August 19, 2024

Maybe the nearestroad API of the Roads API but as far as I read it is a very fragile stuff. For the SnapToRoads API the GPS waypoint should not exceed a distance of max. 300 meters.

from googleapi.

vivet avatar vivet commented on August 19, 2024

Yes you can try nearest roads.
Otherwise you can consider using directions api to "fake" the results.

from googleapi.

ericbrunner avatar ericbrunner commented on August 19, 2024

regarding "directions api to 'fake' the result"

Yes that would be pretty much sufficient ...

PEASE could you give me a sample or starting point for such scenario as in my case, where I have several pre-collected waypoints ? Thanks in advance.

from googleapi.

vivet avatar vivet commented on August 19, 2024

Sorry i can't help much with that.
I support the GoogleApi, but not concrete business requirements.
I guess you have to experiment a bit.

from googleapi.

ericbrunner avatar ericbrunner commented on August 19, 2024

Ok thanks

from googleapi.

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.