[Qgis-user] Why does clipping a raster alters cell size? (Luciano La Sala)

Michael Treglia mtreglia at gmail.com
Wed May 20 09:47:32 PDT 2015


Hi Luciano,

I'm bringing this back to the list so others can chime in and follow this
thread in the future.

Strange that the file isn't writing out with the .asc extension (it does
for me) - what version of QGIS are you using?

A very simple solution: simply rename the file to add the '.asc' extension.
(Right click on the file name in Windows Explorer, select 'Rename', and at
the end of the filename simply add '.asc') - again , this should be with
the Windows setting to have file extensions visible.

Hope that helps
mike


On Wed, May 20, 2015 at 11:30 AM, Luciano La Sala <
lucianolasala at yahoo.com.ar> wrote:

> Hi Mike,
>
> Many thanks for the response. Your assumption about the content of my file
> is correct. This seems to be the .asc file that I need. I did follow your
> instructions and unchecked the box next to "Hide extensions for known file
> types". Now, two of the three files show their extension, namely .aux.xml
> and .prj. However, the suspected .asc file still shows no extension. Also,
> when I look at the file in
> Windows Explorer, under the detail view, there is no extension for the
> file! Finally, when right-click on the file, go to Properties and then
> under General >> Type of file: FILE, and under Details >> Type: File. No
> extension whatsoever!
>
> I did a quick search on the web and I found that the FILE file type is
> primarily associated with 'File With No Extension'. If you are seeing the
> file type FILE this is not a file extension but an indicator in Windows
> Explorer that the file has not file extension. Incorrect file associations
> could be the result of underlying issues within the PC system.
>
> This is very frustrating since I need those .asc files to model my species
> distribution models using maxent.
>
> Ideas?
>
> Best,
>
> Luciano
>
>
> El 5/20/2015 a las 12:50 PM, Michael Treglia escribió:
>
>> Hi Luciano,
>>
>> the file that can be opened in notepad is probably has a header of
>> something like:
>> ncols
>> nrows
>> xllcorner
>> yllcorner
>> cellsize
>> NODATA_value
>>
>> Followed by the values from your raster next, right?
>>
>> If so, that is the .asc file that you want - when I export the .asc file
>> (running QGIS 2.8.1 x64 on Win 7), it exports these files correctly,
>> with the appropriate extension. (Though in the file Explorer, if you are
>> viewing the
>>
>> On Windows [not sure about other OSs], the file extension (.asc) is not
>> shown by default, for files that Windows knows how to open.  To change
>> this, you would go to Control Panel -> [view by icons] ->Folder Options
>> -> View Tab, and un-check the box next to 'Hide extensions for known
>> file types'.  Also, if when you are looking at the available files in
>> Windows Explorer, if you change to the detail view (which has file size,
>> date modified, etc.), there should be a field "Type", for which this
>> file should be specified as a "ASC" file
>>
>> Hope this helps and works for you.
>>
>> Best
>> mike
>>
>>
>> On Wed, May 20, 2015 at 10:21 AM, Luciano La Sala
>> <lucianolasala at yahoo.com.ar <mailto:lucianolasala at yahoo.com.ar>> wrote:
>>
>>     Thank you very much Nicolas for your response. I have no idea how to
>>     use use the -tr xres yres switch in gdalwarp.
>>     However, I solved the problem using GDAL's algorithm "Clip raster by
>>     mask layer" and by seting the option "Keep resolution of output
>>     raster" to "Yes". That produced a .tif file with equal pixel size
>>     (200, -200).
>>
>>     Following, I convert this GeoTIFF to .ASC format using: "Raster >
>>     Conversion > Translate (Convert format)" and the setting the Output
>>     file to [GDAL] Arc/Info ASCII Grid (*.asc *.ASC).
>>
>>     The result is three files: the auxiliary file .aux, the coordinate
>>     system file .prj, and one more filename of File type FILE that can
>>     be opened with Notepad. Disappointingly, no .asc file was created.
>>     What am I doing wrong? I need .asc files of my environmental
>>     variables to be later processed using other software.
>>
>>     Thanks!
>>
>>
>>
>>     El 5/20/2015 a las 6:02 AM, qgis-user-request at lists.osgeo.org
>>     <mailto:qgis-user-request at lists.osgeo.org> escribió:
>>
>>         Send Qgis-user mailing list submissions to
>>         qgis-user at lists.osgeo.org <mailto:qgis-user at lists.osgeo.org>
>>
>>         To subscribe or unsubscribe via the World Wide Web, visit
>>         http://lists.osgeo.org/mailman/listinfo/qgis-user
>>         or, via email, send a message with subject or body 'help' to
>>         qgis-user-request at lists.osgeo.org
>>         <mailto:qgis-user-request at lists.osgeo.org>
>>
>>         You can reach the person managing the list at
>>         qgis-user-owner at lists.osgeo.org
>>         <mailto:qgis-user-owner at lists.osgeo.org>
>>
>>         When replying, please edit your Subject line so it is more
>> specific
>>         than "Re: Contents of Qgis-user digest..."
>>
>>
>>         Today's Topics:
>>
>>              1. Re: Error installing QGIS 2.8.2-1 on Mac (Jacopo Tonetti)
>>              2. Draw square or line and see meters (elmalle)
>>              3. Re: Error installing QGIS 2.8.2-1 on Mac (Jes?s)
>>              4. Re: Error installing QGIS 2.8.2-1 on Mac (William
>>         Kyngesburye)
>>              5. Why does clipping a raster alters cell size? (Luciano La
>>         Sala)
>>              6. Re: Why does clipping a raster alters cell size?
>>         (Nicolas Cadieux)
>>              7. How I create web gis through Qgis (Debajyoti Ghosh)
>>              8. Re: new issue with raster calculator (Bernd Vogelgesang)
>>              9. Re: How I create web gis through Qgis (McDonaldR)
>>
>>
>>
>> ----------------------------------------------------------------------
>>
>>         Message: 1
>>         Date: Tue, 19 May 2015 22:23:33 +0200
>>         From: Jacopo Tonetti <jacopotonetti at gmail.com
>>         <mailto:jacopotonetti at gmail.com>>
>>         To: Jes?s <jesusl.temez at gmail.com <mailto:jesusl.temez at gmail.com
>> >>
>>         Cc: qgis-user at lists.osgeo.org <mailto:qgis-user at lists.osgeo.org>
>>         Subject: Re: [Qgis-user] Error installing QGIS 2.8.2-1 on Mac
>>         Message-ID:
>>
>>         <
>> CAJnh74mJHzhAJEnXJ6PmQ_UQf_n04p5OnMZONg8UJMwYREaN2Q at mail.gmail.com
>>         <mailto:
>> CAJnh74mJHzhAJEnXJ6PmQ_UQf_n04p5OnMZONg8UJMwYREaN2Q at mail.gmail.com>>
>>         Content-Type: text/plain; charset="iso-8859-1"
>>
>>         Hi, seems that you have an older version of PROJ library. Did
>>         you download
>>         the package or install via homebrew? I recommend the latter (but
>>         you should
>>         use command line), I followed this
>>         <
>> https://github.com/OSGeo/homebrew-osgeo4mac/wiki/Developing-on-QGIS-using-OSGeo4Mac
>> >
>>         guide and everything is fine, same OS and version of QGIS.
>>         j
>>
>>         2015-05-19 19:38 GMT+02:00 Jes?s <jesusl.temez at gmail.com
>>         <mailto:jesusl.temez at gmail.com>>:
>>
>>
>>             Trying to install 2.8.2-1 on a Mac (10.9.5) I find this error:
>>
>>             Dyld Error Message:
>>                 Library not loaded:
>>             /Library/Frameworks/PROJ.framework/Versions/4/PROJ
>>                 Referenced from:
>> /Applications/QGIS.app/Contents/MacOS/QGIS
>>                 Reason: Incompatible library version: QGIS requires
>>             version 10.0.0 or
>>             later, but PROJ provides version 8.0.0
>>
>>             Binary Images:
>>                   0x7fff6810f000 -     0x7fff68142817  dyld (239.4)
>>             <7AD43B9B-5CEA-3C7E-9836-A06909F9CA56> /usr/lib/dyld
>>                   0x7fff8bc7f000 -     0x7fff8bc7ffff
>>             com.apple.ApplicationServices (48
>>             -
>>             48) <3E3F01A8-314D-378F-835E-9CC4F8820031>
>>
>>
>> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Applicat
>>             ionServices
>>                   0x7fff8bc9f000 -     0x7fff8bd0bfff
>>             com.apple.framework.IOKit (2.0.1 -
>>             907.100.14) <10932113-9F7E-38A0-A158-A019A555CAC3>
>>             /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
>>                   0x7fff8dd59000 -     0x7fff8df3efff
>>             com.apple.CoreFoundation (6.9 -
>>             855.17) <729BD6DA-1F63-3E72-A148-26F21EBF52BB>
>>
>>
>> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundatio
>>             n
>>
>>             I delete old version first but I can't open new version when
>>             finishing the
>>             installation. I got this message: Qgis can't be open due to
>>             a problem.
>>
>>             Any idea? Thanks
>>             Jesus
>>
>>
>>             _______________________________________________
>>             Qgis-user mailing list
>>             Qgis-user at lists.osgeo.org <mailto:Qgis-user at lists.osgeo.org>
>>             http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>>
>>
>>
>>
>>     --
>>     Luciano F. La Sala
>>     Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
>>     Cátedra de Epidemiología
>>     Departamento de Biología, Bioquímica y Farmacia
>>     Universidad Nacional del Sur
>>     San Juan 670
>>     Bahía Blanca (8000)
>>     Argentina
>>     _______________________________________________
>>     Qgis-user mailing list
>>     Qgis-user at lists.osgeo.org <mailto:Qgis-user at lists.osgeo.org>
>>     http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>>
>>
> --
> Luciano F. La Sala
> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
> Cátedra de Epidemiología
> Departamento de Biología, Bioquímica y Farmacia
> Universidad Nacional del Sur
> San Juan 670
> Bahía Blanca (8000)
> Argentina
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150520/f82095fd/attachment.html>


More information about the Qgis-user mailing list