Changes between Version 40 and Version 41 of MapGuideRfc14


Ignore:
Timestamp:
Feb 19, 2007, 4:49:25 PM (17 years ago)
Author:
waltweltonlair
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideRfc14

    v40 v41  
    11= !MapGuide RFC 14 - Cartographic Stylization Engine =
    22
    3 This page contains an change request (RFC) for the !MapGuide Open Source project. 
     3This page contains an change request (RFC) for the !MapGuide Open Source project.
    44More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs RFCs] page.
    55
    6 == Status == 
     6== Status ==
    77 
    8 ||RFC Template Version||(1.0)|| 
     8||RFC Template Version||(1.0)||
    99||Submission Date||Feb 2/2007||
    1010||Last Modified||Walt Welton-Lair [[Timestamp]]||
     
    6060      <Image>
    6161        <Reference>Library%3A%2F%2FHighwaySymbols%2FInterstateImage.png</Reference>
    62         <SizeX>10.8mm</SizeX>
    63         <SizeY>11.2mm</SizeY>
     62        <SizeX>10.8</SizeX>
     63        <SizeY>11.2</SizeY>
    6464        <PositionX>0</PositionX>
    6565        <PositionY>0.8</PositionY>
     
    6868        <String>%INTERSTATE_NUMBER%</String>
    6969        <FontName>Arial</FontName>
    70         <Height>6mm</Height>
     70        <Height>6</Height>
    7171        <PositionX>0</PositionX>
    7272        <PositionY>0</PositionY>
    7373        <HorizontalAlignment>Center</HorizontalAlignment>
    74         <VerticalAlignment>Middle</VerticalAlignment>
     74        <VerticalAlignment>Halfline</VerticalAlignment>
    7575      </Text>
    7676    </Graphics>
    77     <LineUsage> 
     77    <LineUsage>
    7878      <AngleControl>FromAngle</AngleControl>
    7979      <VertexControl>OverlapNoWrap</VertexControl>
     
    8383      <Repeat>100</Repeat>
    8484    </LineUsage>
     85    <ParameterDefinition>
     86      <Parameter>
     87        <Identifier>%INTERSTATE_NUMBER%</Identifier>
     88        <DefaultValue>0</DefaultValue>
     89        <DisplayName>Interstate Number</DisplayName>
     90        <Description>The interstate number</Description>
     91      </Parameter>
     92    </ParameterDefinition>
    8593  </SimpleSymbolDefinition>
    8694</SymbolDefinition>
    8795}}}
    8896
    89 The symbol graphics are defined such that the center of the text label is the symbol origin.  The image is therefore shifted upwards slightly to compensate for this.  The text string is also parametrized.  Its value is obtained from an expression in the symbol instance.  In this case the expression would be set to the interstate number attribute.
     97The symbol graphics are defined such that the center of the text label is the symbol origin.  The image is therefore shifted upwards slightly to compensate for this.  The text string is also parametrized.  Its value is obtained from an expression in the symbol instance.  In this case the expression would be set to the interstate number attribute.  One limitation of this symbol definition is that it doesn't resize if the number of characters in the text string changes.  This limitation is removed in example 6 below.
    9098
    9199'''Example 2:'''  line style with simple dashing
     
    114122      <Repeat>25</Repeat>
    115123    </LineUsage>
     124    <ParameterDefinition>
     125    </ParameterDefinition>
    116126  </SimpleSymbolDefinition>
    117127</SymbolDefinition>
     
    130140  <SimpleSymbolDefinition>
    131141    <Name>ThickRail</Name>
     142    <Description>This is a railroad symbol</Description>
    132143    <Graphics>
    133144      <Path>
     
    136147          M 2.5,-2.5 L 2.5,2.5
    137148        </Geometry>
    138         <LineWeight>%LINE_WEIGHT%=1mm</LineWeight>
     149        <LineWeight>%LINE_WEIGHT%</LineWeight>
    139150        <LineCap>Round</LineCap>
    140151        <LineJoin>Round</LineJoin>
     
    143154    <LineUsage>
    144155      <VertexControl>OverlapWrap</VertexControl>
    145       <Repeat>5.0</Repeat>
     156      <Repeat>5</Repeat>
    146157    </LineUsage>
     158    <ParameterDefinition>
     159      <Parameter>
     160        <Identifier>%LINE_WEIGHT%</Identifier>
     161        <DefaultValue>1</DefaultValue>
     162        <DisplayName>Line Weight</DisplayName>
     163      </Parameter>
     164    </ParameterDefinition>
    147165  </SimpleSymbolDefinition>
    148166</SymbolDefinition>
    149167}}}
    150168
    151 This time the line weight for the path has been parametrized.  Its default value is 1 mm and this can be overridden at the symbol instance level.  We’ve also changed the path’s line cap and line join styles to round.
     169This time the line weight for the path has been parametrized.  Its default value is 1 mm, as specified in the ParameterDefinition element, and this can be overridden at the symbol instance level.  We’ve also changed the path’s line cap and line join styles to round.
    152170
    153171Note that when the line weight is modified the spacing between the vertical ticks does *not* change.  The path geometry is fixed.  If you want the symbol to get bigger / smaller to account for the line weight then this would be done using the symbol instance scales.  For example, setting the scales to “1 + !LineWeight / 5” would ensure that there is always 5 mm of empty horizontal space between adjacent vertical ticks.
     
    163181  <CompoundSymbolDefinition>
    164182    <Name>GasWithStartEndSymbols</Name>
    165     <Symbols>
     183    <SimpleSymbol>
    166184      <SimpleSymbolDefinition>
    167185        <Name>GasStyle</Name>
     
    169187          <Path>
    170188            <Geometry>M 0,0 H 5 M 15,0 H 5</Geometry>
    171             <LineWeight>1mm</LineWeight>
     189            <LineWeight>1</LineWeight>
    172190            <LineCap>Round</LineCap>
    173191            <LineJoin>Round</LineJoin>
     
    176194            <String>GAS</String>
    177195            <FontName>Arial</FontName>
    178             <Height>3.5mm</Height>
     196            <Height>3.5</Height>
    179197            <PositionX>10</PositionX>
    180198            <PositionY>0</PositionY>
    181199            <HorizontalAlignment>Center</HorizontalAlignment>
    182             <VerticalAlignment>Middle</VerticalAlignment>
     200            <VerticalAlignment>Halfline</VerticalAlignment>
    183201          </Text>
    184202        </Graphics>
     
    187205          <Repeat>20</Repeat>
    188206        </LineUsage>
     207        <ParameterDefinition>
     208        </ParameterDefinition>
    189209      </SimpleSymbolDefinition>
     210    </SimpleSymbol>
     211    <SimpleSymbol>
    190212      <SimpleSymbolDefinition>
    191213        <Name>BlueSquare</Name>
     
    201223          <Repeat>0</Repeat>
    202224        </LineUsage>
     225        <ParameterDefinition>
     226        </ParameterDefinition>
    203227      </SimpleSymbolDefinition>
     228    </SimpleSymbol>
     229    <SimpleSymbol>
    204230      <SimpleSymbolDefinition>
    205231        <Name>RedTriangle</Name>
     
    215241          <Repeat>0</Repeat>
    216242        </LineUsage>
     243        <ParameterDefinition>
     244        </ParameterDefinition>
    217245      </SimpleSymbolDefinition>
    218     </Symbols>
     246    </SimpleSymbol>
    219247  </CompoundSymbolDefinition>
    220248</SymbolDefinition>
     
    230258
    231259{{{
    232     <SimpleSymbolDefinition>
    233       <Name>BlueSquare</Name>
    234       ...
    235       <LineUsage>
    236         <AngleControl>FromAngle</AngleControl>
    237         <VertexControl>OverlapNoWrap</VertexControl>
    238         <Angle>0</Angle>
    239         <StartOffset>0</Repeat>
    240         <Repeat>0</Repeat>
    241       </LineUsage>
    242     </SimpleSymbolDefinition>
     260      <SimpleSymbolDefinition>
     261        <Name>BlueSquare</Name>
     262        ...
     263        <LineUsage>
     264          <AngleControl>FromAngle</AngleControl>
     265          <VertexControl>OverlapNoWrap</VertexControl>
     266          <Angle>0</Angle>
     267          <StartOffset>0</Repeat>
     268          <Repeat>0</Repeat>
     269        </LineUsage>
     270        ...
     271      </SimpleSymbolDefinition>
    243272}}}
    244273
     
    253282
    254283{{{
    255 SymbolDefinition>
     284<SymbolDefinition>
    256285<CompoundSymbolDefinition>
    257286  <Name>MTYP1500a</Name>
     
    271300        <Repeat>24</Repeat>
    272301      </LineUsage>
     302      <ParameterDefinition>
     303      </ParameterDefinition>
    273304    </SimpleSymbolDefinition>
    274305  </SimpleSymbol>
     
    286317        <Repeat>24</Repeat>
    287318      </LineUsage>
     319      <ParameterDefinition>
     320      </ParameterDefinition>
    288321    </SimpleSymbolDefinition>
    289322  </SimpleSymbol>
     
    302335}}}
    303336
    304 This means that the parameter named 1 can be set to an expression in the Layer Definition, based on style choice made by the map author. Optionally the !SymbolDefinition can contain an element that describes what that parameter does and also provides a default value for the parameter. For example, here is a !SymbolDefinition with this optional !ParameterDefinition element:
    305 
    306 {{{
    307 <SimpleSymbolDefinition>
    308   <Name>ThickRail</Name>
    309   <Description>This is a railroad symbol</Description>
    310   <Graphics>
    311     <Path>
    312       <Geometry>
    313         M 0.0, 0.0 L 5.0,0.0
    314         M 2.5,-2.5 L 2.5,2.5
    315       </Geometry>
    316       <LineWeight>%LINE_WEIGHT%</LineWeight>
    317       <LineCap>Round</LineCap>
    318       <LineJoin>Round</LineJoin>
    319     </Path>
    320   </Graphics>
    321   <LineUsage>
    322     <VertexControl>OverlapWrap</VertexControl>
    323     <Repeat>5.0</Repeat>
    324   </LineUsage>
    325   <ParameterDefintion>
    326      <Parameter>
    327         <Identifier>%LINE_WEIGHT%</Identifier>
    328         <DefaultValue>1mm</DefaultValue>
    329         <DisplayName>Line Weight:<DisplayName>
    330         <Description>This is a sample</Description>
    331         <ValueList>1mm 2mm 3mm 4mm</ValueList>
    332      </Parameter>
    333   </ParameterDefintion>
    334 </SimpleSymbolDefinition>
    335 }}}
    336 
    337 
    338 For translation of this symbol into another language, our solution is to create a translated parameter section and attach that to the !SymbolDefinition resource in the !MapGuide repository as Resource Data. The name of the attached resource will contain the locale of the translation. For example if the original symbol is called Symbol.xml, the German translated section would be called Symbol.xml.de. Here is what it would look like:
    339 
    340 {{{
    341 <SimpleSymbolDefinition>
    342   <Name>DickeEisenBahnShiene</Name>
    343   <Description>Das ist ein Eisenbahnschienen Symbol.</Description>
    344   <ParameterDefintion>
    345      <Parameter>
    346         <Identifier>%LINE_WEIGHT%</Identifier>
    347         <DefaultValue>0.0393700787in</DefaultValue>
    348         <DisplayName>Linien Dicke:<DisplayName>
    349         <Description>Das is nur Beispiel.</Description>
    350         <ValueList>0.0393700787in 1in 2in 3in 4in</ValueList>
    351      </Parameter>
    352   </ParameterDefintion>
    353 </SimpleSymbolDefinition>
     337This means that the parameter named 1 can be set to an expression in the Layer Definition, based on style choices made by the map author.  The !SymbolDefinition must also declare this parameter in its !ParameterDefinition element.  Here it can describe what that parameter does and also provide a default value for the parameter.  Here is a sample !SymbolDefinition with this !ParameterDefinition element:
     338
     339{{{
     340<SymbolDefinition>
     341  <SimpleSymbolDefinition>
     342    <Name>ThickRail</Name>
     343    <Description>This is a railroad symbol</Description>
     344    <Graphics>
     345      <Path>
     346        <Geometry>
     347          M 0.0, 0.0 L 5.0,0.0
     348          M 2.5,-2.5 L 2.5,2.5
     349        </Geometry>
     350        <LineWeight>%LINE_WEIGHT%</LineWeight>
     351        <LineCap>Round</LineCap>
     352        <LineJoin>Round</LineJoin>
     353      </Path>
     354    </Graphics>
     355    <LineUsage>
     356      <VertexControl>OverlapWrap</VertexControl>
     357      <Repeat>5</Repeat>
     358    </LineUsage>
     359    <ParameterDefinition>
     360       <Parameter>
     361          <Identifier>%LINE_WEIGHT%</Identifier>
     362          <DefaultValue>1</DefaultValue>
     363          <DisplayName>Line Weight</DisplayName>
     364          <Description>The line weight for the symbol</Description>
     365          <ValueList>
     366            <Value>1</Value>
     367            <Value>2</Value>
     368            <Value>3</Value>
     369            <Value>4</Value>
     370          </ValueList>
     371       </Parameter>
     372    </ParameterDefinition>
     373  </SimpleSymbolDefinition>
     374</SymbolDefinition>
     375}}}
     376
     377For translation of this symbol other languages, our solution is to create a translated parameter section and attach that to the !SymbolDefinition resource in the !MapGuide repository as Resource Data.  The name of the attached resource will contain the locale of the translation.  For example, if the original symbol is called Symbol.xml, the German translated section would be called Symbol.xml.de.  Here is what it would look like:
     378
     379{{{
     380<SymbolDefinition>
     381  <SimpleSymbolDefinition>
     382    <Name>DickeEisenBahnShiene</Name>
     383    <Description>Das ist ein Eisenbahnschienen Symbol</Description>
     384    ...
     385    <ParameterDefinition>
     386       <Parameter>
     387          <Identifier>%LINE_WEIGHT%</Identifier>
     388          <DefaultValue>1</DefaultValue>
     389          <DisplayName>Linien Dicke<DisplayName>
     390          <Description>Das ist nur ein Beispiel.</Description>
     391          <ValueList>
     392            <Value>1</Value>
     393            <Value>2</Value>
     394            <Value>3</Value>
     395            <Value>4</Value>
     396          </ValueList>
     397       </Parameter>
     398    </ParameterDefinition>
     399  </SimpleSymbolDefinition>
     400</SymbolDefinition>
    354401}}}
    355402
     
    357404== Implications ==
    358405
    359 The new symbol definitions will have an imapct on the Layer Definition XML schema. To preserve backwards compatibility,
    360 we propose to add a new element, a !CompositeTypeStyle that will be the only LDF element that references new symbol definitions.
    361 The !CompositeTypeStyle inherits !FeatureTypeStyle alongside Area, Line and !PointTypeStyle. Layers that have a !CompositeTypeStyle
    362 will use a new code path for stylization based on the new !SymbolDefinitions. Stylization of layers that have one of the old
    363 !TypeStyles will not change. Thus one will be able to mix the two kinds of layers within the same map.
    364 
    365 Just like the other !FeatureTypeStyles, the !CompositeTypeStyle will hold on to a symbolization object (!CompositeSymbolization),
    366 which defines the way features draw. The !CompositeSymbolization will reference a !SymbolDefinition and also optionally define
    367 theming expressions for properties of the !SymbolDefinition which are marked as parametrized. Those allow for the symbol definition
    368 to take up styles based on attributes of the specific feature class that the !CompositeSymbolization is associated with.
     406The new symbol definitions will have an imapct on the Layer Definition XML schema.  To preserve backwards compatibility, we propose to add a new !CompositeTypeStyle element that will be the only LDF element that references new symbol definitions.  The !CompositeTypeStyle inherits !FeatureTypeStyle alongside Area, Line and !PointTypeStyle.  Layers that have a !CompositeTypeStyle will use a new code path for stylization based on the new !SymbolDefinitions.  Stylization of layers that have one of the old !FeatureTypeStyles will not change.  One will therefore be able to mix the two kinds of layers within the same map.
     407
     408Just like the other !FeatureTypeStyles, the !CompositeTypeStyle will hold on to a symbolization object (!CompositeSymbolization) which defines the way features draw.  The !CompositeSymbolization will reference one or more !SymbolDefinitions and also optionally define theming expressions for properties of the !SymbolDefinition which are marked as parametrized.  Those allow for the symbol definition to take up styles based on attributes of the specific feature class that the !CompositeSymbolization is associated with.
    369409
    370410See Appendix A for a link to the schema for the proposed Layer Definition additions.
     
    372412== Test Plan ==
    373413
    374 Unit tests will be written to verify the new cartographic styling engine. In addition we will also create a sample symbol library to use for testing.
     414Unit tests will be written to verify the new cartographic styling engine.  In addition we will also create a sample symbol library to use for testing.
    375415
    376416== Funding/Resources ==
    377417
    378 Autodesk will provide resources to implement the core symbolization engine and detailed implementation for point symbols and label symbols.  If time allows we will also implement some portion of the line symbolization. In the future we plan to finish the symbolization engine to also include area symbolization.  Timing for this has yet to be determined.
     418Autodesk will provide resources to implement the core symbolization engine and detailed implementation for point symbols and label symbols.  If time allows we will also implement some portion of the line symbolization.  In the future we plan to finish the symbolization engine to also include area symbolization.  Timing for this has yet to be determined.
    379419
    380420== Appendix A ==
    381421
    382 Link to the symbolization schema (xsd) 
     422Link to the symbolization schema (xsd)
    383423
    384424 * [attachment:symbolization_v5.xsd symbolization_v5.xsd]
     
    392432 * [attachment:symbolization_v5.zip symbolization_v5.zip]
    393433 * [attachment:mdf_changes_v5.zip mdf_changes_v5.zip]
    394