Open AnkithThodupunoori opened 2 years ago
What version of MATLAB are you using? Can you please confirm you successfully ran the startup scripts?
my matlab version is R2021b, i executed the setup file, but i am not sure it executed completely, i attached a picture what it is showing at the end when i run setup file.
Unable to establish SSL connection
, so it looks like the files were not downloaded. You can confirm this by inspecting if the files are in the `em-core/data/DEM-GLOBE directory.
A common culprit is not setting a web proxy if you're working on a managed network.
files are already in dem_gobe folder
That's good. The files are there, so we can assume the system environment variable was set correctly. Is em-core
added to your MATLAB path?
yes it is added to the path
georasterinfo
is part of the MATLAB mapping toolbox. Can you please confirm you have access to the mapping toolbox?
yes, mapping tool box is installed in my matlab.
in gerasterinfo , at line 37, the command is not able to execute, thats the one throwing error
is it a file format issue or the matlab file "georasterinfo" ?
On Line 108, replace parfor
with for
, so it reads fori=1:1:numel(LAT_deg)
On Line 108, replace
parfor
withfor
, so it readsfori=1:1:numel(LAT_deg)
@AnkithThodupunoori Where you able to test this proposed change? Do you have access to the parallel toolbox. If no, replace 'parfor' may address the bug. Also replacing it should produce a different error message, which hopefully should be more insightful.
i have the parfor tool box. anyway i made the changes as you asked to replace the parfor to for loop, this is the error i am getting after executing the code.
what is inFile
on line 189? That error reads like it can find the e10g
file, but you're previously shown it is downloaded:
files are already in dem_gobe folder
infile represents the "e10" file, matlab is able to find the file but it just cant read the file.
If you change directory to DEM-GLOBE
, can you load the file via command line?
it gives the same error, saying unable to read the file format or file may be corrupted, as shown below.
if i use the fileread function, it reads the data in characters but cannot be displayed as the legth of the character is too large.
but when i use the same function which is used in georasterinfo, it throws the error as usual.
Have you tried redownloading e10g
manually and confirm it isn't corrupted?
Yes, Just now downloaded manually and tried to execute the code, it shows same error.
The output should look something like this (I slightly censored the Filename
property):
>> inFile = [getenv('AEM_DIR_CORE') filesep 'data' filesep 'DEM-GLOBE' filesep 'e10g'];
>> info = georasterinfo(inFile)
Warning: Projection information missing from 'e10g'. Assuming the RasterReference property is a map raster reference object.
> In georasterinfo>constructRasterReference (line 163)
In georasterinfo (line 52)
info =
RasterInfo with properties:
Filename: ["\em-core\data\DEM-GLOBE\e10g" "\em-core\data\DEM-GLOBE\e10g.hdr"]
FileModifiedDate: [2004-05-07 13:31:30 2004-05-07 13:48:38]
FileSize: [129600000 340]
FileFormat: "Esri GridFloat"
RasterSize: [6000 10800]
NumBands: 1
NativeFormat: "int16"
MissingDataIndicator: -500
Categories: []
ColorType: "unknown"
Colormap: []
RasterReference: [1×1 map.rasterref.MapCellsReference]
CoordinateReferenceSystem: []
Metadata: []
>>
Is both e10g
and e10g.hdr
in your directory?
NO, I have only one file "e10g" in my directory.
i tried to generate the output of the file using the code you posted above, this is how it showing.
The bug looks to be with using georasterinfo
and not the MATLAB code in em-core
. Only the e10g
file is required and extracted from the zip downloaded using the setup.sh
script. The file size of e10g
is the same as what you reported and what I redownloaded this afternoon. I successfully tested georasterinfo
using MATLAB R2020b and R2022a.
Brainstorming here, can you confirm exist()
returns 2
and which
returns something the mapping toolbox directory?
>> inFile = [getenv('AEM_DIR_CORE') filesep 'data' filesep 'DEM-GLOBE' filesep 'e10g'];
>> exist(inFile)
ans =
2
>> which inFile
This is what it return when used the suggested commands
What about which georasterinfo
?
All those returns are what is expected
So do you what exactly the problem here? is it the matlab version i am using?
I don't think it is the MATLAB version because I tested a version older and newer than what you're using. MATLAB recognizes the file exists and which
indicates the correct georasterinfo
is on the path.
I'm a bit stumped on the bug. For sanity, can you try loading the file using readgeoraster
? It should fail like when using georasterinfo
yes, looks like it failed same like before
I'm still musing about what the bug could be here because its with a built-in MATLAB function.
Instructions
Read the instructions and fill out your responses at the bottom.
Relation
Is your feature request related to a problem? Please describe. Please provide a clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Description
A clear and concise description of what you want to happen.
Alternatives
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
FILL ME OUT
Relation
.hdr files which are located in DEM_GLOBE folder are unable to be read by code. when ever i execute RUN_Airspace_1, it throws an error saying "e10g" file format unable to read. i have tried to with automatic generated file format by running setup script and with manual downloaded file. both doesnt work.
Description
the error thrown by matlab looks like shown bellow. can i know how to get rid of this issue and execute the code further.
Error using georasterinfo (line 70) Unable to read 'e10g'. Format may not be supported, file may be corrupt, or a supporting file may have been specified.
Error in msl2agl (line 189) info = georasterinfo(inFile);
Error in readAirspace (line 108) parfor i=1:1:numel(LAT_deg)
Error in RUN_Airspace_1 (line 30) airspaceUS = readAirspace('inFile',inFile,...
Alternatives
Additional