Skip to content
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

Wms Projection with DotSpatial (EPSG:6706 as sample) #2073

Merged
merged 17 commits into from Jun 19, 2023

Conversation

inforithmics
Copy link
Contributor

No description provided.

@inforithmics inforithmics mentioned this pull request Jun 17, 2023
@inforithmics
Copy link
Contributor Author

I added A Sample that uses DotSpatialProjection for EPSG:6706 (Italy) Projection.
Things done:

  1. Not known Projections can be registered.
  2. Transparent can now be configured in the WmsProvider (default true)
  3. Fixed Bug in DotSpatialProjection did not transform MRaster

@inforithmics inforithmics changed the title WIP Wms Projection with DotSpatial (EPSG:6706 as sample) Wms Projection with DotSpatial (EPSG:6706 as sample) Jun 17, 2023
@pauldendulk
Copy link
Member

I added A Sample that uses DotSpatialProjection for EPSG:6706 (Italy) Projection. Things done:

  1. Not known Projections can be registered.
  2. Transparent can now be configured in the WmsProvider (default true)
  3. Fixed Bug in DotSpatialProjection did not transform MRaster

I do not understand what this is about.

Mapsui does not support projection of MRaster, so I would think it should not try to. Raster transformation is hard although not impossible (it was done in SharpMap at some point). So, I assume this is not what this is about, although perhaps DotSpatialProjection has functionality for this.

Also I do not understand WMS projection with DotSpatial. Usually a WMS itself supports projection. So you pass in the required CRS and get a bitmap in the expected projection, so you would not need DotSpatial for this.

I am sure you are doing something useful, I just do not understand what it is. 🤔

@inforithmics
Copy link
Contributor Author

inforithmics commented Jun 18, 2023

Was wrong wording, the Extent from MRaster is now transformed or else it wouldn't work. in the default projectionprovider a coordinate visitor is used to handle extents and geometries... but in the dotspatial provider only geometries were transformed. Now it transforms other than geometry features by coordinate visitors too.
The register was added to add not known projections dotspatial knows around 4000 but not Epsg:6706 (Italy).
Concerning the projection the sample webservice only supports epsg:6706 so mixing this map with other maps and other projections wouldn't work.

@inforithmics
Copy link
Contributor Author

This service does not allow CORS Access so it doesn't work in blazor unless Cors check is disabled in the Browser (From the security Standpoint a Bad idea).
https://wms.cartografia.agenziaentrate.gov.it/inspire/wms/ows01.php?service=WMS&request=getcapabilities

What I thought is that I could display the static Test image instead of the Map when I know that a Sample does not work in Blazor.

@inforithmics
Copy link
Contributor Author

I added a sample that tiles a WmsProvider with Projection using the RasterizingTileLayer

@pauldendulk
Copy link
Member

This service does not allow CORS Access so it doesn't work in blazor unless Cors check is disabled in the Browser (From the security Standpoint a Bad idea). https://wms.cartografia.agenziaentrate.gov.it/inspire/wms/ows01.php?service=WMS&request=getcapabilities

What I thought is that I could display the static Test image instead of the Map when I know that a Sample does not work in Blazor.

How about adding a CORS exception just for this service? Allowing everything is the kind of thing you do during the development phase to just get things working and then forget to turn off. I think allowing specific sources is just fine from security perspective.

@pauldendulk pauldendulk merged commit 74d6a43 into Mapsui:master Jun 19, 2023
6 checks passed
@inforithmics
Copy link
Contributor Author

inforithmics commented Jun 19, 2023

This service does not allow CORS Access so it doesn't work in blazor unless Cors check is disabled in the Browser (From the security Standpoint a Bad idea). https://wms.cartografia.agenziaentrate.gov.it/inspire/wms/ows01.php?service=WMS&request=getcapabilities
What I thought is that I could display the static Test image instead of the Map when I know that a Sample does not work in Blazor.

How about adding a CORS exception just for this service? Allowing everything is the kind of thing you do during the development phase to just get things working and then forget to turn off. I think allowing specific sources is just fine from security perspective.

I tried to implement a workaround, But because Blazor runs in the Browser the Browser settings override the .Net Code. So the only workaround is to call a Proxy Service, That loads the Data Outside of the Browser.

Here an example.
https://darnton.co.nz/2020/07/13/cors-proxy-for-client-side-blazor/
But because Blazor has no WebServer instance (That's why it can be deployed on a static WebSite, I cannot Implement it currently, I'm trying to cache the initial calls so that there is no webcall making the samples work in blazor, But I discovered some Sqlite Blazor issues along the way)

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.

None yet

2 participants