ThinkGeo.com    |     Documentation    |     Premium Support

Error from Linux build using Gdal to open KML data

Hi Jason, v13.3 is now available online.

Hi there,
I downloaded the 13.3.0 release and used those packages in my test project (TestThinkGeoOnLinuxDocker attached). Here’s a list of what is and isn’t working for the test app:

  1. The test kml file is processed correctly when using Visual Studio 2022 debugging and non-debug Windows builds targeting .NET 6 and .NET 8 Frameworks
  2. The test kml file is processed correctly when using Visual Studio 2022 debugging and non-debug Docker builds targeting .NET 8 Framework
  3. The test kml file is processed correctly when using Visual Studio 2022 debugging Docker builds targeting .NET 6 Framework
  4. The test kml file is NOT processed correctly when using Visual Studio 2022 non-debugging Docker builds targeting .NET 6 Framework. The container starts and stops immediately with no errors or logs
  5. The test kml file is NOT processed correctly when using our deployed Docker builds targeting .NET 6 Framework. I get the same error as before: " OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_Gdal"

Can you attempt to run the attached test project which is setup for non-debug Docker and targeting .NET 6 Framework? Perhaps you can determine where the failure is because I cannot see it.DockerNet6Fails_TestThinkGeoOnLinuxDocker.zip (611 Bytes)

Hi Jason, the attached TestThinkGeoOnLinuxDocker.zip (611 bytes) only has a .sln file, no project file or any other files in it, do I miss anything?

Thanks,
Ben

That is my mistake. I’ve attached the zip of the full project.
Thank you!
JasonDockerNet6Fails_TestThinkGeoOnLinuxDocker.zip (5.6 KB)

Hi Jason,

For #4 that the project working incorrectly in VS 2022 on a docker without the debugger attached, we recreated the issue with your project, and we created a new project which works correctly. Please try it on your side and review the changes we made.
TestThinkGeoOnLinux6.zip (46.0 KB)

About #5, we made it work after packaging and deploying it as following:

  1. make sure the StartUp Object in project property matches the correct namespace and class name:

  2. adjust the docker file accordingly:

  3. Go into the folder where the Dockerfile is located using the Windows Command Prompt and run the command ‘docker build -t testthinkgeo6 .’ to build the Docker image for deployment. ‘testthinkgeo6’ is the name of the Docker image we are building:

  4. Run the command ‘docker run -d -p 8080:80 --name testthinkgeo6 testthinkgeo6’ to run the Docker container after it has been built successfully,

Now you can see the docker running in the containers list,

and you can access it via a browser

Thanks,
Ben

Hi Jason,

We’ve updated the Gdal to the latest 3.9.1, and here is an updated demo project running on Linux through docker with .NET 8 TestThinkGeoOnLinux6_09032024.zip (9.5 KB). Please have a try.

Notes:

  1. It’s using ThinkGeo.Gdal instead of ThinkGeo.Gdal3, also don’t forget to install ThinkGeo.Gdal.Dependency.Linux.nupkg to make it run on Linux.
    image

  2. ThinkGeo.Gdal is in beta, let me know if you see any issues, the release version will be ready soon.

  3. ThinkGeo.Gdal3 package will be unlisted from Nuget pretty soon.

Thanks,
Ben