Friday, October 8, 2010

offline repository

Maven Alternative

The alternative to using Maven to download and manage jars for you is to manually install them. To start with we will obtain GeoTools from the website:

  1. Download the GeoTools binary release from http://sourceforge.net/projects/geotools/files

  2. Extract the geotools-2.6.0-bin.zip file to C:javageotools-2.6.0 folder.

  3. If you open up the folder and have a look you will see GeoTools and all of the other jars that it uses including those from other libraries such as GeoAPI and JTS.

    ../_images/gtunzipped.jpg
  4. We can now set up GeoTools as a library in NetBeans:

    From the menu bar choose Tools > Libraries to open the Library Manager.

  5. From the Library Manager press the New Library button.

  6. Enter “GeoTools” for the Library Name and press OK

  7. You can now press the Add JAR/Folder button and add in all the jars from C:javaGeoTools-2.7-M2

  8. GeoTools includes a copy of the “EPSG” map projections database; but also allows you to hook up your own copy of the EPSG database as an option. However, only one copy can be used at a time so we will need to remove the following jars from the Library Manager:

  1. GeoTools allows you to work with many different databases; however to make them work you will need to download jdbc drivers from the manufacturer.

    For now remove the following plugins from the Library Manager:

    • gt-arcsde
    • gt-arcsde-common
    • gt-db2
    • gt-jdbc-db2
    • gt-oracle-spatial
    • gt-jdbc-oracle
  2. We are now ready to proceed with creating an example project. Select File > New Project

  3. Choose the default “Java Application”

  4. Fill in “Tutorial” as the project name; and our initial Main class will be called “Quickstart”.

  5. Open up Example in the Projects window, right click on Libraries and select Add Libraries. Choose GeoTools from the Add Library dialog.

  6. Congratulations ! You can now return to Quickstart or any of the other tutorials

No comments:

Post a Comment