public class CustomProjection extends AbstractProjection
Modifier and Type | Class and Description |
---|---|
static class |
CustomProjection.Param
Proj4-like projection parameters.
|
Modifier and Type | Field and Description |
---|---|
protected Bounds |
bounds |
protected String |
cacheDir |
protected String |
code |
protected String |
name |
protected String |
pref
pref String that defines the projection
null means fall back mode (Mercator)
|
Constructor and Description |
---|
CustomProjection()
Constructs a new empty
CustomProjection . |
CustomProjection(String pref)
Constructs a new
CustomProjection with given parameters. |
CustomProjection(String name,
String code,
String pref,
String cacheDir)
Constructs a new
CustomProjection with given name, code and parameters. |
Modifier and Type | Method and Description |
---|---|
String |
getCacheDirectoryName()
Get a filename compatible string (for the cache directory).
|
Integer |
getEpsgCode() |
Bounds |
getWorldBoundsLatLon()
Get the bounds of the world.
|
static double |
parseAngle(String angleStr,
String parameterName) |
static Bounds |
parseBounds(String boundsStr) |
Datum |
parseDatum(Map<String,String> parameters,
Ellipsoid ellps) |
static double |
parseDouble(Map<String,String> parameters,
String parameterName) |
static double |
parseDouble(String doubleStr,
String parameterName) |
Ellipsoid |
parseEllipsoid(Map<String,String> parameters) |
private Map<String,String> |
parseParameterList(String pref) |
Proj |
parseProjection(Map<String,String> parameters,
Ellipsoid ellps) |
Datum |
parseToWGS84(String paramList,
Ellipsoid ellps) |
String |
toCode()
Default implementation of toCode().
|
String |
toString()
Describe the projection in one or two words.
|
void |
update(String pref)
Updates this
CustomProjection with given parameters. |
convertDegreeMinuteSecond, convertMinuteSecond, eastNorth2latlon, getCentralMeridian, getDatum, getDefaultZoomInPPD, getEllipsoid, getFalseEasting, getFalseNorthing, getProj, getScaleFactor, latlon2eastNorth
protected String pref
public CustomProjection()
CustomProjection
.public CustomProjection(String pref)
CustomProjection
with given parameters.pref
- String containing projection parameters (ex: "+proj=tmerc +lon_0=-3 +k_0=0.9996 +x_0=500000 +ellps=WGS84 +datum=WGS84 +bounds=-8,-5,2,85")public CustomProjection(String name, String code, String pref, String cacheDir)
CustomProjection
with given name, code and parameters.name
- describe projection in one or two wordscode
- unique code for this projection - may be nullpref
- the string that defines the custom projectioncacheDir
- cache directory namepublic final void update(String pref) throws ProjectionConfigurationException
CustomProjection
with given parameters.pref
- String containing projection parameters (ex: "+proj=lonlat +ellps=WGS84 +datum=WGS84 +bounds=-180,-90,180,90")ProjectionConfigurationException
- if pref
cannot be parsed properlyprivate Map<String,String> parseParameterList(String pref) throws ProjectionConfigurationException
ProjectionConfigurationException
public Ellipsoid parseEllipsoid(Map<String,String> parameters) throws ProjectionConfigurationException
ProjectionConfigurationException
public Datum parseDatum(Map<String,String> parameters, Ellipsoid ellps) throws ProjectionConfigurationException
ProjectionConfigurationException
public Datum parseToWGS84(String paramList, Ellipsoid ellps) throws ProjectionConfigurationException
ProjectionConfigurationException
public Proj parseProjection(Map<String,String> parameters, Ellipsoid ellps) throws ProjectionConfigurationException
ProjectionConfigurationException
public static Bounds parseBounds(String boundsStr) throws ProjectionConfigurationException
ProjectionConfigurationException
public static double parseDouble(Map<String,String> parameters, String parameterName) throws ProjectionConfigurationException
ProjectionConfigurationException
public static double parseDouble(String doubleStr, String parameterName) throws ProjectionConfigurationException
ProjectionConfigurationException
public static double parseAngle(String angleStr, String parameterName) throws ProjectionConfigurationException
ProjectionConfigurationException
public Integer getEpsgCode()
getEpsgCode
in class AbstractProjection
public String toCode()
AbstractProjection
toCode
in interface Projection
toCode
in class AbstractProjection
public String getCacheDirectoryName()
Projection
public Bounds getWorldBoundsLatLon()
Projection
public String toString()
Projection
toString
in interface Projection
toString
in class Object