Skip to main content
edited title
Link
PolyGeo
  • 65.5k
  • 29
  • 115
  • 353

Merge Merging shapefiles and savesaving them to file gdbgeodatabase using ogr2ogr?

English usage
Source Link
Vince
  • 20.5k
  • 16
  • 49
  • 65

merge Merge shapefiles and save them to file gdb using ogr2ogr

I have multiple shapefiles. whenWhen it becomes one layer (one shapefile) the volume of shapefile gets over the limit of its capacity (iI believe 4GB  ? is the limit of *.shp can have)

Therefore, I need to save them into FGDB using ogr2ogr

this is the code I came out with so far.

for %f in (*disp_line.shp) do (if not exist test.gdb (ogr2ogr -progress --config shape_encoding "UTF-8" -f "filegdb" test.gdb %f -lco encoding="UTF-8") Else (ogr2ogr --config shape_encoding "UTF-8" -progress -f "filegdb" -update -append test.gdb %f -nln test_layer -lco encoding="UTF-8"))

when I see the result.. I get two layers. enter image description here

t_sc1disp_line feture class has 20 rows and test_line has 286 rows it is supposed to be 306 rows (20+286)..

What it means is that I have to merge the layers once again using QGIS or ArcGIS GUI tools.

Could you fix my weird OGR2OGR command?? please :(

merge shapefiles and save them to file gdb using ogr2ogr

I have multiple shapefiles. when it becomes one layer (one shapefile) the volume of shapefile gets over the limit of its capacity (i believe 4GB  ? is the limit of *.shp can have)

Therefore, I need to save them into FGDB using ogr2ogr

this is the code I came out with so far.

for %f in (*disp_line.shp) do (if not exist test.gdb (ogr2ogr -progress --config shape_encoding "UTF-8" -f "filegdb" test.gdb %f -lco encoding="UTF-8") Else (ogr2ogr --config shape_encoding "UTF-8" -progress -f "filegdb" -update -append test.gdb %f -nln test_layer -lco encoding="UTF-8"))

when I see the result.. I get two layers. enter image description here

t_sc1disp_line feture class has 20 rows and test_line has 286 rows it is supposed to be 306 rows (20+286)..

What it means is that I have to merge the layers once again using QGIS or ArcGIS GUI tools.

Could you fix my weird OGR2OGR command?? please :(

Merge shapefiles and save them to file gdb using ogr2ogr

I have multiple shapefiles. When it becomes one layer (one shapefile) the volume of shapefile gets over the limit of its capacity (I believe 4GB? is the limit of *.shp can have)

Therefore, I need to save them into FGDB using ogr2ogr

this is the code I came out with so far.

for %f in (*disp_line.shp) do (if not exist test.gdb (ogr2ogr -progress --config shape_encoding "UTF-8" -f "filegdb" test.gdb %f -lco encoding="UTF-8") Else (ogr2ogr --config shape_encoding "UTF-8" -progress -f "filegdb" -update -append test.gdb %f -nln test_layer -lco encoding="UTF-8"))

when I see the result.. I get two layers. enter image description here

t_sc1disp_line feture class has 20 rows and test_line has 286 rows it is supposed to be 306 rows (20+286)..

What it means is that I have to merge the layers once again using QGIS or ArcGIS GUI tools.

Could you fix my weird OGR2OGR command?

Source Link
Pil Kwon
  • 1.1k
  • 2
  • 10
  • 24

merge shapefiles and save them to file gdb using ogr2ogr

I have multiple shapefiles. when it becomes one layer (one shapefile) the volume of shapefile gets over the limit of its capacity (i believe 4GB ? is the limit of *.shp can have)

Therefore, I need to save them into FGDB using ogr2ogr

this is the code I came out with so far.

for %f in (*disp_line.shp) do (if not exist test.gdb (ogr2ogr -progress --config shape_encoding "UTF-8" -f "filegdb" test.gdb %f -lco encoding="UTF-8") Else (ogr2ogr --config shape_encoding "UTF-8" -progress -f "filegdb" -update -append test.gdb %f -nln test_layer -lco encoding="UTF-8"))

when I see the result.. I get two layers. enter image description here

t_sc1disp_line feture class has 20 rows and test_line has 286 rows it is supposed to be 306 rows (20+286)..

What it means is that I have to merge the layers once again using QGIS or ArcGIS GUI tools.

Could you fix my weird OGR2OGR command?? please :(