Revision 263 org.gvsig.projection.jcrs/trunk/org.gvsig.projection.jcrs/org.gvsig.projection.jcrs.lib/src/main/java/org/gvsig/crs/Proj4.java
Proj4.java | ||
---|---|---|
1675 | 1675 |
addProjectionName(count,"9804"); |
1676 | 1676 |
addProjectionName(count, "Mercator (1SP)"); |
1677 | 1677 |
addProjectionName(count, "Mercator_(1SP)"); |
1678 |
addProjectionName(count,"Mercator_(variant_A)");
|
|
1678 |
addProjectionName(count,"Mercator_(variant_A)");
|
|
1679 | 1679 |
|
1680 | 1680 |
String[] parameterName={"central_meridian"}; |
1681 | 1681 |
projectionParameterList.add(count,parameterName); |
1682 | 1682 |
addProjectionParameter(count,"latitude_of_origin"); // o latitude_origin |
1683 |
addProjectionParameter(count,"scale_factor"); // o latitude_origin
|
|
1683 |
addProjectionParameter(count,"scale_factor"); |
|
1684 | 1684 |
addProjectionParameter(count,"false_easting"); |
1685 | 1685 |
addProjectionParameter(count,"false_northing"); |
1686 | 1686 |
|
1687 | 1687 |
String[] parameterAcronym={"lon_0"}; |
1688 | 1688 |
projectionParameterAcronymList.add(count,parameterAcronym); |
1689 |
addProjectionParameterAcronymList(count,"lat_ts"); // o lat_ts
|
|
1690 |
addProjectionParameterAcronymList(count,"k"); // o lat_ts
|
|
1689 |
addProjectionParameterAcronymList(count,"lat_ts"); |
|
1690 |
addProjectionParameterAcronymList(count,"k"); |
|
1691 | 1691 |
addProjectionParameterAcronymList(count,"x_0"); |
1692 | 1692 |
addProjectionParameterAcronymList(count,"y_0"); |
1693 | 1693 |
|
... | ... | |
1723 | 1723 |
addProjectionName(count,"Mercator"); |
1724 | 1724 |
addProjectionName(count,"9805"); |
1725 | 1725 |
addProjectionName(count, "Mercator (2SP)"); |
1726 |
addProjectionName(count, "Mercator_(variant_B)"); |
|
1726 | 1727 |
|
1727 | 1728 |
String[] parameterName={"central_meridian"}; |
1728 | 1729 |
projectionParameterList.add(count,parameterName); |
... | ... | |
1939 | 1940 |
addProjectionName(count,"Rectified_Skew_Orthomorphic_Center"); |
1940 | 1941 |
addProjectionName(count,"Hotine Oblique Mercator"); |
1941 | 1942 |
addProjectionName(count,"Hotine_Oblique_Mercator"); |
1942 |
addProjectionName(count,"Hotine_Oblique_Mercator_(variant_B)");
|
|
1943 |
addProjectionName(count,"Hotine_Oblique_Mercator_(variant_B)");
|
|
1943 | 1944 |
|
1944 | 1945 |
String[] parameterName={"latitude_of_center"}; |
1945 | 1946 |
projectionParameterList.add(count,parameterName); |
... | ... | |
2785 | 2786 |
String[] projectionAcronym={"wintri"}; |
2786 | 2787 |
projectionAcronymList.add(count,projectionAcronym); |
2787 | 2788 |
} |
2788 |
|
|
2789 | 2789 |
|
2790 |
count++;
|
|
2791 |
{// Popular_Visualisation_Pseudo_Mercator based Mercator_1SP
|
|
2790 |
count++; |
|
2791 |
{// Popular_Visualisation_Pseudo_Mercator (based on Mercator_1SP)
|
|
2792 | 2792 |
String[] projectionName={"Popular_Visualisation_Pseudo_Mercator"}; |
2793 | 2793 |
projectionNameList.add(count,projectionName); |
2794 | 2794 |
|
2795 | 2795 |
String[] parameterName={"central_meridian"}; |
2796 | 2796 |
projectionParameterList.add(count,parameterName); |
2797 | 2797 |
addProjectionParameter(count,"latitude_of_origin"); // o latitude_origin |
2798 |
addProjectionParameter(count,"scale_factor"); // o latitude_origin
|
|
2798 |
addProjectionParameter(count,"scale_factor"); |
|
2799 | 2799 |
addProjectionParameter(count,"false_easting"); |
2800 | 2800 |
addProjectionParameter(count,"false_northing"); |
2801 | 2801 |
addProjectionParameter(count,"semi_major"); |
... | ... | |
2803 | 2803 |
|
2804 | 2804 |
String[] parameterAcronym={"lon_0"}; |
2805 | 2805 |
projectionParameterAcronymList.add(count,parameterAcronym); |
2806 |
addProjectionParameterAcronymList(count,"lat_ts"); // o lat_ts
|
|
2807 |
addProjectionParameterAcronymList(count,"k"); // o lat_ts
|
|
2806 |
addProjectionParameterAcronymList(count,"lat_ts"); |
|
2807 |
addProjectionParameterAcronymList(count,"k"); |
|
2808 | 2808 |
addProjectionParameterAcronymList(count,"x_0"); |
2809 | 2809 |
addProjectionParameterAcronymList(count,"y_0"); |
2810 | 2810 |
addProjectionParameterAcronymList(count,"a"); |
... | ... | |
2812 | 2812 |
|
2813 | 2813 |
String[] parameterDefaultValue={"0.0"}; |
2814 | 2814 |
projectionParameterDefaultValueList.add(count,parameterDefaultValue); |
2815 |
addProjectionParameterDefaultValue(count,"0.0"); // o 0.0 |
|
2816 |
addProjectionParameterDefaultValue(count,"1.0"); // o 0.0 |
|
2817 | 2815 |
addProjectionParameterDefaultValue(count,"0.0"); |
2816 |
addProjectionParameterDefaultValue(count,"1.0"); |
|
2818 | 2817 |
addProjectionParameterDefaultValue(count,"0.0"); |
2818 |
addProjectionParameterDefaultValue(count,"0.0"); |
|
2819 | 2819 |
addProjectionParameterDefaultValue(count,"6378137.0"); |
2820 | 2820 |
addProjectionParameterDefaultValue(count,"6378137.0"); |
2821 | 2821 |
|
... | ... | |
3300 | 3300 |
if(projectionName.equals("Oblique_Mercator")) |
3301 | 3301 |
{ |
3302 | 3302 |
isOmerc=true; |
3303 |
if (crs.getCode()==21781) |
|
3304 |
isSomerc=true; |
|
3303 | 3305 |
for(int j=0;j<gtParameterNames.length;j++) |
3304 | 3306 |
{ |
3305 | 3307 |
String gtParameterName=gtParameterNames[j].trim(); |
... | ... | |
3310 | 3312 |
double value=Double.parseDouble(gtParameterValues[j]); |
3311 | 3313 |
if(Math.abs(Math.abs(value)-90.0)<0.0001) |
3312 | 3314 |
{ |
3313 |
throw new CrsException(new Exception("In proj4 projection 'Oblique_Mercator' not allow latitude origen close to the poles"));
|
|
3315 |
throw new CrsException(new Exception("In proj4 the 'Oblique_Mercator' projection doesn't allow latitude origen close to the poles"));
|
|
3314 | 3316 |
} |
3315 | 3317 |
} |
3316 | 3318 |
if(gtParameterName.equalsIgnoreCase("azimuth")) |
3317 | 3319 |
{ |
3318 | 3320 |
valueAlpha=Double.parseDouble(gtParameterValues[j]); |
3319 |
if(Math.abs(valueAlpha-90.0)<0.0001) |
|
3321 |
//if(Math.abs(valueAlpha-90.0)<0.0001) |
|
3322 |
if (valueAlpha > 90.0) |
|
3320 | 3323 |
{ |
3321 |
throw new CrsException(new Exception("In proj4 projection 'Oblique_Mercator' not allow azimut close to 90")); |
|
3324 |
//throw new CrsException(new Exception("In proj4 projection 'Oblique_Mercator' not allow azimut close to 90")); |
|
3325 |
throw new CrsException(new Exception("In proj4 the 'Oblique_Mercator' projection doesn't allow azimut values > 90")); |
|
3322 | 3326 |
} |
3323 | 3327 |
if(Math.abs(valueAlpha-270.0)<0.0001) |
3324 | 3328 |
{ |
3325 |
throw new CrsException(new Exception("In proj4 projection 'Oblique_Mercator' not allow azimut close to 270"));
|
|
3329 |
throw new CrsException(new Exception("In proj4 the 'Oblique_Mercator' projection doesn't allow azimut close to 270"));
|
|
3326 | 3330 |
} |
3327 | 3331 |
existsAlpha=true; |
3328 | 3332 |
} |
... | ... | |
3336 | 3340 |
{ |
3337 | 3341 |
if(Math.abs(valueAlpha-valueGamma)>0.00000001) |
3338 | 3342 |
{ |
3339 |
throw new CrsException(new Exception("In proj4 projection 'Oblique_Mercator' not allow diferent azimut and spin axis"));
|
|
3343 |
throw new CrsException(new Exception("In proj4 the 'Oblique_Mercator' projection doesn't allow different azimut and spin axis"));
|
|
3340 | 3344 |
} |
3341 | 3345 |
} |
3342 | 3346 |
|
... | ... | |
3415 | 3419 |
{ |
3416 | 3420 |
if(value_sf!=1.0&&value_lo!=0.0) |
3417 | 3421 |
{ |
3418 |
throw new CrsException(new Exception("In proj4 projection Mercator not allow scale factor and latitude of origin"));
|
|
3422 |
throw new CrsException(new Exception("The 'Mercator' proj4 projection doesn't allow scale factor and latitude of origin."));
|
|
3419 | 3423 |
} |
3420 | 3424 |
else if(projectionName.equals("Mercator_1SP")) |
3421 | 3425 |
exists_lo=false; |
... | ... | |
3428 | 3432 |
exists_sf=false; |
3429 | 3433 |
*/ |
3430 | 3434 |
} |
3435 |
if(projectionName.equalsIgnoreCase("Popular_Visualisation_Pseudo_Mercator")) |
|
3436 |
value_sf=1.0; |
|
3437 |
exists_sf=true; |
|
3431 | 3438 |
} |
3432 | 3439 |
else if(projectionAcronym[0].equals("lcc")) |
3433 | 3440 |
{ |
... | ... | |
3627 | 3634 |
String elipName=crs.getCrsWkt().getSpheroid()[0]; |
3628 | 3635 |
a=Double.parseDouble(crs.getCrsWkt().getSpheroid()[1]); |
3629 | 3636 |
inv_f=Double.parseDouble(crs.getCrsWkt().getSpheroid()[2]); |
3637 |
if (crs.getCode() == 3857) |
|
3638 |
inv_f = Double.POSITIVE_INFINITY; |
|
3630 | 3639 |
String strEllipseAcronym=ellipseToProj4(a,inv_f); |
3631 |
String strEllipse=""; |
|
3640 |
String strEllipse="";
|
|
3632 | 3641 |
if(strEllipseAcronym.equals("")) |
3633 | 3642 |
{ |
3634 | 3643 |
if (!Double.isInfinite(inv_f)) |
... | ... | |
3638 | 3647 |
else |
3639 | 3648 |
strEllipse="+R="+a+" "; |
3640 | 3649 |
} |
3650 |
/* |
|
3641 | 3651 |
else |
3642 | 3652 |
strEllipse="+R="+a+" "; |
3653 |
*/ |
|
3643 | 3654 |
} |
3644 | 3655 |
else |
3645 | 3656 |
{ |
... | ... | |
3915 | 3926 |
if(projectionName.equals("Oblique_Mercator")) |
3916 | 3927 |
{ |
3917 | 3928 |
isOmerc=true; |
3929 |
// TODO Set isSomerc as true for EPSG:21781 |
|
3930 |
//if (crs.getCode()==21781) |
|
3931 |
// isSomerc=true; |
|
3918 | 3932 |
for(int j=0;j<gtParameterNames.length;j++) |
3919 | 3933 |
{ |
3920 | 3934 |
String gtParameterName=gtParameterNames[j].trim(); |
... | ... | |
3925 | 3939 |
double value=Double.parseDouble(gtParameterValues[j]); |
3926 | 3940 |
if(Math.abs(Math.abs(value)-90.0)<0.0001) |
3927 | 3941 |
{ |
3928 |
throw new CrsException(new Exception("The proj4 projection 'Oblique Mercator' not allow latitude origin close to the poles."));
|
|
3942 |
throw new CrsException(new Exception("In proj4 the 'Oblique_Mercator' projection doesn't allow latitude origin close to the poles."));
|
|
3929 | 3943 |
} |
3930 | 3944 |
} |
3931 | 3945 |
if(gtParameterName.equalsIgnoreCase("azimuth")) |
3932 | 3946 |
{ |
3933 | 3947 |
valueAlpha=Double.parseDouble(gtParameterValues[j]); |
3934 |
if(Math.abs(valueAlpha-90.0)<0.0001) |
|
3948 |
//if(Math.abs(valueAlpha-90.0)<0.0001) |
|
3949 |
if (valueAlpha > 90.0) |
|
3935 | 3950 |
{ |
3936 |
throw new CrsException(new Exception("The proj4 projection 'Oblique Mercator' not allow azimut close to 90.")); |
|
3951 |
//throw new CrsException(new Exception("In proj4 projection 'Oblique_Mercator' not allow azimut close to 90")); |
|
3952 |
throw new CrsException(new Exception("In proj4 the 'Oblique_Mercator' projection doesn't allow azimut values > 90")); |
|
3937 | 3953 |
} |
3938 | 3954 |
if(Math.abs(valueAlpha-270.0)<0.0001) |
3939 | 3955 |
{ |
3940 |
throw new CrsException(new Exception("The proj4 projection 'Oblique Mercator' not allow azimut close to 270."));
|
|
3956 |
throw new CrsException(new Exception("In proj4 the 'Oblique_Mercator' projection doesn't allow azimut close to 270."));
|
|
3941 | 3957 |
} |
3942 | 3958 |
existsAlpha=true; |
3943 | 3959 |
} |
... | ... | |
4030 | 4046 |
{ |
4031 | 4047 |
if(value_sf!=1.0&&value_lo!=0.0) |
4032 | 4048 |
{ |
4033 |
throw new CrsException(new Exception("The proj4 projection 'Mercator' not allow scale factor and latitude of origin."));
|
|
4049 |
throw new CrsException(new Exception("The 'Mercator' proj4 projection doesn't allow scale factor and latitude of origin."));
|
|
4034 | 4050 |
} |
4035 | 4051 |
else if(projectionName.equals("Mercator_1SP")) |
4036 | 4052 |
exists_lo=false; |
... | ... | |
4043 | 4059 |
exists_sf=false; |
4044 | 4060 |
*/ |
4045 | 4061 |
} |
4062 |
if(projectionName.equalsIgnoreCase("Popular_Visualisation_Pseudo_Mercator")) |
|
4063 |
value_sf=1.0; |
|
4064 |
exists_sf=true; |
|
4065 |
inv_f = Double.POSITIVE_INFINITY; |
|
4046 | 4066 |
} |
4047 | 4067 |
else if(projectionAcronym[0].equals("lcc")) |
4048 | 4068 |
{ |
... | ... | |
4238 | 4258 |
else |
4239 | 4259 |
strEllipse="+R="+a+" "; |
4240 | 4260 |
} |
4261 |
/* |
|
4241 | 4262 |
else |
4242 | 4263 |
strEllipse="+R="+a+" "; |
4264 |
*/ |
|
4243 | 4265 |
} |
4244 | 4266 |
else |
4245 | 4267 |
{ |
... | ... | |
4560 | 4582 |
{ |
4561 | 4583 |
pszPROJ4Ellipse = "WGS84"; |
4562 | 4584 |
} |
4585 |
else if( Math.abs(dfSemiMajor-6378137.0) < 0.01 |
|
4586 |
&& Double.isInfinite(dfInvFlattening) ) |
|
4587 |
{ |
|
4588 |
pszPROJ4Ellipse = ""; /* Popular Visualisation Sphere */ |
|
4589 |
} |
|
4563 | 4590 |
/* |
4564 | 4591 |
else if( EQUAL(pszDatum,"North_American_Datum_1927") ) |
4565 | 4592 |
{ |
Also available in: Unified diff