Mercurial > mxd2map
changeset 191:17b4aaa159ec
Added offset attributes to marker style symbols.
author | raimund renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 20 Jul 2011 16:02:57 +0200 |
parents | c640fb351f66 |
children | 0dc34dcdaedc |
files | ChangeLog src/java/de/intevation/mxd/writer/MarkerStyleWriter.java |
diffstat | 2 files changed, 31 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Jul 20 16:00:22 2011 +0200 +++ b/ChangeLog Wed Jul 20 16:02:57 2011 +0200 @@ -1,3 +1,8 @@ +2011-07-20 Raimund Renkert <raimund.renkert@intevation.de> + + * src/java/de/intevation/mxd/writer/MarkerStyleWriter.java: + Added offset attributes to marker style symbols. + 2011-07-20 Raimund Renkert <raimund.renkert@intevation.de> * src/java/de/intevation/mxd/writer/MapScriptWriter.java:
--- a/src/java/de/intevation/mxd/writer/MarkerStyleWriter.java Wed Jul 20 16:00:22 2011 +0200 +++ b/src/java/de/intevation/mxd/writer/MarkerStyleWriter.java Wed Jul 20 16:02:57 2011 +0200 @@ -100,6 +100,32 @@ logger.warn("Error setting outline width."); } } + + if (symbolElement.hasAttribute("x_offset")) { + try { + double val = + Double.parseDouble(symbolElement.getAttribute("x_offset")); + double r = Math.round(val); + style.setOffsetx(r); + } + catch (NumberFormatException nfe) { + logger.warn("Error setting the symbol x-offset"); + } + } + if (symbolElement.hasAttribute("y_offset")) { + try { + double val = + Double.parseDouble(symbolElement.getAttribute("y_offset")); + double r = Math.round(val); + //In ArcGIS positive y offset values move the symbol upwards, + //in Mapserver positive values move downwards. + r = -r; + style.setOffsety(r); + } + catch (NumberFormatException nfe) { + logger.warn("Error setting the symbol y-offset."); + } + } String symType = symbolElement.getAttribute("style"); if(symType.equals("point") || symType.equals("arrow") ||