[][src]Function spatialite_sys::load_shapefile_ex

pub unsafe extern "C" fn load_shapefile_ex(
    sqlite: *mut sqlite3,
    shp_path: *mut c_char,
    table: *mut c_char,
    charset: *mut c_char,
    srid: c_int,
    geo_column: *mut c_char,
    gtype: *mut c_char,
    pk_column: *mut c_char,
    coerce2d: c_int,
    compressed: c_int,
    verbose: c_int,
    spatial_index: c_int,
    rows: *mut c_int,
    err_msg: *mut c_char
) -> c_int

Loads an external Shapefile into a newly created table

\param sqlite handle to current DB connection \param shp_path pathname of the Shapefile to be imported (no suffix) \param table the name of the table to be created \param charset a valid GNU ICONV charset to be used for DBF text strings \param srid the SRID to be set for Geometries \param geo_column the name of the geometry column \param gtype expected to be one of: "LINESTRING", "LINESTRINGZ", "LINESTRINGM", "LINESTRINGZM", "MULTILINESTRING", "MULTILINESTRINGZ", "MULTILINESTRINGM", "MULTILINESTRINGZM", "POLYGON", "POLYGONZ", "POLYGONM", "POLYGONZM", "MULTIPOLYGON", "MULTIPOLYGONZ", "MULTIPOLYGONM", "MULTIPOLYGONZM" or "AUTO". \param pk_column name of the Primary Key column; if NULL or mismatching then "PK_UID" will be assumed by default. \param coerce2d if TRUE any Geometry will be casted to 2D [XY] \param compressed if TRUE compressed Geometries will be created \param verbose if TRUE a short report is shown on stderr \param spatial_index if TRUE an R*Tree Spatial Index will be created \param rows on completion will contain the total number of imported rows \param err_msg on completion will contain an error message (if any)

\return 0 on failure, any other value on success

\sa load_shapefile, load_shapefile_ex2

\note the Shapefile format doesn't supports any distinction between LINESTRINGs and MULTILINESTRINGs, or between POLYGONs and MULTIPOLYGONs; as does not allows to clearly distinguish if the M-measure is required. \n So a first preliminary scan of the Shapefile is required in order to correctly identify the actual payload (gtype = "AUTO", default case). \n By explicitly specifying some expected geometry type this first scan will be skipped at all thus introducing a noticeable performance gain. \n Anyway, declaring a mismatching geometry type will surely cause a failure.