Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rupture GeoJSON files don't conform to RFC 7946 polygon specificiation, lists additional segments as "holes" instead of new polygons #10

Open
kevinmilner opened this issue Oct 19, 2023 · 0 comments

Comments

@kevinmilner
Copy link

kevinmilner commented Oct 19, 2023

I believe that the ShakeMap GeoJSON rupture geometry files, documented here, don't strictly conform to the GeoJSON specification (RFC 7946).

ShakeMap uses the MultiPolygon geometry type, and formats the geometry array this way:

{
  "type": "MultiPolygon",
  "coordinates": [
    [
      [
        [-117.3707820945, 35.5741994328, 0.0],
        [-117.3980967662, 35.5927834531, 0.0]
      ],
     [
        [-117.4768565955, 35.647137561, 0.0],
        [-117.5140293653, 35.673709514, 0.0]
      ]
    ]
  ]
}

Even though this is a MultiPolygon, the coordinates array only contains a single Polygon coordinate array:

    [
      [
        [-117.3707820945, 35.5741994328, 0.0],
        [-117.3980967662, 35.5927834531, 0.0]
      ],
     [
        [-117.4768565955, 35.647137561, 0.0],
        [-117.5140293653, 35.673709514, 0.0]
      ]
    ]

That single Polygon coordinate array lists multiple linear rings; according to the Polygon specification, that 2nd array is (and any after are) actually a hole meant as a cutout from the first listed linear ring:

For Polygons with more than one of these rings, the first MUST be the exterior ring, and any others MUST be interior rings. The exterior ring bounds the surface, and the interior rings (if present) bound holes within the surface.

Instead, I believe it should be specified this way with multiple Polygon arrays within the coordinates array, each with a single linear ring:

{
  "type": "MultiPolygon",
  "coordinates": [
    [
      [
        [-117.3707820945, 35.5741994328, 0.0],
        [-117.3980967662, 35.5927834531, 0.0]
      ]
    ],
    [
     [
        [-117.4768565955, 35.647137561, 0.0],
        [-117.5140293653, 35.673709514, 0.0]
      ]
    ]
  ]
}

For a real world example with this issue, see the Ridgecrest M7.1 ShakeMap: https://earthquake.usgs.gov/product/shakemap/ci38457511/atlas/1594160054783/download/rupture.json

I have attached it (after reformatting for readability) here: rupture_original_reformatted.json

And here is a modified version that I believe conforms to the GeoJSON spec: rupture_fixed.json

I think that correcting this issue will help users to more easily use these files in existing codes without having to write special cases. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant