Answer the question
In order to leave comments, you need to log in
php exec function?
OS: windows 10;
Apache, PHP7;
I need to run an OS function, namely run ogr2ogr to convert from geojson to postgis (PostgreSQL). Maybe I need to give apache permissions.
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]
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.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question