-
Notifications
You must be signed in to change notification settings - Fork 329
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
WMTS layer with custom EPSG projection fails in Cesium #771
Comments
Hi @bampakoa, CesiumJS does not support projections other than EPSG:4326 and EPSG:3857. There was this PR: CesiumGS/cesium#7502 which is stalled and only focused in adding local projection support to the 2D and columbus views (so not the 3D globe we use in OL-Cesium). Your OpenLayers map is using the default EPSG:3857 projection. However, there is some special support in OpenLayers for client side raster reprojection. So what you see in 2D is the result of the internal (and I guess blurry) reprojection by OpenLayers of your EPSG:5221 layer. I did some experiments in exposing the raster reprojection capabilities of OpenLayers in OL-Cesium but there were cases not working and I did not pursue. There was also some help from @samuel-girard who ported the code to newer OL-Cesium version (see #690). For low traffic you can do on-the-fly server side reprojection to EPSG:3857; for higher traffic you may prefer to pre-generate the tiles. Then you need to handle the substitution of the layer in the RasterSynchronizer. It is not very well documented but this behaviour is a core feature of OL-Cesium. I can improve that documentation. |
@gberaudo thanks very much for your feedback. I have some questions though regarding your comments:
How does the WMS example work with a custom projection? Does it use another technique than client side reprojection?
So, the result of the client side raster reprojection is not actually supported in Cesium?
I tried to apply the changes of this PR in my code with no luck. Do you think it should work anyway?
If you could provide some sort of documentation, that would be awesome! |
Old iron, I also want to know how to load the EPSG:4526 projection. I converted the "bbox" parameter when loading the WMS service, and the graphics can be loaded, but there will be offsets. I don’t know how to load the WMTS service. I hope you can publish it when you find a solution. Thank you very much! |
Hi,
I am trying to render a WMTS layer from URL
http://geoportal.cuzk.cz/WMTS_ORTOFOTO/WMTService.aspx
using the projectionEPSG:5221
(here are the specs of the projection). The layer is correctly rendered in OpenLayers but that is not the same for Cesium. However, network requests seem to fire and respond correctly. I can actually see the tiles in the responses of the network tab.I have put in place an example of what I am trying to achieve here:
tileMatrixSet
andextent
properties in the source layer.proj4
to define the EPSG projection and register it with OpenLayers.After some debugging I came to the conclusion that the
tileLayerToImageryLayer
function returnsnull
because the 5221 projection fails to pass theisCesiumProjection
function here.Alternatively, I tried to add an if statement so that I can check whether the source is of type WMTS, before the check here and create the provider inside my statement. In this scenario, Cesium reported logs in the console that it could not find tile coordinates.
I have searched through the repository about similar problems and I think that Cesium cannot handle custom projections but I am not 100% sure. I would appreciate it if you could help me.
Thanks!
The text was updated successfully, but these errors were encountered: