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

Lines rendered skewed #1097

Closed
paulmach opened this issue Mar 17, 2015 · 4 comments
Closed

Lines rendered skewed #1097

paulmach opened this issue Mar 17, 2015 · 4 comments
Labels

Comments

@paulmach
Copy link

screen shot 2015-03-16 at 11 30 07 pm

Rendering many short lines. I expect them to be basically rotated rectangles, but they are skewed. There does not appear to be any consistency in the way they are skewed. The layer JSON is:

{
  "id": "time" + i,
  "type": "line",
  "source": "activities",
  "source-layer": "time10",
  "paint": {
    "line-width": 0,
  },
  "paint.time10on": {
    "line-width": 6,
    "line-color": '#F94D1E',
  },
  "filter": [
    "==",
    "t",
    "Ride"
  ]
}

with the time10on class added. I can provide a more detailed test case if needed.

@ansis
Copy link
Contributor

ansis commented Mar 17, 2015

Would it be possible to get access to the source?

@paulmach
Copy link
Author

I might have done something weird, here is an example https://gist.github.com/paulmach/14bb232091a31f24b70d

What I did was use tippeecanoe to generate tiles with extent 256. Then I "manually" multiplied the move-to/line-to geometry values by 16 and set the extent to 4096 so they'd display correctly. The difference between just having tippeecanoe generage 4096 extent tiles is that the geometry is simplified. I'm dealing with a lot of data and was exploring ways to make the tiles smaller.

I could have a bug here but I don't understand why the lines wouldn't be some form of rectangles, even if in wrong locations.

When I just display the original 256 extent tiles I still see a few skew issues, but there were less of them. And the lines are in the wrong locations as mentioned before in #1093

@tmcw tmcw added the bug 🐞 label Mar 18, 2015
@ansis
Copy link
Contributor

ansis commented Mar 18, 2015

Thanks for the great test case!

One of the lines (with bigger width, transparency and round caps) looks like this:

screen shot 2015-03-18 at 1 14 07 pm

The point values:

[
    {
        "x": 4294968908,
        "y": 1696
    },
    {
        "x": 4294968992,
        "y": 2147485312
    },
    {
        "x": 4294969052,
        "y": 4294968956
    }
]

When tessellating the line into triangles it uses these big values to calculate the offsets, but when they are added to the rendering buffers the positions are forced into a short. The positions and the offsets don't correspond so the lines look weird.

Are the coordinates being calculated and encoded correctly? If they are, this could be a pbf decoding issue on our side.

@paulmach
Copy link
Author

Yes, this was my bad. Signed bit shift issue. I guess the impact was magnified in this test case. Sorry to trouble you.

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

No branches or pull requests

3 participants