Function esriGeometryToGeoJSON

  • Convert a single Esri-JSON geometry into a GeoJSON geometry.

    Supports Esri point ({ x, y }), multipoint ({ points }), polyline ({ paths }), polygon ({ rings }), and envelope ({ xmin, ymin, xmax, ymax }) shapes. Returns null for null/undefined input and for geometries that contain no finite coordinates (e.g. empty rings/paths).

    Parameters

    • geometry:
          | undefined
          | null
          | Record<string, unknown>
          | EsriGeometry

      Esri geometry, the geometry field of a HonuaFeature, or null/undefined.

    Returns GeoJsonGeometry | null

    The equivalent GeoJSON geometry, or null when the input is empty or unrecognized.