我有一个 PostGIS 数据库,其中包含一些 POLYGON(有些是 MULTIPOLYGON)。我想找到这些多边形的边界长度。它们是行政边界的形状,因此我想得到边界的长度。
对于 MULTIPOLYGON 形状,我希望它是构成它的每个 POLYGON 的边界之和。
这是 2 个形状的示例(SRID 为 900913):
POLYGON((-771958.31 6885015.34,-771923.15 6885310.54,-771809.28 6885392.78,-771679.07 6885406.05,-771424.03 6885497.97,-770935.04 6885439.73,-770713.55 6885538.08,-770482.81 6885745.21,-770233.34 6886191.66,-770181.32 6886711.86,-770370.21 6886944.29,-770397.74 6886956.42,-770303.56 6887085.22,-770234.96 6887174.93,-770110.06 6887301.59,-769891.93 6887400.11,-769761.75 6887417.69,-769724.8 6887495.1,-769529.55 6887931.36,-769425.75 6887880.34,-769228.74 6887818.78,-769114.39 6887829.32,-768933.2 6887896.17,-768896.84 6887976.98,-768741.36 6888049.11,-768711.51 6888129.98,-768629.41 6888316.56,-768516.09 6888456.13,-768438.68 6888533.53,-768334.47 6888647.22,-768256.1 6888760.41,-768166.54 6888689.5,-768103.1 6888692.01,-768056.2 6888520.15,-767980.56 6888469.13,-767846.87 6888393.49,-767635.77 6888212.29,-767565.41 6888094.43,-767465.14 6888068.05,-767255.8 6888046.94,-767097.49 6888046.94,-767000.73 6888031.11,-766896.94 6887851.68,-766782.6 6887663.44,-766604.93 6887519.21,-766413.18 6887371.43,-766139.4 6887370.19,-765988.89 6887303.02,-765897.72 6887162.23,-765924.86 6887144.75,-765977.74 6887058.21,-766136.4 6887012.53,-766190.39 6886977.26,-766385.86 6886894.81,-766536.29 6886825.12,-766726.67 6886753.74,-766903.44 6886749.84,-766984.18 6886698.85,-767036.04 6886737.09,-767177.11 6886761.74,-767264.65 6886771.08,-767350.14 6886738.68,-767523.22 6886759.11,-767572.5 6886717.04,-767653.03 6886739.86,-767691.49 6886685.78,-767772.01 6886682.18,-767778.03 6886589.63,-767910.62 6886578.9,-768035.55 6886518.56,-768184.29 6886435.26,-768198.74 6886385.97,-768241.23 6886229.58,-768346.61 6886081.7,-768361.91 6885969.53,-768306.67 6885814.84,-768274.37 6885730.7,-768153.68 6885684.8,-768134.14 6885608.32,-768165.62 6885539.63,-768244.94 6885492.76,-768331.48 6885360.55,-768430.01 6885214.38,-768437.96 6885113.83,-768636.67 6885175.57,-768758.43 6885374.97,-768775.54 6885487.75,-768887.58 6885663.36,-768890.62 6885697.22,-769007.53 6885852.57,-769032.42 6885847.82,-769046.75 6885814.89,-769079.05 6885777.21,-769172.84 6885705.87,-769222.94 6885673.18,-769269.78 6885663.38,-769332.85 6885636.46,-769456.56 6885615.08,-769674.02 6885529.96,-769708.16 6885476.49,-769707.47 6885411.77,-769739.7 6885358.83,-769792.79 6885311.27,-769833.53 6885288.08,-769858.28 6885233.95,-769883.51 6885138.09,-769923.29 6885074.87,-769897.32 6885017.75,-769915.3 6884984.68,-770018.88 6884984.27,-770144.01 6885043.71,-770211.53 6884848.97,-770266.09 6884545.38,-770295.69 6884559.34,-770577.74 6884634.02,-770774.56 6884742.9,-771051.06 6884901.37,-771286.57 6884987.78,-771421.81 6884985.53,-771480.47 6884957.27,-771619.97 6884859.66,-771748.55 6884800.97,-771887.67 6884896.97,-771958.31 6885015.34))
MULTIPOLYGON(((-748402.29 6933642.13,-748200.12 6933723.79,-747125.33 6934322.44,-747080.44 6934234.95,-747015.79 6934158.69,-746940.66 6934083.36,-746869.3 6934016.65,-746810.92 6933906.62,-746778.54 6933811.99,-746718.21 6933728.99,-746628.02 6933648.49,-746546.94 6933494.73,-746397.31 6933370.7,-747345.83 6933019.56,-747417.1 6933252.35,-747583.38 6933428.15,-747668.91 6933432.89,-747801.85 6933366.36,-747906.14 6933234.1,-748173.7 6933683.88,-748399.51 6933622.62,-748402.29 6933642.13)),((-748665.23 6934960.19,-747689.57 6935406.98,-747622.32 6935293.38,-747576.11 6935204.26,-747541.11 6935103.13,-747496.85 6935009.48,-747840.87 6934882.49,-748550.36 6934423.01,-748613.66 6934709.69,-748665.23 6934960.19)))
我确定这个列表中有一个 PostGIS 函数(http://postgis.refractions.net/docs/reference.html),但我不确定是哪个。
我也想要这个以米为单位的长度。我在 a 中有相同的数据GEOGRAPHY
(与旧的GEOMETRY
列类型相反)。是否可以从中计算边界长度?