heremaps/harp.gl

Satellite/vector data misalignment

Closed this issue · 7 comments

Overlaying HERE satellite & vector data shows a clear systematic misalignment at some zoom levels.

To reproduce, overlay Vector Tile API data over e.g. the 'datasource_satellite-tile' example by adding the code below. There is a clear bias at many zoom levels whereby the vectors are drawn several pixels above and to the left of the satellite data.

  const omvDataSourceStreets = new OmvDataSource({
    baseUrl: "https://vector.hereapi.com/v2/vectortiles/base/mc",
    apiFormat: APIFormat.HereV1,
    authenticationCode: apikey,
  });
  mapView.addDataSource(omvDataSourceStreets).then(() => {
    const styles: any = [
      {
        when: `$geometryType ^= 'poly'`,
        technique: "solid-line",
        renderOrder: 2010,
        attr: {
          color: "#ffffff",
          lineWidth: "1px"
        }
      }
    ];
    omvDataSourceStreets.setStyleSet(styles);
    mapView.update();
  });

Expected reasonable correspondence between satellite & vector data or at least no systematic bias towards the upper-left.

Attached harp.gl example + Google Earth Pro for reference. Bias is clear everywhere but especially obvious on islands, a few circled in red for clarity. Taken on macOS Catalina, latest Chrome Version 87.0.4280.88 (Official Build) (x86_64), harp.gl 0.21.1.

a
b

Hi @brent-williams ,

thanks for reporting this, I can actually reproduce it also with the other raster tile formats, I ll create an internal issue to investigate this issue, and let you know when there is a solution.

@brent-williams , I did some investigation, and it seems there is an offset in our satellite images, but, as far as I can tell, it isn't related to harp.gl. I compared also in another internal renderer and got the same issue.

I also compared with a google satellite image, and there seems to be a 1px shift south east. I will ask internally to find who is responsible for this service and ask to resolve.

Thanks from my side to for your bug report!

2021-01-13-22-29.mp4

@nzjony good to know, please advise when you have some more information. One pixel when viewing tiles straight on isn't so bad, but with harp.gl globe rendering zoomed out it results in the satellite being out by 4, 5, 6 pixels even, which of course looks terrible.

@brent-williams , will do.

Yes, agreed. I managed to see the shift even when changing zoom levels, see:

2021-01-14-09-50.mp4

And between 3 and 4 seconds, there seems to be a shift in the texture. Note, this example uses a storageLevelOffset of -1, so it makes the problem seem a bit worse. The problem is exaggerated in some cases because the vector data is simplified, which may explain the larger gaps you see.

I have asked internally and we will contact the team responsible for the image generation.

I wanted to suggest a 'fix', but using the storageLevelOffset, which basically lets you control how the zoom level dictates which storage level to request, but this seems broken. :(.

I will make a fix for this, and you can then at least configure a larger storageLevelOffset (if it doesn't affect performance in your case drastically) so that you can mitigate the problem somewhat.

@brent-williams , I fixed the bug with the storageLevelOffset and tested locally, and you can now see the difference. The storageLevelOffset set to 1 provides the closest match. This could be a good "fix", until the images themselves are corrected.

Screenshot 2021-01-14 at 11 25 31

Screenshot 2021-01-14 at 11 25 09

Screenshot 2021-01-14 at 11 24 52

@nzjony nice work thanks for the fast workaround! Still looking forward to corrected imagery of course to eliminate the 4x/16x oversample.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.