vsgCs icon indicating copy to clipboard operation
vsgCs copied to clipboard

add wmts wms tms urltemplate rasterOverlay

Open chengdz opened this issue 10 months ago • 6 comments

chengdz avatar Feb 23 '25 13:02 chengdz

@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.

timoore avatar Feb 24 '25 01:02 timoore

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

chengdz avatar Feb 26 '25 05:02 chengdz

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...

timoore avatar Feb 27 '25 15:02 timoore

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 avatar Feb 28 '25 03:02 chengdz

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

chengdz avatar Mar 05 '25 10:03 chengdz

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.

timoore avatar May 12 '25 08:05 timoore

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 avatar May 15 '25 10:05 timoore

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.

timoore avatar May 16 '25 11:05 timoore

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

chengdz avatar May 19 '25 01:05 chengdz

This has been merged to master. Thanks @chengdz !

timoore avatar Jun 26 '25 00:06 timoore