iTowns / itowns

A Three.js-based framework written in Javascript/WebGL for visualizing 3D geospatial data
http://www.itowns-project.org
Other
1.08k stars 293 forks source link

Feature/add bbox url precision #2243

Closed ketourneau closed 6 months ago

ketourneau commented 7 months ago

Description

When we try to use a custom WMS source (omniscale provider) we got some mistake if the coordinate in BBOX url is rounded.

Motivation and Context

We would like to set custom precision of BBOX passed in url to solve our problem. In our case if bbox precision is 9 it's work.

sourceMap = new itowns.WMSSource({
    url: `https://maps.omniscale.net/v2/${omniscaleKey}/style.default/map`,
    name: "osm",
    format: "image/png",
    crs: "EPSG:2154",
    extent: extent,
    version: '1.1.0',
    bboxUrlPrecision: 9
});

Screenshots

bboxUrlPrecision: 2 Capture d’écran 2023-12-19 à 16 34 09

bboxUrlPrecision: 9 Capture d’écran 2023-12-19 à 16 33 44

ketourneau commented 7 months ago

For the time we don't have any overfitting with IGN ortho data, only with omniscale Open Street Map. I applied your code review, thanks for the review.

Desplandis commented 6 months ago

Sounds good to me! I saw the implementation of both mapbox and openlayers and they use numbers directly without truncating them, it may have been a fix for some IGN datasets, I will look into it!