How to update the EPSG database

From gvSIG CE Wiki

Jump to: navigation, search

gvSIG CE uses a modified module of GeoTools to manage the EPSG database. This module is gt2-epsg-hsql and its code is in the gvSIG CE support folder[1]. See also [2] for more information.

Getting the necessary project to update the database

Download this project into your workspace like any other project.

Download gt2-epsg-hsql like a project into workspace

In the src folder there is an EPSG.zip file with three files inside:

  • EPSG.properties with the HSQLDB database properties
  • EPSG.script contains the SQL statements to generate the database
  • EPSG.data with the database data

These files are a copy of the EPSG database. To update this, it is necessary to generate a new EPSG.zip file with the latest version of the database.

Generating a new EPSG.zip with the latest EPSG database

To obtain an updated EPSG.zip file with the latest version of the EPSG database:

  1. Get the epsg-hsql module, version 8.x, from the GeoTools repository[3] and all its dependencies.
  2. In the resources folder there is a text file, UpdateEPSGDatabase.txt[4] and the rest of the files needed to perform the update process.
  3. Follow the instructions in UpdateEPSGDatabase.txt to generate the EPSG.zip file.

Replacing the old EPSG database

Once you have generated an updated EPSG.zip file with the latest EPSG database, it is necessary to create an updated library that includes it.

  1. In the gt2-epsg-hsql project, replace the existing EPSG.zip file in the src folder with the new version of the file.
  2. Run CRSTest to check that all is OK.
  3. Run build.xml as Ant Build with target create-jar; you must obtain a message like this: ...create-jar: BUILD SUCCESSFUL Total time: XXX milliseconds
  4. The new library geotools-epsg-hsql-2.1.1_gvsig.jar will be generated in the dist folder.
  5. Replace with this library the old version of the library in folders libFmap/lib and libJCRS/lib
  6. Congratulations!! You have updated gvSIG CE to the latest version of the EPSG database.