在开发过程中调用一个webAPI的接口,需要传递一个Geojson格式的string字符串:
需求是传递一条线段,期间一直报错无法解析,研究半天,正确格式如下:
"SpatialLocationStr": "{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"LINESTRING","coordinates":[[119.92166720920139,29.446581488715278],[119.92151638454861,29.446602918836806],[119.9212109375,29.44662923177083],[119.92076144748263,29.44669677734375],[119.92043023003473,29.446729329427082],[119.92002549913194,29.44680392795139],[119.91955702039931,29.446898328993054],[119.91920844184028,29.446982421875],[119.91896402994792,29.447027452256943],[119.91886962890625,29.44716335720486]]}}]}"