Skip to main content
added 7 characters in body
Source Link
Pil Kwon
  • 1.1k
  • 2
  • 9
  • 23

I have a quite many feature classes in a filegdb and they all have same data schema (same field names and etc).

I wanted to apply a single sqlite query and I am having hard time to make a loop command

ogr2ogr -f "filegdb" -a_srs epsg:3857 -dialect sqlite -sql "select scalecoords(geometry,0.0000000002), field1, field2, field3 from "FEATURE_CLASSES_WITHIN_A_FILEGDB" "inputGDB_Dir" "outputGDB_Dir"

what I did was simply applying

For /D /R %g in (*.gdbinputGDB_Dir) do ogr2ogr -f "filegdb" -a_srs epsg:3857 -dialect sqlite -sql "select scalecoords(geometry,0.0000000002), field1, field2, field3 from "FEATURE_CLASSES_WITHIN_A_FILEGDB" "inputGDB_Dir"field3" "inputGDB_Dir %g" "outputGDB_Dir"

and obviously, it does not work. I would like to know how to make a loop command using OGR2OGR

I have a quite many feature classes in a filegdb and they all have same data schema (same field names and etc).

I wanted to apply a single sqlite query and I am having hard time to make a loop command

ogr2ogr -f "filegdb" -a_srs epsg:3857 -dialect sqlite -sql "select scalecoords(geometry,0.0000000002), field1, field2, field3 from "FEATURE_CLASSES_WITHIN_A_FILEGDB" "inputGDB_Dir" "outputGDB_Dir"

what I did was simply applying

For /D /R %g in (*.gdb) do ogr2ogr -f "filegdb" -a_srs epsg:3857 -dialect sqlite -sql "select scalecoords(geometry,0.0000000002), field1, field2, field3 from "FEATURE_CLASSES_WITHIN_A_FILEGDB" "inputGDB_Dir" "outputGDB_Dir"

and obviously, it does not work. I would like to know how to make a loop command using OGR2OGR

I have a quite many feature classes in a filegdb and they all have same data schema (same field names and etc).

I wanted to apply a single sqlite query and I am having hard time to make a loop command

ogr2ogr -f "filegdb" -a_srs epsg:3857 -dialect sqlite -sql "select scalecoords(geometry,0.0000000002), field1, field2, field3 from "FEATURE_CLASSES_WITHIN_A_FILEGDB" "inputGDB_Dir" "outputGDB_Dir"

what I did was simply applying

For /R %g in (inputGDB_Dir) do ogr2ogr -f "filegdb" -a_srs epsg:3857 -dialect sqlite -sql "select scalecoords(geometry,0.0000000002), field1, field2, field3" "inputGDB_Dir %g" "outputGDB_Dir"

and obviously, it does not work. I would like to know how to make a loop command using OGR2OGR

Source Link
Pil Kwon
  • 1.1k
  • 2
  • 9
  • 23

ogr2ogr apply sqlite dialect to multiple feature classes within a fgdb

I have a quite many feature classes in a filegdb and they all have same data schema (same field names and etc).

I wanted to apply a single sqlite query and I am having hard time to make a loop command

ogr2ogr -f "filegdb" -a_srs epsg:3857 -dialect sqlite -sql "select scalecoords(geometry,0.0000000002), field1, field2, field3 from "FEATURE_CLASSES_WITHIN_A_FILEGDB" "inputGDB_Dir" "outputGDB_Dir"

what I did was simply applying

For /D /R %g in (*.gdb) do ogr2ogr -f "filegdb" -a_srs epsg:3857 -dialect sqlite -sql "select scalecoords(geometry,0.0000000002), field1, field2, field3 from "FEATURE_CLASSES_WITHIN_A_FILEGDB" "inputGDB_Dir" "outputGDB_Dir"

and obviously, it does not work. I would like to know how to make a loop command using OGR2OGR