d3.jsflashgeojsonswfobject

Convert Flash Coordinate into GeoJSON


I have a legacy .swf file that my team used to create a custom map.

The .swf file looks like this with following format:

{
  "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
      },
      "Reserved": 0,
      "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,
            "Reserved": 0,
            "NoClose": 0,
            "EndCapStyle": 0,
            "Color": [
              255,
              255,
              255,
              255
            ]
          },
          {
            "Width": 2,
            "StartCapStyle": 0,
            "JoinStyle": 0,
            "HasFillFlag": 0,
            "NoHScaleFlag": 0,
            "NoVScaleFlag": 0,
            "PixelHintingFlag": 0,
            "Reserved": 0,
            "NoClose": 0,
            "EndCapStyle": 0,
            "Color": [
              255,
              255,
              102,
              255
            ]
          }
        ],
        "FillBits": 1,
        "LineBits": 2,
        "ShapeRecords": [
          {
            "RecordType": "stylechange",
            "MoveDeltaX": 10630,
            "MoveDeltaY": 4306,
            "LineStyle": 1
          },
          {
            "RecordType": "straightedge",
            "LineType": "General",
            "DeltaX": 23,
            "DeltaY": -1
          },
       },
    }

What format is this? and is there a way to convert this to GeoJson format so I can use it with d3.js? To be specific, this is the data data for US combatant command(COCOM) map. I could not find the GeoJson format of this map in the entire Internet, so my only hope is to covert the legacy data into GeoJson


Solution

  • I ended up drawing my own cocom map using Geojson.io. I don't think there is a simple way to convert ShapeRecord to GeoJson since it is a completely different coordinate system.