{
  "versions": {
    "shapely": "2.1.2",
    "geopandas": "1.1.4",
    "gdal": "3.8.4",
    "postgis": "3.4.2",
    "turf": "7.3.4"
  },
  "languages": {
    "python": {
      "label": "Python",
      "note": "Shapely 2.x",
      "syntax": "python"
    },
    "postgis": {
      "label": "PostGIS",
      "note": "PostgreSQL with PostGIS",
      "syntax": "sql"
    },
    "gdal": {
      "label": "GDAL",
      "note": "ogr2ogr on the command line",
      "syntax": "bash"
    },
    "javascript": {
      "label": "JavaScript",
      "note": "Turf.js in Node",
      "syntax": "javascript"
    }
  },
  "inputs": {
    "buffer": {
      "a": {
        "type": "Feature",
        "properties": {
          "name": "PS 116 Mary Lindley Murray",
          "type": "elementary_school"
        },
        "geometry": {
          "type": "Point",
          "coordinates": [
            -73.9857,
            40.7484
          ]
        }
      }
    },
    "clip": {
      "a": {
        "type": "Feature",
        "properties": {
          "name": "Coastal Trail Connector",
          "surface": "asphalt"
        },
        "geometry": {
          "type": "LineString",
          "coordinates": [
            [
              -122.49,
              37.8199
            ],
            [
              -122.4783,
              37.8199
            ],
            [
              -122.465,
              37.8199
            ]
          ]
        }
      },
      "b": {
        "type": "Feature",
        "properties": {
          "name": "City Boundary"
        },
        "geometry": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -122.485,
                37.81
              ],
              [
                -122.47,
                37.81
              ],
              [
                -122.47,
                37.828
              ],
              [
                -122.485,
                37.828
              ],
              [
                -122.485,
                37.81
              ]
            ]
          ]
        }
      }
    },
    "union": {
      "a": {
        "type": "Feature",
        "properties": {
          "parcel_id": "A-1042"
        },
        "geometry": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -73.987,
                40.748
              ],
              [
                -73.985,
                40.748
              ],
              [
                -73.985,
                40.7495
              ],
              [
                -73.987,
                40.7495
              ],
              [
                -73.987,
                40.748
              ]
            ]
          ]
        }
      },
      "b": {
        "type": "Feature",
        "properties": {
          "parcel_id": "A-1043"
        },
        "geometry": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -73.9855,
                40.7488
              ],
              [
                -73.9835,
                40.7488
              ],
              [
                -73.9835,
                40.7503
              ],
              [
                -73.9855,
                40.7503
              ],
              [
                -73.9855,
                40.7488
              ]
            ]
          ]
        }
      }
    },
    "intersection": {
      "a": {
        "type": "Feature",
        "properties": {
          "zone": "AE",
          "bfe_ft": 14
        },
        "geometry": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -122.482,
                37.818
              ],
              [
                -122.475,
                37.818
              ],
              [
                -122.475,
                37.822
              ],
              [
                -122.482,
                37.822
              ],
              [
                -122.482,
                37.818
              ]
            ]
          ]
        }
      },
      "b": {
        "type": "Feature",
        "properties": {
          "zone_code": "R-2",
          "units_per_acre": 8
        },
        "geometry": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -122.48,
                37.817
              ],
              [
                -122.473,
                37.817
              ],
              [
                -122.473,
                37.821
              ],
              [
                -122.48,
                37.821
              ],
              [
                -122.48,
                37.817
              ]
            ]
          ]
        }
      }
    },
    "difference": {
      "a": {
        "type": "Feature",
        "properties": {
          "district": "Midtown South"
        },
        "geometry": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -73.988,
                40.747
              ],
              [
                -73.982,
                40.747
              ],
              [
                -73.982,
                40.751
              ],
              [
                -73.988,
                40.751
              ],
              [
                -73.988,
                40.747
              ]
            ]
          ]
        }
      },
      "b": {
        "type": "Feature",
        "properties": {
          "name": "Bryant Park Annex",
          "protected": true
        },
        "geometry": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -73.9865,
                40.7482
              ],
              [
                -73.9845,
                40.7482
              ],
              [
                -73.9845,
                40.7498
              ],
              [
                -73.9865,
                40.7498
              ],
              [
                -73.9865,
                40.7482
              ]
            ]
          ]
        }
      }
    },
    "dissolve": {
      "a": {
        "type": "FeatureCollection",
        "features": [
          {
            "type": "Feature",
            "properties": {
              "name": "West A",
              "region": "West"
            },
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    -120.0,
                    40.0
                  ],
                  [
                    -119.0,
                    40.0
                  ],
                  [
                    -119.0,
                    41.0
                  ],
                  [
                    -120.0,
                    41.0
                  ],
                  [
                    -120.0,
                    40.0
                  ]
                ]
              ]
            }
          },
          {
            "type": "Feature",
            "properties": {
              "name": "West B",
              "region": "West"
            },
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    -119.0,
                    40.0
                  ],
                  [
                    -118.0,
                    40.0
                  ],
                  [
                    -118.0,
                    41.0
                  ],
                  [
                    -119.0,
                    41.0
                  ],
                  [
                    -119.0,
                    40.0
                  ]
                ]
              ]
            }
          },
          {
            "type": "Feature",
            "properties": {
              "name": "West C",
              "region": "West"
            },
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    -116.0,
                    40.0
                  ],
                  [
                    -115.0,
                    40.0
                  ],
                  [
                    -115.0,
                    41.0
                  ],
                  [
                    -116.0,
                    41.0
                  ],
                  [
                    -116.0,
                    40.0
                  ]
                ]
              ]
            }
          },
          {
            "type": "Feature",
            "properties": {
              "name": "East A",
              "region": "East"
            },
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    -75.0,
                    40.0
                  ],
                  [
                    -74.0,
                    40.0
                  ],
                  [
                    -74.0,
                    41.0
                  ],
                  [
                    -75.0,
                    41.0
                  ],
                  [
                    -75.0,
                    40.0
                  ]
                ]
              ]
            }
          }
        ]
      }
    }
  },
  "inputShapes": {
    "buffer": {
      "a": {
        "document": {
          "type": "Feature",
          "properties": {
            "name": "PS 116 Mary Lindley Murray",
            "type": "elementary_school"
          },
          "geometry": {
            "type": "Point",
            "coordinates": [
              -73.9857,
              40.7484
            ]
          }
        },
        "shape": {
          "features": 1,
          "types": [
            "Point"
          ],
          "positions": 1
        }
      }
    },
    "clip": {
      "a": {
        "document": {
          "type": "Feature",
          "properties": {
            "name": "Coastal Trail Connector",
            "surface": "asphalt"
          },
          "geometry": {
            "type": "LineString",
            "coordinates": [
              [
                -122.49,
                37.8199
              ],
              [
                -122.4783,
                37.8199
              ],
              [
                -122.465,
                37.8199
              ]
            ]
          }
        },
        "shape": {
          "features": 1,
          "types": [
            "LineString"
          ],
          "positions": 3,
          "lengthMetres": 2201.171
        }
      },
      "b": {
        "document": {
          "type": "Feature",
          "properties": {
            "name": "City Boundary"
          },
          "geometry": {
            "type": "Polygon",
            "coordinates": [
              [
                [
                  -122.485,
                  37.81
                ],
                [
                  -122.47,
                  37.81
                ],
                [
                  -122.47,
                  37.828
                ],
                [
                  -122.485,
                  37.828
                ],
                [
                  -122.485,
                  37.81
                ]
              ]
            ]
          }
        },
        "shape": {
          "features": 1,
          "types": [
            "Polygon"
          ],
          "positions": 5,
          "areaSquareMetres": 2638630.38
        }
      }
    },
    "union": {
      "a": {
        "document": {
          "type": "Feature",
          "properties": {
            "parcel_id": "A-1042"
          },
          "geometry": {
            "type": "Polygon",
            "coordinates": [
              [
                [
                  -73.987,
                  40.748
                ],
                [
                  -73.985,
                  40.748
                ],
                [
                  -73.985,
                  40.7495
                ],
                [
                  -73.987,
                  40.7495
                ],
                [
                  -73.987,
                  40.748
                ]
              ]
            ]
          }
        },
        "shape": {
          "features": 1,
          "types": [
            "Polygon"
          ],
          "positions": 5,
          "areaSquareMetres": 28135.565
        }
      },
      "b": {
        "document": {
          "type": "Feature",
          "properties": {
            "parcel_id": "A-1043"
          },
          "geometry": {
            "type": "Polygon",
            "coordinates": [
              [
                [
                  -73.9855,
                  40.7488
                ],
                [
                  -73.9835,
                  40.7488
                ],
                [
                  -73.9835,
                  40.7503
                ],
                [
                  -73.9855,
                  40.7503
                ],
                [
                  -73.9855,
                  40.7488
                ]
              ]
            ]
          }
        },
        "shape": {
          "features": 1,
          "types": [
            "Polygon"
          ],
          "positions": 5,
          "areaSquareMetres": 28135.232
        }
      }
    },
    "intersection": {
      "a": {
        "document": {
          "type": "Feature",
          "properties": {
            "zone": "AE",
            "bfe_ft": 14
          },
          "geometry": {
            "type": "Polygon",
            "coordinates": [
              [
                [
                  -122.482,
                  37.818
                ],
                [
                  -122.475,
                  37.818
                ],
                [
                  -122.475,
                  37.822
                ],
                [
                  -122.482,
                  37.822
                ],
                [
                  -122.482,
                  37.818
                ]
              ]
            ]
          }
        },
        "shape": {
          "features": 1,
          "types": [
            "Polygon"
          ],
          "positions": 5,
          "areaSquareMetres": 273632.099
        }
      },
      "b": {
        "document": {
          "type": "Feature",
          "properties": {
            "zone_code": "R-2",
            "units_per_acre": 8
          },
          "geometry": {
            "type": "Polygon",
            "coordinates": [
              [
                [
                  -122.48,
                  37.817
                ],
                [
                  -122.473,
                  37.817
                ],
                [
                  -122.473,
                  37.821
                ],
                [
                  -122.48,
                  37.821
                ],
                [
                  -122.48,
                  37.817
                ]
              ]
            ]
          }
        },
        "shape": {
          "features": 1,
          "types": [
            "Polygon"
          ],
          "positions": 5,
          "areaSquareMetres": 273635.744
        }
      }
    },
    "difference": {
      "a": {
        "document": {
          "type": "Feature",
          "properties": {
            "district": "Midtown South"
          },
          "geometry": {
            "type": "Polygon",
            "coordinates": [
              [
                [
                  -73.988,
                  40.747
                ],
                [
                  -73.982,
                  40.747
                ],
                [
                  -73.982,
                  40.751
                ],
                [
                  -73.988,
                  40.751
                ],
                [
                  -73.988,
                  40.747
                ]
              ]
            ]
          }
        },
        "shape": {
          "features": 1,
          "types": [
            "Polygon"
          ],
          "positions": 5,
          "areaSquareMetres": 225083.687
        }
      },
      "b": {
        "document": {
          "type": "Feature",
          "properties": {
            "name": "Bryant Park Annex",
            "protected": true
          },
          "geometry": {
            "type": "Polygon",
            "coordinates": [
              [
                [
                  -73.9865,
                  40.7482
                ],
                [
                  -73.9845,
                  40.7482
                ],
                [
                  -73.9845,
                  40.7498
                ],
                [
                  -73.9865,
                  40.7498
                ],
                [
                  -73.9865,
                  40.7482
                ]
              ]
            ]
          }
        },
        "shape": {
          "features": 1,
          "types": [
            "Polygon"
          ],
          "positions": 5,
          "areaSquareMetres": 30011.158
        }
      }
    },
    "dissolve": {
      "a": {
        "document": {
          "type": "FeatureCollection",
          "features": [
            {
              "type": "Feature",
              "properties": {
                "name": "West A",
                "region": "West"
              },
              "geometry": {
                "type": "Polygon",
                "coordinates": [
                  [
                    [
                      -120.0,
                      40.0
                    ],
                    [
                      -119.0,
                      40.0
                    ],
                    [
                      -119.0,
                      41.0
                    ],
                    [
                      -120.0,
                      41.0
                    ],
                    [
                      -120.0,
                      40.0
                    ]
                  ]
                ]
              }
            },
            {
              "type": "Feature",
              "properties": {
                "name": "West B",
                "region": "West"
              },
              "geometry": {
                "type": "Polygon",
                "coordinates": [
                  [
                    [
                      -119.0,
                      40.0
                    ],
                    [
                      -118.0,
                      40.0
                    ],
                    [
                      -118.0,
                      41.0
                    ],
                    [
                      -119.0,
                      41.0
                    ],
                    [
                      -119.0,
                      40.0
                    ]
                  ]
                ]
              }
            },
            {
              "type": "Feature",
              "properties": {
                "name": "West C",
                "region": "West"
              },
              "geometry": {
                "type": "Polygon",
                "coordinates": [
                  [
                    [
                      -116.0,
                      40.0
                    ],
                    [
                      -115.0,
                      40.0
                    ],
                    [
                      -115.0,
                      41.0
                    ],
                    [
                      -116.0,
                      41.0
                    ],
                    [
                      -116.0,
                      40.0
                    ]
                  ]
                ]
              }
            },
            {
              "type": "Feature",
              "properties": {
                "name": "East A",
                "region": "East"
              },
              "geometry": {
                "type": "Polygon",
                "coordinates": [
                  [
                    [
                      -75.0,
                      40.0
                    ],
                    [
                      -74.0,
                      40.0
                    ],
                    [
                      -74.0,
                      41.0
                    ],
                    [
                      -75.0,
                      41.0
                    ],
                    [
                      -75.0,
                      40.0
                    ]
                  ]
                ]
              }
            }
          ]
        },
        "shape": {
          "features": 4,
          "types": [
            "Polygon"
          ],
          "positions": 20,
          "areaSquareMetres": 37651154982.756
        }
      }
    }
  },
  "operations": {
    "buffer": {
      "languages": {
        "python": {
          "code": "import json\nfrom shapely.geometry import shape, mapping\nfrom shapely.ops import transform\nfrom pyproj import Transformer\n\nschool = json.load(open(\"a.geojson\"))\npoint = shape(school[\"geometry\"])\n\n# Shapely works in the units it is given, and these units are degrees. A\n# 1000 \"degree\" buffer is meaningless, so project to a metre-based CRS\n# centred on the point, buffer there, and come back.\nlon, lat = point.x, point.y\nlocal = f\"+proj=aeqd +lat_0={lat} +lon_0={lon} +datum=WGS84 +units=m\"\nto_m = Transformer.from_crs(\"EPSG:4326\", local, always_xy=True).transform\nto_deg = Transformer.from_crs(local, \"EPSG:4326\", always_xy=True).transform\n\nring = transform(to_deg, transform(to_m, point).buffer(1000, quad_segs=16))\n\nprint(json.dumps({\n    \"type\": \"Feature\",\n    \"properties\": {\"source\": school[\"properties\"][\"name\"], \"radius_m\": 1000},\n    \"geometry\": mapping(ring),\n}))",
          "output": {
            "type": "Feature",
            "properties": {
              "source": "PS 116 Mary Lindley Murray",
              "radius_m": 1000
            },
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    -73.97385927762036,
                    40.74839939263463
                  ],
                  [
                    -73.97391644973541,
                    40.74751675113071
                  ],
                  [
                    -73.97408709938702,
                    40.74664262131516
                  ],
                  [
                    -73.97436957881216,
                    40.74578542104346
                  ],
                  [
                    -73.97476116360465,
                    40.74495340482346
                  ],
                  [
                    -73.97525807910547,
                    40.74415458435088
                  ],
                  [
                    -73.97585553688853,
                    40.74339665139346
                  ],
                  [
                    -73.97654778098554,
                    40.74268690376545
                  ],
                  [
                    -73.97732814340061,
                    40.742032175103134
                  ],
                  [
                    -73.97818910837695,
                    40.741438769115426
                  ],
                  [
                    -73.97912238479437,
                    40.7409123989405
                  ],
                  [
                    -73.98011898600032,
                    40.740458132189886
                  ],
                  [
                    -73.9811693163059,
                    40.74008034220692
                  ],
                  [
                    -73.98226326331584,
                    40.7397826660064
                  ],
                  [
                    -73.98339029520659,
                    40.739567969298385
                  ],
                  [
                    -73.98453956201968,
                    40.73943831893117
                  ],
                  [
                    -73.9857,
                    40.73939496301705
                  ],
                  [
                    -73.98686043798033,
                    40.73943831893117
                  ],
                  [
                    -73.9880097047934,
                    40.739567969298385
                  ],
                  [
                    -73.98913673668416,
                    40.7397826660064
                  ],
                  [
                    -73.99023068369411,
                    40.74008034220692
                  ],
                  [
                    -73.99128101399967,
                    40.740458132189886
                  ],
                  [
                    -73.99227761520564,
                    40.740912398940495
                  ],
                  [
                    -73.99321089162305,
                    40.741438769115426
                  ],
                  [
                    -73.99407185659939,
                    40.742032175103134
                  ],
                  [
                    -73.99485221901446,
                    40.74268690376545
                  ],
                  [
                    -73.99554446311146,
                    40.74339665139346
                  ],
                  [
                    -73.9961419208945,
                    40.74415458435089
                  ],
                  [
                    -73.99663883639533,
                    40.74495340482346
                  ],
                  [
                    -73.99703042118783,
                    40.74578542104346
                  ],
                  [
                    -73.99731290061297,
                    40.74664262131516
                  ],
                  [
                    -73.99748355026459,
                    40.74751675113072
                  ],
                  [
                    -73.99754072237964,
                    40.74839939263463
                  ],
                  [
                    -73.99748386187272,
                    40.749282045673475
                  ],
                  [
                    -73.9973135118543,
                    40.75015620965054
                  ],
                  [
                    -73.99703130857272,
                    40.75101346539755
                  ],
                  [
                    -73.99663996582207,
                    40.7518455562747
                  ],
                  [
                    -73.99614324895984,
                    40.752644467717325
                  ],
                  [
                    -73.99554593877859,
                    40.7534025044617
                  ],
                  [
                    -73.99485378557435,
                    40.75411236470513
                  ],
                  [
                    -73.99407345385,
                    40.75476721048357
                  ],
                  [
                    -73.99321245818295,
                    40.75536073358742
                  ],
                  [
                    -73.9922790908728,
                    40.75588721637779
                  ],
                  [
                    -73.99128234206505,
                    40.756341586915354
                  ],
                  [
                    -73.99023181312087,
                    40.75671946786835
                  ],
                  [
                    -73.98913762406907,
                    40.75701721872607
                  ],
                  [
                    -73.98801031603477,
                    40.757231970909366
                  ],
                  [
                    -73.98686074958847,
                    40.757361655438096
                  ],
                  [
                    -73.9857,
                    40.757405022887156
                  ],
                  [
                    -73.98453925041152,
                    40.757361655438096
                  ],
                  [
                    -73.98338968396523,
                    40.757231970909366
                  ],
                  [
                    -73.98226237593092,
                    40.75701721872607
                  ],
                  [
                    -73.98116818687913,
                    40.75671946786835
                  ],
                  [
                    -73.98011765793494,
                    40.75634158691535
                  ],
                  [
                    -73.97912090912719,
                    40.75588721637778
                  ],
                  [
                    -73.97818754181704,
                    40.75536073358742
                  ],
                  [
                    -73.97732654615,
                    40.75476721048357
                  ],
                  [
                    -73.97654621442564,
                    40.75411236470513
                  ],
                  [
                    -73.9758540612214,
                    40.753402504461704
                  ],
                  [
                    -73.97525675104015,
                    40.752644467717325
                  ],
                  [
                    -73.97476003417793,
                    40.7518455562747
                  ],
                  [
                    -73.97436869142729,
                    40.75101346539754
                  ],
                  [
                    -73.9740864881457,
                    40.75015620965054
                  ],
                  [
                    -73.97391613812727,
                    40.749282045673475
                  ],
                  [
                    -73.97385927762036,
                    40.74839939263463
                  ]
                ]
              ]
            }
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 65,
            "areaSquareMetres": 3136548.484
          }
        },
        "postgis": {
          "code": "-- Cast to geography and ST_Buffer takes metres directly. This is the\n-- shortest correct route to a metre buffer in any of the four.\nWITH school AS (\n  SELECT ST_GeomFromGeoJSON(:'a_geometry') AS geom\n)\nSELECT ST_AsGeoJSON(\n         ST_Buffer(geom::geography, 1000, 16)::geometry\n       )\nFROM school;",
          "output": {
            "type": "Polygon",
            "coordinates": [
              [
                [
                  -73.973856431,
                  40.7482953
                ],
                [
                  -73.973927032,
                  40.747412948
                ],
                [
                  -73.974111008,
                  40.746540108
                ],
                [
                  -73.974406582,
                  40.745685184
                ],
                [
                  -73.974810905,
                  40.74485641
                ],
                [
                  -73.975320079,
                  40.744061765
                ],
                [
                  -73.975929198,
                  40.743308901
                ],
                [
                  -73.976632393,
                  40.742605067
                ],
                [
                  -73.977422891,
                  40.741957039
                ],
                [
                  -73.97829308,
                  40.741371058
                ],
                [
                  -73.979234579,
                  40.740852763
                ],
                [
                  -73.980238322,
                  40.740407147
                ],
                [
                  -73.981294646,
                  40.740038497
                ],
                [
                  -73.98239338,
                  40.739750364
                ],
                [
                  -73.983523947,
                  40.739545521
                ],
                [
                  -73.984675462,
                  40.739425941
                ],
                [
                  -73.98583684,
                  40.739392774
                ],
                [
                  -73.986996902,
                  40.73944634
                ],
                [
                  -73.988144479,
                  40.739586124
                ],
                [
                  -73.989268524,
                  40.739810779
                ],
                [
                  -73.990358216,
                  40.740118143
                ],
                [
                  -73.991403063,
                  40.740505257
                ],
                [
                  -73.992393007,
                  40.740968394
                ],
                [
                  -73.993318514,
                  40.741503096
                ],
                [
                  -73.994170674,
                  40.742104215
                ],
                [
                  -73.99494128,
                  40.742765964
                ],
                [
                  -73.995622909,
                  40.74348197
                ],
                [
                  -73.996208997,
                  40.74424534
                ],
                [
                  -73.996693895,
                  40.745048724
                ],
                [
                  -73.997072933,
                  40.745884387
                ],
                [
                  -73.997342454,
                  40.74674428
                ],
                [
                  -73.99749986,
                  40.747620124
                ],
                [
                  -73.997543631,
                  40.748503485
                ],
                [
                  -73.997473341,
                  40.749385854
                ],
                [
                  -73.997289661,
                  40.750258735
                ],
                [
                  -73.996994357,
                  40.75111372
                ],
                [
                  -73.996590268,
                  40.751942574
                ],
                [
                  -73.996081284,
                  40.752737314
                ],
                [
                  -73.995472302,
                  40.753490285
                ],
                [
                  -73.994769186,
                  40.754194234
                ],
                [
                  -73.993978706,
                  40.754842379
                ],
                [
                  -73.993108475,
                  40.755428477
                ],
                [
                  -73.992166874,
                  40.755946882
                ],
                [
                  -73.991162972,
                  40.7563926
                ],
                [
                  -73.99010644,
                  40.756761336
                ],
                [
                  -73.989007456,
                  40.757049539
                ],
                [
                  -73.987876608,
                  40.757254431
                ],
                [
                  -73.986724789,
                  40.75737404
                ],
                [
                  -73.985563098,
                  40.757407211
                ],
                [
                  -73.984402726,
                  40.757353627
                ],
                [
                  -73.983254852,
                  40.757213804
                ],
                [
                  -73.982130537,
                  40.756989087
                ],
                [
                  -73.981040611,
                  40.756681644
                ],
                [
                  -73.979995574,
                  40.756294434
                ],
                [
                  -73.979005494,
                  40.75583119
                ],
                [
                  -73.978079907,
                  40.755296374
                ],
                [
                  -73.977227728,
                  40.754695137
                ],
                [
                  -73.976457165,
                  40.754033272
                ],
                [
                  -73.975775638,
                  40.753317155
                ],
                [
                  -73.975189709,
                  40.752553684
                ],
                [
                  -73.974705019,
                  40.751750213
                ],
                [
                  -73.974326231,
                  40.750914481
                ],
                [
                  -73.974056992,
                  40.750054538
                ],
                [
                  -73.973899889,
                  40.749178666
                ],
                [
                  -73.973856431,
                  40.7482953
                ]
              ]
            ]
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 65,
            "areaSquareMetres": 3138492.464
          }
        },
        "gdal": {
          "code": "# ogr2ogr buffers in whatever units the layer is already in, and these\n# are degrees, so this takes two passes. The intermediate has to be a\n# GeoPackage: GeoJSON is always longitude and latitude, and metres written\n# into it come back as invalid longitudes.\nAEQD=\"+proj=aeqd +lat_0=40.7484 +lon_0=-73.9857 +datum=WGS84 +units=m\"\n\n# 1. Reproject the point into metres.\nogr2ogr -f GPKG metres.gpkg a.geojson -t_srs \"$AEQD\" -nln pt\n\n# 2. Buffer by 1000 metres there, and come back to WGS 84 on the way out.\nogr2ogr -f GeoJSON /vsistdout/ metres.gpkg -t_srs EPSG:4326 \\\n  -dialect SQLITE -sql \"SELECT ST_Buffer(geom, 1000, 16) AS geom FROM pt\"",
          "output": {
            "type": "FeatureCollection",
            "name": "SELECT",
            "crs": {
              "type": "name",
              "properties": {
                "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
              }
            },
            "features": [
              {
                "type": "Feature",
                "properties": {},
                "geometry": {
                  "type": "Polygon",
                  "coordinates": [
                    [
                      [
                        -73.97385927762036,
                        40.74839939263463
                      ],
                      [
                        -73.97391644973541,
                        40.74751675113071
                      ],
                      [
                        -73.97408709938702,
                        40.74664262131516
                      ],
                      [
                        -73.97436957881216,
                        40.74578542104346
                      ],
                      [
                        -73.97476116360465,
                        40.74495340482346
                      ],
                      [
                        -73.97525807910547,
                        40.74415458435088
                      ],
                      [
                        -73.97585553688853,
                        40.74339665139346
                      ],
                      [
                        -73.97654778098554,
                        40.74268690376545
                      ],
                      [
                        -73.97732814340061,
                        40.742032175103134
                      ],
                      [
                        -73.97818910837695,
                        40.741438769115426
                      ],
                      [
                        -73.97912238479437,
                        40.7409123989405
                      ],
                      [
                        -73.98011898600032,
                        40.740458132189886
                      ],
                      [
                        -73.9811693163059,
                        40.74008034220692
                      ],
                      [
                        -73.98226326331584,
                        40.7397826660064
                      ],
                      [
                        -73.98339029520659,
                        40.739567969298385
                      ],
                      [
                        -73.98453956201968,
                        40.73943831893117
                      ],
                      [
                        -73.9857,
                        40.73939496301705
                      ],
                      [
                        -73.98686043798033,
                        40.73943831893117
                      ],
                      [
                        -73.9880097047934,
                        40.739567969298385
                      ],
                      [
                        -73.98913673668416,
                        40.7397826660064
                      ],
                      [
                        -73.99023068369411,
                        40.74008034220692
                      ],
                      [
                        -73.99128101399967,
                        40.740458132189886
                      ],
                      [
                        -73.99227761520564,
                        40.740912398940495
                      ],
                      [
                        -73.99321089162305,
                        40.741438769115426
                      ],
                      [
                        -73.99407185659939,
                        40.742032175103134
                      ],
                      [
                        -73.99485221901446,
                        40.74268690376545
                      ],
                      [
                        -73.99554446311146,
                        40.74339665139346
                      ],
                      [
                        -73.9961419208945,
                        40.74415458435089
                      ],
                      [
                        -73.99663883639533,
                        40.74495340482346
                      ],
                      [
                        -73.99703042118783,
                        40.74578542104346
                      ],
                      [
                        -73.99731290061297,
                        40.74664262131516
                      ],
                      [
                        -73.99748355026459,
                        40.74751675113072
                      ],
                      [
                        -73.99754072237964,
                        40.74839939263463
                      ],
                      [
                        -73.99748386187272,
                        40.749282045673475
                      ],
                      [
                        -73.9973135118543,
                        40.75015620965054
                      ],
                      [
                        -73.99703130857272,
                        40.75101346539755
                      ],
                      [
                        -73.99663996582207,
                        40.7518455562747
                      ],
                      [
                        -73.99614324895984,
                        40.752644467717325
                      ],
                      [
                        -73.99554593877859,
                        40.7534025044617
                      ],
                      [
                        -73.99485378557435,
                        40.75411236470513
                      ],
                      [
                        -73.99407345385,
                        40.75476721048357
                      ],
                      [
                        -73.99321245818295,
                        40.75536073358742
                      ],
                      [
                        -73.9922790908728,
                        40.75588721637779
                      ],
                      [
                        -73.99128234206505,
                        40.756341586915354
                      ],
                      [
                        -73.99023181312087,
                        40.75671946786835
                      ],
                      [
                        -73.98913762406907,
                        40.75701721872607
                      ],
                      [
                        -73.98801031603477,
                        40.757231970909366
                      ],
                      [
                        -73.98686074958847,
                        40.757361655438096
                      ],
                      [
                        -73.9857,
                        40.757405022887156
                      ],
                      [
                        -73.98453925041152,
                        40.757361655438096
                      ],
                      [
                        -73.98338968396523,
                        40.757231970909366
                      ],
                      [
                        -73.98226237593092,
                        40.75701721872607
                      ],
                      [
                        -73.98116818687913,
                        40.75671946786835
                      ],
                      [
                        -73.98011765793494,
                        40.75634158691535
                      ],
                      [
                        -73.97912090912719,
                        40.75588721637778
                      ],
                      [
                        -73.97818754181704,
                        40.75536073358742
                      ],
                      [
                        -73.97732654615,
                        40.75476721048357
                      ],
                      [
                        -73.97654621442564,
                        40.75411236470513
                      ],
                      [
                        -73.9758540612214,
                        40.753402504461704
                      ],
                      [
                        -73.97525675104015,
                        40.752644467717325
                      ],
                      [
                        -73.97476003417793,
                        40.7518455562747
                      ],
                      [
                        -73.97436869142729,
                        40.75101346539754
                      ],
                      [
                        -73.9740864881457,
                        40.75015620965054
                      ],
                      [
                        -73.97391613812727,
                        40.749282045673475
                      ],
                      [
                        -73.97385927762036,
                        40.74839939263463
                      ]
                    ]
                  ]
                }
              }
            ]
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 65,
            "areaSquareMetres": 3136548.484
          }
        },
        "javascript": {
          "code": "import { readFileSync } from \"node:fs\";\nimport buffer from \"@turf/buffer\";\n\nconst school = JSON.parse(readFileSync(\"a.geojson\", \"utf8\"));\n\n// Turf takes a distance and a unit and handles the conversion, which is why\n// it is the only one of the four with no projection step.\nconst ring = buffer(school, 1, { units: \"kilometers\", steps: 16 });\nring.properties = { source: school.properties.name, radius_m: 1000 };\n\nconsole.log(JSON.stringify(ring));",
          "output": {
            "type": "Feature",
            "properties": {
              "source": "PS 116 Mary Lindley Murray",
              "radius_m": 1000
            },
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    -73.97382908808817,
                    40.748399391885755
                  ],
                  [
                    -73.9738860931704,
                    40.74928088581948
                  ],
                  [
                    -73.97405687713638,
                    40.750153902001905
                  ],
                  [
                    -73.9743397995806,
                    40.75101003231226
                  ],
                  [
                    -73.9747321398034,
                    40.751841030938955
                  ],
                  [
                    -73.97523012285885,
                    40.75263889382229
                  ],
                  [
                    -73.9758289557749,
                    40.75339593577981
                  ],
                  [
                    -73.97652287360162,
                    40.75410486456968
                  ],
                  [
                    -73.97730519484855,
                    40.75475885117722
                  ],
                  [
                    -73.97816838578034,
                    40.75535159564521
                  ],
                  [
                    -73.97910413295355,
                    40.75587738781152
                  ],
                  [
                    -73.98010342329664,
                    40.756331162366905
                  ],
                  [
                    -73.9811566309612,
                    40.75670854769975
                  ],
                  [
                    -73.98225361010623,
                    40.75700590805546
                  ],
                  [
                    -73.98338379271875,
                    40.75722037860166
                  ],
                  [
                    -73.98453629052416,
                    40.75734989306013
                  ],
                  [
                    -73.9857,
                    40.75739320363724
                  ],
                  [
                    -73.98686370947584,
                    40.75734989306013
                  ],
                  [
                    -73.98801620728123,
                    40.75722037860166
                  ],
                  [
                    -73.98914638989376,
                    40.75700590805546
                  ],
                  [
                    -73.99024336903881,
                    40.75670854769975
                  ],
                  [
                    -73.99129657670335,
                    40.756331162366905
                  ],
                  [
                    -73.99229586704644,
                    40.75587738781152
                  ],
                  [
                    -73.99323161421965,
                    40.75535159564521
                  ],
                  [
                    -73.99409480515145,
                    40.75475885117722
                  ],
                  [
                    -73.99487712639838,
                    40.75410486456968
                  ],
                  [
                    -73.9955710442251,
                    40.75339593577981
                  ],
                  [
                    -73.99616987714116,
                    40.75263889382229
                  ],
                  [
                    -73.9966678601966,
                    40.751841030938955
                  ],
                  [
                    -73.99706020041938,
                    40.75101003231226
                  ],
                  [
                    -73.99734312286363,
                    40.750153902001905
                  ],
                  [
                    -73.9975139068296,
                    40.74928088581948
                  ],
                  [
                    -73.99757091191184,
                    40.748399391885755
                  ],
                  [
                    -73.99751359363046,
                    40.74751790963677
                  ],
                  [
                    -73.99734250850143,
                    40.746644928059546
                  ],
                  [
                    -73.99705930850374,
                    40.74578885394497
                  ],
                  [
                    -73.99666672500328,
                    40.74495793094509
                  ],
                  [
                    -73.99616854229502,
                    40.74416016021326
                  ],
                  [
                    -73.99556956102354,
                    40.74340322339067
                  ],
                  [
                    -73.99487555183998,
                    40.74269440867886
                  ],
                  [
                    -73.99409319974563,
                    40.7420405407085
                  ],
                  [
                    -73.99323003966126,
                    40.74144791487772
                  ],
                  [
                    -73.99229438384485,
                    40.74092223678946
                  ],
                  [
                    -73.99129524185717,
                    40.740468567369014
                  ],
                  [
                    -73.99024223384544,
                    40.74009127418769
                  ],
                  [
                    -73.98914549797806,
                    40.7397939894588
                  ],
                  [
                    -73.98801559291901,
                    40.739579575108394
                  ],
                  [
                    -73.9868633962767,
                    40.73945009525512
                  ],
                  [
                    -73.9857,
                    40.73940679636275
                  ],
                  [
                    -73.9845366037233,
                    40.73945009525512
                  ],
                  [
                    -73.98338440708099,
                    40.739579575108394
                  ],
                  [
                    -73.98225450202195,
                    40.7397939894588
                  ],
                  [
                    -73.98115776615455,
                    40.74009127418769
                  ],
                  [
                    -73.98010475814283,
                    40.740468567369014
                  ],
                  [
                    -73.97910561615515,
                    40.74092223678946
                  ],
                  [
                    -73.97816996033875,
                    40.74144791487772
                  ],
                  [
                    -73.97730680025437,
                    40.7420405407085
                  ],
                  [
                    -73.97652444816002,
                    40.74269440867886
                  ],
                  [
                    -73.97583043897646,
                    40.74340322339067
                  ],
                  [
                    -73.97523145770498,
                    40.74416016021326
                  ],
                  [
                    -73.97473327499672,
                    40.74495793094509
                  ],
                  [
                    -73.97434069149627,
                    40.74578885394497
                  ],
                  [
                    -73.97405749149856,
                    40.746644928059546
                  ],
                  [
                    -73.97388640636953,
                    40.74751790963677
                  ],
                  [
                    -73.97382908808817,
                    40.748399391885755
                  ]
                ]
              ]
            }
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 65,
            "areaSquareMetres": 3140415.812
          }
        }
      },
      "agree": [
        "gdal",
        "python"
      ],
      "differ": [
        "javascript",
        "postgis"
      ],
      "restructured": [],
      "spreadPercent": 0.1231
    },
    "clip": {
      "languages": {
        "python": {
          "code": "import json\nfrom shapely.geometry import shape, mapping\n\nline = json.load(open(\"a.geojson\"))\nboundary = json.load(open(\"b.geojson\"))\n\nclipped = shape(line[\"geometry\"]).intersection(shape(boundary[\"geometry\"]))\n\nprint(json.dumps({\n    \"type\": \"Feature\",\n    \"properties\": line[\"properties\"],\n    \"geometry\": mapping(clipped),\n}))",
          "output": {
            "type": "Feature",
            "properties": {
              "name": "Coastal Trail Connector",
              "surface": "asphalt"
            },
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  -122.485,
                  37.8199
                ],
                [
                  -122.4783,
                  37.8199
                ],
                [
                  -122.47,
                  37.8199
                ]
              ]
            }
          },
          "shape": {
            "features": 1,
            "types": [
              "LineString"
            ],
            "positions": 3,
            "lengthMetres": 1320.702
          }
        },
        "postgis": {
          "code": "-- ST_Intersection on a line and a polygon returns the part of the line\n-- inside the polygon. A line that leaves and re-enters comes back as a\n-- MultiLineString, so handle both.\nSELECT ST_AsGeoJSON(\n         ST_Intersection(\n           ST_GeomFromGeoJSON(:'a_geometry'),\n           ST_GeomFromGeoJSON(:'b_geometry')\n         )\n       );",
          "output": {
            "type": "LineString",
            "coordinates": [
              [
                -122.485,
                37.8199
              ],
              [
                -122.4783,
                37.8199
              ],
              [
                -122.47,
                37.8199
              ]
            ]
          },
          "shape": {
            "features": 1,
            "types": [
              "LineString"
            ],
            "positions": 3,
            "lengthMetres": 1320.702
          }
        },
        "gdal": {
          "code": "# -clipsrc takes the clipping geometry from a second file and keeps the\n# attributes of the layer being clipped.\nogr2ogr -f GeoJSON /vsistdout/ a.geojson -clipsrc b.geojson",
          "output": {
            "type": "FeatureCollection",
            "name": "a",
            "crs": {
              "type": "name",
              "properties": {
                "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
              }
            },
            "features": [
              {
                "type": "Feature",
                "properties": {
                  "name": "Coastal Trail Connector",
                  "surface": "asphalt"
                },
                "geometry": {
                  "type": "LineString",
                  "coordinates": [
                    [
                      -122.485,
                      37.8199
                    ],
                    [
                      -122.4783,
                      37.8199
                    ],
                    [
                      -122.47,
                      37.8199
                    ]
                  ]
                }
              }
            ]
          },
          "shape": {
            "features": 1,
            "types": [
              "LineString"
            ],
            "positions": 3,
            "lengthMetres": 1320.702
          }
        },
        "javascript": {
          "code": "import { readFileSync } from \"node:fs\";\nimport bboxClip from \"@turf/bbox-clip\";\nimport bbox from \"@turf/bbox\";\n\nconst line = JSON.parse(readFileSync(\"a.geojson\", \"utf8\"));\nconst boundary = JSON.parse(readFileSync(\"b.geojson\", \"utf8\"));\n\n// Turf has no line-on-polygon clip. bboxClip cuts to the boundary's bounding\n// box, which is the same answer only when the boundary is a rectangle. For\n// any other shape this is wrong, and the guide says so.\nconst clipped = bboxClip(line, bbox(boundary));\nclipped.properties = line.properties;\n\nconsole.log(JSON.stringify(clipped));",
          "output": {
            "type": "Feature",
            "properties": {
              "name": "Coastal Trail Connector",
              "surface": "asphalt"
            },
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  -122.485,
                  37.8199
                ],
                [
                  -122.4783,
                  37.8199
                ],
                [
                  -122.47,
                  37.8199
                ]
              ]
            }
          },
          "shape": {
            "features": 1,
            "types": [
              "LineString"
            ],
            "positions": 3,
            "lengthMetres": 1320.702
          }
        }
      },
      "agree": [
        "gdal",
        "javascript",
        "postgis",
        "python"
      ],
      "differ": [],
      "restructured": [],
      "spreadPercent": 0.0
    },
    "union": {
      "languages": {
        "python": {
          "code": "import json\nfrom shapely.geometry import shape, mapping\nfrom shapely.ops import unary_union\n\na = json.load(open(\"a.geojson\"))\nb = json.load(open(\"b.geojson\"))\n\nmerged = unary_union([shape(a[\"geometry\"]), shape(b[\"geometry\"])])\n\nprint(json.dumps({\n    \"type\": \"Feature\",\n    \"properties\": {\"parcel_ids\": f\"{a['properties']['parcel_id']},{b['properties']['parcel_id']}\"},\n    \"geometry\": mapping(merged),\n}))",
          "output": {
            "type": "Feature",
            "properties": {
              "parcel_ids": "A-1042,A-1043"
            },
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    -73.985,
                    40.748
                  ],
                  [
                    -73.987,
                    40.748
                  ],
                  [
                    -73.987,
                    40.7495
                  ],
                  [
                    -73.9855,
                    40.7495
                  ],
                  [
                    -73.9855,
                    40.7503
                  ],
                  [
                    -73.9835,
                    40.7503
                  ],
                  [
                    -73.9835,
                    40.7488
                  ],
                  [
                    -73.985,
                    40.7488
                  ],
                  [
                    -73.985,
                    40.748
                  ]
                ]
              ]
            }
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 9,
            "areaSquareMetres": 52988.334
          }
        },
        "postgis": {
          "code": "SELECT ST_AsGeoJSON(\n         ST_Union(\n           ST_GeomFromGeoJSON(:'a_geometry'),\n           ST_GeomFromGeoJSON(:'b_geometry')\n         )\n       );",
          "output": {
            "type": "Polygon",
            "coordinates": [
              [
                [
                  -73.985,
                  40.748
                ],
                [
                  -73.987,
                  40.748
                ],
                [
                  -73.987,
                  40.7495
                ],
                [
                  -73.9855,
                  40.7495
                ],
                [
                  -73.9855,
                  40.7503
                ],
                [
                  -73.9835,
                  40.7503
                ],
                [
                  -73.9835,
                  40.7488
                ],
                [
                  -73.985,
                  40.7488
                ],
                [
                  -73.985,
                  40.748
                ]
              ]
            ]
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 9,
            "areaSquareMetres": 52988.334
          }
        },
        "gdal": {
          "code": "# ogr2ogr has no union across files, so merge the two into one layer first\n# and let the SQLite dialect aggregate them.\nogr2ogr -f GeoJSON merged.geojson a.geojson -nln parcels\nogr2ogr -f GeoJSON -update -append merged.geojson b.geojson -nln parcels\n\nogr2ogr -f GeoJSON /vsistdout/ merged.geojson \\\n  -dialect SQLITE -sql \"SELECT ST_Union(geometry) AS geometry FROM parcels\"",
          "output": {
            "type": "FeatureCollection",
            "name": "parcels",
            "crs": {
              "type": "name",
              "properties": {
                "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
              }
            },
            "features": [
              {
                "type": "Feature",
                "properties": {},
                "geometry": {
                  "type": "Polygon",
                  "coordinates": [
                    [
                      [
                        -73.985,
                        40.748
                      ],
                      [
                        -73.987,
                        40.748
                      ],
                      [
                        -73.987,
                        40.7495
                      ],
                      [
                        -73.9855,
                        40.7495
                      ],
                      [
                        -73.9855,
                        40.7503
                      ],
                      [
                        -73.9835,
                        40.7503
                      ],
                      [
                        -73.9835,
                        40.7488
                      ],
                      [
                        -73.985,
                        40.7488
                      ],
                      [
                        -73.985,
                        40.748
                      ]
                    ]
                  ]
                }
              }
            ]
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 9,
            "areaSquareMetres": 52988.334
          }
        },
        "javascript": {
          "code": "import { readFileSync } from \"node:fs\";\nimport union from \"@turf/union\";\nimport { featureCollection } from \"@turf/helpers\";\n\nconst a = JSON.parse(readFileSync(\"a.geojson\", \"utf8\"));\nconst b = JSON.parse(readFileSync(\"b.geojson\", \"utf8\"));\n\nconst merged = union(featureCollection([a, b]));\nmerged.properties = {\n  parcel_ids: `${a.properties.parcel_id},${b.properties.parcel_id}`,\n};\n\nconsole.log(JSON.stringify(merged));",
          "output": {
            "type": "Feature",
            "properties": {
              "parcel_ids": "A-1042,A-1043"
            },
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    -73.987,
                    40.748
                  ],
                  [
                    -73.985,
                    40.748
                  ],
                  [
                    -73.985,
                    40.7488
                  ],
                  [
                    -73.9835,
                    40.7488
                  ],
                  [
                    -73.9835,
                    40.7503
                  ],
                  [
                    -73.9855,
                    40.7503
                  ],
                  [
                    -73.9855,
                    40.7495
                  ],
                  [
                    -73.987,
                    40.7495
                  ],
                  [
                    -73.987,
                    40.748
                  ]
                ]
              ]
            }
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 9,
            "areaSquareMetres": 52988.334
          }
        }
      },
      "agree": [
        "gdal",
        "javascript",
        "postgis",
        "python"
      ],
      "differ": [],
      "restructured": [],
      "spreadPercent": 0.0
    },
    "intersection": {
      "languages": {
        "python": {
          "code": "import json\nfrom shapely.geometry import shape, mapping\n\nflood = json.load(open(\"a.geojson\"))\nzoning = json.load(open(\"b.geojson\"))\n\noverlap = shape(flood[\"geometry\"]).intersection(shape(zoning[\"geometry\"]))\n\n# An intersection can come back empty. Check before using it.\nif overlap.is_empty:\n    raise SystemExit(\"the two areas do not overlap\")\n\nprint(json.dumps({\"type\": \"Feature\", \"properties\": {}, \"geometry\": mapping(overlap)}))",
          "output": {
            "type": "Feature",
            "properties": {},
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    -122.475,
                    37.818
                  ],
                  [
                    -122.48,
                    37.818
                  ],
                  [
                    -122.48,
                    37.821
                  ],
                  [
                    -122.475,
                    37.821
                  ],
                  [
                    -122.475,
                    37.818
                  ]
                ]
              ]
            }
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 5,
            "areaSquareMetres": 146589.601
          }
        },
        "postgis": {
          "code": "SELECT ST_AsGeoJSON(\n         ST_Intersection(\n           ST_GeomFromGeoJSON(:'a_geometry'),\n           ST_GeomFromGeoJSON(:'b_geometry')\n         )\n       );",
          "output": {
            "type": "Polygon",
            "coordinates": [
              [
                [
                  -122.475,
                  37.818
                ],
                [
                  -122.48,
                  37.818
                ],
                [
                  -122.48,
                  37.821
                ],
                [
                  -122.475,
                  37.821
                ],
                [
                  -122.475,
                  37.818
                ]
              ]
            ]
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 5,
            "areaSquareMetres": 146589.601
          }
        },
        "gdal": {
          "code": "# -clipsrc works for polygon-on-polygon too, and is shorter than the SQL.\nogr2ogr -f GeoJSON /vsistdout/ a.geojson -clipsrc b.geojson",
          "output": {
            "type": "FeatureCollection",
            "name": "a",
            "crs": {
              "type": "name",
              "properties": {
                "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
              }
            },
            "features": [
              {
                "type": "Feature",
                "properties": {
                  "zone": "AE",
                  "bfe_ft": 14
                },
                "geometry": {
                  "type": "Polygon",
                  "coordinates": [
                    [
                      [
                        -122.48,
                        37.821
                      ],
                      [
                        -122.475,
                        37.821
                      ],
                      [
                        -122.475,
                        37.818
                      ],
                      [
                        -122.48,
                        37.818
                      ],
                      [
                        -122.48,
                        37.821
                      ]
                    ]
                  ]
                }
              }
            ]
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 5,
            "areaSquareMetres": 146589.601
          }
        },
        "javascript": {
          "code": "import { readFileSync } from \"node:fs\";\nimport intersect from \"@turf/intersect\";\nimport { featureCollection } from \"@turf/helpers\";\n\nconst flood = JSON.parse(readFileSync(\"a.geojson\", \"utf8\"));\nconst zoning = JSON.parse(readFileSync(\"b.geojson\", \"utf8\"));\n\n// Returns null when the two do not overlap, so check it.\nconst overlap = intersect(featureCollection([flood, zoning]));\nif (overlap === null) throw new Error(\"the two areas do not overlap\");\n\noverlap.properties = {};\nconsole.log(JSON.stringify(overlap));",
          "output": {
            "type": "Feature",
            "properties": {},
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    -122.48,
                    37.818
                  ],
                  [
                    -122.475,
                    37.818
                  ],
                  [
                    -122.475,
                    37.821
                  ],
                  [
                    -122.48,
                    37.821
                  ],
                  [
                    -122.48,
                    37.818
                  ]
                ]
              ]
            }
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 5,
            "areaSquareMetres": 146589.601
          }
        }
      },
      "agree": [
        "gdal",
        "javascript",
        "postgis",
        "python"
      ],
      "differ": [],
      "restructured": [],
      "spreadPercent": 0.0
    },
    "difference": {
      "languages": {
        "python": {
          "code": "import json\nfrom shapely.geometry import shape, mapping\n\ndistrict = json.load(open(\"a.geojson\"))\npark = json.load(open(\"b.geojson\"))\n\nnet = shape(district[\"geometry\"]).difference(shape(park[\"geometry\"]))\n\nprint(json.dumps({\n    \"type\": \"Feature\",\n    \"properties\": {\"district\": district[\"properties\"][\"district\"]},\n    \"geometry\": mapping(net),\n}))",
          "output": {
            "type": "Feature",
            "properties": {
              "district": "Midtown South"
            },
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    -73.988,
                    40.751
                  ],
                  [
                    -73.982,
                    40.751
                  ],
                  [
                    -73.982,
                    40.747
                  ],
                  [
                    -73.988,
                    40.747
                  ],
                  [
                    -73.988,
                    40.751
                  ]
                ],
                [
                  [
                    -73.9845,
                    40.7482
                  ],
                  [
                    -73.9845,
                    40.7498
                  ],
                  [
                    -73.9865,
                    40.7498
                  ],
                  [
                    -73.9865,
                    40.7482
                  ],
                  [
                    -73.9845,
                    40.7482
                  ]
                ]
              ]
            }
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 10,
            "areaSquareMetres": 195072.529
          }
        },
        "postgis": {
          "code": "-- The order matters. A minus B is not B minus A.\nSELECT ST_AsGeoJSON(\n         ST_Difference(\n           ST_GeomFromGeoJSON(:'a_geometry'),\n           ST_GeomFromGeoJSON(:'b_geometry')\n         )\n       );",
          "output": {
            "type": "Polygon",
            "coordinates": [
              [
                [
                  -73.988,
                  40.751
                ],
                [
                  -73.982,
                  40.751
                ],
                [
                  -73.982,
                  40.747
                ],
                [
                  -73.988,
                  40.747
                ],
                [
                  -73.988,
                  40.751
                ]
              ],
              [
                [
                  -73.9845,
                  40.7482
                ],
                [
                  -73.9845,
                  40.7498
                ],
                [
                  -73.9865,
                  40.7498
                ],
                [
                  -73.9865,
                  40.7482
                ],
                [
                  -73.9845,
                  40.7482
                ]
              ]
            ]
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 10,
            "areaSquareMetres": 195072.529
          }
        },
        "gdal": {
          "code": "# GDAL 3.9 added an -erase flag. Before that, and this is the version\n# the output below came from, put both shapes in one layer and let the\n# SQLite dialect subtract one from the other.\nogr2ogr -f GeoJSON both.geojson a.geojson -nln parts \\\n  -dialect SQLITE -sql \"SELECT 'district' AS role, geometry FROM a\"\nogr2ogr -f GeoJSON -update -append both.geojson b.geojson -nln parts \\\n  -dialect SQLITE -sql \"SELECT 'park' AS role, geometry FROM b\"\n\nogr2ogr -f GeoJSON /vsistdout/ both.geojson -dialect SQLITE -sql \"\n  SELECT ST_Difference(\n           (SELECT geometry FROM parts WHERE role = 'district'),\n           (SELECT geometry FROM parts WHERE role = 'park')\n         ) AS geometry\"",
          "output": {
            "type": "FeatureCollection",
            "name": "parts",
            "crs": {
              "type": "name",
              "properties": {
                "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
              }
            },
            "features": [
              {
                "type": "Feature",
                "properties": {},
                "geometry": {
                  "type": "Polygon",
                  "coordinates": [
                    [
                      [
                        -73.988,
                        40.751
                      ],
                      [
                        -73.982,
                        40.751
                      ],
                      [
                        -73.982,
                        40.747
                      ],
                      [
                        -73.988,
                        40.747
                      ],
                      [
                        -73.988,
                        40.751
                      ]
                    ],
                    [
                      [
                        -73.9845,
                        40.7482
                      ],
                      [
                        -73.9845,
                        40.7498
                      ],
                      [
                        -73.9865,
                        40.7498
                      ],
                      [
                        -73.9865,
                        40.7482
                      ],
                      [
                        -73.9845,
                        40.7482
                      ]
                    ]
                  ]
                }
              }
            ]
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 10,
            "areaSquareMetres": 195072.529
          }
        },
        "javascript": {
          "code": "import { readFileSync } from \"node:fs\";\nimport difference from \"@turf/difference\";\nimport { featureCollection } from \"@turf/helpers\";\n\nconst district = JSON.parse(readFileSync(\"a.geojson\", \"utf8\"));\nconst park = JSON.parse(readFileSync(\"b.geojson\", \"utf8\"));\n\n// The first feature is the one being cut. Reversing them gives the park\n// minus the district, which here is empty.\nconst net = difference(featureCollection([district, park]));\nnet.properties = { district: district.properties.district };\n\nconsole.log(JSON.stringify(net));",
          "output": {
            "type": "Feature",
            "properties": {
              "district": "Midtown South"
            },
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    -73.988,
                    40.747
                  ],
                  [
                    -73.982,
                    40.747
                  ],
                  [
                    -73.982,
                    40.751
                  ],
                  [
                    -73.988,
                    40.751
                  ],
                  [
                    -73.988,
                    40.747
                  ]
                ],
                [
                  [
                    -73.9865,
                    40.7482
                  ],
                  [
                    -73.9865,
                    40.7498
                  ],
                  [
                    -73.9845,
                    40.7498
                  ],
                  [
                    -73.9845,
                    40.7482
                  ],
                  [
                    -73.9865,
                    40.7482
                  ]
                ]
              ]
            }
          },
          "shape": {
            "features": 1,
            "types": [
              "Polygon"
            ],
            "positions": 10,
            "areaSquareMetres": 195072.529
          }
        }
      },
      "agree": [
        "gdal",
        "javascript",
        "postgis",
        "python"
      ],
      "differ": [],
      "restructured": [],
      "spreadPercent": 0.0
    },
    "dissolve": {
      "languages": {
        "python": {
          "code": "import json\nimport geopandas as gpd\n\nstates = gpd.read_file(\"a.geojson\")\n\n# dissolve() groups by the column and unions each group. aggfunc controls\n# what happens to the other columns.\nregions = states.dissolve(by=\"region\", aggfunc={\"name\": \"count\"})\nregions = regions.rename(columns={\"name\": \"feature_count\"}).reset_index()\n\nprint(regions.to_json())",
          "output": {
            "type": "FeatureCollection",
            "features": [
              {
                "id": "0",
                "type": "Feature",
                "properties": {
                  "region": "East",
                  "feature_count": 1
                },
                "geometry": {
                  "type": "Polygon",
                  "coordinates": [
                    [
                      [
                        -75.0,
                        40.0
                      ],
                      [
                        -74.0,
                        40.0
                      ],
                      [
                        -74.0,
                        41.0
                      ],
                      [
                        -75.0,
                        41.0
                      ],
                      [
                        -75.0,
                        40.0
                      ]
                    ]
                  ]
                }
              },
              {
                "id": "1",
                "type": "Feature",
                "properties": {
                  "region": "West",
                  "feature_count": 3
                },
                "geometry": {
                  "type": "MultiPolygon",
                  "coordinates": [
                    [
                      [
                        [
                          -120.0,
                          40.0
                        ],
                        [
                          -120.0,
                          41.0
                        ],
                        [
                          -119.0,
                          41.0
                        ],
                        [
                          -118.0,
                          41.0
                        ],
                        [
                          -118.0,
                          40.0
                        ],
                        [
                          -119.0,
                          40.0
                        ],
                        [
                          -120.0,
                          40.0
                        ]
                      ]
                    ],
                    [
                      [
                        [
                          -115.0,
                          41.0
                        ],
                        [
                          -115.0,
                          40.0
                        ],
                        [
                          -116.0,
                          40.0
                        ],
                        [
                          -116.0,
                          41.0
                        ],
                        [
                          -115.0,
                          41.0
                        ]
                      ]
                    ]
                  ]
                }
              }
            ]
          },
          "shape": {
            "features": 2,
            "types": [
              "MultiPolygon",
              "Polygon"
            ],
            "positions": 17,
            "areaSquareMetres": 37651154982.756
          }
        },
        "postgis": {
          "code": "-- ST_Union as an aggregate over a GROUP BY is the whole operation.\nSELECT region,\n       count(*) AS feature_count,\n       ST_AsGeoJSON(ST_Union(geom)) AS geometry\nFROM states\nGROUP BY region\nORDER BY region;",
          "output": {
            "type": "FeatureCollection",
            "features": [
              {
                "type": "Feature",
                "properties": {
                  "region": "East",
                  "feature_count": 1
                },
                "geometry": {
                  "type": "Polygon",
                  "coordinates": [
                    [
                      [
                        -75,
                        40
                      ],
                      [
                        -74,
                        40
                      ],
                      [
                        -74,
                        41
                      ],
                      [
                        -75,
                        41
                      ],
                      [
                        -75,
                        40
                      ]
                    ]
                  ]
                }
              },
              {
                "type": "Feature",
                "properties": {
                  "region": "West",
                  "feature_count": 3
                },
                "geometry": {
                  "type": "MultiPolygon",
                  "coordinates": [
                    [
                      [
                        [
                          -120,
                          40
                        ],
                        [
                          -120,
                          41
                        ],
                        [
                          -119,
                          41
                        ],
                        [
                          -118,
                          41
                        ],
                        [
                          -118,
                          40
                        ],
                        [
                          -119,
                          40
                        ],
                        [
                          -120,
                          40
                        ]
                      ]
                    ],
                    [
                      [
                        [
                          -115,
                          41
                        ],
                        [
                          -115,
                          40
                        ],
                        [
                          -116,
                          40
                        ],
                        [
                          -116,
                          41
                        ],
                        [
                          -115,
                          41
                        ]
                      ]
                    ]
                  ]
                }
              }
            ]
          },
          "shape": {
            "features": 2,
            "types": [
              "MultiPolygon",
              "Polygon"
            ],
            "positions": 17,
            "areaSquareMetres": 37651154982.756
          }
        },
        "gdal": {
          "code": "# The SQLite dialect gives you ST_Union as an aggregate, so the dissolve is\n# one GROUP BY. ST_Union returns the bare geometry, so name the column\n# \"geometry\" for ogr2ogr to pick it up.\nogr2ogr -f GeoJSON /vsistdout/ a.geojson -dialect SQLITE -sql \"\n  SELECT region, COUNT(*) AS feature_count, ST_Union(geometry) AS geometry\n  FROM a GROUP BY region ORDER BY region\"",
          "output": {
            "type": "FeatureCollection",
            "name": "SELECT",
            "features": [
              {
                "type": "Feature",
                "properties": {
                  "region": "East",
                  "feature_count": 1
                },
                "geometry": {
                  "type": "Polygon",
                  "coordinates": [
                    [
                      [
                        -75.0,
                        40.0
                      ],
                      [
                        -74.0,
                        40.0
                      ],
                      [
                        -74.0,
                        41.0
                      ],
                      [
                        -75.0,
                        41.0
                      ],
                      [
                        -75.0,
                        40.0
                      ]
                    ]
                  ]
                }
              },
              {
                "type": "Feature",
                "properties": {
                  "region": "West",
                  "feature_count": 3
                },
                "geometry": {
                  "type": "MultiPolygon",
                  "coordinates": [
                    [
                      [
                        [
                          -120.0,
                          40.0
                        ],
                        [
                          -120.0,
                          41.0
                        ],
                        [
                          -119.0,
                          41.0
                        ],
                        [
                          -118.0,
                          41.0
                        ],
                        [
                          -118.0,
                          40.0
                        ],
                        [
                          -119.0,
                          40.0
                        ],
                        [
                          -120.0,
                          40.0
                        ]
                      ]
                    ],
                    [
                      [
                        [
                          -115.0,
                          41.0
                        ],
                        [
                          -115.0,
                          40.0
                        ],
                        [
                          -116.0,
                          40.0
                        ],
                        [
                          -116.0,
                          41.0
                        ],
                        [
                          -115.0,
                          41.0
                        ]
                      ]
                    ]
                  ]
                }
              }
            ]
          },
          "shape": {
            "features": 2,
            "types": [
              "MultiPolygon",
              "Polygon"
            ],
            "positions": 17,
            "areaSquareMetres": 37651154982.756
          }
        },
        "javascript": {
          "code": "import { readFileSync } from \"node:fs\";\nimport dissolve from \"@turf/dissolve\";\n\nconst states = JSON.parse(readFileSync(\"a.geojson\", \"utf8\"));\n\n// Turf's dissolve takes polygons only and keeps each merged piece as its own\n// feature, so a region in two pieces comes back as two features here where\n// the other three return one MultiPolygon.\nconst regions = dissolve(states, { propertyName: \"region\" });\n\nconsole.log(JSON.stringify(regions));",
          "output": {
            "type": "FeatureCollection",
            "features": [
              {
                "type": "Feature",
                "properties": {
                  "region": "West"
                },
                "geometry": {
                  "type": "Polygon",
                  "coordinates": [
                    [
                      [
                        -120,
                        40
                      ],
                      [
                        -118,
                        40
                      ],
                      [
                        -118,
                        41
                      ],
                      [
                        -120,
                        41
                      ],
                      [
                        -120,
                        40
                      ]
                    ]
                  ]
                }
              },
              {
                "type": "Feature",
                "properties": {
                  "region": "West"
                },
                "geometry": {
                  "type": "Polygon",
                  "coordinates": [
                    [
                      [
                        -116,
                        40
                      ],
                      [
                        -115,
                        40
                      ],
                      [
                        -115,
                        41
                      ],
                      [
                        -116,
                        41
                      ],
                      [
                        -116,
                        40
                      ]
                    ]
                  ]
                }
              },
              {
                "type": "Feature",
                "properties": {
                  "region": "East"
                },
                "geometry": {
                  "type": "Polygon",
                  "coordinates": [
                    [
                      [
                        -75,
                        40
                      ],
                      [
                        -74,
                        40
                      ],
                      [
                        -74,
                        41
                      ],
                      [
                        -75,
                        41
                      ],
                      [
                        -75,
                        40
                      ]
                    ]
                  ]
                }
              }
            ]
          },
          "shape": {
            "features": 3,
            "types": [
              "Polygon"
            ],
            "positions": 15,
            "areaSquareMetres": 37650777685.69
          }
        }
      },
      "agree": [
        "gdal",
        "javascript",
        "postgis",
        "python"
      ],
      "differ": [],
      "restructured": [
        "javascript"
      ],
      "spreadPercent": 0.001
    }
  }
}
