Hi,
nowadays when generating .prj files for shapefile and world files
GeoTools produces something like
the following:

PROJCS["WGS 84 / UTM zone 35S",
  GEOGCS["WGS 84",
    DATUM["World Geodetic System 1984",
      SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]],
      AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
    UNIT["degree", 0.017453292519943295],
    AXIS["Geodetic latitude", NORTH],
    AXIS["Geodetic longitude", EAST],
    AUTHORITY["EPSG","4326"]],
  PROJECTION["Transverse Mercator", AUTHORITY["EPSG","9807"]],
  PARAMETER["central_meridian", 27.0],
  PARAMETER["latitude_of_origin", 0.0],
  PARAMETER["scale_factor", 0.9996],
  PARAMETER["false_easting", 500000.0],
  PARAMETER["false_northing", 10000000.0],
  UNIT["m", 1.0],
  AXIS["Easting", EAST],
  AXIS["Northing", NORTH],
  AUTHORITY["EPSG","32735"]]

This is fine and standard, but unfortunately ESRI ArcMap does not understand it.
The ESRI equivalent is:

PROJCS["WGS_1984_UTM_Zone_35S",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],
PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["Central_Meridian",27],
PARAMETER["Latitude_Of_Origin",0],PARAMETER["Scale_Factor",0.9996],PARAMETER["False_Easting",500000],PARAMETER["False_Northing",10000000],
UNIT["Meter",1]

Notable differences are the way the datum, unit of measure, projection
and projection parameters are spelled out,
plus the fact that it's all in one line.

Now, I've just committed a few changes on trunk that make the following code:

Formattable f = (Formattable) CRS.decode("EPSG:32735", true);
System.out.println(f.toWKT(Citations.ESRI, 0));

generate this instead:

PROJCS["WGS 84 / UTM zone 35S", GEOGCS["WGS 84", DATUM["D_WGS_1984",
SPHEROID["D_WGS_1984", 6378137.0, 298.257223563,
AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["Degree",
0.017453292519943295], AXIS["Geodetic longitude", EAST],
AXIS["Geodetic latitude", NORTH], AUTHORITY["EPSG","4326"]],
PROJECTION["Transverse_Mercator", AUTHORITY["EPSG","9807"]],
PARAMETER["Longitude_Of_Center", 27.0],
PARAMETER["Latitude_Of_Origin", 0.0], PARAMETER["Scale_Factor",
0.9996], PARAMETER["false_easting", 500000.0],
PARAMETER["False_Northing", 10000000.0], UNIT["Meter", 1.0],
AXIS["Easting", EAST], AXIS["Northing", NORTH],
AUTHORITY["EPSG","32735"]]

While not 1-1 equal, the datum, projection, projection parameters and
units are spelled out the same
way. I don't have an ArcMap to test that, but my guess would be that
it should read it.

Ah, what was the code above? First I casted the CRS into a Formattable
object, that gives
the developer more control on how things are converted in WKT, and
then asked to generate
the WKT using the ESRI aliases and 0 indentation when generating the output
(the default is CITATIONS.ESPG, 2 instead).

Now, I was wondering, shall we make this wkt format the default for
the shapefile
and image world stores?

Shapefile wise it would also be possible to add a store parameter or a
store property
(I would go for the latter, since prj file creation is a programmatic
business), whilst
for WorldImageWriter it might be either a creation Hint or a write
time GeneralParameterValue.

Opinions, experiences? Anyone with an ArcMap that can try this out? :-)

Cheers
Andrea

-- 
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to