## geotools-gt2-users

 [Geotools-gt2-users] How to translate a ProjectedCRS From: Benoît Thiébault - 2010-01-20 11:14:33 ```Hi everyone, I would like to use the World Mercator projection (EPSG:3395), but with a different longitude origin. How can I do that ? I think I just need to change the prime meridian of my projected crs, but I don't know exactly how to do it. I have read the tutorial, but it is apparently deprecated (last paragraph) http://docs.codehaus.org/display/GEOTDOC/03+CoordinateReferenceSystem and it deals with creating the CRS from scratch, while I just want to translate an existing one. Thank you very much Benoît Thiébault ```
 Re: [Geotools-gt2-users] How to translate a ProjectedCRS From: jle - 2010-01-20 14:00:16 ```Good morning, I believe that the Longitude of Origin is actually the Central Meridian parameter. So somewhere in your code when you set up your parameters, make sure you set the central meridian value as your value. I found this link: http://www.remotesensing.org/geotiff/proj_list/mercator_2sp.html Looks like the required parameters are: - "standard_parallel_1" : the Latitude of first standard parallel, unit: angular (radian i believe) - "latitude_of_origin": the Latitude of natural origin, unit: angular (radian I believe) - "central_meridian": the Longitude of natural origin, unit: angular (radian ~me) - "false_easting": False Easting - "false_northing": False Northing This is what I think how to set up the parameters (in my theory :) I am still testing with UTM) try { MathTransformFactory mtFactory = ReferencingFactoryFinder.getMathTransformFactory(null); ParameterValueGroup parameters = mtFactory.getDefaultParameters("Mercator_2SP"); parameters.parameter("standard_parallel_1").setValue( ); parameters.parameter("latitude_of_origin").setValue( ); parameters.parameter("central_meridian").setValue( ); parameters.parameter("false_easting").setValue( ); parameters.parameter("false_northing").setValue( ); // TODO: set up the math transform and do transform } catch (NoSuchIdentifierException e) { e.printStackTrace(); } I hope this helps. ~jle Note to myself: http://www.remotesensing.org/geotiff/proj_list/ -- View this message in context: http://n2.nabble.com/How-to-translate-a-ProjectedCRS-tp4425910p4426611.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. ```
 Re: [Geotools-gt2-users] How to translate a ProjectedCRS From: Benoît Thiébault - 2010-01-20 14:09:44 ```Thank you for your answer. Do you know how I can retrieve the parameters values from an existing CRS ? I don't want to build a new one from scratch, just to change the central_meridian parameter Thanks Ben Le 20 janv. 2010 à 15:00, jle a écrit : > > Good morning, > I believe that the Longitude of Origin is actually the Central Meridian > parameter. So somewhere in your code when you set up your parameters, make > sure you set the central meridian value as your value. > > I found this link: > http://www.remotesensing.org/geotiff/proj_list/mercator_2sp.html > > Looks like the required parameters are: > - "standard_parallel_1" : the Latitude of first standard parallel, unit: > angular (radian i believe) > - "latitude_of_origin": the Latitude of natural origin, unit: angular > (radian I believe) > - "central_meridian": the Longitude of natural origin, unit: angular (radian > ~me) > - "false_easting": False Easting > - "false_northing": False Northing > > This is what I think how to set up the parameters (in my theory :) I am > still testing with UTM) > > try { > MathTransformFactory mtFactory = > ReferencingFactoryFinder.getMathTransformFactory(null); > ParameterValueGroup parameters = > mtFactory.getDefaultParameters("Mercator_2SP"); > parameters.parameter("standard_parallel_1").setValue( value here> ); > parameters.parameter("latitude_of_origin").setValue( value here> ); > parameters.parameter("central_meridian").setValue( value here> ); > parameters.parameter("false_easting").setValue( here> ); > parameters.parameter("false_northing").setValue( here> ); > > // TODO: set up the math transform and do transform > > } catch (NoSuchIdentifierException e) { > e.printStackTrace(); > } > > I hope this helps. > ~jle > > Note to myself: http://www.remotesensing.org/geotiff/proj_list/ > > -- > View this message in context: http://n2.nabble.com/How-to-translate-a-ProjectedCRS-tp4425910p4426611.html > Sent from the geotools-gt2-users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Geotools-gt2-users mailing list > Geotools-gt2-users@... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > ---- Benoît Thiébault Société Artenum 24 rue Louis Blanc, 75010 Paris tel: +33 (0)1 46 94 67 54 Artenum - Science & Groupware - http://www.artenum.com ```
 Re: [Geotools-gt2-users] How to translate a ProjectedCRS From: jle - 2010-01-20 14:19:57 ```I actually don't know. I am a newbie here. I notice that there is a method called getParameterDescriptors() for each projection transform. Probably that's where to get the parameter information. Please post your solution if you find one. Thanks. -- View this message in context: http://n2.nabble.com/How-to-translate-a-ProjectedCRS-tp4425910p4426716.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. ```
 Re: [Geotools-gt2-users] How to translate a ProjectedCRS From: Andrea Aime - 2010-01-20 14:26:53 ```Benoît Thiébault ha scritto: > Thank you for your answer. Do you know how I can retrieve the > parameters values from an existing CRS ? I don't want to build a new > one from scratch, just to change the central_meridian parameter If this is a one time issue (that is, you don't need to automate it), you can use the following: CoordinateReferenceSystem crs = CRS.decode("EPSG:3395); System.out.println(crs); // this will print the WKT definition String newWKT = "..."; // modified WKT definition with new cent. mer. CoordinateReferenceSystem crs2 = CRS.parseWKT(newWKT); Hope this helps Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ```
 Re: [Geotools-gt2-users] How to translate a ProjectedCRS From: Benoît Thiébault - 2010-01-20 14:33:09 ```It's indeed a one time issue. I will thus try your method. However, I find it strange that there are no accessors on such CRS parameters... Thank you very much Ben Le 20 janv. 2010 à 15:26, Andrea Aime a écrit : > Benoît Thiébault ha scritto: >> Thank you for your answer. Do you know how I can retrieve the >> parameters values from an existing CRS ? I don't want to build a new >> one from scratch, just to change the central_meridian parameter > > If this is a one time issue (that is, you don't need to automate it), > you can use the following: > > CoordinateReferenceSystem crs = CRS.decode("EPSG:3395); > System.out.println(crs); // this will print the WKT definition > String newWKT = "..."; // modified WKT definition with new cent. mer. > CoordinateReferenceSystem crs2 = CRS.parseWKT(newWKT); > > Hope this helps > > Cheers > Andrea > > -- > Andrea Aime > OpenGeo - http://opengeo.org > Expert service straight from the developers. > ---- Benoît Thiébault Société Artenum 24 rue Louis Blanc, 75010 Paris tel: +33 (0)1 46 94 67 54 Artenum - Science & Groupware - http://www.artenum.com ```
 Re: [Geotools-gt2-users] How to translate a ProjectedCRS From: Andrea Aime - 2010-01-20 16:08:36 ```Benoît Thiébault ha scritto: > It's indeed a one time issue. > I will thus try your method. > However, I find it strange that there are no accessors on such CRS parameters... There are, but the explanation of how to do the change would have been much longer Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ```
 Re: [Geotools-gt2-users] How to translate a ProjectedCRS From: Benoît Thiébault - 2010-01-20 17:15:18 ```Thanks for your answer. I tested it, and it works like a charm Ben Le 20 janv. 2010 à 17:08, Andrea Aime a écrit : > Benoît Thiébault ha scritto: >> It's indeed a one time issue. >> I will thus try your method. >> However, I find it strange that there are no accessors on such CRS parameters... > > There are, but the explanation of how to do the change would > have been much longer > > Cheers > Andrea > > -- > Andrea Aime > OpenGeo - http://opengeo.org > Expert service straight from the developers. > ---- Benoît Thiébault Société Artenum 24 rue Louis Blanc, 75010 Paris tel: +33 (0)1 46 94 67 54 Artenum - Science & Groupware - http://www.artenum.com ```