Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

chengdz
Copy link
Contributor

@chengdz chengdz commented Feb 23, 2025

No description provided.

@timoore
Copy link
Owner

timoore commented Feb 24, 2025

@chengdz , thanks so much for this contribution! I've been wanting to do this myself. It would be very useful if you could write a couple of test files that show off how to use these new classes.

@chengdz
Copy link
Contributor Author

chengdz commented Feb 26, 2025

thanks for your suggestion! I have already added a couple of test files

@timoore
Copy link
Owner

timoore commented Feb 27, 2025

I gave this a try. I think you forgot to check in changes to src/vsgCs/CMakeLists.txt.

The overlay-urlTemplate.json test worked. Very nice! The other tests failed with various errors:

$ /opt/bin/worldviewer --ion-token-file ~/ion-token tests/overlay-wmts.json 
info: Selected sRGB window 0.0289912 0.0289912 0.133209 1
Warning: miniCompile did recording!
[2025-02-27 15:44:19.811] [error] [ErrorList.h:89] Errors while loading image for tile:
- Received response code 500 for image https://ows.terrestris.de/osm/service?request=GetTile&version=1.0.0&service=WMTS&format=image%2Fpng&layer=HikeMap&style=default&tilematrixset=hikemap_grid&tilematrix=0&tilerow=0&tilecol=0.
[2025-02-27 15:44:19.811] [error] [ErrorList.h:89] Errors while loading image for tile:
- Received response code 500 for image https://ows.terrestris.de/osm/service?request=GetTile&version=1.0.0&service=WMTS&format=image%2Fpng&layer=HikeMap&style=default&tilematrixset=hikemap_grid&tilematrix=0&tilerow=0&tilecol=0.

$ /opt/bin/worldviewer --ion-token-file ~/ion-token tests/overlay-tms.json 
info: Selected sRGB window 0.0289912 0.0289912 0.133209 1
[2025-02-27 15:45:20.264] [error] [RasterOverlayCollection.cpp:150] Error while creating tile provider: curl: Could not connect to server
Warning: Error while creating tile provider: curl: Could not connect to server
$ /opt/bin/worldviewer --ion-token-file ~/ion-token tests/overlay-wms.json 

No error, but no imagery on the globe.

If a demo requires an API key to work at all, you should add a comment in the test file. I realize that I haven't done that with any of the Cesium ion tests...

@chengdz
Copy link
Contributor Author

chengdz commented Feb 28, 2025

I have fixed overlay-wmts.json and overlay-wms.json test file configuration error, but there are relatively few publicly available TMS metadata services,if you know, modify the url address in the overlay-tms.json file to test it, thanks

@chengdz
Copy link
Contributor Author

chengdz commented Mar 5, 2025

I found a TMS service in Rocky, it's so far away and right in front of me

@timoore
Copy link
Owner

timoore commented May 12, 2025

This is really excellent; thanks for the contribution. I've pushed this pull request as the topic branch chengz/addRasterOverlay and merged it to the next branch so that people can play with it before it goes into master. I will have some notes on the code.

One thing I'd love to see is support for designating a color to represent transparent pixels, so that a map with a monochrome background could be overlayed on photo imagery. I thought about doing this in the fragment shader, but I think that's not going to work with filtering, sRGB->linear, etc., so best done in vsgResourcePreparer::prepareRasterInLoadThread.

CesiumRasterOverlays::RasterOverlay* CsUrlTemplateRasterOverlay::createOverlay(
const CesiumRasterOverlays::RasterOverlayOptions& options)
{
if (this->TemplateUrl.empty())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't use this-> in member functions. I feel it should be clear enough that an identifier refers to a class member.

{
if (!TileMatrixSetLabels.empty())
{
std::vector<std::string> labels;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be:
wmts.Options.tileMatrixLabels = this->TileMatrixSetLabels;

Am I missing something?

@chengdz chengdz requested a review from timoore May 15, 2025 06:36
@timoore
Copy link
Owner

timoore commented May 15, 2025

FYI, I prefer that master not be merged into topic branches and pull requests. I realize that the build system has changed since you started this branch and that it might not be obvious how to build your branch in isolation anymore; what I would do is create a local integration branch with your topic merged into master. You can commit changes on top of that and then, when ready for review, rebase any new changes onto the topic branch.

At the moment the next branch is sort of an example of that; I was able to merge the addRasterOverlay branch to it with no problems and test it out with all the latest stuff.

@timoore
Copy link
Owner

timoore commented May 16, 2025

I've merged your review changes to chengz/addRasterOverlay and to next. This is looking good. I added an example with OpenRailwayMap, which is nice because it has alpha transparency.

@chengdz
Copy link
Contributor Author

chengdz commented May 19, 2025

Thanks for the review! Let me know if there's anything else needed from my side.

@timoore
Copy link
Owner

timoore commented Jun 26, 2025

This has been merged to master. Thanks @chengdz !

@timoore timoore closed this Jun 26, 2025
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

Successfully merging this pull request may close these issues.

2 participants