Many thanks, I've got this Exception:
org.opengis.referencing.NoSuchIdentifierException: No transform for
classification "Sinusoidal".
at
org.geotools.referencing.operation.DefaultMathTransformFactory.getProvider(DefaultMathTransformFactory.java:289)
at
org.geotools.referencing.operation.DefaultMathTransformFactory.getDefaultParameters(DefaultMathTransformFactory.java:315)
I am working with the projection code 16 (Sinusoidal) see paramaters
herebelow. Moreover, I don't know how to set the parameter "Sphere".
Here is my code :
public static ProjectedCRS getModisCrs(){
ReferencingFactoryContainer factories = new
ReferencingFactoryContainer(null);
GeographicCRS geoCRS =
org.geotools.referencing.crs.DefaultGeographicCRS.WGS84;
CartesianCS cartCS =
org.geotools.referencing.cs.DefaultCartesianCS.PROJECTED;
MathTransformFactory mtfactory=factories.getMathTransformFactory();
ParameterValueGroup parameters=null;
try {
parameters =
mtfactory.getDefaultParameters("Sinusoidal");
} catch (NoSuchIdentifierException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
parameters.parameter("sphere").setValue(6371007.181);
Map properties = Collections.singletonMap("name", "Sinusoidal");
ProjectedCRS projCRS =null;
try {
Conversion cv = new DefiningConversion("Sinusoidal",
parameters);
projCRS = factories.createProjectedCRS(properties, geoCRS, cv,
cartCS);
} catch (FactoryException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return projCRS;
}
Thanks!
http://svn.osgeo.org/gdal/trunk/gdal/ogr/ogr_srs_usgs.cpp
----------------------------------------------------------------------------
* | Array Element
* Code & Projection Id
|---------------------------------------------------
* | 0 | 1 | 2 | 3 | 4 | 5 |6
| 7
*
----------------------------------------------------------------------------
* 0 Geographic | | | | | | |
|
* 1 U T M |Lon/Z |Lat/Z | | | | |
|
* 2 State Plane | | | | | | |
|
* 3 Albers Equal Area
|SMajor|SMinor|STDPR1|STDPR2|CentMer|OriginLat|FE|FN
* 4 Lambert Conformal C
|SMajor|SMinor|STDPR1|STDPR2|CentMer|OriginLat|FE|FN
* 5 Mercator |SMajor|SMinor| |
|CentMer|TrueScale|FE|FN
* 6 Polar Stereographic |SMajor|SMinor| |
|LongPol|TrueScale|FE|FN
* 7 Polyconic |SMajor|SMinor| |
|CentMer|OriginLat|FE|FN
* 8 Equid. Conic A |SMajor|SMinor|STDPAR|
|CentMer|OriginLat|FE|FN
* Equid. Conic B
|SMajor|SMinor|STDPR1|STDPR2|CentMer|OriginLat|FE|FN
* 9 Transverse Mercator |SMajor|SMinor|Factor|
|CentMer|OriginLat|FE|FN
* 10 Stereographic |Sphere| | |
|CentLon|CenterLat|FE|FN
* 11 Lambert Azimuthal |Sphere| | |
|CentLon|CenterLat|FE|FN
* 12 Azimuthal |Sphere| | |
|CentLon|CenterLat|FE|FN
* 13 Gnomonic |Sphere| | |
|CentLon|CenterLat|FE|FN
* 14 Orthographic |Sphere| | |
|CentLon|CenterLat|FE|FN
* 15 Gen. Vert. Near Per |Sphere| |Height|
|CentLon|CenterLat|FE|FN
* 16 Sinusoidal |Sphere| | | |CentMer|
|FE|FN
* 17 Equirectangular |Sphere| | |
|CentMer|TrueScale|FE|FN
* 18 Miller Cylindrical |Sphere| | | |CentMer|
|FE|FN
* 19 Van der Grinten |Sphere| | |
|CentMer|OriginLat|FE|FN
* 20 Hotin Oblique Merc A |SMajor|SMinor|Factor| |
|OriginLat|FE|FN
* Hotin Oblique Merc B
|SMajor|SMinor|Factor|AziAng|AzmthPt|OriginLat|FE|FN
* 21 Robinson |Sphere| | | |CentMer|
|FE|FN
* 22 Space Oblique Merc A |SMajor|SMinor| |IncAng|AscLong|
|FE|FN
* Space Oblique Merc B |SMajor|SMinor|Satnum|Path | |
|FE|FN
* 23 Alaska Conformal |SMajor|SMinor| | | |
|FE|FN
* 24 Interrupted Goode |Sphere| | | | | |
|
* 25 Mollweide |Sphere| | | |CentMer|
|FE|FN
* 26 Interrupt Mollweide |Sphere| | | | | |
|
* 27 Hammer |Sphere| | | |CentMer|
|FE|FN
* 28 Wagner IV |Sphere| | | |CentMer|
|FE|FN
* 29 Wagner VII |Sphere| | | |CentMer|
|FE|FN
* 30 Oblated Equal Area |Sphere|
|Shapem|Shapen|CentLon|CenterLat|FE|FN
*
----------------------------------------------------------------------------
*
* ----------------------------------------------------
* | Array Element |
* Code & Projection Id |---------------------------
* | 8 | 9 | 10 | 11 | 12 |
* ----------------------------------------------------
* 0 Geographic | | | | | |
* 1 U T M | | | | | |
* 2 State Plane | | | | | |
* 3 Albers Equal Area | | | | | |
* 4 Lambert Conformal C | | | | | |
* 5 Mercator | | | | | |
* 6 Polar Stereographic | | | | | |
* 7 Polyconic | | | | | |
* 8 Equid. Conic A |zero | | | | |
* Equid. Conic B |one | | | | |
* 9 Transverse Mercator | | | | | |
* 10 Stereographic | | | | | |
* 11 Lambert Azimuthal | | | | | |
* 12 Azimuthal | | | | | |
* 13 Gnomonic | | | | | |
* 14 Orthographic | | | | | |
* 15 Gen. Vert. Near Per | | | | | |
* 16 Sinusoidal | | | | | |
* 17 Equirectangular | | | | | |
* 18 Miller Cylindrical | | | | | |
* 19 Van der Grinten | | | | | |
* 20 Hotin Oblique Merc A |Long1|Lat1|Long2|Lat2|zero|
* Hotin Oblique Merc B | | | | |one |
* 21 Robinson | | | | | |
* 22 Space Oblique Merc A |PSRev|LRat|PFlag| |zero|
* Space Oblique Merc B | | | | |one |
* 23 Alaska Conformal | | | | | |
* 24 Interrupted Goode | | | | | |
* 25 Mollweide | | | | | |
* 26 Interrupt Mollweide | | | | | |
* 27 Hammer | | | | | |
* 28 Wagner IV | | | | | |
* 29 Wagner VII | | | | | |
* 30 Oblated Equal Area |Angle| | | | |
* ----------------------------------------------------
*
* where
*
* Lon/Z Longitude of any point in the UTM zone or zero. If zero,
* a zone code must be specified.
* Lat/Z Latitude of any point in the UTM zone or zero. If zero, a
* zone code must be specified.
* SMajor Semi-major axis of ellipsoid. If zero, Clarke 1866 in
meters
* is assumed.
* SMinor Eccentricity squared of the ellipsoid if less than zero,
* if zero, a spherical form is assumed, or if greater than
* zero, the semi-minor axis of ellipsoid.
* Sphere Radius of reference sphere. If zero, 6370997 meters is
used.
* STDPAR Latitude of the standard parallel
* STDPR1 Latitude of the first standard parallel
* STDPR2 Latitude of the second standard parallel
* CentMer Longitude of the central meridian
* OriginLat Latitude of the projection origin
* FE False easting in the same units as the semi-major axis
* FN False northing in the same units as the semi-major axis
* TrueScale Latitude of true scale
* LongPol Longitude down below pole of map
* Factor Scale factor at central meridian (Transverse Mercator) or
* center of projection (Hotine Oblique Mercator)
* CentLon Longitude of center of projection
* CenterLat Latitude of center of projection
* Height Height of perspective point
* Long1 Longitude of first point on center line (Hotine Oblique
* Mercator, format A)
* Long2 Longitude of second point on center line (Hotine Oblique
* Mercator, format A)
* Lat1 Latitude of first point on center line (Hotine Oblique
* Mercator, format A)
* Lat2 Latitude of second point on center line (Hotine Oblique
* Mercator, format A)
* AziAng Azimuth angle east of north of center line (Hotine Oblique
* Mercator, format B)
* AzmthPt Longitude of point on central meridian where azimuth occurs
* (Hotine Oblique Mercator, format B)
* IncAng Inclination of orbit at ascending node, counter-clockwise
* from equator (SOM, format A)
* AscLong Longitude of ascending orbit at equator (SOM, format A)
* PSRev Period of satellite revolution in minutes (SOM, format A)
* LRat Landsat ratio to compensate for confusion at northern end
* of orbit (SOM, format A -- use 0.5201613)
* PFlag End of path flag for Landsat: 0 = start of path,
* 1 = end of path (SOM, format A)
* Satnum Landsat Satellite Number (SOM, format B)
* Path Landsat Path Number (Use WRS-1 for Landsat 1, 2 and 3 and
* WRS-2 for Landsat 4, 5 and 6.) (SOM, format B)
* Shapem Oblated Equal Area oval shape parameter m
* Shapen Oblated Equal Area oval shape parameter n
* Angle Oblated Equal Area oval rotation angle
Martin Desruisseaux wrote:
>
> Agossa a écrit :
>> Thanks a lot for your answers. My problem could be solved out if I knew
>> how
>> to create a projectioncrs from scratch with some geotools class having in
>> hand the projection parameters(like "src_semi_major" and so one). I am
>> using
>> HDFEOS file format and as Frank said there are using this kind of
>> projection
>> in their product. I found an example here but deprecated: I'm unable to
>> find
>> neither FactoryGroup nor FactoryContainer in geotools. Herebelow is the
>> code
>> copied from GeoTools 2.5 Users Guide
>
>
> The code snippet is still valid if we replace
> "FactoryGroup"/"FactoryContainer"
> by "ReferencingFactoryContainer". The "ConstantesDespliegue" class is
> unknown to
> me - I guess that it come from a specific use case. And finally the last
> line:
>
>> ProjectedCRS projCRS = factories.createProjectedCRS(properties, geoCRS,
>> null, parameters, cartCS);
>
> can be replaced by:
>
> Conversion cv = new DefiningConversion("Oblique Stereographic",
> parameters);
> ProjectedCRS projCRS = factories.createProjectedCRS(properties, geoCRS,
> cv, cartCS);
>
> Martin
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with
> Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code
> to
> build responsive, highly engaging applications that combine the power of
> local
> resources and data with the reach of the web. Download the Adobe AIR SDK
> and
> Ajax docs to start building applications
> today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
--
View this message in context:
http://n2.nabble.com/GCTP-Projection-tp2269223p2289015.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users