-
Notifications
You must be signed in to change notification settings - Fork 86
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
file:///
URLs with escaped spaces (%20
) do not work
#522
Comments
Thanks for the test case, but it is invalid.
Think about it like this. In regular old HTML, if you have a web page at: And inside there you have a link that looks like this: Where will you go when you click that? The answer is |
@kring
compared to:
|
@TheYarin both of those test cases pass. |
@kring Interesting. Then the problem is probably elsewhere. I recreated the circumstances and the problem indeed reproduces. Would you mind trying to reproduce the issue I've been encountering? Loading a layer from a |
@TheYarin what problem are you having when you try to do this? |
@kring {
"attribution": "",
"available": [
[{ "endX": 1, "endY": 0, "startX": 0, "startY": 0 }],
[{ "endX": 3, "endY": 1, "startX": 0, "startY": 0 }],
[{ "endX": 7, "endY": 3, "startX": 0, "startY": 0 }],
[{ "endX": 15, "endY": 7, "startX": 0, "startY": 0 }],
[{ "endX": 31, "endY": 15, "startX": 0, "startY": 0 }],
[{ "endX": 10, "endY": 24, "startX": 10, "startY": 24 }],
[{ "endX": 20, "endY": 49, "startX": 20, "startY": 49 }],
[{ "endX": 41, "endY": 98, "startX": 41, "startY": 98 }],
[{ "endX": 82, "endY": 196, "startX": 82, "startY": 196 }],
[{ "endX": 164, "endY": 392, "startX": 164, "startY": 392 }],
[{ "endX": 328, "endY": 785, "startX": 328, "startY": 785 }],
[{ "endX": 657, "endY": 1571, "startX": 657, "startY": 1571 }],
[{ "endX": 1315, "endY": 3143, "startX": 1315, "startY": 3142 }],
[{ "endX": 2631, "endY": 6286, "startX": 2630, "startY": 6285 }],
[{ "endX": 5262, "endY": 12572, "startX": 5261, "startY": 12571 }],
[{ "endX": 10524, "endY": 25145, "startX": 10522, "startY": 25143 }],
[{ "endX": 21049, "endY": 50290, "startX": 21045, "startY": 50286 }],
[{ "endX": 42099, "endY": 100580, "startX": 42090, "startY": 100573 }],
[{ "endX": 84199, "endY": 201160, "startX": 84180, "startY": 201147 }]
],
"bounds": [-180, -90, 180, 90],
"description": "",
"extensions": ["metadata", "octvertexnormals"],
"format": "quantized-mesh-1.0",
"maxzoom": 18,
"metadataAvailability": 10,
"minzoom": 0,
"name": "",
"projection": "EPSG:4326",
"scheme": "tms",
"tiles": ["{z}/{x}/{y}.terrain?v={version}"],
"version": "1.1.0"
} When I set the following URL in the Cesium3dTileset:
And I get the same error if I use a space instead of If I change the name of the folder to It seems that the relative path in the Where do you think the problem lies? |
This appears to be a bug in Unity. When we construct a |
I'm going to move this issue into the cesium-unity project and update the title. |
Uri::resolve()
not resolving URIs with spaces properlyfile:///
URLs with escaped spaces (%20
) do not work
There's a similar issue in Unity's issue tracker, but it claims to be fixed: And perhaps it was, mostly... |
Hmm, that explains it then. I'm using Unity 2022.3 and still experience this issue. Did you manage to reproduce the issue on your machine? |
Yep, I wrote the comment above after reproducing the problem on my system and digging into what went wrong. |
amazing, thank you! |
The
CesiumUtility::Uri::resolve()
function does not seem to handle a base URI with spaces as expected, even when the spaces are encoded as%20
.Specifically, I'm working with a file URI, so let's use
file:///C:/Temp/3d%20tiles/tileset.json
as an example.Note: I am not sure the problem is within this specific function, this is just my suspicion. I encountered this issue while trying to load a 3DTiles tileset using Cesium for Unity.
If anyone with a dev environment for cesium-native set up could test that, this would be very helpful.
Adding the following code to line 98 of
CesiumUtility/test/TestUri.cpp
might save you some time:By the way, for some reason if the base URI is
file:///C:/Temp/3dtiles/tileset.json
(assuming this path is correct) and the relative path istiles/1
it still finds the right files somehow, despite ending up with what I expect is a URI to a subfolder of a file, which can't be right. Does anyone have any idea how?The text was updated successfully, but these errors were encountered: