Monday, 14 May 2018

python - Gdal_translate with WMS troubles


The data I'm interested in is found here and can be opened directly in your browser:


http://maps.greenmin.gl/geusmap/ows/32624.jsp?nocache=nocache&whoami=[email]&LAYERS=grl_geus_500k_geology_map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES=&SRS=EPSG%3A32624&BBOX=499980.0,7190220.0,609780.0,7400040.0&WIDTH=1500&HEIGHT=3000


Then I'm using this code in my terminal to output it to a GTiff with its reference system intact, which is based on information found here.


gdal_translate -of GTiff -co "TFW=YES" "http://maps.greenmin.gl/geusmap/ows/32624.jsp?nocache=nocache&whoami=130.225.0.251&LAYERS=grl_geus_500k_geology_map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES=&SRS=EPSG%3A32624&BBOX=499980.0,7190220.0,609780.0,7400040.0&WIDTH=1500&HEIGHT=3000" output_geo.tif

I then get an error


Input file size is 561895206, 1073741824

0ERROR 3: Free disk space available is 745445371904 bytes, whereas 2413321533549182976 are at least necessary. You can disable this check by defining the CHECK_DISK_FREE_SPACE configuration option to FALSE.

Any suggestions?



Answer



In case anyone else may stumble on this problem.


I managed to get workarounds to it, but it produced a file size of 92 gb. Which made it unusable. I went with a solution of opening it in QGIS. Then I exported it which can be done by either:


1) Right clicking the layer and saving it as.


2) Using the print composer function or


3) Download the Georefexporter plugin which is available for the Linux version of QGIS.


However my problem is the WMS service wont give images any larger than 3000 pixels. So I had to settle for a smaller 1500x3000 image which unfortunately is pix-elated for my purpose. But it is usable.



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...