Skip to content

Releases: TomasJohansson/crsTransformations

v2.0.1

05 Jan 21:16
Compare
Choose a tag to compare

Release notes for the upgrade 2.0.0 ==> 2.0.1:
Updated with later versions for some of the adaptee libraries:
geotools 25.1 ==> 28.0
orbisgis 1.5.2 ==> 1.6.0
ngageoint 4.0.0 ==> 4.3.0
locationtech 1.1.3 ==> 1.2.2

https://search.maven.org/search?q=com.programmerare.crs-transformation
https://mvnrepository.com/artifact/com.programmerare.crs-transformation

v2.0.0

12 Jul 20:37
Compare
Choose a tag to compare

Release notes for the upgrade 1.1.1 ==> 2.0.0 :

  • Removed the enum CrsTransformationAdapteeType (which had been deprecated) and of course also removed all usages of it e.g. in method signatures
  • Removed two protected methods from CrsTransformationAdapterBase
  • Renamed a class: CrsTransformationAdapterGeoPackageNGA ==> CrsTransformationAdapterNgaGeoInt
    (and also renamed its package and renamed a CrsTransformationImplementationType enum item: LEAF_NGA_GEOPACKAGE ==> LEAF_NGA_GEOINT)
  • The dependency for the "nga" implementation is now using mil.nga.sf:sf-proj instead of mil.nga.geopackage:geopackage which is also the reason for the above renaming
  • Updated versions of some adaptee libraries:
    ngageoint/geopackage-java 3.5.0 ==> ngageoint/simple-features-proj-java 4.0.0
    geotools 23.0 ==> 25.1
    locationtech/proj4j 1.1.1 ==> 1.1.3

Some of the above are "incompatible API changes" and therefore the major version was increased from 1 to 2, according to to semantic versioning

https://mvnrepository.com/artifact/com.programmerare.crs-transformation/crs-transformation-adapter-core/2.0.0
https://mvnrepository.com/artifact/com.programmerare.crs-transformation/crs-transformation-adapter-impl-geotools/2.0.0
https://mvnrepository.com/artifact/com.programmerare.crs-transformation/crs-transformation-adapter-impl-nga/2.0.0
https://mvnrepository.com/artifact/com.programmerare.crs-transformation/crs-transformation-adapter-impl-orbisgis/2.0.0
https://mvnrepository.com/artifact/com.programmerare.crs-transformation/crs-transformation-adapter-impl-proj4jlocationtech/2.0.0
https://mvnrepository.com/artifact/com.programmerare.crs-transformation/crs-transformation-adapter-impl-proj4j/2.0.0
https://mvnrepository.com/artifact/com.programmerare.crs-transformation/crs-transformation-adapter-impl-goober/2.0.0

https://search.maven.org/artifact/com.programmerare.crs-transformation/crs-transformation-adapter-core
https://search.maven.org/artifact/com.programmerare.crs-transformation/crs-transformation-adapter-impl-geotools/
https://search.maven.org/artifact/com.programmerare.crs-transformation/crs-transformation-adapter-impl-nga/
https://search.maven.org/artifact/com.programmerare.crs-transformation/crs-transformation-adapter-impl-orbisgis/
https://search.maven.org/artifact/com.programmerare.crs-transformation/crs-transformation-adapter-impl-proj4jlocationtech/
https://search.maven.org/artifact/com.programmerare.crs-transformation/crs-transformation-adapter-impl-proj4j/
https://search.maven.org/artifact/com.programmerare.crs-transformation/crs-transformation-adapter-impl-goober/

crs-transformation-constants 10.027

12 Jul 20:11
Compare
Choose a tag to compare

Java class with 7193 constants:
https://search.maven.org/artifact/com.programmerare.crs-transformation/crs-transformation-constants/10.027/jar

The number of constants (7193) can easily be counted and printed to screen by using this Java code:

System.out.println(com.programmerare.crsConstants.constantsByAreaNameNumber.v10_027.EpsgNumber.class.getFields().length);

The constants have been generated with the Kotlin module crs-transformation-code-generation with data based on the 10.027 version of the EPSG database at epsg.org.

https://mvnrepository.com/artifact/com.programmerare.crs-transformation/crs-transformation-constants/10.027
https://search.maven.org/artifact/com.programmerare.crs-transformation/crs-transformation-constants

v1.1.1

21 Apr 21:48
Compare
Choose a tag to compare

Release notes for the upgrade 1.1.0 ==> 1.1.1 :

  • Fixed a problem which only occurred when calling the code from Jython.
    (but it did work fine in 1.1.0 from Java, Kotlin, Scala, Groovy and JRuby) (8835e4)
  • A dependency has been added to the logging framework SLF4J
  • Performance improvement with a lazy loading refactoring (58fec8c)

v1.1.0

17 Apr 17:16
Compare
Choose a tag to compare

Release notes for the upgrade 1.0.0 ==> 1.1.0 :

Upgraded used versions of three adaptee libraries:

New Adapter CrsTransformationAdapterProj4jLocationtech (in crs-transformation-adapter-impl-proj4jlocationtech) using locationtech/proj4j 1.1.1 as the adaptee library:

Upgraded Kotlin dependency: 1.3.10 ==> 1.3.72

Updated interface CrsTransformationAdapter:

  • Deprecation of the method "fun getAdapteeType() : CrsTransformationAdapteeType"
    (including deprectation of the enum return type)
  • New method "fun getImplementationType() : CrsTransformationImplementationType"
    (and the enum return type is also new)
  • New method "fun getVersionOfImplementationAdapteeLibrary() : String"

The both new methods above can be used instead of the above deprecated method which included version information for the Leaf's.

Gradle and Maven dependencies can be copied from the repository home page.

crs-transformation-constants 9.8.9

15 Apr 11:14
Compare
Choose a tag to compare

Java class with 6937 constants:
https://search.maven.org/artifact/com.programmerare.crs-transformation/crs-transformation-constants/9.8.9/jar

The number of constants (6937) can easily be counted and printed to screen by using this Java code:

System.out.println(com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber.class.getFields().length);

The constants have been generated with the Kotlin module crs-transformation-code-generation with data based on the 9.8.9 version of the EPSG database at epsg-registry.org.

v1.0.0

16 Nov 09:05
Compare
Choose a tag to compare

Information about Gradle and Maven configuration:
https://github.com/TomasJohansson/crsTransformations

"Jitpack release" using Kotlin 1.3.0

06 Nov 12:53
Compare
Choose a tag to compare
Pre-release

https://jitpack.io/com/github/TomasJohansson/crsTransformations/ab96ddf4727ce4b9b7ce1c981a1527f5fc896279/build.log

If you are using Maven you can add jitpack as below to your pom.xml :

    <properties>
        <!--  reuse the git commit value in a property to avoid the duplication -->
        <crsTransformationsGitCommit>ab96ddf4727ce4b9b7ce1c981a1527f5fc896279</crsTransformationsGitCommit>
        
        <!-- other properties you may want in your pom file ...  -->
    </properties>
    
    <dependencies>
        
        <dependency>
            <groupId>com.github.TomasJohansson.crsTransformations</groupId>
            <artifactId>crs-transformation-constants</artifactId>
            <version>${crsTransformationsGitCommit}</version>
        </dependency> 	 
        
        <dependency>
            <groupId>com.github.TomasJohansson.crsTransformations</groupId>
            <artifactId>crs-transformation-adapter-impl-goober</artifactId>
            <version>${crsTransformationsGitCommit}</version>    	
        </dependency>
        
        <dependency>
            <groupId>com.github.TomasJohansson.crsTransformations</groupId>
            <artifactId>crs-transformation-adapter-impl-orbisgis</artifactId>
            <version>${crsTransformationsGitCommit}</version>
        </dependency>		
        
        <dependency>
            <groupId>com.github.TomasJohansson.crsTransformations</groupId>
            <artifactId>crs-transformation-adapter-impl-proj4j</artifactId>
            <version>${crsTransformationsGitCommit}</version>
        </dependency>
        
        <dependency>
            <groupId>com.github.TomasJohansson.crsTransformations</groupId>
            <artifactId>crs-transformation-adapter-impl-nga</artifactId>
            <version>${crsTransformationsGitCommit}</version>
        </dependency>
        
        <dependency>
            <groupId>com.github.TomasJohansson.crsTransformations</groupId>
            <artifactId>crs-transformation-adapter-impl-geotools</artifactId>
            <version>${crsTransformationsGitCommit}</version>
        </dependency>	  	
        
        <!-- other dependencies you may want in your pom file ... --> 	  	
    </dependencies>

	<repositories>
	       
		<!--  jitpack repository is currently needed until the code is released to maven central  -->
		<repository>
			<id>jitpack.io</id>
			<url>https://jitpack.io</url>
		</repository>
		
		<!-- osgeo repository is needed for geotools  -->	
		<repository>
			<id>osgeo.org</id>
			<url>https://download.osgeo.org/webdav/geotools/</url>
		</repository>
	        
	</repositories>

Java example code working with the above "jitpack release":

import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber;
import com.programmerare.crsTransformations.CrsTransformationAdapteeType;
import com.programmerare.crsTransformations.CrsTransformationAdapter;
import com.programmerare.crsTransformations.CrsTransformationResult;
import com.programmerare.crsTransformations.CrsTransformationResultStatistic;
import com.programmerare.crsTransformations.compositeTransformations.CrsTransformationAdapterCompositeFactory;
import com.programmerare.crsTransformations.coordinate.CrsCoordinate;
import com.programmerare.crsTransformations.coordinate.CrsCoordinateFactory;
...
    // Some terminology regarding the names used in the below code example:
    // "CRS" = Coordinate Reference System
    // "WGS84" is the most frequently used coordinate system (e.g. the coordinates usually used in a GPS)    
    // "SWEREF99TM" is the official coordinate system used by authorities in Sweden
    // "EPSG" = "European Petroleum Survey Group" was (but the EPSG name is still often used) 
    //           an organization defining CRS with integer numbers e.g.  4326 for WGS84 or 3006 for SWEREF99TM
    int epsgWgs84  = EpsgNumber.WORLD__WGS_84__4326;
    int epsgSweRef = EpsgNumber.SWEDEN__SWEREF99_TM__3006;
    // The above "EpsgNumber" class with LOTS OF constants (and more constants classes) have been generated, 
    // using "FreeMarker" and database downloaded from EPSG ( http://www.epsg.org or http://www.epsg-registry.org ) 
    
    CrsCoordinate centralStockholmWgs84 = CrsCoordinateFactory.latLon(59.330231, 18.059196, epsgWgs84);
    // https://kartor.eniro.se/m/03Yxp
    // SWEREF99TM coordinates (for WGS84 59.330231, 18.059196) 
    // according to Eniro (above URL): 6580822, 674032 (northing, easting)
    
    CrsTransformationAdapter crsTransformationAdapter; // interface with concrete "leaf" implementation or "composite" implementations
    // This code example is using a "composite" which will use multiple libraries to do the same transformation and then 
    // return a coordinate with the median values (median of the northing values and median of the easting values)  
    crsTransformationAdapter = CrsTransformationAdapterCompositeFactory.createCrsTransformationMedian();
    // The above factory will try to use those known objects which implements the interface i.e. the number 
    // of "leaf" objects will depend on how many you included in for example the maven pom file (five in the above maven example)
    System.out.println("Number of 'leafs' : " + crsTransformationAdapter.getTransformationAdapterChildren().size());
    // Console output from the above row:
    // Number of 'leafs' : 5

    // Transform the WGS84 coordinate to a SWEREF99TM coordinate:
    CrsCoordinate centralStockholmSweRef = crsTransformationAdapter.transformToCoordinate(centralStockholmWgs84, epsgSweRef);
    System.out.println("Median Composite Northing: " + centralStockholmSweRef.getNorthing());        
    System.out.println("Median Composite Easting: " + centralStockholmSweRef.getEasting());      
    // Console output from the above two rows:
    //      Median Composite Northing: 6580821.991123579
    //      Median Composite Easting: 674032.3573261796        
    // (and these can be compared with the 'Eniro' values above i.e. '6580822, 674032 (northing, easting)' )
    
    // The coordinate class provides four methods with different names for the same east-west value and 
    // four methods for the same name each north-south value, as below:
    //      Four EQUIVALENT methods:  getEasting  , getX , getLongitude , getXEastingLongitude
    //      Four EQUIVALENT methods:  getNorthing , getY , getLatitude  , getYNorthingLatitude
    // Regarding the above alternative methods, depending on the desired semantic in your context, you may want to use:
    //      x/y for a geocentric or cartesian system
    //      longitude/latitude for a geodetic or geographic system
    //      easting/northing for a cartographic or projected system
    //      xEastingLongitude/yNorthingLatitude for general code handling different types of system
    
    // If you want more details for the result you can use the following 'transform' method: 
    //  (instead of the method 'transformToCoordinate' used above)
    CrsTransformationResult centralStockholmResultSweRef = crsTransformationAdapter.transform(centralStockholmWgs84, epsgSweRef);
    if(!centralStockholmResultSweRef.isSuccess()) {
        System.out.println("No coordinate result");
    }
    else {
        if(centralStockholmResultSweRef.isReliable(
            4,      //  minimumNumberOfSuccesfulResults, 
            0.01    // maxDeltaValueForXLongitudeAndYLatitude
        )) {
            // at least 4 succesful results and the maximal difference in northing or easting is less than 0.01
            // (and if you want to know the exact difference you can find it in this code example further down the page)
            System.out.println("Reliable result"); // according to your chosen parameters to the method 'isReliable'    
        }
        else {
            System.out.println("Not reliable result");
        }
        System.out.println(centralStockholmResultSweRef.getOutputCoordinate());
        // Console output from the above code row:
        // Coordinate(xEastingLongitude=674032.3573261796, yNorthingLatitude=6580821.991123579, crsIdentifier=CrsIdentifier(crsCode='EPSG:3006', isEpsgCode=true, epsgNumber=3006))
        
        // When your code is in a context where you only have the result (but not the adapter object) 
        // (e.g. in a method receiving the result as a parameter)
        // you can get back the object which created the result as below:
        CrsTransformationAdapter crsTransformationAdapterResultSource = centralStockholmResultSweRef.getCrsTransformationAdapterResultSource();
        CrsTransformationAdapteeType adapteeType = crsTransformationAdapterResultSource.getAdapteeType();
        System.out.println("adapteeType: " + adapteeType); // console output: COMPOSITE_MEDIAN
        // The above code row returned an enum which is not really a true adaptee just like the 'composite' is not a true adapter.
        // However, when iterating (as below) the "leaf" results, 
        // it might be more interesting to keep track of from where the different values originated
        List<CrsTransformationResult> transformationResultChildren = centralStockholmResultSweRef.getTransformationResultChildren();
        for (CrsTransformationResult crsTransformationResultLeaf : transformationResultChildren) {
            if(!crsTransformationResultLeaf.isSuccess()) continue; // continue with the next 'leaf'
            
            CrsTransformationAdapter resultAdapter = crsTransformationResultLeaf.getCrsTransformationAdapterResultSource();
            System.out.println(resultAdapter.getAdapteeType());
            // The above code row will output rows like this: "LEAF_GOOBER_1_1" or "LEAF_NGA_GEOPACKAGE_3_1_0" and so on
            if(!crsTransformationResultLeaf.isReliable(
                    2,      ...
Read more