问题描述
我有一个旧的 .swf 文件,我的团队用它来创建自定义地图。
.swf 文件如下所示:
{
"Signature": "CWS","Version": 8,"FileLength": 87736,"FrameSize": {
"Xmin": 0,"Xmax": 14400,"Ymin": 0,"Ymax": 10000
},"FrameRate": 12,"FrameCount": 1,"Tags": [
{
"TagName": "FileAttributes","Length": 4,"Reserved": 0,"HasMetaData": 0,"SWFFlagsAS3": 0,"SWFFlagsNoCrossDomainCache": 0,"SWFFlagsUseNetwork": 0,"UNDEFINED": 0
},{
"TagName": "SetBackgroundColor","Length": 3,"BackgroundColor": [
51,51,51
]
},{
"TagName": "Protect","Length": 0
},{
"TagName": "Defineshape4","Length": 309,"ShapeId": 1,"ShapeBounds": {
"Xmin": 10629,"Xmax": 12137,"Ymin": 4084,"Ymax": 4748
},"EdgeBounds": {
"Xmin": 10630,"Xmax": 12136,"Ymin": 4085,"Ymax": 4747
},"UsesFillWindingRule": 0,"UsesNonScalingstrokes": 0,"UsesScalingstrokes": 1,"Shapes": {
"FillStyles": [
{
"FillStyleType": 0,"FillStyleName": "solid fill","Color": [
255,255,102,255
]
}
],"Linestyles": [
{
"Width": 2,"StartCapStyle": 0,"JoinStyle": 0,"HasFillFlag": 0,"NoHScaleFlag": 0,"NoVScaleFlag": 0,"PixelHintingFlag": 0,"NoClose": 0,"EndCapStyle": 0,255
]
},{
"Width": 2,"FillBits": 1,"LineBits": 2,"ShapeRecords": [
{
"recordtype": "stylechange","MoveDeltaX": 10630,"MoveDeltaY": 4306,"Linestyle": 1
},{
"recordtype": "straightedge","LineType": "General","DeltaX": 23,"DeltaY": -1
},},}
这是什么格式?有没有办法将其转换为 GeoJson 格式,以便我可以将它与 d3.js 一起使用? 具体来说,这是美国作战司令部(COCOM)地图的数据数据。我在整个互联网上都找不到这张地图的GeoJson格式,所以我唯一的希望是将遗留数据转换成GeoJson
解决方法
我最终使用 Geojson.io 绘制了自己的 cocom 地图。我不认为有一种简单的方法可以将 ShapeRecord 转换为 GeoJson,因为它是一个完全不同的坐标系。