-
Notifications
You must be signed in to change notification settings - Fork 8
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
Alignment issues when source cog is in non-native projection #16
Comments
I don't know what's going on either, but there may be some issues with the simple bbox's coordinate system conversion. Do you know how to improve it? |
Hi @hongfaqiu no I dont know how to improve it - but if you point me to some lines in the codebase, I could take a look? |
Thank you for your help! All the code related to reprojection is here: https://github.com/hongfaqiu/TIFFImageryProvider/blob/main/packages/TIFFImageryProvider/src/TIFFImageryProvider.ts#L200-L227 |
Im not sure, Ill have a look at this tomorrow, perhaps your method is not sufficient. Thanks for your work so far! We are trying to use your code in our open source tool TerriaJS |
Thank you for your recognition! I really love TerriaJS, and have learned a lot from it. |
I have confirmed that reprojecting a cog to EPSG:4326 fixes the alignment problem: Datasets |
Cool! I have found a repo geotiff-geokeys-to-proj4 that can perform coordinate system transformation on TIFF files. It seems to perform the transformation on every pixel rather than just the bounding box. I'm not sure if this will be effective. |
Yes I dont think reprojecting the bounding box is sufficient. This is how OpenLayers handles it: https://openlayers.org/doc/tutorials/raster-reprojection.html |
@hongfaqiu this is great news, thanks for your efforts! I will check it out now |
Dear @hongfaqiu , I have incorporated your changes into my terriajs test branch, and it resolved the alignment issue, thanks so much for your work! However, it does present a different problem: the COGs are sometimes displayed in the wrong location when zoomed out: |
Dear @hongfaqiu , our cesium expert suggests that you can fix this by changing how
|
Dear @staffordsmith83, thank you and your team for the work you have done. It's working great now! |
When I project the non-3857 coordinate system into the 4326 coordinate system, I noticed that the four vertices constructed using the bbox attribute of the geotiff do not form a regular rectangle. This also causes the failure of constructing a Cesium.Rectangle. |
Thanks for your work on this @hongfaqiu , we are following with great interest |
Dear @hongfaqiu how did you go resolving these issues? Any luck? |
Dear @staffordsmith83, I was busy with other things recently, but today I had some time to update the code. However, the results are not satisfactory, and there are areas for improvement. Originally, my idea was to make the implementation of the In any case, the reprojection function is currently executing sequentially on the CPU, which makes it inefficient and blocks the rendering process. That's why I have marked the reprojection method as experimental. |
Dear @hongfaqiu thanks somuch for your efforts! Yes its a difficult issue, the library that we are using for 2d mode, |
@staffordsmith83 Thank you very much for your ongoing support. I will also continue to follow your progress in terriaJS and look forward to finding a more effective general solution. It would be even better if this could help advance Cesium's capabilities in reprojection. |
Dear @hongfaqiu did you make any progress with the reprojection? I notice in your changelog you have implemented some web based reprojection that is slow but works? Perhaps GeoWarp is an option? https://github.com/DanielJDufour/geowarp |
Excellent repo! I will try it next week. Thanks your sharing. |
I have looked at DanielJDufour's code, and its reprojection is also based on CPU computation. Furthermore, it performs poorly on non-rectangular boundaries as it clips a portion of the content. |
We are having problems where COGs are not positioned correctly on the cesium globe when they are reprojected by TIFFImageryProvider:
This COG is in EPSG:32756, available here: https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/56/J/NP/2023/4/S2A_56JNP_20230410_0_L2A/TCI.tif
The text was updated successfully, but these errors were encountered: