Open xjpmauricio opened 4 years ago
I've tried this but I get all sorts of errors:
double latitude = 37.42342342342342, longitude = -122.08395287867832;
CRSFactory factory = new CRSFactory();
CoordinateReferenceSystem sourceCRS = factory.createFromParameters("EPSG:4326",
"+title=long/lat:WGS84 +proj=longlat +a=6378137.0 +b=6356752.31424518 +ellps=WGS84 +datum=WGS84 +units=degrees\"");
CoordinateReferenceSystem targetCRS = factory.createFromParameters("EPSG:20790",
"+title=Hayford-Gauss Datum Lisboa (Militar) +proj=tmerc +lat_0=39.66666666666666 +lon_0=1 +k=1 +x_0=200000 +y_0=300000 +ellps=intl +towgs84=-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4,058 +pm=lisbon +units=m +no_defs");
CoordinateTransform transform = new CoordinateTransformFactory().createTransform(sourceCRS, targetCRS);
ProjCoordinate srcCoord = new ProjCoordinate(latitude, longitude);
ProjCoordinate destCoord = new ProjCoordinate();
transform.transform(srcCoord, destCoord);
Errors:
org.osgeo.proj4j.UnsupportedParameterException: Datum parameter is not supported
How can I convert this javascript to this java library?
I've tried using the method factory.createFromParameters but I get all sorts of errors related with the parameters.
Any ideias?