Skip to content

Geomatys/geoapi-gt-wrappers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeoAPI wrappers for GeoTools

Implementation of GeoAPI 3.0 interfaces as wrappers around the GeoTools library. GeoAPI is a set of implementation-neutral interfaces standardized by the Open Geospatial Consortium (OGC). Projects using GeoAPI interfaces for their metadata and referencing services have more flexibility for changing implementation according their needs. It also makes possible to use GeoTools with projects designed for GeoAPI. For example, it makes possible to run the GIGS tests against GeoTools.

All wrappers in this project are bidirectional: GeoTools objects can be viewed as GeoAPI objects, or conversely. The latter should, in theory, allow the use of alternative referencing library such as Apache SIS or PROJ inside GeoTools. However, as of Mars 2025, it has not been tested.

For more details, see the Javadoc.

Maven coordinates

This artifact can be used in a Maven project as below:

  <dependencies>
    <dependency>
      <groupId>com.geomatys</groupId>
      <artifactId>geoapi-geotools</artifactId>
      <version>1.0</version>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>geotoolkit.org</id>
      <name>Geotoolkit.org repository</name>
      <url>https://maven.geotoolkit.org</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

Usage

This project provides only two public classes: Wrappers and Services. For viewing a GeoTools object as a GeoAPI object, simply invoke the following:

var geotools = CRS.decode("EPSG:4326");
var geoapi = Wrappers.geoapi(geotools);

The geoapi method is overloaded with all types of objects supported by this project. Conversely, a GeoAPI object can be unwrapped or viewed as a GeoTools object like below:

var geotools = Wrappers.geotools(geoapi);

Factories

The following methods of GeoTools are reproduced in Services with the same signature, but returning the GeoTools factory wrapped in a GeoAPI factory:

  • CRS.getAuthorityFactory(longitudeFirst)
  • CRS.getCoordinateOperationFactory(lenient)

Build from source code

Simply run mvn install in a local clone of this repository.

Possible donation to OSGeo

A better home for this project would be the OSGeo foundation, which is where GeoTools is hosted. Deployment on the OSGeo Maven repository would be convenient since it would be the same repository as for GeoTools. Having this project hosted by OSGeo has been proposed in the end of 2024, but OSGeo declined. If another volunteer has some evidence of a user base and is willing to ask again to OSGeo, we would be happy to donate this project, including a transfer of copyright to OSGeo if desired.

About

GeoAPI wrappers for GeoTools

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages