Closed zsxgb closed 7 years ago
For this project, I was given the street intersections (some didn't actually exist, and some were labeled with the wrong borough, but that's another story) Step 1: To obtain the coordinates of the street intersections, I used Google Maps Place Text Search and queried strings such as "14 St and 3rd Ave Manhattan NY" (so this query would translate into: "https://maps.googleapis.com/maps/api/place/textsearch/xml?query=14%20St%20and%203rd%20Ave%20Manhattan%20NY&key={YOUR_KEY_HERE}") You can see the documentation for Google Maps Place Search here: https://developers.google.com/places/web-service/search
I think the true question you're asking is how do you get all the street intersections for any specific region. Alternate Step 1: This StackOverflow post: http://stackoverflow.com/questions/12965090/get-list-of-all-intersections-in-a-city provides 2 methods of getting the latitude/longitude pairs for street intersections (with some false positives). I just tried them with different queries, and they work well at extracting nodes/points/geospatial coordinates of street intersections; however, both fail if the area is too large. You could try either of these approaches and simply scan over the city in question with a zoomed in view that does not cause the server to timeout or run out of memory, and make your CSV of latitude/longitude pairs for street intersections by putting together the extracts from each viewport.
Step 2: You can then obtain street view images of street intersections by supplying the coordinates to the Street View API as seen in this guide: https://developers.google.com/maps/documentation/streetview/intro
thank you for your help. I found another website. Is in another map service provider gaode.com They provide an API in China, this can query the intersection. "Http://lbs.amap.com/api/webservice/summary/" This is their URL.
New question came. Many junctions are no traffic lights. This is a lot of trouble.
If you want to detect whether the image you get has a traffic light, you will most likely need to use Computer Vision tools (or build a traffic light detector with something like OpenCV). One simple Computer Vision API is available from Microsoft: https://www.microsoft.com/cognitive-services/en-us/computer-vision-api In the online demo, if you provide it the URL to this image: http://www.southeastroads.com/georgia001/us-025_sb_at_norwich_st.jpg it will give you tags for the image: [ { "name": "road", "confidence": 0.9999780654907227 }, { "name": "sky", "confidence": 0.9999679327011108 }, { "name": "outdoor", "confidence": 0.9999172687530518 }, { "name": "light", "confidence": 0.9980942606925964 }, { "name": "street", "confidence": 0.992097020149231 }, { "name": "traffic", "confidence": 0.9881325364112854 }, { "name": "green", "confidence": 0.9706493616104126 }, { "name": "way", "confidence": 0.9286357164382935 }, { "name": "intersection", "confidence": 0.9269002079963684 }, { "name": "scene", "confidence": 0.8815078139305115 }, { "name": "highway", "confidence": 0.436069130897522 }, { "name": "turn", "confidence": 0.4315124452114105 }, { "name": "empty", "confidence": 0.304784893989563 } ]
thank you for your help. This API I did not know before. I think I need to understand this API.
Thank you very much for your help.
You're welcome, good luck with your project =)
I want to collect some of the images within a region of traffic lights. But this data is not New York. I would like to ask you how to get these data csv file it.
I used google API, looking for a long time, did not find this method