Hi all (hi Martin),
sorry to bother, but it seems there are still quite a bit
of issues on 2.3.x with the epsg-hsql module and the new EPSG database.
The following simple WKT encoding app tries to summarize the issues
found scanning epsg-hsql contents. I just developed it inside the
epsg-hsql module for simplicity, without committing it, of course :-):
---------------------------------------------------------------------------
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.geotools.referencing.CRS;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
public class WKTLister {
static final boolean printStackTraces = false;
public static void main(String[] args) {
Set codes = CRS.getSupportedCodes("EPSG");
int decodeExceptions = 0;
int wktExceptions = 0;
Set exceptions = new HashSet();
for (Iterator it = codes.iterator(); it.hasNext();) {
String code = (String) it.next();
CoordinateReferenceSystem crs = null;
try {
crs = CRS.decode("EPSG:" + code);
} catch (Exception e) {
decodeExceptions++;
System.out.println("Issues decoding EPSG:" + code + ". ");
if(printStackTraces) e.printStackTrace();
exceptions.add(e.getMessage());
}
if(crs != null)
try {
crs.toWKT();
} catch(Exception e) {
wktExceptions++;
System.out.println("Issues converting EPSG:" + code
+ " in WKT format.");
if(printStackTraces) e.printStackTrace();
exceptions.add(e.getMessage());
}
}
System.out.println("Total codes: " + codes.size());
System.out.println("Decode exceptions: " + decodeExceptions);
System.out.println("Wkt encode exceptions: " + wktExceptions);
List exceptionList = new ArrayList(exceptions);
Collections.sort(exceptionList);
System.out.println("Unique exceptions found: " +
exceptions.size());
for (Iterator it = exceptionList.iterator(); it.hasNext();) {
System.out.println(it.next());
}
}
}
-----------------------------------------------------------------------------
The summary output is:
Total codes: 3885
Decode exceptions: 157
Wkt encode exceptions: 240
Unique exceptions found: 58
Can't set a value to the parameter "Latitude of natural origin".
Can't set a value to the parameter "Scale factor at natural origin".
Invalid WKT format.
No transform for classification "American Polyconic".
No transform for classification "Bonne (South Orientated)".
No transform for classification "Cassini-Soldner".
No transform for classification "Guam Projection".
No transform for classification "Hyperbolic Cassini-Soldner".
No transform for classification "Laborde Madagascar".
No transform for classification "Lambert Azimuthal Equal Area (Spherical)".
No transform for classification "Lambert Azimuthal Equal Area".
No transform for classification "Lambert Conic Conformal (West Orientated)".
No transform for classification "Lambert Conic Near-Conformal".
No transform for classification "Lambert Cylindrical Equal Area
(Spherical)".
No transform for classification "Modified Azimuthal Equidistant".
No transform for classification "Transverse Mercator Zoned Grid System".
No transform for classification "Tunisia Mining Grid".
Type "Along receiver lines" is unknow in this context.
Type "North along 0 deg" is unknow in this context.
Type "North along 105 deg East" is unknow in this context.
Type "North along 105 deg West" is unknow in this context.
Type "North along 120 deg East" is unknow in this context.
Type "North along 120 deg West" is unknow in this context.
Type "North along 130 deg West" is unknow in this context.
Type "North along 135 deg East" is unknow in this context.
Type "North along 135 deg West" is unknow in this context.
Type "North along 15 deg East" is unknow in this context.
Type "North along 15 deg West" is unknow in this context.
Type "North along 160 deg East" is unknow in this context.
Type "North along 165 deg East" is unknow in this context.
Type "North along 165 deg West" is unknow in this context.
Type "North along 180 deg" is unknow in this context.
Type "North along 45 deg East" is unknow in this context.
Type "North along 45 deg West" is unknow in this context.
Type "North along 60 deg East" is unknow in this context.
Type "North along 60 deg West" is unknow in this context.
Type "North along 75 deg East" is unknow in this context.
Type "North along 75 deg West" is unknow in this context.
Type "North along 90 deg East" is unknow in this context.
Type "South along 10 deg West" is unknow in this context.
Type "South along 100 deg East" is unknow in this context.
Type "South along 180 deg" is unknow in this context.
Type "South along 45 deg East" is unknow in this context.
Type "South along 50 deg East" is unknow in this context.
Type "South along 60 deg West" is unknow in this context.
Type "South along 90 deg East" is unknow in this context.
Type "South along 90 deg West" is unknow in this context.
Type "east-south-east" is unknow in this context.
Type "north north east" is unknow in this context.
Type "north-east" is unknow in this context.
Type "north-west" is unknow in this context.
Unit conversion from "DMS" to "°" is non-linear.
Unsupported unit: 9115
Unsupported unit: 9116
Unsupported unit: 9117
Unsupported unit: 9118
Unsupported unit: 9119
Unsupported unit: 9120
I separated WKT encoding issues because Geoserver is
using toString() now, and in the single exceptions list
there are quite a bit of things that cannot be fixed
in 2.3.x, such as missing projections, yet a few seem
to be missing aliases or issues with unit conversion.
Can you look into this Martin?
Cheers
Andrea
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel