Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unable to call SpatialReference.SetWellKnownGeogCS #2

Closed
pictureaday opened this issue Sep 30, 2019 · 7 comments
Closed

[BUG] Unable to call SpatialReference.SetWellKnownGeogCS #2

pictureaday opened this issue Sep 30, 2019 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@pictureaday
Copy link

(I suspect I'm missing a call that will include the DLLs that are necessary)
Describe the bug
Windows 10, VS 2019, Nuget packages.
After constructing a SpacialReference object I try to call SetWellKnownGeogCS, and receive the error: "System.EntryPointNotFoundException: 'Unable to find an entry point named '?' in DLL 'osr_wrap'.'

To Reproduce
In a console based application netcore v2.2:
GdalBase.ConfigureAll();
Gdal.AllRegister();

// Uncomment line below to get a different EntryPoint exception
//Console.WriteLine("Osr.Version: {0}.{1}", Osr.GetPROJVersionMajor(), Osr.GetPROJVersionMinor());

IntPtr intPtr = new IntPtr();
SpatialReference spatialReference = new SpatialReference(intPtr, true, null);
spatialReference.SetWellKnownGeogCS("WGS84");

Expected behavior
The above should run without error/exception.

Environment information:

  • OS (version): Windows 10
  • Package version (core): v3.0.0.4
  • Package version (runtime): v3.0.0.4
  • Visual Studio Version: 2019 (v16.1.0)

Additional context
I have not yet tested this on linux.

@pictureaday pictureaday added the bug Something isn't working label Sep 30, 2019
@MaxRev-Dev
Copy link
Owner

I had a repro on my machine. That must be a broken reference in library, caused by a version collision during the build.
Already building a new version for both runtimes.

@pictureaday
Copy link
Author

I had a repro on my machine. That must be a broken reference in library, caused by a version collision during the build.
Already building a new version for both runtimes.

Do you know when you might be able to post the new packages?

Thanks!

@MaxRev-Dev
Copy link
Owner

MaxRev-Dev commented Oct 5, 2019

Do you know when you might be able to post the new packages?

Sorry for the late reply. In my leisure time, I'm trying to complete the build.
Currently I'm experiencing problems with geotiff library in windows build.
I could release it without geotiff, but by default it was and stays in linux package.
It would be nice, if you could help.

@pictureaday
Copy link
Author

Believe me I'm trying to help. The build process is very complicated and we are hitting quite a few hiccups. Still learning how to link everything up on the windows side before moving on to the linux side.

@MaxRev-Dev
Copy link
Owner

MaxRev-Dev commented Oct 8, 2019

Almost completed the build with 3.0.1 using an internal geotiff lib for windows. Need a few days to test it.
Also, I've found how to create a SpatialReference. So, spatial ref in for OGR namespace is not working. This comes from a swig interface bindings directly from gdal.
But you can use OSR instead.

UPD: Use new SpatialReference(string wkt) ctor where wkt can be null. Otherwise, it will throw nullref 'hSRS' pointer.
image

@MaxRev-Dev
Copy link
Owner

Please, checkout a new 3.0.1.2 release MaxRev.Gdal.Core. And tell me, if you have any issues with it.

@pictureaday
Copy link
Author

Thanks. I'm using SpatialReference from OSR as you suggested and it works. I'm also using the new packages. Thanks for the effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants