ОС: windows 10;
Apache, PHP7;
Мне нужно запустить функцию ОС, а именно запустить ogr2ogr для конвертации из geojson в postgis (PostgreSQL).Возможно нужно дать права apache.
var_dump(exec('"C:\Program Files\GDAL\ogr2ogr.exe" -f "PostgreSQL" -a_srs "EPSG:2249"
PG:"dbname=postgis20 user=postgres password=1" "C:\Apache24\htdocs\temp_files\file.json" -nln ABC1 -append', $output, $return));
лог
Usage: ogr2ogr [--help-general] [-skipfailures] [-append] [-update]
[-select field_list] [-where restricted_where|@filename]
[-progress] [-sql <sql statement>|@filename] [-dialect dialect]
[-preserve_fid] [-fid FID] [-limit nb_features]
[-spat xmin ymin xmax ymax] [-spat_srs srs_def] [-geomfield field]
[-a_srs srs_def] [-t_srs srs_def] [-s_srs srs_def]
[-f format_name] [-overwrite] [[-dsco NAME=VALUE] ...]
dst_datasource_name src_datasource_name
[-lco NAME=VALUE] [-nln name]
[-nlt type|PROMOTE_TO_MULTI|CONVERT_TO_LINEAR|CONVERT_TO_CURVE]
[-dim XY|XYZ|XYM|XYZM|layer_dim] [layer [layer ...]]
Advanced options :
[-gt n] [-ds_transaction]
[[-oo NAME=VALUE] ...] [[-doo NAME=VALUE] ...]
[-clipsrc [xmin ymin xmax ymax]|WKT|datasource|spat_extent]
[-clipsrcsql sql_statement] [-clipsrclayer layer]
[-clipsrcwhere expression]
[-clipdst [xmin ymin xmax ymax]|WKT|datasource]
[-clipdstsql sql_statement] [-clipdstlayer layer]
[-clipdstwhere expression]
[-wrapdateline][-datelineoffset val]
[[-simplify tolerance] | [-segmentize max_dist]]
[-addfields] [-unsetFid]
[-relaxedFieldNameMatch] [-forceNullable] [-unsetDefault]
[-fieldTypeToString All|(type1[,type2]*)] [-unsetFieldWidth]
[-mapFieldType srctype|All=dsttype[,srctype2=dsttype2]*]
[-fieldmap identity | index1[,index2]*]
[-splitlistfields] [-maxsubfields val]
[-explodecollections] [-zfield field_name]
[-gcp pixel line easting northing [elevation]]* [-order n | -tps]
[-nomd] [-mo "META-TAG=VALUE"]* [-noNativeData]
Note: ogr2ogr --long-usage for full help.
P.S из cmd эта конвертация работает!