Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Using a non-standard CRS

I'm trying to make uDig use a non-standard CRS (called NDS) on my data, instead of converting all coordinates to WGS84 before uDig sees them.

My CRS is simply a scaled version of WGS84, where 360° = 2^32. The CRS is defined by WKT, by replacing the UNIT clause from WGS84 by

UNIT["NDS", 0.000000001462918079267]

The MathTransforms between WGS84 and NDS seem to work.

Now I'm getting the following exception when opening my map:

Caused by: javax.measure.converter.ConversionException: rad*1.462918079267E-9 is not compatible with m
	at javax.measure.unit.Unit.getConverterTo(Unit.java:224)
	at net.refractions.udig.project.internal.render.impl.ScaleUtils.fromCrsToMeter(ScaleUtils.java:64)
	at net.refractions.udig.project.internal.render.impl.ScaleUtils.calculateScaleDenominator(ScaleUtils.java:325)
	at net.refractions.udig.project.internal.render.impl.ViewportModelImpl.getScaleDenominator(ViewportModelImpl.java:1048)
	at net.refractions.udig.render.internal.feature.basic.BasicFeatureRenderer.render(BasicFeatureRenderer.java:298)



and the cause for this seems to be the isLatLong() method


	/**
	 * Determines if the crs is a lat/long crs (has angular units)
	 * 
	 * @return true if the crs is a latlong crs (has angular units)
	 */
	public static boolean isLatLong(CoordinateReferenceSystem crs) {
		Unit<?> unit = getUnit(crs);
		Unit<?> degrees = getUnit(DefaultGeographicCRS.WGS84);
		boolean isLatLong = CRS.equalsIgnoreMetadata(unit, degrees);
		return isLatLong;
	}

In fact the comment does not seem to match the implementation. My CRS is a lat/lon CRS and it has angular units, only the unit is not degree but a multiple of degree, both are derived from rad.

Is something wrong with my definitions, is there a gap in the ScaleUtils, or are all my attempts futile, since the implicit assumption lat/long=degrees is used all over the place....?

Any hints appreciated...

Regards,

Harald 
 
*******************************************
innovative systems GmbH Navigation-Multimedia
Geschaeftsfuehrung: Edwin Summers - Michael Juergen Mauser
Sitz der Gesellschaft: Hamburg - Registergericht: Hamburg HRB 59980 
 
*******************************************
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the contents in this e-mail is strictly forbidden.
*******************************************


Back to the top