Skip to content

Commit

Permalink
support geocent (#60)
Browse files Browse the repository at this point in the history
* support geocent

* Add inverse project radians

Signed-off-by: novpla <tuannn.bk@gmail.com>
  • Loading branch information
tuan-nng authored Apr 7, 2021
1 parent 8740500 commit 15254ec
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/locationtech/proj4j/Registry.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ private synchronized void initialize() {
register("fouc", FoucautProjection.class, "Foucaut");
register("fouc_s", FoucautSinusoidalProjection.class, "Foucaut Sinusoidal");
register("gall", GallProjection.class, "Gall (Gall Stereographic)");
register("geocent", GeocentProjection.class, "Geocentric");
register("geos", GeostationarySatelliteProjection.class, "Geostationary Satellite");
// register( "gins8", Projection.class, "Ginsburg VIII (TsNIIGAiK)" );
// register( "gn_sinu", Projection.class, "General Sinusoidal Series" );
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/org/locationtech/proj4j/proj/GeocentProjection.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.locationtech.proj4j.proj;

import org.locationtech.proj4j.ProjCoordinate;
import org.locationtech.proj4j.datum.GeocentricConverter;

public class GeocentProjection extends Projection {

@Override
public ProjCoordinate projectRadians(ProjCoordinate src, ProjCoordinate dst) {
GeocentricConverter geocentricConverter = new GeocentricConverter(this.ellipsoid);
geocentricConverter.convertGeodeticToGeocentric(dst);
return dst;
}

@Override
public ProjCoordinate inverseProjectRadians(ProjCoordinate src, ProjCoordinate dst) {
GeocentricConverter geocentricConverter = new GeocentricConverter(this.ellipsoid);
geocentricConverter.convertGeocentricToGeodetic(dst);
return dst;
}
}

0 comments on commit 15254ec

Please sign in to comment.