Changes between Version 40 and Version 41 of MapGuideRfc14
- Timestamp:
- 02/19/07 16:49:25 (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MapGuideRfc14
v40 v41 1 1 = !MapGuide RFC 14 - Cartographic Stylization Engine = 2 2 3 This page contains an change request (RFC) for the !MapGuide Open Source project. 3 This page contains an change request (RFC) for the !MapGuide Open Source project. 4 4 More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs RFCs] page. 5 5 6 == Status == 6 == Status == 7 7 8 ||RFC Template Version||(1.0)|| 8 ||RFC Template Version||(1.0)|| 9 9 ||Submission Date||Feb 2/2007|| 10 10 ||Last Modified||Walt Welton-Lair [[Timestamp]]|| … … 60 60 <Image> 61 61 <Reference>Library%3A%2F%2FHighwaySymbols%2FInterstateImage.png</Reference> 62 <SizeX>10.8 mm</SizeX>63 <SizeY>11.2 mm</SizeY>62 <SizeX>10.8</SizeX> 63 <SizeY>11.2</SizeY> 64 64 <PositionX>0</PositionX> 65 65 <PositionY>0.8</PositionY> … … 68 68 <String>%INTERSTATE_NUMBER%</String> 69 69 <FontName>Arial</FontName> 70 <Height>6 mm</Height>70 <Height>6</Height> 71 71 <PositionX>0</PositionX> 72 72 <PositionY>0</PositionY> 73 73 <HorizontalAlignment>Center</HorizontalAlignment> 74 <VerticalAlignment> Middle</VerticalAlignment>74 <VerticalAlignment>Halfline</VerticalAlignment> 75 75 </Text> 76 76 </Graphics> 77 <LineUsage> 77 <LineUsage> 78 78 <AngleControl>FromAngle</AngleControl> 79 79 <VertexControl>OverlapNoWrap</VertexControl> … … 83 83 <Repeat>100</Repeat> 84 84 </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> 85 93 </SimpleSymbolDefinition> 86 94 </SymbolDefinition> 87 95 }}} 88 96 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. 97 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. 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. 90 98 91 99 '''Example 2:''' line style with simple dashing … … 114 122 <Repeat>25</Repeat> 115 123 </LineUsage> 124 <ParameterDefinition> 125 </ParameterDefinition> 116 126 </SimpleSymbolDefinition> 117 127 </SymbolDefinition> … … 130 140 <SimpleSymbolDefinition> 131 141 <Name>ThickRail</Name> 142 <Description>This is a railroad symbol</Description> 132 143 <Graphics> 133 144 <Path> … … 136 147 M 2.5,-2.5 L 2.5,2.5 137 148 </Geometry> 138 <LineWeight>%LINE_WEIGHT% =1mm</LineWeight>149 <LineWeight>%LINE_WEIGHT%</LineWeight> 139 150 <LineCap>Round</LineCap> 140 151 <LineJoin>Round</LineJoin> … … 143 154 <LineUsage> 144 155 <VertexControl>OverlapWrap</VertexControl> 145 <Repeat>5 .0</Repeat>156 <Repeat>5</Repeat> 146 157 </LineUsage> 158 <ParameterDefinition> 159 <Parameter> 160 <Identifier>%LINE_WEIGHT%</Identifier> 161 <DefaultValue>1</DefaultValue> 162 <DisplayName>Line Weight</DisplayName> 163 </Parameter> 164 </ParameterDefinition> 147 165 </SimpleSymbolDefinition> 148 166 </SymbolDefinition> 149 167 }}} 150 168 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.169 This 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. 152 170 153 171 Note 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. … … 163 181 <CompoundSymbolDefinition> 164 182 <Name>GasWithStartEndSymbols</Name> 165 <S ymbols>183 <SimpleSymbol> 166 184 <SimpleSymbolDefinition> 167 185 <Name>GasStyle</Name> … … 169 187 <Path> 170 188 <Geometry>M 0,0 H 5 M 15,0 H 5</Geometry> 171 <LineWeight>1 mm</LineWeight>189 <LineWeight>1</LineWeight> 172 190 <LineCap>Round</LineCap> 173 191 <LineJoin>Round</LineJoin> … … 176 194 <String>GAS</String> 177 195 <FontName>Arial</FontName> 178 <Height>3.5 mm</Height>196 <Height>3.5</Height> 179 197 <PositionX>10</PositionX> 180 198 <PositionY>0</PositionY> 181 199 <HorizontalAlignment>Center</HorizontalAlignment> 182 <VerticalAlignment> Middle</VerticalAlignment>200 <VerticalAlignment>Halfline</VerticalAlignment> 183 201 </Text> 184 202 </Graphics> … … 187 205 <Repeat>20</Repeat> 188 206 </LineUsage> 207 <ParameterDefinition> 208 </ParameterDefinition> 189 209 </SimpleSymbolDefinition> 210 </SimpleSymbol> 211 <SimpleSymbol> 190 212 <SimpleSymbolDefinition> 191 213 <Name>BlueSquare</Name> … … 201 223 <Repeat>0</Repeat> 202 224 </LineUsage> 225 <ParameterDefinition> 226 </ParameterDefinition> 203 227 </SimpleSymbolDefinition> 228 </SimpleSymbol> 229 <SimpleSymbol> 204 230 <SimpleSymbolDefinition> 205 231 <Name>RedTriangle</Name> … … 215 241 <Repeat>0</Repeat> 216 242 </LineUsage> 243 <ParameterDefinition> 244 </ParameterDefinition> 217 245 </SimpleSymbolDefinition> 218 </S ymbols>246 </SimpleSymbol> 219 247 </CompoundSymbolDefinition> 220 248 </SymbolDefinition> … … 230 258 231 259 {{{ 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> 243 272 }}} 244 273 … … 253 282 254 283 {{{ 255 SymbolDefinition>284 <SymbolDefinition> 256 285 <CompoundSymbolDefinition> 257 286 <Name>MTYP1500a</Name> … … 271 300 <Repeat>24</Repeat> 272 301 </LineUsage> 302 <ParameterDefinition> 303 </ParameterDefinition> 273 304 </SimpleSymbolDefinition> 274 305 </SimpleSymbol> … … 286 317 <Repeat>24</Repeat> 287 318 </LineUsage> 319 <ParameterDefinition> 320 </ParameterDefinition> 288 321 </SimpleSymbolDefinition> 289 322 </SimpleSymbol> … … 302 335 }}} 303 336 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> 337 This 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 377 For 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> 354 401 }}} 355 402 … … 357 404 == Implications == 358 405 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. 406 The 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 408 Just 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. 369 409 370 410 See Appendix A for a link to the schema for the proposed Layer Definition additions. … … 372 412 == Test Plan == 373 413 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.414 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. 375 415 376 416 == Funding/Resources == 377 417 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.418 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. 379 419 380 420 == Appendix A == 381 421 382 Link to the symbolization schema (xsd) 422 Link to the symbolization schema (xsd) 383 423 384 424 * [attachment:symbolization_v5.xsd symbolization_v5.xsd] … … 392 432 * [attachment:symbolization_v5.zip symbolization_v5.zip] 393 433 * [attachment:mdf_changes_v5.zip mdf_changes_v5.zip] 394