Java maven Installation Gdal

Source: Internet
Author: User

1. Use the compiled installation Jdal

http://www.gisinternals.com/release.php
gdal-111-1800-x64-core.msi:http://download.gisinternals.com/sdk/downloads/ Release-1800-x64-gdal-1-11-3-mapserver-6-4-2/gdal-111-1800-x64-core.msi

2. Configure Maven

Pom.xml

<Dependency>        <groupId>Org.gdal</groupId>        <Artifactid>Gdal</Artifactid>        <version>1.11.2</version></Dependency>
3. Configure Environment variables
gdal_bin=C:\Program files\gdal gdal_data=c:\program files\gdal\gdal-DATA gdal_driver=c:\ Program Files\gdal\gdalplugins
4. Questions
Nativelibraryloadfailed.java.lang.UnsatisfiedLinkError:noogrjniinjava.library.pathExceptioninthread "Main" Java.lang.UnsatisfiedLinkError:RegisterAllatorg.gdal.ogr.ogrJNI.RegisterAll (Nativemethod) Atorg.gdal.ogr.ogr.RegisterAll (ogr.java:115) atcom.gdal.vector.ShapeFileWrite.main (shapefilewrite.java:20)
Method 1,Place the DLL file directly under the Java Engineering root directory. GDAL Java Demo compiled successfully. Advantages: Simple thinking, 32, 64-bit DLL can be very convenient to switch. Disadvantage: Each new project needs to copy these DLLs, increase the project file size, cumbersome operation. Method 2, setSystem environment variables Specify the DLL path, add it to the path in the operating system to run a program (command), if you do not specify an absolute path, it will go to the program itself is located under the path to find the executable file, when the file is not found, will go to the environment variable path below to find what you need. So we just need to add the path of this gdal DLL to path, right-click Computer--"Properties--" Advanced system settings--"Environment variables-" New system variables: New two system variables Gdal32_dll variable name: Gdal32_dll variable value: \ C Gdal\release-1600-win32-dev\release-1600\bin; The C:\GDAL\release-1600-win32-dev\release-1600\bin\gdal\java name can be defined by itself, specifying the GDAL DLL path location, and the GDAL Java version of the compiled path. Increase in front of path (if no path system variable is created) "%gdal32_dll%;", that is, path becomes%gdal32_dll%;%java_home%/... Note: After you add a DLL to path, you need to restart your computer, or log off and enter the Windows system before it takes effect.

Java maven Installation Gdal

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.