ECW support on Fedora Linux - error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

ECW support on Fedora Linux - error

jkadlec
Hi, I have a problem making GDAL work with ECW files on Fedora Linux 17.
Here are the steps I did following the instructions on: http://trac.osgeo.org/gdal/wiki/ECW
1. I downloaded, installed and compiled libecwj 3.3 library
2. I downloaded the source of gdal 1.9.1
3. I ran ./configure --with-ecw, make and make install
4. gdalinfo --formats now includes ECW
5. However, I have a problem opening any ECW file with GDAL. For example, I downloaded the sample ECW files from http://www.terracolor.net/sample_imagery.html. One of the files is called Terracolor_SanFrancisco_US_15m.ecw
When I run gdalinfo Terracolor_SanFrancisco_US_15m.ecw I get a weird error:

terminate called after throwing an instance of 'std::length_error' what(): basic_string::_S_create Aborted (core dumped)

Other file types such as tiff or asc open with GDAL correctly.
Was anybody able to get GDAL running with ECW support on Linux?
Should I try to use the KAKADU library with GDAL instead of libecwj?

Any suggestions are welcome.
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

Jean-Claude Repetto
On 27/07/2012 16:33, jkadlec wrote:

> Hi, I have a problem making GDAL work with ECW files on Fedora Linux 17.
> Here are the steps I did following the instructions on:
> http://trac.osgeo.org/gdal/wiki/ECW
> 1. I downloaded, installed and compiled libecwj 3.3 library
> 2. I downloaded the source of gdal 1.9.1
> 3. I ran ./configure --with-ecw, make and make install
> 4. gdalinfo --formats now includes ECW
> 5. However, I have a problem opening any ECW file with GDAL. For example, I
> downloaded the sample ECW files from
> http://www.terracolor.net/sample_imagery.htmlhttp://
> http://www.terracolor.net/sample_imagery.html . One of the files is called
> Terracolor_SanFrancisco_US_15m.ecw
> When I run gdalinfo Terracolor_SanFrancisco_US_15m.ecw I get a weird error:
>
> terminate called after throwing an instance of 'std::length_error' what():
> basic_string::_S_create Aborted (core dumped)
>
> Other file types such as tiff or asc open with GDAL correctly.
> Was anybody able to get GDAL running with ECW support on Linux?
> Should I try to use the KAKADU library with GDAL instead of libecwj?
>
> Any suggestions are welcome.
>

Hi,

I have tested the file "Terracolor_SanFrancisco_US_15m.ecw" on Gentoo
Linux 64 bits, with GDAL 1.9.1, and libecwj2-3.3.
No problem :

$ gdalinfo Terracolor_SanFrancisco_US_15m.ecw
Driver: ECW/ERDAS Compressed Wavelets (SDK 3.x)
Files: Terracolor_SanFrancisco_US_15m.ecw
       Terracolor_SanFrancisco_US_15m.eww
Size is 7204, 7204
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9108"]],
    AXIS["Lat",NORTH],
    AXIS["Long",EAST],
    AUTHORITY["EPSG","4326"]]
Origin = (-122.809804036593036,38.285436652047451)
Pixel Size = (0.000138800000000,-0.000138800000000)
Corner Coordinates:
Upper Left  (-122.8098040,  38.2854367) (122d48'35.29"W, 38d17' 7.57"N)
Lower Left  (-122.8098040,  37.2855215) (122d48'35.29"W, 37d17' 7.88"N)
Upper Right (-121.8098888,  38.2854367) (121d48'35.60"W, 38d17' 7.57"N)
Lower Right (-121.8098888,  37.2855215) (121d48'35.60"W, 37d17' 7.88"N)
Center      (-122.3098464,  37.7854791) (122d18'35.45"W, 37d47' 7.72"N)
Band 1 Block=7204x1 Type=Byte, ColorInterp=Red
  Overviews: 3602x3602, 1801x1801, 900x900, 450x450, 225x225
Band 2 Block=7204x1 Type=Byte, ColorInterp=Green
  Overviews: 3602x3602, 1801x1801, 900x900, 450x450, 225x225
Band 3 Block=7204x1 Type=Byte, ColorInterp=Blue
  Overviews: 3602x3602, 1801x1801, 900x900, 450x450, 225x225


I was also able to display the image in QGIS 1.8.0,

HTH !
Jean-Claude
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

Zoltan Szecsei
In reply to this post by jkadlec
On 2012/07/27 16:33, jkadlec wrote:

> Hi, I have a problem making GDAL work with ECW files on Fedora Linux 17.
> Here are the steps I did following the instructions on:
> http://trac.osgeo.org/gdal/wiki/ECW
> 1. I downloaded, installed and compiled libecwj 3.3 library
> 2. I downloaded the source of gdal 1.9.1
> 3. I ran ./configure --with-ecw, make and make install
> 4. gdalinfo --formats now includes ECW
> 5. However, I have a problem opening any ECW file with GDAL. For example, I
> downloaded the sample ECW files from
> http://www.terracolor.net/sample_imagery.htmlhttp://
> http://www.terracolor.net/sample_imagery.html . One of the files is called
> Terracolor_SanFrancisco_US_15m.ecw
> When I run gdalinfo Terracolor_SanFrancisco_US_15m.ecw I get a weird error:
>
> terminate called after throwing an instance of 'std::length_error' what():
> basic_string::_S_create Aborted (core dumped)
>
> Other file types such as tiff or asc open with GDAL correctly.
> Was anybody able to get GDAL running with ECW support on Linux?
> Should I try to use the KAKADU library with GDAL instead of libecwj?
>
> Any suggestions are welcome.
>
>
>
>
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/ECW-support-on-Fedora-Linux-error-tp4991388.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
Hi,
I went exactly your route with recompiling gdal on Ubuntu 12.04 - no
problems whatsoever and I converted my ECW images to tiff using gdalwarp.
I suggest you download the (free?) Erdas viewer for ecw files and check
the integrity of your ecw image - maybe it got corrupt on your download.

HTH,
Zoltan
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

lanufabi
In reply to this post by jkadlec
 In reply to this post by jkadlec
Hey,

I compiled libecwj2 and gdal 1.9.1 on arch linux like "jkadlec" did and get the same error when i use gdalinfo for ecw files:
terminate called after throwing an instance of 'std::length_error' what(): basic_string::_S_create

gdalinfo --formats puts out that ECW is supported.

What can I do to identify the problem? Do you know a solution?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

Johan Hedin
I had the same problem with libecwj2-3.3 and Fedora 17 64-bit
yesterday. I tracked this down and it is a bug in libecwj2 itself
regarding wchar_t handling in the file NCSPrefsXML.cpp.

I have attached a patch to this mail to fix this. It is a super simple fix :-)

Another way around this is to just define the environment variable
NCS_USER_PREFS to point to some bogus file name. If this is done the
code take another path in libecwj2 and the bug is not triggered. But
fixing the bug is of course better.

BTW, this has apparently always been a bug and I guess that is has
started to show now due to updates to libstdc++, c++ compilers etc. In
the beginning of Fedora 16 this worked but on a up-to-date Fedora 16
today the behaviour is the same as on Fedora 17.

All distributions that are updating c++ and/or libstdc++ in the future
will probably see this bug as well. My patch is not fedora specific.

Pleas report back here if this patch is working for you as well!

(Small disclaimer: I'm recreating the patch from my head. I don't have
the running instance of gdal with ECW support on this computer)

Regards Johan

2012/9/11 lanufabi <[hidden email]>:

>  In reply to this post by jkadlec
> Hey,
>
> I compiled libecwj2 and gdal 1.9.1 on arch linux like "jkadlec" did and get
> the same error when i use gdalinfo for ecw files:
> terminate called after throwing an instance of 'std::length_error' what():
> basic_string::_S_create
>
> gdalinfo --formats puts out that ECW is supported.
>
> What can I do to identify the problem? Do you know a solution?
>
> Thanks
>
>
>
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/ECW-support-on-Fedora-Linux-error-tp4991388p5001142.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

libecwj2-3.3-wcharfix.patch (926 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

jmckenna
Administrator
You might add your notes (and even attach your patch) to the ECW
buildhints wiki page for GDAL yourself:
http://trac.osgeo.org/gdal/wiki/ECW  (otherwise emails are long forgotten)

Works great for your FOSS4G karma as well!

Thanks,

-jeff



On 12-09-12 5:09 PM, Johan Hedin wrote:

> I had the same problem with libecwj2-3.3 and Fedora 17 64-bit
> yesterday. I tracked this down and it is a bug in libecwj2 itself
> regarding wchar_t handling in the file NCSPrefsXML.cpp.
>
> I have attached a patch to this mail to fix this. It is a super simple fix :-)
>
> Another way around this is to just define the environment variable
> NCS_USER_PREFS to point to some bogus file name. If this is done the
> code take another path in libecwj2 and the bug is not triggered. But
> fixing the bug is of course better.
>
> BTW, this has apparently always been a bug and I guess that is has
> started to show now due to updates to libstdc++, c++ compilers etc. In
> the beginning of Fedora 16 this worked but on a up-to-date Fedora 16
> today the behaviour is the same as on Fedora 17.
>
> All distributions that are updating c++ and/or libstdc++ in the future
> will probably see this bug as well. My patch is not fedora specific.
>
> Pleas report back here if this patch is working for you as well!
>
> (Small disclaimer: I'm recreating the patch from my head. I don't have
> the running instance of gdal with ECW support on this computer)
>
> Regards Johan
>
> 2012/9/11 lanufabi <[hidden email]>:
>>  In reply to this post by jkadlec
>> Hey,
>>
>> I compiled libecwj2 and gdal 1.9.1 on arch linux like "jkadlec" did and get
>> the same error when i use gdalinfo for ecw files:
>> terminate called after throwing an instance of 'std::length_error' what():
>> basic_string::_S_create
>>
>> gdalinfo --formats puts out that ECW is supported.
>>
>> What can I do to identify the problem? Do you know a solution?
>>
>> Thanks
>>


--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/


_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

Johan Hedin
Thanks for the hint Jeff. I will definitely update the ECW wiki as
soon as I get time!

I'm working on collecting as many patches regarding libecwj2 and linux
as I can find to get the lib to build cleanly on modern linux
distributions.

Regards Johan

2012/9/12 Jeff McKenna <[hidden email]>:

> You might add your notes (and even attach your patch) to the ECW
> buildhints wiki page for GDAL yourself:
> http://trac.osgeo.org/gdal/wiki/ECW  (otherwise emails are long forgotten)
>
> Works great for your FOSS4G karma as well!
>
> Thanks,
>
> -jeff
>
>
>
> On 12-09-12 5:09 PM, Johan Hedin wrote:
>> I had the same problem with libecwj2-3.3 and Fedora 17 64-bit
>> yesterday. I tracked this down and it is a bug in libecwj2 itself
>> regarding wchar_t handling in the file NCSPrefsXML.cpp.
>>
>> I have attached a patch to this mail to fix this. It is a super simple fix :-)
>>
>> Another way around this is to just define the environment variable
>> NCS_USER_PREFS to point to some bogus file name. If this is done the
>> code take another path in libecwj2 and the bug is not triggered. But
>> fixing the bug is of course better.
>>
>> BTW, this has apparently always been a bug and I guess that is has
>> started to show now due to updates to libstdc++, c++ compilers etc. In
>> the beginning of Fedora 16 this worked but on a up-to-date Fedora 16
>> today the behaviour is the same as on Fedora 17.
>>
>> All distributions that are updating c++ and/or libstdc++ in the future
>> will probably see this bug as well. My patch is not fedora specific.
>>
>> Pleas report back here if this patch is working for you as well!
>>
>> (Small disclaimer: I'm recreating the patch from my head. I don't have
>> the running instance of gdal with ECW support on this computer)
>>
>> Regards Johan
>>
>> 2012/9/11 lanufabi <[hidden email]>:
>>>  In reply to this post by jkadlec
>>> Hey,
>>>
>>> I compiled libecwj2 and gdal 1.9.1 on arch linux like "jkadlec" did and get
>>> the same error when i use gdalinfo for ecw files:
>>> terminate called after throwing an instance of 'std::length_error' what():
>>> basic_string::_S_create
>>>
>>> gdalinfo --formats puts out that ECW is supported.
>>>
>>> What can I do to identify the problem? Do you know a solution?
>>>
>>> Thanks
>>>
>
>
> --
> Jeff McKenna
> MapServer Consulting and Training Services
> http://www.gatewaygeomatics.com/
>
>
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

Homme Zwaagstra


Hi Johan,

Johan Hedin <[hidden email]> wrote:

>Thanks for the hint Jeff. I will definitely update the ECW wiki as
>soon as I get time!
>
>I'm working on collecting as many patches regarding libecwj2 and linux
>as I can find to get the lib to build cleanly on modern linux
>distributions.

Many of the various patches floating around are applied to the Arch Linux libecwj2 package available at
<https://aur.archlinux.org/packages.php?ID=38915> which might save you time. I'll notify the package maintainer about this latest one.

Regards,

Homme

>Regards Johan
>
>2012/9/12 Jeff McKenna <[hidden email]>:
>> You might add your notes (and even attach your patch) to the ECW
>> buildhints wiki page for GDAL yourself:
>> http://trac.osgeo.org/gdal/wiki/ECW  (otherwise emails are long
>forgotten)
>>
>> Works great for your FOSS4G karma as well!
>>
>> Thanks,
>>
>> -jeff
>>
>>
>>
>> On 12-09-12 5:09 PM, Johan Hedin wrote:
>>> I had the same problem with libecwj2-3.3 and Fedora 17 64-bit
>>> yesterday. I tracked this down and it is a bug in libecwj2 itself
>>> regarding wchar_t handling in the file NCSPrefsXML.cpp.
>>>
>>> I have attached a patch to this mail to fix this. It is a super
>simple fix :-)
>>>
>>> Another way around this is to just define the environment variable
>>> NCS_USER_PREFS to point to some bogus file name. If this is done the
>>> code take another path in libecwj2 and the bug is not triggered. But
>>> fixing the bug is of course better.
>>>
>>> BTW, this has apparently always been a bug and I guess that is has
>>> started to show now due to updates to libstdc++, c++ compilers etc.
>In
>>> the beginning of Fedora 16 this worked but on a up-to-date Fedora 16
>>> today the behaviour is the same as on Fedora 17.
>>>
>>> All distributions that are updating c++ and/or libstdc++ in the
>future
>>> will probably see this bug as well. My patch is not fedora specific.
>>>
>>> Pleas report back here if this patch is working for you as well!
>>>
>>> (Small disclaimer: I'm recreating the patch from my head. I don't
>have
>>> the running instance of gdal with ECW support on this computer)
>>>
>>> Regards Johan
>>>
>>> 2012/9/11 lanufabi <[hidden email]>:
>>>>  In reply to this post by jkadlec
>>>> Hey,
>>>>
>>>> I compiled libecwj2 and gdal 1.9.1 on arch linux like "jkadlec" did
>and get
>>>> the same error when i use gdalinfo for ecw files:
>>>> terminate called after throwing an instance of 'std::length_error'
>what():
>>>> basic_string::_S_create
>>>>
>>>> gdalinfo --formats puts out that ECW is supported.
>>>>
>>>> What can I do to identify the problem? Do you know a solution?
>>>>
>>>> Thanks
>>>>
>>
>>
>> --
>> Jeff McKenna
>> MapServer Consulting and Training Services
>> http://www.gatewaygeomatics.com/
>>
>>
>> _______________________________________________
>> gdal-dev mailing list
>> [hidden email]
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>_______________________________________________
>gdal-dev mailing list
>[hidden email]
>http://lists.osgeo.org/mailman/listinfo/gdal-dev

--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

lanufabi
In reply to this post by Johan Hedin
Hey,

thanks a lot for the patch. Now I can use my ECW rastafiles again and finish my job. I searched for many weeks but very late the idea to contact the gdal-dev mailinglist came to my mind. I willspread the solution because I remeber some threads according this problem.

thanks
Fabian
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

tanasko
This post was updated on .
In reply to this post by jmckenna
Can you explain the process by which you get your GIS supports ECW please. I use Ubuntu 12.10 and 1.80 Quantum GIS. In the drop-down list I have ECW, select it, and QGIS crashes with message: basic_string::_S_create gdalinfo --formats puts out that ECW is supported too. Please, help me.
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

lanufabi
Hey tanasko,
can you check whether your libecwj2 package includes libecwj2-3.3-wcharfix.patch ? From which repository did you install qgis + gdal? Please post the output of
$ gdalinfo --formats |grep ECW

Gr
Fabian
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

tanasko
I did everything according to the instructions from this link:
http://wiki.openstreetmap.org/wiki/ECW#Howto_install_gdal_with_ECW_support

gdalinfo --formats |grep ECW
  ECW (rw): ERDAS Compressed Wavelets (SDK 3.x)
  JP2ECW (rw+v): ERDAS JPEG2000 (SDK 3.x)



2013/4/18 lanufabi [via OSGeo.org] <[hidden email]>
Hey tanasko,
can you check whether your libecwj2 package includes libecwj2-3.3-wcharfix.patch ? From which repository did you install qgis + gdal? Please post the output of
$ gdalinfo --formats |grep ECW

Gr
Fabian


If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1560.x6.nabble.com/ECW-support-on-Fedora-Linux-error-tp4991388p5047862.html
To unsubscribe from ECW support on Fedora Linux - error, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

Jean-Claude Repetto
Le 18/04/2013 10:13, tanasko a écrit :
> I did everything according to the instructions from this link:
> http://wiki.openstreetmap.org/wiki/ECW#Howto_install_gdal_with_ECW_support

The libecwj2-3.3-wcharfix.patch patch is missing on this page.

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

tanasko
OK, how can I apply this patch? Please provide step-by step instructions.


2013/4/18 Jean-Claude Repetto [via OSGeo.org] <[hidden email]>
Le 18/04/2013 10:13, tanasko a écrit :
> I did everything according to the instructions from this link:
> http://wiki.openstreetmap.org/wiki/ECW#Howto_install_gdal_with_ECW_support

The libecwj2-3.3-wcharfix.patch patch is missing on this page.

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1560.x6.nabble.com/ECW-support-on-Fedora-Linux-error-tp4991388p5047904.html
To unsubscribe from ECW support on Fedora Linux - error, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

lanufabi
 Hey,
at the moment I haven't enough time. I will try to give instructions next days.
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

tanasko
Can I hope to get help from someone?
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

BigBaka
In reply to this post by lanufabi
It's been a few months, but wondering if there are any instructions on how to install this patch, or if tanasko managed to fix the error message saying basic_string::_S_create

I also have the same problem on newly installed Ubuntu 12.04 with QGIS 1.8.

Any updates to this thread would be much appreciated.

Thx
BB
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

Jean-Claude Repetto
On 26/08/2013 11:14, BigBaka wrote:

> It's been a few months, but wondering if there are any instructions on how to
> install this patch, or if tanasko managed to fix the error message saying
> basic_string::_S_create
>
> I also have the same problem on newly installed Ubuntu 12.04 with QGIS 1.8.
>
> Any updates to this thread would be much appreciated.
>
> Thx
> BB
>

I have updated the instructions on the OSM wiki :
http://wiki.openstreetmap.org/wiki/ECW#Building_libecwj

Jean-Claude

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: ECW support on Fedora Linux - error

BigBaka
Thanks Jean-Claude that will be a big help to many I'm sure.

Alas, I have already compiled an installed using the following commands should I first remove libgdal-ecw-src? Or can I just run as per your link from scratch? If I need to remove, could you please give some commands as to how to successfully remove.

Thanks,
BB

previously I've installed using the commands below.

sudo apt-get install libgdal-ecw-src build-essential
wget http://de-mirror.org/distro/gentoo/distfiles/libecwj2-3.3-2006-09-06.zip
unzip libecwj2-3.3-2006-09-06.zip
cd libecwj2-3.3
./configure
make
sudo make install
sudo gdal-ecw-build /usr/local/
sudo ldconfig
gdalinfo --formats | grep -i ecw