Ecw can not load

Hello,

I using mapwindows ocx 5.1.1 on Ms Access and I got a problem to load ecw file. The error message is “Couldn’t open file”. Can you help me ?

Thanks a lot

Best regards

1 Like

Hello @Etienne, and welcome.

Could you paste in the code you are using to try to load the ecw file? That would be helpful.

Thank you,
Jerry.

Hello Jerry
my code is :
Dim img_ortho As New MapWinGIS.Image
Dim file_path As String
Dim h As Integer
file_path = “O:\Cartes\scan25.ecw”
If img_ortho.Open(file_path, ImageType.ECW_FILE, False) = True Then
h = MapG.AddLayer(img_ortho, True)
Else
MsgBox img_ortho.ErrorMsg(img_ortho.LastErrorCode)
End If

If I use Tiff_File it’s working.

Thanks a lot for your help

Best regard

Could you check if you can open the file using GDAL?
In the utils class of MapWinGIS the method Utils.GdalInfo exists.

Pseudo code:

Dim utils = new MapWinGIS.Utils()
Dim result As String
Set result = utils.GDALInfo(file_path, "")
MsgBox rsult

Paste the contents of result in this forum.
And if possible share your ECW-file so we can have a closer look.

Hello Paul,

With a ecw file, the result is empty (I try with several files with the same result). But If I try with a geotiff i got a result. (see below). For sharing the ecw file, it’s will be a little complicated because of the weight ot these files (between 1 o 10 go). But I can try if you think it’s help.

Driver: GTiff/GeoTIFF
Files: O:\Cartes\Satellite\SAT_2000_PACA.tif
       O:\Cartes\Satellite\SAT_2000_PACA.tif.aux.xml
       O:\Cartes\Satellite\SAT_2000_PACA.TAB
Size is 14591, 12486
Coordinate System is:
PROJCS["RGF93 / Lambert-93",
    GEOGCS["RGF93",
        DATUM["Reseau_Geodesique_Francais_1993",
            SPHEROID["GRS 80",6378137,298.257222101],
            TOWGS84[0,0,0,0,0,0,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",49],
    PARAMETER["standard_parallel_2",44],
    PARAMETER["latitude_of_origin",46.5],
    PARAMETER["central_meridian",3],
    PARAMETER["false_easting",700000],
    PARAMETER["false_northing",6600000],
    UNIT["Meter",1.0],
    AUTHORITY["EPSG","2154"]]
Origin = (795681.803043300053105,6457419.246939199976623)
Pixel Size = (20.000000000000000,-20.000000000000000)
Metadata:
  TIFFTAG_DATETIME=2010:04:14 15:24:49
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  TIFFTAG_SOFTWARE=Adobe Photoshop CS4 Windows
  TIFFTAG_XRESOLUTION=72
  TIFFTAG_YRESOLUTION=72
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  795681.803, 6457419.247) (  4d13' 7.86"E, 45d12'34.02"N)
Lower Left  (  795681.803, 6207699.247) (  4d10'17.95"E, 42d57'44.20"N)
Upper Right ( 1087501.803, 6457419.247) (  7d55'48.72"E, 45d 6'25.70"N)
Lower Right ( 1087501.803, 6207699.247) (  7d44'23.01"E, 42d51'50.57"N)
Center      (  941591.803, 6332559.247) (  6d 0'55.94"E, 44d 3' 1.84"N)
Band 1 Block=14591x1 Type=Byte, ColorInterp=Red
  Min=1.000 Max=255.000 
  Minimum=1.000, Maximum=255.000, Mean=133.284, StdDev=110.182
  Metadata:
    STATISTICS_MAXIMUM=255
    STATISTICS_MEAN=133.28381903501
    STATISTICS_MINIMUM=1
    STATISTICS_STDDEV=110.18160442097
Band 2 Block=14591x1 Type=Byte, ColorInterp=Green
  Min=1.000 Max=255.000 
  Minimum=1.000, Maximum=255.000, Mean=170.391, StdDev=85.735
  Metadata:
    STATISTICS_MAXIMUM=255
    STATISTICS_MEAN=170.39141839769
    STATISTICS_MINIMUM=1
    STATISTICS_STDDEV=85.73490005545
Band 3 Block=14591x1 Type=Byte, ColorInterp=Blue
  Min=1.000 Max=255.000 
  Minimum=1.000, Maximum=255.000, Mean=164.613, StdDev=96.138
  Metadata:
    STATISTICS_MAXIMUM=255
    STATISTICS_MEAN=164.61334996782
    STATISTICS_MINIMUM=1
    STATISTICS_STDDEV=96.138148948944

If GalInfo can’t read your file, something is wrong.
Either your ECW is in an unrecognized format or the ECW driver is not properly loaded.

Could you send me your smallest ECW-file, so I can investigate?

Good morning,

OK, I will drop a ecw file on my OneDrive. I’ll inform you when it’s OK

Best regard

Hello Paul,

You find in this url a ecw file
https://smavd13-my.sharepoint.com/:f:/g/personal/etienne_masse_smavd13_onmicrosoft_com/EnCI3TBzugpNoj-Et20NBr8B48UYbIMqVugZBvqEJ7Geog?e=XGp5p5
Best regards

Hello Paul,

have you download the ecw file ? did you have time to test it ?

Best regard

I just downloaded it, I missed your message.

On my pc MW5 is complaining about Can't load requested DLL: [...]\MapWinGis\gdalplugins\gdal_ECW_JP2ECW.dll. But the dll is present.

I’ll have to look into this more closely. I’ll get back to you later this week.

Great ! So I’m waiting

Thank a lot

Have a good day

It seems we’re missing some dlls.
We use the GDAL binaries from www.gisinternals.com I’ve contacted Tamas and he just told me that he needs to update the ECW SDK for the VS2017 builds, which we are using.

So we need to wait for Tamas to be finished. Then I’ll create new installers and let you know.

1 Like

Hello Paul,

have you some news from Tamas ?

Best regards

No, no news. I think it will take a few more weeks until he has upgraded his server farm to be able to automatically make new GDAL builds with ECW-support.

Dears Sirs,
I have the same problem with my VB.Net 2015 application and MapWindow Ocx 5.1.1.
AddLayerFromFilename methos does not add the ecw layer to the map.
Me too utils.GDALInfo(file_path, "") method returns an empy string and also MapWinGISDemo return “Failed to open datasource” error.
Thank you

Hello Paul,

I know that the situation is not easy but do you have some news from Tamas and the update ecw sdk ?

Best regards

I just asked Tamas again and he didn’t update the ecw sdk yet.
In consultation with him I created https://github.com/gisinternals/buildsystem/issues/154

Hi Paul,

This is also affecting us. I see from the ticket, it looks like it’s still pending - is there a workaround, can we manually obtain the dlls etc?

Seems to affect MapWindow too (unsurprisingly).

Regards,

Rob H

Having not done any research on this, I can’t speak with authority; however, I notice that the ticket refers to missing DLLs in the VS2017 distribution. So I wonder, are the DLLs present in the VS2015 distribution, and can they be extracted from there?

This discussion also runs on Opening ECW Files · Issue #208 · MapWindow/MapWinGIS · GitHub

I just posted this reply

No news. At this moment the volunteers that have enough skills to get MapWinGIS to compile on VS2019 and working with GDAL v3 are too busy with their main jobs.

Until we can compile MapWinGIS with VS2019 we can’t move on.
I tried, with my limited C++ skills, but couldn’t get it to work.