Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapillary object tiles not loading #36

Closed
jinalfoflia opened this issue Jul 25, 2016 · 17 comments
Closed

Mapillary object tiles not loading #36

jinalfoflia opened this issue Jul 25, 2016 · 17 comments

Comments

@jinalfoflia
Copy link

jinalfoflia commented Jul 25, 2016

Sometimes the detected restrictions from Mapillary fail to load, there are these errors in the console:

image

cc: @planemad

@planemad
Copy link
Contributor

planemad commented Jul 25, 2016

@jinalfoflia looking into it.

@gyllen we're getting CORS error inconsistently across different users while requesting vector tiles of the restrictions. Any tips on how to resolve this?

@planemad
Copy link
Contributor

Error observed with 10 concurrent users, and the tiles loaded very slow (30 seconds-5 minutes) after map load. Once this was reduced to 5 users, the error was no longer faced, so it seems like the Mapillary servers got overloaded.

@gyllen
Copy link

gyllen commented Jul 25, 2016

@planemad Can't really see any big loads coming in. Would need to check this again.

I talked to some of you colleagues over the weekend a SOTMUS. Here is a first fix for you guys.

First lets switch to the production API, to call it you need to register a new applicaiton on Mapillary. Login and go here https://www.mapillary.com/app/settings/developers then copy that client id in link below.

https://a.mapillary.com/v3/tiles/{z}/{x}/{y}.mapbox?objects=accuracy,alt,first_seen_at,last_seen_at,package,rect_count,rects,updated_at,value,user_keys&client_id={CLIENT_ID}

Big change with these tiles is that they are no longer connected to an image. Its the actual object, so many detections can be merged into on object and it gets its own location. All of the properties in the link are optional so you request the ones you want. Here is a breakdown on what they mean.

accuracy
How accurate the objects location is 0-1

first_seen_at
The date when this object was first spotted.

last_seen_at
The date when this object was last seen/

package
Internal name of detector package. You don't really need to care so much about this one.

rect_count
Number of detections that this object was constructed from.

rects
A list of the actual detections.

rects: [
  {
    image_key: "a0veRvWMFLSv2bdEi1bQ2Q", // Image detected in
    rect_key: "msd42t7g6x2ai3cp1pdqr6bpq7", // Referrs to the actual detection
    captured_at: 1402837647000 // The time the image was captured
  }
],

updated_at
Last time this object was updated.

value
The actual value of the detection same values in old tiles. Check these out https://www.mapillary.com/sprites/sprites.png, https://www.mapillary.com/sprites/sprites@2x.png, https://www.mapillary.com/sprites/sprites.json and https://www.mapillary.com/sprites/sprites@2x.json

user_keys
List of users contributing

user1 | user2 | user3 | user4 | user5
Since I can't find any regexp filtering in mapbox-gl users are also supplied one by one. So a filter would have to filter over all of these 5 to search for a specific user.

Let me know how this works out for you and if you need some additional properties or tweaking of the current ones.

@planemad
Copy link
Contributor

@gyllen fantastic. Will give this a try tomorrow 🐳

@planemad
Copy link
Contributor

@gyllen getting "Uncaught Error: Unimplemented type: 4" using that endpoint. Is the source-layer still ors?

Does this look ok?

osm-navigation-map/index.js

Lines 154 to 163 in 6e4c40c

var mapillaryClientId = "MFo5YmpwMmxHMmxJaUt3VW14c0ZCZzphZDU5ZDBjNTMzN2Y3YTE3";
var mapillaryTrafficSigns = {
"type": "vector",
"tiles": [
// "http://mapillary-vector.mapillary.io/tiles/{z}/{x}/{y}.mapbox?ors=key,l,package,value,validated,image_key,user,score,obj,rect",
"https://a.mapillary.io/v3/tiles/{z}/{x}/{y}.mapbox?objects=accuracy,alt,first_seen_at,last_seen_at,rect_count,rects,updated_at,value,user_keys&client_id=" + mapillaryClientId,
],
"minzoon": 14,
"maxzoom": 16
};

@gyllen
Copy link

gyllen commented Jul 25, 2016

Its objects sorry about that

@planemad
Copy link
Contributor

@gyllen 🙇 works! Couple of things:

  • rects seem to be a string rather than an array rects:"[{"image_key":"yPzvdXKLXPIE-BhBwkzOZw","rect_key":"ii2ddu8vsv9goiceuhinamis04","captured_at":1468851591000}]". Is this expected?
  • Curious abut how to use rect_key. Is this referring to the part of the image with the signage?

@planemad planemad changed the title Getting this error on the map and also the total Mapillary restrictions reviewed remains constant (5) Mapillary object tiles not loading Jul 26, 2016
@planemad
Copy link
Contributor

planemad commented Jul 26, 2016

@gyllen the tiles loaded much faster with the new endpoint. But we continue to face the same issues intermittently on the map, the tiles suddenly stop loading.

screenshot 2016-07-26 15 30 50

cc @ajithranka

@maanyaumashaanker
Copy link

screen shot 2016-07-26 at 3 42 26 pm

This error that was encountered while adding turn restriction. Would be great if this could be fixed.

@manoharuss
Copy link

screenshot 2016-07-26 15 49 58

I am getting a 504 error. The Mapillary detected signage overlay is not loading. It would be great to resume mapping if this is fixed.

cc @planemad @ajithranka

@gyllen
Copy link

gyllen commented Jul 26, 2016

@planemad Are you still facing this issues. It looks like we were overloading our read/write servers ourself for a couple of hours (huge segmentation works)

@planemad
Copy link
Contributor

@gyllen looks smooth now 👍 is this something to expect in the coming days?

@gyllen
Copy link

gyllen commented Jul 26, 2016

@planemad No this should not be expected ;), and if you ever see it again please report (tuning the system before making it real live in production).

For the array, it is expected I don't think vector-tiles allows me to send actual json as properties.

The rect_key is referring to the the part in the actual image. However to show rectangles you should probably ask for them by requesting all for an image.

In MapillaryJS you can enable to show rects with a config option, also in a near future we will enable zoom in regular images.

@planemad
Copy link
Contributor

All smooth now.

@ajithranka
Copy link
Contributor

@gyllen Do the detected objects have a unique key we can use for filtering? Right now we are highlighting a selected object by filtering on rects: https://github.com/mapbox/osm-navigation-map/blob/gh-pages/index.js#L352. Would be great if each object has an id of some kind.

@gyllen
Copy link

gyllen commented Aug 17, 2016

@ajashton Yes add key to the tile url and you will get an uniq object key. Don't count on it as staying there though, as new images gets into the area this key will update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants