I am importing kmz into postgres

$ogrCommand = 'ogr2ogr -f "PostgreSQL" -a_srs "EPSG:4326" PG:"host='.env("DB_HOST").' port='.env("DB_PORT").' user='.env("DB_USERNAME").' dbname='.env("DB_DATABASE").' password='.env("DB_PASSWORD").'" -append '.$absFilePath.' -nln '.$schema_table.' -sql "SELECT *,'.$proj_id.' AS project_id,\''.$dbFileName.'\' AS filename,\''.$this->generateRandomFileCode().'\' AS filecode FROM '.$fileName.'"; echo $?';

I need to get feature class name from ogrinfo filename currently, I am getting this using below command

ogrinfo SampleOperationArea_v2.kmz

INFO: Open of SampleOperationArea_v2.kmz

using driver `LIBKML' successful.

1: SampleOperationArea

I just needed SampleOperationArea name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.