ChamplainMemphisRenderer

## ChamplainMemphisRenderer ChamplainMemphisRenderer — A renderer that renders tiles from OSM vector XML data |

## Synopsis

                        ChamplainMemphisRenderer;
                        ChamplainMemphisRule;
                        ChamplainMemphisRuleAttr;
    enum                ChamplainMemphisRuleType;
    ChamplainMemphisRenderer * champlain_memphis_renderer_new_full
                                                            (guint tile_size);
    void                champlain_memphis_renderer_load_rules
                                                            (ChamplainMemphisRenderer *renderer,
                                                             const gchar *rules_path);
    ClutterColor *      champlain_memphis_renderer_get_background_color
                                                            (ChamplainMemphisRenderer *renderer);
    void                champlain_memphis_renderer_set_background_color
                                                            (ChamplainMemphisRenderer *renderer,
                                                             const ClutterColor *color);
    GList *             champlain_memphis_renderer_get_rule_ids
                                                            (ChamplainMemphisRenderer *renderer);
    void                champlain_memphis_renderer_set_rule (ChamplainMemphisRenderer *renderer,
                                                             ChamplainMemphisRule *rule);
    ChamplainMemphisRule * champlain_memphis_renderer_get_rule
                                                            (ChamplainMemphisRenderer *renderer,
                                                             const gchar *id);
    void                champlain_memphis_renderer_remove_rule
                                                            (ChamplainMemphisRenderer *renderer,
                                                             const gchar *id);
    ChamplainBoundingBox * champlain_memphis_renderer_get_bounding_box
                                                            (ChamplainMemphisRenderer *renderer);
    void                champlain_memphis_renderer_set_tile_size
                                                            (ChamplainMemphisRenderer *renderer,
                                                             guint size);
    guint               champlain_memphis_renderer_get_tile_size
                                                            (ChamplainMemphisRenderer *renderer);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----ChamplainRenderer
                   +----ChamplainMemphisRenderer

## Properties

      "bounding-box"             ChamplainBoundingBox*  : Read / Write
      "tile-size"                guint                 : Read / Write

## Description

The ChamplainMemphisRenderer uses the rendering library LibMemphis to render tiles based on OpenStreetMap data. Tiles are rendered in separate threads. It supports zoom levels 12 to 18.

The output of the renderer can be configured with a Memphis rules XML file. (TODO: link to the specification) The default rules only show highways as thin black lines. Once loaded, rules can be queried and edited.

## Details

### ChamplainMemphisRenderer

    typedef struct _ChamplainMemphisRenderer ChamplainMemphisRenderer;

### ChamplainMemphisRule

    typedef struct {
      gchar **keys;
      gchar **values;
      ChamplainMemphisRuleType type;
      ChamplainMemphisRuleAttr *polygon;
      ChamplainMemphisRuleAttr *line;
      ChamplainMemphisRuleAttr *border;
      ChamplainMemphisRuleAttr *text;
    } ChamplainMemphisRule;

A wrapper of the MemphisRule structure. For details see the libmemphis documentation.

gchar **`keys`; | keys
gchar **`values`; | values
ChamplainMemphisRuleType `type`; | type
ChamplainMemphisRuleAttr *`polygon`; | polygon
ChamplainMemphisRuleAttr *`line`; | line
ChamplainMemphisRuleAttr *`border`; | border
ChamplainMemphisRuleAttr *`text`; | text

Since 0.8

### ChamplainMemphisRuleAttr

    typedef struct {
      guint8 z_min;
      guint8 z_max;
      guint8 color_red;
      guint8 color_green;
      guint8 color_blue;
      guint8 color_alpha;
      gchar *style;
      gdouble size;
    } ChamplainMemphisRuleAttr;

A wrapper of the MemphisRuleAttr structure. For details see the libmemphis documentation.

guint8 `z_min`; | z_min
guint8 `z_max`; | z_max
guint8 `color_red`; | color_red
guint8 `color_green`; | color_green
guint8 `color_blue`; | color_blue
guint8 `color_alpha`; | color_alpha
gchar *`style`; | style
gdouble `size`; | size

Since 0.8

### enum ChamplainMemphisRuleType

    typedef enum
    {
      CHAMPLAIN_MEMPHIS_RULE_TYPE_UNKNOWN,
      CHAMPLAIN_MEMPHIS_RULE_TYPE_NODE,
      CHAMPLAIN_MEMPHIS_RULE_TYPE_WAY,
      CHAMPLAIN_MEMPHIS_RULE_TYPE_RELATION
    } ChamplainMemphisRuleType;

A wrapper of the MemphisRuleType union. For details see the libmemphis documentation.

`CHAMPLAIN_MEMPHIS_RULE_TYPE_UNKNOWN` | MEMPHIS_RULE_TYPE_UNKNOWN
`CHAMPLAIN_MEMPHIS_RULE_TYPE_NODE` | MEMPHIS_RULE_TYPE_NODE
`CHAMPLAIN_MEMPHIS_RULE_TYPE_WAY` | MEMPHIS_RULE_TYPE_WAY
`CHAMPLAIN_MEMPHIS_RULE_TYPE_RELATION` | MEMPHIS_RULE_TYPE_RELATION

Since 0.8

### champlain_memphis_renderer_new_full ()

    ChamplainMemphisRenderer * champlain_memphis_renderer_new_full
                                                            (guint tile_size);

Constructor of a ChamplainMemphisRenderer.

`tile_size` : | the size of the rendered error tile
Returns : | a constructed ChamplainMemphisRenderer object

Since 0.8

### champlain_memphis_renderer_load_rules ()

    void                champlain_memphis_renderer_load_rules
                                                            (ChamplainMemphisRenderer *renderer,
                                                             const gchar *rules_path);

Loads a Memphis rules file.

`renderer` : | a ChamplainMemphisRenderer
`rules_path` : | a path to a rules file

Since 0.8

### champlain_memphis_renderer_get_background_color ()

    ClutterColor *      champlain_memphis_renderer_get_background_color
                                                            (ChamplainMemphisRenderer *renderer);

Gets the background color of the map.

`renderer` : | a ChamplainMemphisRenderer
Returns : | the background color of the map as a newly-allocated ClutterColor.

Since 0.8

### champlain_memphis_renderer_set_background_color ()

    void                champlain_memphis_renderer_set_background_color
                                                            (ChamplainMemphisRenderer *renderer,
                                                             const ClutterColor *color);

Sets the background color of the map from a ClutterColor.

`renderer` : | a ChamplainMemphisRenderer
`color` : | a ClutterColor

Since 0.8

### champlain_memphis_renderer_get_rule_ids ()

    GList *             champlain_memphis_renderer_get_rule_ids
                                                            (ChamplainMemphisRenderer *renderer);

Get a list of rule id's.

`renderer` : | a ChamplainMemphisRenderer
Returns : | a GList of id strings of the form: key1|key2|...|keyN:value1|value2|...|valueM Example: "waterway:river|stream|canal"

Since 0.8

### champlain_memphis_renderer_set_rule ()

    void                champlain_memphis_renderer_set_rule (ChamplainMemphisRenderer *renderer,
                                                             ChamplainMemphisRule *rule);

Edits or adds a ChamplainMemphisRule to the rules-set. New rules are appended to the list.

`renderer` : | a ChamplainMemphisRenderer
`rule` : | a ChamplainMemphisRule

Since 0.8

### champlain_memphis_renderer_get_rule ()

    ChamplainMemphisRule * champlain_memphis_renderer_get_rule
                                                            (ChamplainMemphisRenderer *renderer,
                                                             const gchar *id);

Gets the requested ChamplainMemphisRule.

`renderer` : | a ChamplainMemphisRenderer
`id` : | an id string
Returns : | the requested ChamplainMemphisRule or NULL if none is found.

Since 0.8

### champlain_memphis_renderer_remove_rule ()

    void                champlain_memphis_renderer_remove_rule
                                                            (ChamplainMemphisRenderer *renderer,
                                                             const gchar *id);

Removes the rule with the given id.

`renderer` : | a ChamplainMemphisRenderer
`id` : | an id string

Since 0.8

### champlain_memphis_renderer_get_bounding_box ()

    ChamplainBoundingBox * champlain_memphis_renderer_get_bounding_box
                                                            (ChamplainMemphisRenderer *renderer);

Gets the bounding box of the area for which map data is available.

`renderer` : | a ChamplainMemphisRenderer
Returns : | the bounding box

Since 0.8

### champlain_memphis_renderer_set_tile_size ()

    void                champlain_memphis_renderer_set_tile_size
                                                            (ChamplainMemphisRenderer *renderer,
                                                             guint size);

Sets the size of the rendered tiles.

`renderer` : | a ChamplainMemphisRenderer
`size` : | the size of the rendered tiles

Since 0.8

### champlain_memphis_renderer_get_tile_size ()

    guint               champlain_memphis_renderer_get_tile_size
                                                            (ChamplainMemphisRenderer *renderer);

Gets the size of the rendered tiles.

`renderer` : | a ChamplainMemphisRenderer
Returns : | the size of the rendered tiles

Since 0.8

## Property Details

### The `"bounding-box"` property

      "bounding-box"             ChamplainBoundingBox*  : Read / Write

The bounding box of the area that contains map data.

Since 0.8

### The `"tile-size"` property

      "tile-size"                guint                 : Read / Write

The size of the rendered tile.

Allowed values: <= G_MAXINT

Default value: 256