[PROJ] Interface to PROJ from C#

Bert Huijben bert at qqmail.nl
Thu Jan 5 04:31:15 PST 2023


When I tried to use proj from C# a few years back I created a wrapper library SharpProj (https://github.com/AmpScm/SharpProj.git)

 �

All sourcecode and buildscripts that work for me are in the repository, but I’m guessing you can just use NuGet and use the latest proj directly with some of the sample code from there.

 �

 �

The easiest way to build proj yourself on Windows is current most likely using vcpkg. That helps building proj and all its dependencies.

 �

               Bert

 �

From: PROJ <proj-bounces at lists.osgeo.org> On Behalf Of Jonathan Johansen
Sent: Thursday, January 5, 2023 4:08 AM
To: proj at lists.osgeo.org
Subject: [PROJ] Interface to PROJ from C#

 �

Hi all!

 �

I'm trying to use PROJ 9.1.1 in my C# Windows project, but am not having any success. A friend has tried to use it from EasyGIS, but ran into an issue. So I thought I'd try SharpProj (https://github.com/AmpScm/SharpProj), but I ran into �https://github.com/AmpScm/SharpProj/issues/25. So I thought why not try to use the win DLL directly myself? So I got the 64 bit �OSGeo4W from �https://proj.org/install.html#windows, and grabbed all of the DLLs in the bin folder, and have put them into my project. But it throws a similar error:

>'Unable to load DLL 'proj_9_1.dll' or one of its dependencies: The specified module could not be found.

So I thought I'd try to build the DLLS myself and use them. So I've got the 9.1.1 source code, installed cmake, started going through the first tutorial, and am trying. I'm not familiar with Linux, and I'm building on Windows (I see one entry in the mailing list from June 2022 about windows), so this is probably not going to be easy. Anyway, when trying to build it, I get this:

 �

>D:\Downloads\proj_build>cmake ../proj-9.1.1
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19045.
-- Requiring C++11
-- Requiring C++11 - done
-- Requiring C99
-- Requiring C99 - done
-- Configuring PROJ:
-- PROJ_VERSION  �  �  �  �  �  �  �  �  � = 9.1.1
-- PROJ_ABI_VERSION  �  �  �  �  �  �  � = 9_1
CMake Warning at cmake/ProjConfig.cmake:48 (message):
 � Autoconf's D:/Downloads/proj-9.1.1/src/proj_config.h may interfere with
 � this CMake build. � Run 'make distclean' in the source directory before
 � CMake's build.
Call Stack (most recent call first):
 � CMakeLists.txt:127 (include)

-- nlohmann/json: internal
CMake Error at CMakeLists.txt:176 (message):
 � sqlite3 binary not found!

CMake Error at CMakeLists.txt:181 (message):
 � sqlite3 dependency not found!

CMake Error at CMakeLists.txt:187 (message):
 � sqlite3 >= 3.11 required!

CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
 � Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
Call Stack (most recent call first):
 � C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
 � C:/Program Files/CMake/share/cmake-3.25/Modules/FindTIFF.cmake:124 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
 � CMakeLists.txt:198 (find_package)

-- Configuring incomplete, errors occurred!
See also "D:/Downloads/proj-9.1.1/CMakeFiles/CMakeOutput.log".

 �

I have copied the sqlite3.exe and .dll from �OSGeo4W into both folders, and it still doesn't think sqlite is there. I'll keep going through cmake tutorials to try to understand how I can satisfy it, but any help is appreciated - even better if SharpProj can be made to work. At this point I am a bit sad as I'm in over my head. I can supply a basic project trying to use the �OSGeo4W DLLs too, if you'd like to look at that.

 �

Thanks so much for reading to this point!

 �

Jonathan Johansen


M:   <tel:0438922553> 0438 922 553


E:  jonathan at t3rra.com <mailto:jonathan at t3rra.com> 
W:  http://www.t3rra.com/

 �

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20230105/9f235272/attachment.htm>


More information about the PROJ mailing list