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

Error in line 554: expected array of dim 2 #10

Open
jwidness opened this issue May 13, 2019 · 8 comments
Open

Error in line 554: expected array of dim 2 #10

jwidness opened this issue May 13, 2019 · 8 comments

Comments

@jwidness
Copy link

\GarminCustomMap.py", line 554, in run
t_file.GetRasterBand(1).WriteArray(t_band_1)
File "C:\PROGRA1\QGIS31.4\apps\Python37\lib\site-packages\osgeo\gdal.py", line 2653, in WriteArray
callback_data=callback_data)
File "C:\PROGRA1\QGIS31.4\apps\Python37\lib\site-packages\osgeo\gdal_array.py", line 394, in BandWriteArray
raise ValueError("expected array of dim 2")
ValueError: expected array of dim 2

To avoid issue #9, I turned off "Skip production of empty tiles". Now instead of throwing an error at line 551, it throws an error at 554.

@ghtmtt
Copy link
Contributor

ghtmtt commented May 14, 2019

Could you please provide a step by step example to reproduce the error?

@jwidness
Copy link
Author

Using Windows 10 and QGIS 3.4.3, open new project. From QuickMapServices load OSM Standard. Change project CRS to 4326 and zoom to island of Sardegna. Drag the panel over to limit the canvas to just the island. Run the plugin with 10 as the zoom factor and uncheck "Skip production of empty tiles".

I'm wondering if the problem is the shape of the canvas -- taller than it is wide, i.e. portrait instead of landscape. If I move the panel back to create a wider canvas, it runs without error.

image

@ghtmtt
Copy link
Contributor

ghtmtt commented May 20, 2019

Cannot confirm the issue:

  • loaded OSM XYZ tile (not QuickMapServices)
  • changes the CRS to 4326
  • zoom to you image bbox (as similar as I could)
  • same settings of the plugin you showed

Result:

image

@jwidness
Copy link
Author

It only happens when the height is taller than the width. Yours shows one with a height shorter than the width (5 by 11).

@jwidness
Copy link
Author

I can reproduce this without anything on the canvas as long as the height is more than the width and Skip empty is unchecked.

image

image

@ghtmtt
Copy link
Contributor

ghtmtt commented May 27, 2019

I still cannot reproduce the error. I set the layers panel really with and set the scale as it is in your image.

@jwidness
Copy link
Author

I'm not sure what to say, I tried these steps on another computer with a brand new QGIS install and still got the error. How many tiles were produced when you ran it without error?

@patrice-geo
Copy link

patrice-geo commented Jun 4, 2019

Having this issue on QGIS 3.6.2 (Windows 10). Like OP "To avoid issue #9 , I turned off "Skip production of empty tiles". Now instead of throwing an error at line 551, it throws an error at 554."

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

3 participants