code: def test_json_overwrite(tmpdir):
      """Overwrite an existing GeoJSON file"""
      path = str(tmpdir.join("foo.json"))
  
      driver = "GeoJSON"
      schema1 = {
          "geometry": "Unknown",
          "properties": [("title", "str")],
      }
      schema2 = {
          "geometry": "Unknown",
          "properties": [("other", "str")],
      }
  
      features1 = [
          Feature.from_dict(
              **{
                  "geometry": {
                      "type": "Point",
                      "coordinates": [0.0, 0.0],
                  },
                  "properties": {"title": "One"},
              }
          ),
          Feature.from_dict(
              **{
                  "geometry": {
                      "type": "MultiPoint",
                      "coordinates": [[0.0, 0.0]],
                  },
                  "properties": {"title": "Two"},
              }
          ),
      ]
      features2 = [
          Feature.from_dict(
              **{
                  "geometry": {
                      "type": "Point",
                      "coordinates": [0.0, 0.0],
                  },
                  "properties": {"other": "Three"},
              }
          ),
      ]
  
      # write some data to a file
      with fiona.open(path, "w", driver=driver, schema=schema1) as c:
          c.writerecords(features1)
  
      # test the data was written correctly
      with fiona.open(path, "r") as c:
          assert len(c) == 2
          feature = next(iter(c))
          assert feature.properties["title"] == "One"
  
      # attempt to overwrite the existing file with some new data
      with fiona.open(path, "w", driver=driver, schema=schema2) as c:
          c.writerecords(features2)
  
      # test the second file was written correctly
      with fiona.open(path, "r") as c:
          assert len(c) == 1
          feature = next(iter(c))
          assert feature.properties["other"] == "Three"
  
file_path: Fiona/tests/test_geojson.py
imports: import json
  import pytest
  import fiona
  from fiona.collection import supported_drivers
  from fiona.errors import FionaValueError, DriverError, SchemaError, CRSError
  from fiona.model import Feature
label_desc: Use image node_id 3 for calling a global function with example usage: test_json_overwrite(tmpdir) without return types