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

Custom WMS as elevation #893

Open
AbdelghaniTamort opened this issue May 14, 2024 · 5 comments
Open

Custom WMS as elevation #893

AbdelghaniTamort opened this issue May 14, 2024 · 5 comments

Comments

@AbdelghaniTamort
Copy link

AbdelghaniTamort commented May 14, 2024

Blender and OS versions

Blender 4.1 Windows 10 Professional
BlenderGIS latest release

Describe the bug

This isn't a bug but only a question that have been raised in #158. Since it has been 5 years now I was wondering if it is now possible to import custom elevation from WMS even though it serves a 3 band geotiff (the elevation information is in the first band).

How to Reproduce

What I have been doing is trying to add the WMS GetMap request in the list named DEFAULT_DEM_SERVER of the prefs.py source code. It doesn't seem to be working which is quite anticipated.

Error message

DEBUG:BlenderGIS-2210.operators.io_get_dem:111:https://data.geopf.fr/wms-r/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&STYLES=normal&FORMAT=image/geotiff&LAYERS=ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES&WIDTH=10000&HEIGHT=10000&CRS=EPSG:4326&BBOX=2.2941425720256485,48.84102834957891,2.37504687855078,48.88116715214006
ERROR:BlenderGIS-2210:96:Uncaught exception
Traceback (most recent call last):
File "C:\Users\atamort\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\BlenderGIS-2210\operators\io_get_dem.py", line 148, in execute
bpy.ops.importgis.georaster(
File "C:\Program Files\Blender Foundation\Blender 4.1\4.1\scripts\modules\bpy\ops.py", line 107, in call
ret = _op_call(self.idname_py(), kw, C_exec, C_undo)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Error: Non overlap data

@AbdelghaniTamort
Copy link
Author

In other words, how to adjust the source code so it can allow for WMS handling along with REST for elevations models ?

@domlysz
Copy link
Owner

domlysz commented May 16, 2024

Since WMS 1.3.0 the order of bbox coordinates depends on the CRS. Systems with angular coordinates like EPSG:4326 use latitude as first axis. So the BBOX should be S,W,N,E

DEFAULT_DEM_SERVER = [
	("https://data.geopf.fr/wms-r/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&STYLES=normal&FORMAT=image/geotiff&LAYERS=ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES&WIDTH=5000&HEIGHT=5000&CRS=EPSG:4326&BBOX={S},{W},{N},{E}", 'Geoplateforme', 'Elevation data from IGN')
]

This url works but it miss a peace of code into operators/io_get_dem.py to correctly setup WIDTH and HEIGHT according to the target resolution of the DEM (meter/pixel).

@AbdelghaniTamort
Copy link
Author

Oh I see, I just checked and it works indeed. So you also implemented this handling of WIDTH and HEIGHT according to target resolution for the Basemap I presume? Maybe if you guide me to which line in which file you implemented it I can reproduce the same for the DEM ?

@domlysz
Copy link
Owner

domlysz commented May 17, 2024

check this branch : https://github.com/domlysz/BlenderGIS/tree/wms_dem

The target res is hardcoded to 5m/pixel : b3e6a6a

@AbdelghaniTamort
Copy link
Author

alright, cool!
So the WMS version of RGE ALTI's resolution is 5m and not 1m?
Also there is a max height/width of 10000 imposed by the server, what happens if the user chooses an extent bigger than 10km * 10km ?

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

No branches or pull requests

2 participants