Dulce Posted July 19, 2023 Posted July 19, 2023 Hello everybody! I want to calculate the roughness map from data downloaded by Copernicus Global Cover but I have not been able with Map Editor (version 12) Here what I have done. In Qgis: * I downloaded raster from Copernicus Global Cover Downloader thanks to a plugin in Qgis - It downloads a "discrete classification map" raster. * I clipped to my area of interest * I remove the pixels that do not correspond to the landcover classification because is a discrete raster. * convert raster to polygons vector file with pixel values of classification. * add Z0_int and Z0_ext values to attribute table In Map Editor: * I import this .SHP file in Wasp Map Editor but it gives me 7053 crosspoints. It doesn't matter if I ignore them, I can't continue working with those errors. * When I compare with a .map file generated from WindPRO (nor for me) in another area (not in Europe) I notice visually that there are also have huge physical crosspoints although the error are not marked by Map Editor. Everything is similar except that in file recognize "Roughness LINE-WEBS" and reocognizes the value of z0_right, z0_left and Webs (27915 webs and 27915 roughness areas!) *In the help section I found that "roughness-line web is the web consisting of roughness lines interconnected by node points: lines joined in a common node belong to the same web." *I suspect the reason the other file doesn't throw an error is because it has those web lines but I haven't found how I can activate them in my file. There are also the nodes that recognize nodes. (In their help section: "nodes is a A "star-point", where three or more roughness lines meet, with the roughnesses of the involved contours matching round the node point). *The roughness lines web are not activated even if I go to Roughness Consistency-EnableWebs How can I activate them in Map editor? -Qgis plugin On the other hand, I tried the plug in for Qgis indicated in the forum: https://data.dtu.dk/articles/software/Using_QGIS_to_create_WAsP_maps/20495178?file=38709351 I used the tool "Polygons to roughness lines" and then I saved in .shp format and the result using the tool "Save WASP roughness layer" and when I open the .map file in Map Editor I get 1509 cross lines error and 3178 dead-ends. Also I tried tool "Get WorldCover landcover polygons" but they cannot because mention that "The clipping layer must consist of a single feature only to avoid downloading too many files! " Thanks!
Rogier Posted July 27, 2023 Posted July 27, 2023 The process you are doing with the map editor is a bit tricky because as you have noticed it can result in roughness consistency errors. The safest way is to use the "Get WorldCover landcover polygons" in the QGIS plugin you refer to. It should make a valid polygon map for you and if you then convert the polygons to roughness lines (as required by WAsP) it should not result in any errors. The error that you get indicates that you using a clipping layer that exists of more then 1 feature. The script extracts only data from a single polygon. You can make that following the instructions in the this video (from minute 3:15, i.e. digitize a point in a scratch layer with the correct metric projection and buffer that point with the desired distance).
Dulce Posted July 27, 2023 Author Posted July 27, 2023 Thanks for your answer. In the video appears the Corine Land Cover 2018 but I thinks this apply only for Europe, and the project is in Latinoamerica. When I click on "Get WorldCover landcover polygons" it seem a problem with conexion to esa-worldcover. The error messages mentioned an error connection with esa-worldcover.s3.eu-central-1.amazonaws.com . I see in CORINE tutorial to mention to make a connection in Qgis What page and URL should I connect to in Qgis in order to Wasp script plugin work correctly? Thanks a lot for your reply!
Rogier Posted July 29, 2023 Posted July 29, 2023 You don't have to add any URL anymore. The videos correspond to a slightly older version of the plugin. The only thing you have to do now is make a scratch layer with a single polygon and use that layer as an input "Clipping layer" to the script "Get WorldCover landcover polygons". The resolution is limited to 50 m because otherwise the maps get too large and become very slow in WAsP.
Dulce Posted August 3, 2023 Author Posted August 3, 2023 yes, that's what I did before, cut with ONE polygon layer. But it gives me an error that it can't connect to the page I mentioned, that's why I think it needs to connect to the URL for the whole script to run correctly.
Rogier Posted August 4, 2023 Posted August 4, 2023 Could you sent me the polygon that you are using? Because I can't reproduce the error.
Dulce Posted August 4, 2023 Author Posted August 4, 2023 Could I sent you by an URL to google drive with shapefile?
Rogier Posted August 5, 2023 Posted August 5, 2023 Yes, you can either attach it here or send it to the support: https://www.wasp.dk/support
Dulce Posted September 12, 2023 Author Posted September 12, 2023 Hello Rogier, Sorry for my delayed answer. Here is the polygon in .shp format https://drive.google.com/drive/folders/1wm32IwDg40uBrkXU313USWJR6SYV0f2y?usp=sharing Could you reproduce the error? This continiuous. Thanks
Rogier Posted September 18, 2023 Posted September 18, 2023 I looked at your polygon and the first problem is that it is in a geographic coordinate system. So you will have to reproject to for example a UTM projection. Another problem is that ideally your bounding box should be rectangular so we can crop the boundary lines. I recommend to use the newest plugin that I uploaded: https://data.dtu.dk/articles/software/Using_QGIS_to_create_WAsP_maps/20495178 There is a new script included where you can create a bounding box from lat/lon and a option to download worldcover data. I have also updated the instruction videos.
Dulce Posted September 18, 2023 Author Posted September 18, 2023 Hello Rogier! Thank you so much for your time and your help. I used your script: "Create bounding box form lat/lon" for create the rectangular polygon and then use it to run the script "Get Worldcover landcover polygons" but with same result . Unfortunately, the error continues while I'm trying to connect with it seem the original data source host='esa-worldcover.s3.eu-central-1.amazonaws.com'. I tried in version 3.14 & 3.28. Next, I copy the error message that QGis shows. Should I have to connect with a different URL? Thanks in advance Dulce 2023-09-18T12:48:56 CRITICAL Traceback (most recent call last): File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\urllib3\connection.py", line 159, in _new_conn conn = connection.create_connection( File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\urllib3\util\connection.py", line 84, in create_connection raise err File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection sock.connect(sa) TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen httplib_response = self._make_request( File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\urllib3\connectionpool.py", line 381, in _make_request self._validate_conn(conn) File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\urllib3\connectionpool.py", line 978, in _validate_conn conn.connect() File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\urllib3\connection.py", line 309, in connect conn = self._new_conn() File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\urllib3\connection.py", line 171, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\requests\adapters.py", line 439, in send resp = conn.urlopen( File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\urllib3\connectionpool.py", line 726, in urlopen retries = retries.increment( File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\urllib3\util\retry.py", line 446, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='esa-worldcover.s3.eu-central-1.amazonaws.com', port=443): Max retries exceeded with url: /v100/2020/map/ESA_WorldCover_10m_2020_v100_N12W090_Map.tif (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users/----/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\wasp_scripts\processing_provider\worldcover.py", line 291, in processAlgorithm r = requests.get(url, allow_redirects=True) File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\requests\api.py", line 76, in get return request('get', url, params=params, **kwargs) File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\requests\api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\requests\sessions.py", line 530, in request resp = self.send(prep, **send_kwargs) File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\requests\sessions.py", line 643, in send r = adapter.send(request, **kwargs) File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='esa-worldcover.s3.eu-central-1.amazonaws.com', port=443): Max retries exceeded with url: /v100/2020/map/ESA_WorldCover_10m_2020_v100_N12W090_Map.tif (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))
Rogier Posted September 19, 2023 Posted September 19, 2023 Hm, then I am really not sure. Perhaps the URL is not accessible for you somehow. Can you access the URL "esa-worldcover.s3.eu-central-1.amazonaws.com" directly?
Dulce Posted October 13, 2023 Author Posted October 13, 2023 thanks Rogier I don't have access to that URL directly. Maybe that is the problem.
Guilherme Posted January 22 Posted January 22 Dear Rogier I work with my colleague Dulce and I was also trying to run the tool you shared with us "Get Worldcover landcover polygons". I think we managed to solve the problem indicated previously but we are now having a different error message in our log. At first, it was showing us below message: "(...) Results: {'OUTPUT': 'C:/Users/guilherme.simoes/AppData/Local/Temp/1/processing_knVPBu/0e641317d5d64010967656d3c343bdaf/OUTPUT.gpkg'} Clipping to bounding box... Feature (562) has invalid geometry. Please fix the geometry or change the Processing setting to the "Ignore invalid input features" option. There were errors executing the algorithm. There were errors executing the algorithm. Execution failed after 5.83 seconds (...)" But, then we tried setting a CRS in UTM (with its Zone identified) but it continued showing the same message. Later we tried changing the setting in order to "ignore invalid input features" and it showed another error message: "(...) CRS is EPSG:32633 Traceback (most recent call last): File "C:/Users/guilherme.simoes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\wasp_scripts\processing_provider\worldcover.py", line 209, in processAlgorithm if clipping_layer.crs().isGeographic(): AttributeError: 'NoneType' object has no attribute 'crs' Execution failed after 0.01 seconds (...)" Do you know what could be wrong? Thank you for your help! Guilherme.
Rogier Posted January 23 Posted January 23 That probably means that somehow you have invalid geometries. You can find them by running Vector > Geometry tools > Check Validity. This will generate three layers with valid, invalid and errors. Running the script on the valid output instead of the original layer that you used as input should work. Usually invalid geometry result from cropping very small areas near the border. If that's the case you can safely proceed with the valid layer. If not, you may have to edit your layer and make sure it is valid. I would also download the latest version of the QGIS plugin as there have been some bug fixes and updates: https://data.dtu.dk/articles/software/Using_QGIS_to_create_WAsP_maps/20495178
Guilherme Posted January 29 Posted January 29 Hello, Rogier It worked!!! Thank you very much for your help! Best regards, Guilherme
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now