Comments (3)
Hello, thanks for reporting! Could you prepare the failing test case? I.e. the code that generates a wrong result + what should be the expected result.
from proj4j.
Thank you for your reply
code
import org.locationtech.proj4j.*;
/**
* Proj4jTest
*
* @author jidengke
* @date 2021/3/7 13:24
*/
public class Proj4jTest {
public static void main(String[] args) {
ProjCoordinate s=new ProjCoordinate();
s.y=-4.504755;
s.x=65.324837;
String wgsParam="+proj=longlat +datum=WGS84 +no_defs";
String lccParam="+proj=lcc +lat_1=20.0 +lat_2=50.0 +lat_0=38.00001 +lon_0=102.0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +R=6370000 +no_defs";;
CoordinateTransformFactory ctFactory = new CoordinateTransformFactory();
CRSFactory csFactory = new CRSFactory();
CoordinateReferenceSystem source = csFactory.createFromParameters("wgs", wgsParam);
CoordinateReferenceSystem target = csFactory.createFromParameters("lcc", lccParam);
CoordinateTransform coordinateTransform = ctFactory.createTransform(source, target);
ProjCoordinate t = new ProjCoordinate();
coordinateTransform.transform(s, t);
System.out.println(t.x);
System.out.println(t.y);
}
}
Program output
x=-4813708.6575989155
y=-3981769.0948999394
this is qgis output
x=-4819499.5840
y=-4009501.2945
from proj4j.
I tried to add a new datum to the source code
String lccParam="+proj=lcc +lat_1=20.0 +lat_2=50.0 +lat_0=38.00001 +lon_0=102.0 +x_0=0 +y_0=0 +ellps=CLEAR +units=m +no_defs";
this output
x=-4819499.583995361
y=-4009501.2944552563
from proj4j.
Related Issues (20)
- How I can use vunits in android? HOT 1
- Will there be support for +geoidgrids ? its commonly used for height transformation HOT 1
- VN2000 Error Exception in thread "main" java.lang.IllegalStateException: Latitude is out of range: 9738.514891355962
- Transforming from "EPSG:4326" to "EPSG:3857" results in precision error
- Reprojection results seem to be too imprecise
- Support for polar stereographic with alternate scales HOT 4
- altitude not working when Projecting HOT 1
- rhealpix is not supported HOT 1
- Datum.isEqual maybe have a bug
- Unknown projection: longlat HOT 22
- gtx files cannot be used?
- reprojection from epsg:31370 to epsg:3857 is inaccurate HOT 1
- Transverse Mercator Projection test failed HOT 1
- Equidistant Azimuthal (ESRI:54032) test failed HOT 1
- Robinson projection (ESRI:54030) test failed HOT 2
- UnknownAuthorityCodeException: EPSG:9054 HOT 3
- ntv2 grid support
- Proj4j should not use the Apache License if it contains the EPSG data set HOT 16
- In release 1.2.0, the pom file contains incorrect version '1.2.0-SNAPSHOT' HOT 14
- Improve proj4j tests to reflect the recent changes and the moved out EPSG resources
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proj4j.