geoimport
    Preparing search index...

    Function fromGeoJSON

    • Convert a GeoJSON FeatureCollection to another vector format.

      This is a wrapper around 'ogr2ogr'.

      Parameters

      • layer: FeatureCollection

        The GeoJSON FeatureCollection to convert.

      • layerName: string

        The name of the layer to create.

      • format: SupportedVectorFormat

        The format to convert to (among the following values: 'TopoJSON', 'ESRI Shapefile', 'KML', 'GML', 'GPKG', 'GPX' and 'FlatGeoBuf').

      • Optionalcrs: string = 'EPSG:4326'

        The coordinate reference system to use for the output file (can be a EPSG code, a PROJ string or a WKT string).

      Returns Promise<string | File>

      The resulting layer, either as a String for textual formats (TopoJSON, KML, GML and GPX) or as a File for binary formats (ESRI Shapefile, GPKG, FlatGeobuf).

      • If the format is not supported or if there is an error while creating resulting file.