I've gone back now to the PROJCS WKT implementation.
On the below I was able to get my Unit back in the console as foot_survey_us.
What I need to know is what fields actually need to be altered to account for
meters to feet?????
For example does the central meridian need updated since the UNIT was updated
to US survey foot and the meters to feet ration was updated to 0.304800609601219
This is really important for what I'm working on so I would really appreciate
some explanation on the below. I want to make sure what I do with the below
String is correct. For example I put in UTM_Zone_11ZZ and did not get an
exception. I still got back foot_survey_us.
String wkt = "PROJCS[\"UTM_Zone_11N\", " +
"GEOGCS[\"WGS84\", "
+ "DATUM[\"WGS84\", "
+ "SPHEROID[\"WGS84\", 6378137.0, 298.257223563]], "
+ "PRIMEM[\"Greenwich\", 0.0], "
+ "UNIT[\"degree\",0.017453292519943295], "
+ "AXIS[\"Longitude\",EAST], "
+ "AXIS[\"Latitude\",NORTH]], "
+ "PROJECTION[\"Transverse_Mercator\"], "
+ "PARAMETER[\"semi_major\", 6378137.0], "
+ "PARAMETER[\"semi_minor\", 6356752.314245179], "
+ "PARAMETER[\"central_meridian\", -123.0], "
+ "PARAMETER[\"latitude_of_origin\", 0.0], "
+ "PARAMETER[\"scale_factor\", 0.9996], "
+ "PARAMETER[\"false_easting\", 500000.0], "
+ "PARAMETER[\"false_northing\", 0.0], "
+ "UNIT[\"US survey foot\",0.304800609601219], " +
"AXIS[\"x\",EAST], "
+ "AXIS[\"y\",NORTH]]";
Thanks,
Oliver
-----Original Message-----
From: "Oliver Gottwald" <[email protected]>
Sent: Tuesday, December 15, 2009 12:48pm
To: "geouser" <[email protected]>
Subject: Re: [Geotools-gt2-users] Setting CoordinateReferenceSystem to UTM ft
Update:
What I've found from the EPSG that there is only 4 UTM ft listings in the table
epsg_alias. Unless I'm incorrect for 14N - 32664, 15N - 32665, 16N - 32666,
17N 32667
Also on my code from Question #1 below I made the following update to fix the
compilation error:
CRSAuthorityFactory factory =
ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG", null);
//crs = factory.createCoordinateReferenceSystem("EPSG:" + (32600 + utm_zone));
crs = factory.createCoordinateReferenceSystem("EPSG:" + 32664);
The following code is really handy to see what your units are:
Unit<?> unit =
map.getCoordinateReferenceSystem().getCoordinateSystem().getAxis(0).getUnit();
String unitName = unit.toString();
System.out.println("unitName: "+unitName);
-----Original Message-----
From: "Oliver Gottwald" <[email protected]>
Sent: Monday, December 14, 2009 6:30pm
To: "geouser" <[email protected]>
Subject: Re: [Geotools-gt2-users] Setting CoordinateReferenceSystem to UTM ft
Question #1 is still open as a question below. I figured out Question #2.
Below are #1-#10 steps for setting up the EPSG mysql database and the query for
pulling the UML rows:
#1: install mysql
#2: set mysql bin path in control panel/System/environment variables
#3: login to mysql:
mysql -uyourlogin -pyourpassword
#4: create database
mysql>create database epsg;
#5: exit mysql
#6: goto directory where downloaded epsg - link on
http://www.epsg.org/CurrentDB.html - for mysql - run table creation command
C:\projects\downloads\epsg-v7_4sql-mySQL>mysql -uyourlogin -pyourpassword epsg
< EPSG_v7_4.mdb_Tables_MySQL.sql
#7: run data import command - may take a while
C:\projects\downloads\epsg-v7_4sql-mySQL>mysql -uyourlogin -pyourpassword epsg
< EPSG_v7_4.mdb_Data_MySQL.sql
#8 login to mysql:
mysql -uyourlogin -pyourpassword
#9 select database:
mysql> use epsg;
Database changed
#10 to get utm i did a like after a more narrow DOS: find /N "32610"
EPSG_v7_4.mdb_Data_MySQL.sql
mysql> select *
INTO OUTFILE '/result.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
from epsg_coordinatereferencesystem where coord_ref_sys_name Like "%WGS 84 /
UTM zone%";
What I get back is 120 rows:
1N-60N
1S-60S
-----Original Message-----
From: "Oliver Gottwald" <[email protected]>
Sent: Monday, December 14, 2009 5:10pm
To: "geouser" <[email protected]>
Subject: [Geotools-gt2-users] Setting CoordinateReferenceSystem to UTM ft
Hi,
I noticed a listing on the forum CRS factory question:
http://n2.nabble.com/CRS-factory-question-td1937609.html#a1937611
I want to set my CoordinateReferenceSystem to UTM ft instead of WGS84
It has to be flexible for UTM ft though being from U-R and 10-19 of UTM Zones
Question #1:
Is the below the way that I have to make it more flexible???
When I plug the code in for the FactoryFinder I'm getting
getCRSFactoryFinder("ESPG",null)
is not found for type FactorFinder (compilation error).
I'm willing to post a class with constant variables for the UTM setting if the
below is the way to go.
Question #2:
If the below is the way to go does anyone know the EPSG tables to look at???
Which I downloaded from
http://www.epsg.org/CurrentDB.html
Oliver
>Is there a way with the current set of APIs (looks like some are in flux
> with opengis) to instantiate a CoordinateReferenceSystem for a
> particular UTM zone.
There is no explict API for doing this task. However, if you are using the EPSG
database, you can
use the following trick. A look in the EPSG database show that there is a logic
between EPSG code
and UTM zone. For example
32601 WGS 84 / UTM zone 1N
32602 WGS 84 / UTM zone 2N
32603 WGS 84 / UTM zone 3N
32604 WGS 84 / UTM zone 4N
32605 WGS 84 / UTM zone 5N
32606 WGS 84 / UTM zone 6N
...
32701 WGS 84 / UTM zone 1S
32702 WGS 84 / UTM zone 2S
32703 WGS 84 / UTM zone 3S
32704 WGS 84 / UTM zone 4S
32705 WGS 84 / UTM zone 5S
32706 WGS 84 / UTM zone 6S
...
There is also similar code ranges for UTM using WGS72, NAD27, ED50, etc. datum.
So you can use for example:
int utm_zone = 10;
CRSAuthorityFactory f = FactoryFinder.getCRSAuthorityFactory("EPSG", null);
crs = f.createCoordinateReferenceSystem("EPSG:" + (32600 + utm_zone));
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users