Re: [gdal-dev] Need solution for C# setup, with error at OSGeo.OGR registration

2017-08-01 Thread Tamas Szekeres
Hi,

You probably have multiple dll dependencies availabe in the path. Try copying 
all the dependencies from the same package to the location where your excutable 
is running.

Best regards,

Tamas

Az iPhone-omról küldve

2017. aug. 1. dátummal, 17:08 időpontban C. Zeng  írta:

> ​Hello all,
> 
> I am trying to setup the GDAL in C#.NET 2015, with an error at the 
> registration of the Ogr. A previous post stated the exact same problem but 
> without a solution, I tried to reply in that post but failed,thus send this 
> email instead. 
> 
> That previous post described my problem very well:  
>> "I am using ogr_csharp.dll in my c# program. See the following code snippet: 
>> using OSGeo.OGR; 
>> namespace Test 
>> { 
>> public class Test 
>> { 
>> public Test() 
>> { 
>> ... 
>>   Ogr.RegisterAll(); 
>> }   
>> } 
>> } 
>> Then the following exception message was thrown out when the program is 
>> executed: 
>> {"The type initializer for 'OSGeo.OGR.OgrPINVOKE' threw an exception."}  
>>
>> System.Exception {System.TypeInitializationException} 
>> Does anyone know how to resolve this issue? "
> 
> Some more details for my case. My steps are: 
> - downloaded the stable or daily stable release (same error later) from here. 
> - added the "...\bin" and "...\bin\gdal\csharp" to Environment Variable, 
> setup a sample project, 
> - add the 4 "###sharp.dll" from csharp folder to project reference. 
> - import namespace:  using OSGeo.OGR; using OSGeo.OSR;  and add a simple line 
> "Ogr.RegisterAll(); " 
> 
> Then I can successfully build the project, but with the following error msg. 
> I tried all possible solutions by Google plus this forum such as this and 
> this. 
> test all the x64/x86 , debug/release, switches, no luck. 
> 
> Any comment is appreciated, thank you! 
> 
> Chui 
> 
> 
> 
> --error message -- 
> 
> Unhandled Exception: System.TypeInitializationException: The type initializer 
> fo 
> r 'OSGeo.OGR.OgrPINVOKE' threw an exception. ---> 
> System.TypeInitializationExcep 
> tion: The type initializer for 'SWIGExceptionHelper' threw an exception. ---> 
> Sy 
> stem.BadImageFormatException: An attempt was made to load a program with an 
> inco 
> rrect format. (Exception from HRESULT: 0x8007000B) 
>at 
> OSGeo.OGR.OgrPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_Og 
> r(ExceptionDelegate applicationDelegate, ExceptionDelegate 
> arithmeticDelegate, E 
> xceptionDelegate divideByZeroDelegate, ExceptionDelegate 
> indexOutOfRangeDelegate 
> , ExceptionDelegate invalidCastDelegate, ExceptionDelegate 
> invalidOperationDeleg 
> ate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, 
> Exce 
> ptionDelegate outOfMemoryDelegate, ExceptionDelegate overflowDelegate, 
> Exception 
> Delegate systemExceptionDelegate) 
>at OSGeo.OGR.OgrPINVOKE.SWIGExceptionHelper..cctor() 
>--- End of inner exception stack trace --- 
>at OSGeo.OGR.OgrPINVOKE.SWIGExceptionHelper..ctor() 
>at OSGeo.OGR.OgrPINVOKE..cctor() 
>--- End of inner exception stack trace --- 
>at OSGeo.OGR.OgrPINVOKE.RegisterAll() 
>at OSGeo.OGR.Ogr.RegisterAll() 
>at TestProj.Main(String[] args) in 
> \user\Downloads\Workspace\TestProj\project.cs:line 47
> 
> and also the following log info: 
> 'TestProj.vshost.exe' (CLR v4.0.30319: TestProj.vshost.exe): Loaded 
> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'.
>  Cannot find or open the PDB file. 
> 'TestProj.vshost.exe' (CLR v4.0.30319: TestProj.vshost.exe): Loaded 
> 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll'.
>  Cannot find or open the PDB file. 
> 'TestProj.vshost.exe' (CLR v4.0.30319: TestProj.vshost.exe): Loaded 
> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'.
>  Cannot find or open the PDB file. 
> 'TestProj.vshost.exe' (CLR v4.0.30319: TestProj.vshost.exe): Loaded 
> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'.
>  Cannot find or open the PDB file. 
> 'TestProj.vshost.exe' (CLR v4.0.30319: TestProj.vshost.exe): Loaded 
> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'.
>  Cannot find or open the PDB file. 
> 'TestProj.vshost.exe' (CLR v4.0.30319: TestProj.vshost.exe): Loaded 
> 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll'.
>  Cannot find or open the PDB file. 
> 'TestProj.vshost.exe' (CLR v4.0.30319: TestProj.vshost.exe): Loaded 
> 

Re: [gdal-dev] A modified version of your get_soundg.py

2017-08-01 Thread Dave Liske

Frank,Thank you for this. I had a suspicion feat1 had a purpose at some point. It'd probably be interesting to hear if you ever do remember what that might have been.I've made a couple other changes to my version of this since contacting you last week. Precision of the LAT/LONG fields is now 7, as per S-52 Appendix B.2. But then, to add flexibility for the user of the KML file, I ditched my additional second argument to specify metres or feet in favor of creating and filling both a DEPTHM and a DEPTHF field. This gives the user the choice of switching between the two without generating a separate KML file.Thanks again,DaveOn July 29, 2017 at 10:00 PM Frank Warmerdam  wrote:Dave,Thanks for the notice. I am not updating the upstream get_soundg.pybut I've taken the liberty of cc:ing this reply to the gdal-devmailing list so more potentially interested folks will be aware ofyour changes, and your blog post:http://micuisine.com/code-projects/?page_id=10I was particularly amused by change entry "Changed feat2 to feat1 toprevent searching for unused feat1.". Indeed looking back at the codethere must have been some history behind my use of feat2 that was lostand now is just confusing.Best regards,FrankOn Sat, Jul 29, 2017 at 7:46 AM, Dave Liske  wrote:Mr. Warmerdam,In recently looking for a method to split the depth values from NOAA S-57files for a personal art project, I came across your 2003 get_soundg.py filefor accomplishing the task via Python. In running your file withus3fl28m.000 I found that it did, in fact, accomplish what I was trying todo. But it also generated a number of errors, the reasons of which are notclear as it likely didn't generate those same errors in 2003 when youoriginally released the script.Sir I know this is out-of-the-blue but I wanted you to know that, with somechanges to correct current errors, your 2003 code still does what youintended. I then took it a few more steps to hopefully make it more usefulfor some as well.I've made the following changes, saving the new version ass57_kml_extract_soundg.py:Added error handling if SOUNDG layer or source S-57 file is not found.Deleted second usage argument: Added code to create target file in samedirectory as source S-57 file.Added new second usage argument: Select soundings as provided as 'metre',or calculate new sounding values as 'feet'Target File Type: Changed to KML. Errors are subsequently handledcorrectly, i.e. the errors are suppressed while the FFPT_RIND and LNAM_REFSfields are also not included in the resulting KML file.Added "_metre" or "_feet" to the new filename based on second usageargumentAdded WGS84 CSR to the target KML file.Changed created layer name from 'out' to 'KML_SOUNDG'. When imported intoQGIS the resulting layer is displayed as _KML_SOUNDG_Point in theBrowser Panel.Changed target field 'ELEV' to 'DEPTH', which is accurate for soundings.Changed precision for 'DEPTH' field from 4 to 0 to reflect chart usage.Added target fields 'LAT' and 'LONG' for xcoord and ycoord.Changed feat2 to feat1 to prevent searching for unused feat1.Added completion messages.I've posted the new code at http://micuisine.com/code-projects/?page_id=10along with further descriptions, as well as a link to a ZIP file containings57_kml_extract_soundg.py.I hope this email finds you well, and that these updates are useful and notoffensive in some manner. Please feel free to contact me with any commentsor questions about this updated work.Sincerely,Dave LiskeLuna Pier, Michigan-+--I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.comlight and sound - activate the windows |and watch the world go round - Rush | Geospatial Software Developer
 
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Revisiting ecw

2017-08-01 Thread Even Rouault
On mardi 1 août 2017 17:05:20 CEST Micha Silver wrote:
> I'm following the thread:
> http://osgeo-org.1560.x6.nabble.com/gdal-dev-gdal-2-1-ecw-5-2-1-td5299048.ht
> ml trying to compile gdal with ECW support. I have tried this configure:
> 
> CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" ./configure
> --prefix=/usr/local/gdal --with-libkml=no
> --with-ecw=/home/micha/Downloads/ERDAS-ECW_JPEG_2000_SDK-5.3.0/Desktop_Read-
> Only/ --with-xml2=no --with-expat=no
> 
> to disable KML, xml etc. But I'm still getting compile errors that begin
> with: undefined reference to
> `kmlengine::Clone(boost::intrusive_ptr const&)'
>  and many more after that.
> Any suggestions?

"make clean" if you didn't do it already. It is likely remaining objects that 
link to libkml from a 
previous ./configure && make

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] Revisiting ecw

2017-08-01 Thread Micha Silver
I'm following the thread:
http://osgeo-org.1560.x6.nabble.com/gdal-dev-gdal-2-1-ecw-5-2-1-td5299048.html
trying to compile gdal with ECW support. I have tried this configure:

CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" ./configure
--prefix=/usr/local/gdal --with-libkml=no
--with-ecw=/home/micha/Downloads/ERDAS-ECW_JPEG_2000_SDK-5.3.0/Desktop_Read-Only/
--with-xml2=no --with-expat=no

to disable KML, xml etc. But I'm still getting compile errors that begin with:
undefined reference to
`kmlengine::Clone(boost::intrusive_ptr const&)'
 and many more after that.
Any suggestions?

Thanks
Micha Silver

tel:  +972 (77) 6449059  cell: +972 (52) 3665918
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev