在《GML可视化学习(一)》中,对简单的图形(线段)进行了简单的转换(不考虑比例缩放),只是作初步实验。
railway是数字化的线要素,在ArcGIS中将其导出成xml或gml格式的文件railway.xml(两种一样,以xml为例),这个过程同时导出了这个gml实例的应用模式railwa.xsd。
对railway.xml编写可扩展样式语言转换railway.xslt。(此处不考虑使用viewBox特性)
关键:
1.比例的确定。
根据railway.xml中边界框数据推算线要素的最小可视范围,水平方向为33186m,垂直方向为19201m。
svg可视范围定为width:800,height:600,单位为dpi。我的电脑1inch=96dpi,那么1m=3780dpi。(如果不带单位或者使用像素px,那么将直接根据客户端输出设备的坐标系统单位来显示--《SVG开发实践》P51)
水平方向缩小33186*3780/800=156804
垂直方向缩小19201*3780/600=120966
水平方向缩小比例大,选用水平方向参数的近似值156900,1m=3780/156900dpi
2.坐标系转换
以railway.xml中边界框左下角为坐标计算相对点,水平坐标只用缩小,垂直坐标除了缩小,还要关于x轴翻转180度,然后向下移height距离,也就是乘以-1,然后加上height。
代码如下:
![ContractedBlock.gif](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
2 <? xml-stylesheet type="text/xsl" href="railway.xsl" ?>
3 < gml:FeatureCollection xmlns:gml ="http://www.opengis.net/gml" xmlns:xlink ="http://www.w3.org/1999/xlink" xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance" xmlns:fme ="http://www.safe.com/gml/fme" xsi:schemaLocation ="http://www.safe.com/gml/fme railway.xsd" >
4 < gml:boundedBy >
5 < gml:Envelope srsName ="EPSG:2362" srsDimension ="2" >
6 < gml:lowerCorner > 38497863.6307 3996815.453 </ gml:lowerCorner >
7 < gml:upperCorner > 38531050.1753 4016016.2422 </ gml:upperCorner >
8 </ gml:Envelope >
9 </ gml:boundedBy >
10 < gml:featureMember >
11 < fme:railway gml:id ="idb6a633c0-2acc-4ed3-b290-b7d2340e73ab" >
12 < fme:OBJECTID > 1 </ fme:OBJECTID >
13 < fme:Id > 0 </ fme:Id >
14 < fme:name > </ fme:name >
15 < fme:Shape_Length > 8600.03026056981 </ fme:Shape_Length >
16 < gml:curveProperty >
17 < gml:LineString srsName ="EPSG:2362" srsDimension ="2" >
18 < gml:coordinates > 38512631.9559,4001604.5979 38512685.7699,4001532.846 38512971.2542,4001282.6067 38513168.6261,4001127.5287 38513478.782,4000926.6323 38513725.4969,4000863.1914 38514099.0937,4000785.6524 38514472.6905,4000669.3439 38514803.9934,4000528.364 38515241.0312,4000401.4821 38515579.383,4000278.1246 38515984.7003,4000123.0467 38516182.0723,4000070.1792 38516474.6056,4000017.3117 38516689.6,4000003.2137 38517295.8137,3999950.3463 38517993.6644,3999876.3318 38518494.1432,3999823.4643 38519029.867,3999742.4009 38519435.1843,3999640.1904 38519805.2566,3999520.3575 38520242.2944,3999389.951 38520563.0238,3999315.9366 38520766.3617,3999269.0124 </ gml:coordinates >
19 </ gml:LineString >
20 </ gml:curveProperty >
21 </ fme:railway >
22 </ gml:featureMember >
23 < gml:featureMember >
24 < fme:railway gml:id ="idd4117d96-c85f-4e8d-8cc7-8740cb5f9aab" >
25 < fme:OBJECTID > 2 </ fme:OBJECTID >
26 < fme:Id > 0 </ fme:Id >
27 < fme:name > </ fme:name >
28 < fme:Shape_Length > 4836.51829522531 </ fme:Shape_Length >
29 < gml:curveProperty >
30 < gml:LineString srsName ="EPSG:2362" srsDimension ="2" >
31 < gml:coordinates > 38509205.824,4004651.3118 38509302.2514,4004606.2086 38509626.5052,4004539.2432 38509993.0531,4004454.6552 38510341.9784,4004281.9548 38510588.6933,4004155.0729 38510881.2267,4004007.0439 38511187.858,4003813.1965 38511529.7344,4003481.8937 38511794.0718,4003104.7723 38511924.4782,4002755.847 38512033.7376,4002509.1321 38512213.4871,4002181.3538 38512386.1875,4001948.7369 38512558.8879,4001702.022 38512631.9559,4001604.5979 </ gml:coordinates >
32 </ gml:LineString >
33 </ gml:curveProperty >
34 </ fme:railway >
35 </ gml:featureMember >
36 < gml:featureMember >
37 < fme:railway gml:id ="id2240fdf5-32c9-40c3-aa06-2caaa2286ba3" >
38 < fme:OBJECTID > 3 </ fme:OBJECTID >
39 < fme:Id > 0 </ fme:Id >
40 < fme:name > </ fme:name >
41 < fme:Shape_Length > 1930.26751018981 </ fme:Shape_Length >
42 < gml:curveProperty >
43 < gml:LineString srsName ="EPSG:2362" srsDimension ="2" >
44 < gml:coordinates > 38509205.824,4004651.3118 38509028.1237,4004635.4924 38508661.5759,4004589.674 38508358.4691,4004568.527 38508267.6782,4004566.2852 38507741.3002,4004507.27 38507583.0794,4004473.3655 38507403.33,4004402.8755 38507305.9305,4004368.6541 </ gml:coordinates >
45 </ gml:LineString >
46 </ gml:curveProperty >
47 </ fme:railway >
48 </ gml:featureMember >
49 < gml:featureMember >
50 < fme:railway gml:id ="id2ac37021-4afc-436e-ae3c-ecfbadfbe36c" >
51 < fme:OBJECTID > 4 </ fme:OBJECTID >
52 < fme:Id > 0 </ fme:Id >
53 < fme:name > </ fme:name >
54 < fme:Shape_Length > 11655.433406525 </ fme:Shape_Length >
55 < gml:curveProperty >
56 < gml:LineString srsName ="EPSG:2362" srsDimension ="2" >
57 < gml:coordinates > 38507305.9305,4004368.6541 38507272.9235,4004357.0571 38507218.4653,4004346.1654 38507113.9636,4004334.2113 38507012.1107,4004339.4346 38506979.8418,4004341.5391 38506797.8693,4004367.727 38506673.7588,4004409.9245 38505993.5306,4004635.4924 38505775.0117,4004741.2274 38505604.6809,4004859.9428 38505483.1236,4005004.1154 38505471.9049,4005023.1873 38505345.0229,4005294.5736 38505225.1113,4005534.397 38505135.4495,4005650.5057 38504957.5573,4005799.9351 38504890.1156,4005830.4445 38504798.8763,4005871.7194 38504722.147,4005882.3028 38504616.3134,4005877.0111 38504515.7716,4005874.3653 38504269.7086,4005871.7194 38504047.4581,4005877.0111 38503975.6786,4005882.7535 38503853.5977,4005919.778 38503798.7493,4005948.4487 38503724.283,4005982.5791 38503652.8364,4006005.4752 38503544.7488,4005998.7197 38503436.9807,4005955.2648 38503359.9234,4005896.2827 38503275.5628,4005748.9761 38503181.9278,4005585.4751 38503089.8043,4005330.9644 38502987.381,4005047.9981 38502896.6312,4004885.1293 38502765.0901,4004758.8499 38502218.7929,4004325.3366 38501968.5535,4004142.0627 38501556.1872,4003708.5494 38501362.3397,4003338.477 38501105.0514,4003165.7766 38500742.028,4003045.9437 38500350.8087,4003003.6497 38499924.3444,4002922.5862 38499452.0616,4002721.6898 38499204.4285,4002606.3153 38499057.1936,4002576.4082 38498757.7354,4002573.6609 38498514.5548,4002575.9769 38498332.8644,4002589.2838 38498213.9152,4002615.5453 38498071.2804,4002664.5996 38497989.3948,4002714.6408 38497863.6307,4002791.4966 </ gml:coordinates >
58 </ gml:LineString >
59 </ gml:curveProperty >
60 </ fme:railway >
61 </ gml:featureMember >
62 < gml:featureMember >
63 < fme:railway gml:id ="idb2a13175-f93b-450f-99dd-5bc8de41250f" >
64 < fme:OBJECTID > 5 </ fme:OBJECTID >
65 < fme:Id > 0 </ fme:Id >
66 < fme:name > </ fme:name >
67 < fme:Shape_Length > 2082.82891786472 </ fme:Shape_Length >
68 < gml:curveProperty >
69 < gml:LineString srsName ="EPSG:2362" srsDimension ="2" >
70 < gml:coordinates > 38511899.9577,3998804.1306 38511777.102,3998439.4025 38511678.416,3998133.946 38511612.6254,3997908.3781 38511495.1421,3997621.7189 38511415.2535,3997363.2557 38511358.8615,3997114.1911 38511291.2227,3996815.453 </ gml:coordinates >
71 </ gml:LineString >
72 </ gml:curveProperty >
73 </ fme:railway >
74 </ gml:featureMember >
75 < gml:featureMember >
76 < fme:railway gml:id ="id9f3010e2-865f-4322-a1cf-e15aae11d8c0" >
77 < fme:OBJECTID > 6 </ fme:OBJECTID >
78 < fme:Id > 0 </ fme:Id >
79 < fme:name > </ fme:name >
80 < fme:Shape_Length > 2903.0310234684 </ fme:Shape_Length >
81 < gml:curveProperty >
82 < gml:LineString srsName ="EPSG:2362" srsDimension ="2" >
83 < gml:coordinates > 38512631.9559,4001604.5979 38512613.5829,4001484.5691 38512575.9883,4001141.5179 38512528.9949,4000911.2507 38512439.7076,4000558.8009 38512317.525,4000112.3644 38512195.3424,3999684.7253 38512077.8591,3999365.1708 38511988.5719,3999139.6029 38511927.4805,3998885.839 38511899.9577,3998804.1306 </ gml:coordinates >
84 </ gml:LineString >
85 </ gml:curveProperty >
86 </ fme:railway >
87 </ gml:featureMember >
88 < gml:featureMember >
89 < fme:railway gml:id ="id5e1754ef-adc8-48c1-be16-48ea9f54d88e" >
90 < fme:OBJECTID > 7 </ fme:OBJECTID >
91 < fme:Id > 0 </ fme:Id >
92 < fme:name > </ fme:name >
93 < fme:Shape_Length > 1060.15960166528 </ fme:Shape_Length >
94 < gml:curveProperty >
95 < gml:LineString srsName ="EPSG:2362" srsDimension ="2" >
96 < gml:coordinates > 38507382.8359,4016016.2422 38507393.1481,4015899.3705 38507409.0083,4015719.6211 38507409.0083,4015590.0958 38507411.6517,4015428.85 38507422.2252,4015331.0451 38507411.6517,4015220.0234 38507345.5674,4015058.7776 38507290.5552,4014990.8214 </ gml:coordinates >
97 </ gml:LineString >
98 </ gml:curveProperty >
99 </ fme:railway >
100 </ gml:featureMember >
101 < gml:featureMember >
102 < fme:railway gml:id ="id034a3b26-485a-4220-807c-34b70957eeac" >
103 < fme:OBJECTID > 8 </ fme:OBJECTID >
104 < fme:Id > 0 </ fme:Id >
105 < fme:name > </ fme:name >
106 < fme:Shape_Length > 3524.20655151805 </ fme:Shape_Length >
107 < gml:curveProperty >
108 < gml:LineString srsName ="EPSG:2362" srsDimension ="2" >
109 < gml:coordinates > 38506814.4812,4006770.0641 38506884.4455,4006685.6627 38507004.2784,4006509.4378 38507215.7484,4006280.3454 38507360.2528,4006195.7574 38507490.6592,4006121.743 38507557.6247,4006104.1205 38507638.6882,4006100.596 38507846.6336,4006090.0225 38508036.9565,4006090.0225 38508216.7059,4006044.204 38508389.4063,4005949.0425 38508579.7292,4005790.4401 38508653.7437,4005642.4112 38508720.7092,4005508.4802 38508731.2827,4005371.0248 38508738.3317,4005205.3734 38508770.0521,4005025.624 38508875.7871,4004849.399 38509083.7325,4004708.4191 38509205.824,4004651.3118 </ gml:coordinates >
110 </ gml:LineString >
111 </ gml:curveProperty >
112 </ fme:railway >
113 </ gml:featureMember >
114 < gml:featureMember >
115 < fme:railway gml:id ="id1efb8358-c6b3-40cf-9e30-2f58e8c9865f" >
116 < fme:OBJECTID > 9 </ fme:OBJECTID >
117 < fme:Id > 0 </ fme:Id >
118 < fme:name > </ fme:name >
119 < fme:Shape_Length > 9672.4691586237 </ fme:Shape_Length >
120 < gml:curveProperty >
121 < gml:LineString srsName ="EPSG:2362" srsDimension ="2" >
122 < gml:coordinates > 38507290.5552,4014990.8214 38507255.6927,4014947.7559 38507139.3842,4014860.5246 38506988.7119,4014783.8667 38506819.536,4014741.5728 38506618.6396,4014738.9294 38506386.0227,4014736.286 38506245.9239,4014730.9993 38506126.9721,4014715.139 38506026.5239,4014678.1318 38505907.572,4014601.474 38505796.5503,4014485.1655 38505725.1792,4014368.8571 38505648.5214,4014202.3245 38505643.2347,4014107.1631 38505651.1648,4013964.4209 38505682.8853,4013834.8956 38505743.6829,4013734.4474 38505817.6973,4013583.775 38505844.1311,4013485.9702 38505849.4178,4013377.5919 38505870.5648,4013205.7726 38505918.1455,4012978.4424 38505941.9359,4012798.693 38505952.5094,4012515.852 38505963.0829,4012344.0327 38505980.0853,4011831.7567 38505971.6004,4011422.5885 38505950.4534,4010844.5708 38505922.2574,4010534.4149 38505869.39,4009914.1032 38505865.8655,4009586.3249 38505869.39,4009050.6011 38505901.1105,4008768.6412 38505925.7819,4008627.6613 38506052.6639,4008387.9954 38506094.9579,4008271.687 38506225.3643,4008053.1681 38506334.6238,4007757.1102 38506436.8342,4007499.8218 38506570.7651,4007133.274 38506662.4021,4006953.5246 38506814.4812,4006770.0641 </ gml:coordinates >
123 </ gml:LineString >
124 </ gml:curveProperty >
125 </ fme:railway >
126 </ gml:featureMember >
127 < gml:featureMember >
128 < fme:railway gml:id ="id387c5ad1-9d32-4f57-9944-cdf05804867b" >
129 < fme:OBJECTID > 10 </ fme:OBJECTID >
130 < fme:Id > 0 </ fme:Id >
131 < fme:name > 京广铁路 </ fme:name >
132 < fme:Shape_Length > 9090.73675901561 </ fme:Shape_Length >
133 < gml:curveProperty >
134 < gml:LineString srsName ="EPSG:2362" srsDimension ="2" >
135 < gml:coordinates > 38531050.1753,4013866.2488 38531050.1035,4013784.9367 38531049.9454,4013605.6714 38531048.8302,4013472.9658 38531044.3893,4012947.1858 38531007.7701,4012700.1429 38530880.7699,4011813.7869 38530798.7489,4011419.557 38530727.3112,4010863.9309 38530647.9361,4010427.3675 38530600.311,4010136.3253 38530550.04,4009789.7204 38530499.7691,4009358.4487 38530433.6231,4008826.6351 38530401.8731,4008564.6971 38530388.6439,4008355.6759 38530356.8938,4007900.5916 38530364.8313,4007522.2367 38530341.0188,4007104.1942 38530343.6646,4006437.4429 38530346.3105,4006215.1924 38530325.1437,4005566.962 38530314.5604,4005254.753 38530290.7478,4004939.8982 38530282.2806,4004827.9426 </ gml:coordinates >
136 </ gml:LineString >
137 </ gml:curveProperty >
138 </ fme:railway >
139 </ gml:featureMember >
140 </ gml:FeatureCollection >
141
![ContractedBlock.gif](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
2 < schema xmlns ="http://www.w3.org/2001/XMLSchema" xmlns:gml ="http://www.opengis.net/gml" xmlns:xlink ="http://www.w3.org/1999/xlink" xmlns:fme ="http://www.safe.com/gml/fme" targetNamespace ="http://www.safe.com/gml/fme" elementFormDefault ="qualified" >
3 < import namespace ="http://www.opengis.net/gml" schemaLocation ="E:\XML\GML\03-105r1_GML_3.1.1\GML-3.1.1\base\feature.xsd" />
4 < import namespace ="http://www.opengis.net/gml" schemaLocation ="E:\XML\GML\03-105r1_GML_3.1.1\GML-3.1.1\base\geometryAggregates.xsd" />
5 < element name ="railway" type ="fme:railwayType" substitutionGroup ="gml:_Feature" />
6 < complexType name ="railwayType" >
7 < complexContent >
8 < extension base ="gml:AbstractFeatureType" >
9 < sequence >
10 < element name ="OBJECTID" type ="integer" minOccurs ="0" />
11 < element name ="Id" type ="integer" minOccurs ="0" />
12 < element name ="name" minOccurs ="0" >
13 < simpleType >
14 < restriction base ="string" >
15 < maxLength value ="10" />
16 </ restriction >
17 </ simpleType >
18 </ element >
19 < element name ="Shape_Length" type ="double" minOccurs ="0" />
20 < element ref ="gml:curveProperty" minOccurs ="0" />
21 < element ref ="gml:multiCurveProperty" minOccurs ="0" />
22 </ sequence >
23 </ extension >
24 </ complexContent >
25 </ complexType >
26 </ schema >
27
![ContractedBlock.gif](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
2 < xsl:stylesheet version ="1.0" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" xmlns:gml ="http://www.opengis.net/gml" xmlns:xlink ="http://www.w3.org/1999/xlink" >
3 < xsl:output method ="xml" version ="1.0" encoding ="UTF-8" indent ="yes" />
4 < xsl:preserve-space elements ="*" />
5 < xsl:template match ="/" >
6 < xsl:element name ="svg" >
7 < xsl:attribute name ="width" > 800 </ xsl:attribute >
8 < xsl:attribute name ="height" > 600 </ xsl:attribute >
9 < xsl:apply-templates select ="//gml:coordinates" />
10 </ xsl:element >
11 </ xsl:template >
12 < xsl:template name ="transform-x" >
13 < xsl:param name ="coordinate-pair" />
14 < xsl:param name ="x-offset" select ="38497864" />
15 < xsl:param name ="scale" select ="156900" />
16 < xsl:value-of select ="(substring-before($coordinate-pair,',') - $x-offset) * 3780 div $scale" />
17 </ xsl:template >
18 < xsl:template name ="transform-y" >
19 < xsl:param name ="coordinate-pair" />
20 < xsl:param name ="y-offset" select ="3996815" />
21 < xsl:param name ="scale" select ="156900" />
22 < xsl:value-of select ="(substring-after($coordinate-pair,',') - $y-offset) * -3780 div $scale + 600" />
23 </ xsl:template >
24
25 < xsl:template match ="gml:coordinates" >
26 < xsl:call-template name ="linestring" >
27 < xsl:with-param name ="list" select ="." />
28 </ xsl:call-template >
29 </ xsl:template >
30 < xsl:template name ="linestring" >
31 < xsl:param name ="list" />
32 < xsl:variable name ="current" select ="substring-before($list,' ')" />
33 < xsl:variable name ="rest" select ="substring-after($list,' ')" />
34 < xsl:variable name ="start-x" >
35 < xsl:call-template name ="transform-x" >
36 < xsl:with-param name ="coordinate-pair" select ="$current" />
37 </ xsl:call-template >
38 </ xsl:variable >
39 < xsl:variable name ="start-y" >
40 < xsl:call-template name ="transform-y" >
41 < xsl:with-param name ="coordinate-pair" select ="$current" />
42 </ xsl:call-template >
43 </ xsl:variable >
44 < xsl:variable name ="start" select ="concat( 'M ',$start-x,' ',$start-y)" />
45 < xsl:variable name ="other" >
46 < xsl:call-template name ="gmlcoords-to-svgpath" >
47 < xsl:with-param name ="list" select ="$rest" />
48 </ xsl:call-template >
49 </ xsl:variable >
50 < xsl:element name ="path" >
51 < xsl:attribute name ="d" >< xsl:value-of select ="concat($start,$other)" /></ xsl:attribute >
52 < xsl:attribute name ="style" > fill:none;stroke:black;stroke-width:1 </ xsl:attribute >
53 </ xsl:element >
54 </ xsl:template >
55 < xsl:template name ="gmlcoords-to-svgpath" >
56 < xsl:param name ="list" />
57 < xsl:variable name ="current" select ="substring-before($list,' ')" />
58 < xsl:variable name ="rest" select ="substring-after($list,' ')" />
59 < xsl:variable name ="x" >
60 < xsl:call-template name ="transform-x" >
61 < xsl:with-param name ="coordinate-pair" select ="$current" />
62 </ xsl:call-template >
63 </ xsl:variable >
64 < xsl:variable name ="y" >
65 < xsl:call-template name ="transform-y" >
66 < xsl:with-param name ="coordinate-pair" select ="$current" />
67 </ xsl:call-template >
68 </ xsl:variable >
69 < xsl:choose >
70 < xsl:when test ="string-length($rest) > 0" >
71 < xsl:variable name ="other" >
72 < xsl:call-template name ="gmlcoords-to-svgpath" >
73 < xsl:with-param name ="list" select ="$rest" />
74 </ xsl:call-template >
75 </ xsl:variable >
76 < xsl:value-of select ="concat(' L ',$x,' ',$y,$other)" />
77 </ xsl:when >
78 < xsl:otherwise >
79 < xsl:variable name ="final-x" >
80 < xsl:call-template name ="transform-x" >
81 < xsl:with-param name ="coordinate-pair" select ="$list" />
82 </ xsl:call-template >
83 </ xsl:variable >
84 < xsl:variable name ="final-y" >
85 < xsl:call-template name ="transform-y" >
86 < xsl:with-param name ="coordinate-pair" select ="$list" />
87 </ xsl:call-template >
88 </ xsl:variable >
89 < xsl:value-of select ="concat(' L ',$final-x,' ',$final-y)" />
90 </ xsl:otherwise >
91 </ xsl:choose >
92 </ xsl:template >
93 </ xsl:stylesheet >
94
![ContractedBlock.gif](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
2 < svg width ="800" height ="600" >
3 < path d ="M 355.786318049678 484.610069713195 L 357.08279300195 486.338700573616 L 363.960617437776 492.36741028681 L 368.715657476189 496.103515066918 L 376.187864627098 500.943466577434 L 382.131665277239 502.471870669219 L 391.132276520056 504.339923059273 L 400.132887762873 507.142001644354 L 408.114563747611 510.538458126194 L 418.643581491375 513.595268718926 L 426.795078011504 516.567170248561 L 436.559892504795 520.303272619507 L 441.314934952247 521.57694470363 L 448.362582332682 522.850616787764 L 453.54217973235 523.190262676859 L 468.146945736089 524.46393235182 L 484.959410019034 526.247073269603 L 497.016834263925 527.520745353726 L 509.923373231326 529.473706806889 L 519.688187724617 531.936139502863 L 528.603887495219 534.823127151053 L 539.132905238984 537.964851625242 L 546.859846806897 539.74799013384 L 551.758618393842 540.878477552584" style ="fill:none;stroke:black;stroke-width:1" />
4 < path d ="M 273.24470822182 411.209314187386 L 275.567815755291 412.295930478011 L 283.3796663862 413.909246042067 L 292.210457093626 415.947121376675 L 300.616688030579 420.107781108988 L 306.56048868072 423.16459170172 L 313.608138470375 426.730873537287 L 320.995431740029 431.401002103249 L 329.231842141412 439.382675678779 L 335.600200152987 448.468200803063 L 338.741922218058 456.87443173996 L 341.3741754493 462.818232390056 L 345.704660535317 470.714994493304 L 349.865320267686 476.319149254304 L 354.025980000055 482.262949904401 L 355.786318049678 484.610069713195" style ="fill:none;stroke:black;stroke-width:1" />
5 < path d ="M 273.24470822182 411.209314187386 L 268.963592007657 411.590431663483 L 260.132803709449 412.694278393879 L 252.830421912009 413.203747227539 L 250.643107686401 413.257756175913 L 237.961725659666 414.679537284894 L 234.149905239077 415.496356978971 L 229.819422562098 417.194586424472 L 227.472895411107 418.019040803061" style ="fill:none;stroke:black;stroke-width:1" />
6 < path d ="M 227.472895411107 418.019040803061 L 226.677698087989 418.298433154879 L 225.365703212266 418.56083357553 L 222.8480714340881 418.848829101336 L 220.3942539578471 418.722990516257 L 219.6168387762134 418.672289369021 L 215.2327976673129 418.041376290632 L 212.2427550286795 417.024763479919 L 195.854848106989 411.590431663483 L 190.5903392351067 409.043087495215 L 186.486767380498 406.183022409182 L 183.5582358699484 402.709648107074 L 183.2879574378464 402.250172122374 L 180.2311444359516 395.711993575531 L 177.3422607647957 389.934221414917 L 175.182148566013 387.136956367111 L 170.8964091396127 383.536936405356 L 169.2716186615038 382.801910707452 L 167.0735016825921 381.807524971323 L 165.2249564053509 381.552552045885 L 162.675236787771 381.68003850861 L 160.2530060420785 381.743780535369 L 154.3249108221688 381.807524971323 L 148.9705010707104 381.68003850861 L 147.241205277207 381.541693881451 L 144.3000593116589 380.64970783939 L 142.9786638241653 379.958979694071 L 141.1846382409135 379.136717667299 L 139.4633626004364 378.585109904392 L 136.8593401147719 378.747861912051 L 134.2630149522259 379.794767724665 L 132.4065675716954 381.215751395797 L 130.3741707073998 384.764629330782 L 128.1183370554424 388.703659158702 L 125.8989181262614 394.835274493309 L 123.4313586997427 401.652435831741 L 121.245034646287 405.576234837473 L 118.0759756404828 408.618530133848 L 104.9147046654761 419.062636405353 L 98.8859925429406 423.47803055449 L 88.9513551052197 433.922136826006 L 84.2812241299829 442.837839005737 L 78.082691472236 446.99849873805 L 69.3368122370248 449.885486386229 L 59.911643632953 450.904424053538 L 49.6373603060129 452.857387915875 L 38.2592278393801 457.697339426391 L 32.2933061184664 460.476916290633 L 28.7461555640283 461.197431510518 L 21.53167502864996 461.263618852772 L 15.67302195019806 461.207822294452 L 11.29577713191623 460.887235411093 L 8.43007938820534 460.254549177823 L 4.99375342257449 459.072743862336 L 3.02098370936644 457.867162370933 L -0.00889709369915165 456.015569483743" style ="fill:none;stroke:black;stroke-width:1" />
7 < path d ="M 338.151179770536 552.078306768647 L 335.191367495174 560.86525525813 L 332.813846271538 568.224245506692 L 331.228833728473 573.658577323139 L 328.398452122344 580.564707189287 L 326.47379369024 586.791545277244 L 325.115210133902 592.791954378587 L 323.485671166343 599.989086424469" style ="fill:none;stroke:black;stroke-width:1" />
8 < path d ="M 355.786318049678 484.610069713195 L 355.343679808858 487.501776940727 L 354.437959044052 495.766490363292 L 353.305804474261 501.314036673035 L 351.154714646212 509.805179082214 L 348.211118546809 520.560628221801 L 345.267522447407 530.863214569789 L 342.437140841278 538.561850707458 L 340.286053422626 543.996182523905 L 338.814252963617 550.109806118543 L 338.151179770536 552.078306768647" style ="fill:none;stroke:black;stroke-width:1" />
9 < path d ="M 229.325683250508 137.4079317017157 L 229.574122485746 140.223578776286 L 229.956222906284 144.5540614531523 L 229.956222906284 147.6745562523954 L 230.01990711275 151.559254302101 L 230.274641529575 153.915548260033 L 230.01990711275 156.5902584321264 L 228.427818814555 160.474956481832 L 227.102477093765 162.1121421797375" style ="fill:none;stroke:black;stroke-width:1" />
10 < path d ="M 215.6330078776805 360.164803709367 L 217.3185722753662 362.198183518159 L 220.2055599234329 366.443754722754 L 225.300248260104 371.962998011472 L 228.781616214214 374.00087334608 L 231.923338279105 375.78401185469 L 233.536656252447 376.208569216057 L 235.489620114649 376.293480688339 L 240.499394569707 376.548215105163 L 245.08461166351 376.548215105163 L 249.415094340309 377.652064244744 L 253.575754072678 379.944673996176 L 258.160971166302 383.765687839394 L 259.944112084074 387.331967265775 L 261.557430057416 390.558603212235 L 261.81216447424 393.870148221803 L 261.98198741867 397.860985009562 L 262.746188260105 402.191467686428 L 265.293532428351 406.437041300186 L 270.303306883408 409.833497782025 L 273.24470822182 411.209314187386" style ="fill:none;stroke:black;stroke-width:1" />
11 < path d ="M 227.102477093765 162.1121421797375 L 226.262577476066 163.1496666539144 L 223.4604988909959 165.251223785848 L 219.8305352582046 167.0980489101307 L 215.7547869980506 168.1169841682553 L 210.9148354876024 168.180668374766 L 205.310680726501 168.2443525812657 L 201.9354515105343 168.3717185850911 L 199.0696911280373 168.7538214149148 L 196.6497153729029 169.6453906692139 L 193.7839525811873 171.492213384323 L 191.1092424092284 174.2942919694044 L 189.3897856979223 177.0963681453121 L 187.5429629827235 181.1084346080281 L 187.4155969790103 183.4010419502867 L 187.6066471893689 186.8399553728539 L 188.3708504398426 189.9604501720858 L 189.8355727341446 192.3804259273435 L 191.6187112428775 196.0103919694095 L 192.2555484894585 198.3666835181677 L 192.3829144933512 200.9777094837504 L 192.8923833270004 205.1171419502918 L 194.0386869980119 210.5939307074556 L 194.6118400383064 214.924413384322 L 194.866574455131 221.7385560229456 L 195.1213088719555 225.877988489487 L 195.5309269215705 238.219628260043 L 195.3265105927538 248.077217782025 L 194.8170417591046 262.002692007651 L 194.1377499808459 269.474899158695 L 192.8640803059417 284.419311051631 L 192.7791688337267 292.316073154878 L 192.8640803059417 305.222612122369 L 193.6282835564154 312.015527495221 L 194.2226614532405 315.41198397706 L 197.2794744551353 321.185961682603 L 198.2984121224336 323.988037858511 L 201.4401341873248 329.252546730404 L 204.072389827965 336.385107992352 L 206.534820114777 342.583643059273 L 209.7614536520628 351.414431357548 L 211.9691519310894 355.744914034414 L 215.6330078776805 360.164803709367" style ="fill:none;stroke:black;stroke-width:1" />
12 < path d ="M 799.513974722804 189.2050958317357 L 799.512244933106 191.1640489101348 L 799.508436022935 195.4828687571732 L 799.481568871931 198.679982638626 L 799.374579694161 211.3469577820245 L 798.492358049653 217.2986605353762 L 795.432697399656 238.65255269598 L 793.456665659566 248.150252007647 L 791.735604435955 261.536272772466 L 789.823317131899 272.053861376669 L 788.675943785778 279.065585506689 L 787.464826003803 287.415913881453 L 786.253710631046 297.806016022943 L 784.660135869924 310.61835131931 L 783.895221911989 316.928903518165 L 783.576506959836 321.964595908218 L 782.811590592683 332.928385927344 L 783.002819082167 342.043628260044 L 782.429133613715 352.115015449336 L 782.49287564053 368.178239885274 L 782.556620076564 373.53264963671 L 782.046674225709 389.149672657748 L 781.79170370941 396.671342638623 L 781.21801583174 404.256754646267 L 781.014025927257 406.953964130015" style ="fill:none;stroke:black;stroke-width:1" />
13 </ svg >
用snowflakesoft读取的railway.xml图:
生成的svg图:
参考书:《地理标识语言——Geo-Web基础》、《SVG开发实践》
参考代码:gml2svg.xml