Nouveautés de Mapserver 6.2

18
17 / 10 / 2012 Rencontres OSGEO Thomas Bonfort (Terriscope) Advanced Cartography with MapServer 6.2

description

 

Transcript of Nouveautés de Mapserver 6.2

Page 1: Nouveautés de Mapserver 6.2

17 / 10 / 2012 Rencontres OSGEO

Thomas Bonfort (Terriscope)

Advanced Cartography with MapServer 6.2

Page 2: Nouveautés de Mapserver 6.2

6.2 Rendering Highlights

•  SVG Symbols •  Vector Fields •  Complex Symbols •  Offset Labels •  Layer Masking •  Multiple Fonts for International Text

Page 3: Nouveautés de Mapserver 6.2

SVG Symbols

•  Existing symbology limited for some use cases •  Scalable, multiple colors

SYMBOL NAME "svgsymbol" TYPE SVG IMAGE "/path/to/symbol.svg" END

STYLE SYMBOL "svgsymbol" SIZE 10 ANGLE 45 END

Page 4: Nouveautés de Mapserver 6.2

MultiLanguage Font Support

•  LABEL->FONT now takes comma separated list of fonts to try

•  Each font will be tried in turn if glyph not found

Page 5: Nouveautés de Mapserver 6.2

Mask Layers

•  Clip rendered data across given features

layer name "countries” status off class expression (“[FIPS]” = “EZ”) style color 0 0 0

layer status on name ”naturalearth” mask “countries” type raster

Page 6: Nouveautés de Mapserver 6.2

Precise symbol placement

•  Default is to center symbol on feature point •  Typically useful for arrow type symbols •  SYMBOL

– ANCHORPOINT x y •  STYLE

– POLAROFFSET [distance] [bearing]

Page 7: Nouveautés de Mapserver 6.2

Complex symbols

Page 8: Nouveautés de Mapserver 6.2

Complex symbols

•  Collision avoidance: implemented along with the labelcache.

•  “All or nothing” approach: in case of collision, whole symbol is discarded.

•  Each sub-symbol is positioned relatively to the anchor point, and defined as a LABEL block.

•  Collision detection between sub-symbols is optional.

•  Addresses meteo symbol generation, other use cases in future versions

Page 9: Nouveautés de Mapserver 6.2

Complex symbols LAYER CLASS LABEL OFFSET -15 -10 FORCE GROUP TEXT “[temp]” END LABEL EXPRESSION ([wind_speed]<=5) STYLE GEOMTRANSFORM “labelpnt” SYMBOL “v5” SIZE 30 ANGLE [wind_angle] FORCE GROUP END END LABEL EXPRESSION ([wind_speed]<=10) STYLE SYMBOL “v10” … END END ….

Page 10: Nouveautés de Mapserver 6.2

Vector Fields

Page 11: Nouveautés de Mapserver 6.2

Vector Fields

•  u,v components stored in raster bands •  Mapped to vector points in resulting map •  Additional bindings used for styling:

–  [uv_angle] –  [uv_length]

•  Decoupling size of arrow body and head

Page 12: Nouveautés de Mapserver 6.2

LAYER TYPE POINT CONNECTIONTYPE uvraster DATA “wind.tif” CLASS STYLE SYMBOL "arrowbody" ANGLE [uv_angle] SIZE [uv_length] COLOR 0 127 20 END STYLE SYMBOL "arrowhead" ANGLE [uv_angle] SIZE 10 COLOR 255 0 0 POLAROFFSET [uv_length_2] [uv_angle] END END END

SYMBOL NAME "arrowbody" TYPE VECTOR POINTS 0 0 1 0 END # points END SYMBOL NAME "arrowhead" TYPE vector FILLED true ANCHORPOINT 1 0.5 POINTS 0 2 4 1 0 0 END END

Vector Fields

Page 13: Nouveautés de Mapserver 6.2

Label Leader Offsetting

•  Displace label if collision occurs on initial position

•  NP-hard problem! – Test offsetted positions on a regular grid – O(nlabels * image_size)

•  Leader line can be styled •  Offsets whole label group, future work on

offsetting each sub-label

Page 14: Nouveautés de Mapserver 6.2

Label Leader Offsetting

LAYER CLASS LEADER MAXDISTANCE 100 GRIDSTEP 10 STYLE COLOR 0 0 0 WIDTH 1 #PATTERN 2 2 END END END LABEL … END END END

Page 15: Nouveautés de Mapserver 6.2

Putting it all together

Page 16: Nouveautés de Mapserver 6.2

6.2 Other Notable Highlights

•  First release with tinyOWS and Mapcache •  INSPIRE view services •  WMS DIM_* dimensions •  Source code repository migration •  GD library now optional •  Speedups and Memory usage reduction •  Build changed: libtool + shared library

Page 17: Nouveautés de Mapserver 6.2

Future

•  Text placement: – Alignment – Spacing – Line following

•  Further work on multiple and/or offsetted labels

•  Carto/css? •  Mod_mapserver

Page 18: Nouveautés de Mapserver 6.2

Want More?

•  Docs: http://www.mapserver.org/index.html •  Code: https://github.com/mapserver/mapserver

•  Release date: soon !