I used ogr2ogr to convert shapefiles to fgdb feature classes. I have like 10 of shapefiles so I imported the folder (input as a folder directory) and converted to FGDB This is the code I used

ogr2ogr -progress -overwrite -f "FileGDB" $HOME/MyData/Output.gdb "$HOME/MyData/MyShapefiles/";

ogrinfo $HOME/MyData/Output.gdb seems like I have all the layers that I want to convert

However, check out the screenshot below. This is the original shapefile

enter image description here

This is the one in Geodatabase enter image description here

something has changed and I overlayed the two layers enter image description here

Is this a bug? or is this centOS's issue??

  • Looks like a spatial reference selection error. Please Edit the question to specify both the coordinate system (.prj) and spatial reference parameters used in the target feature class. – Vince Jun 25 '18 at 3:09
  • 1
    Esri geodatabases have a concept of resolution / tolerance. These "won't effect any OGR operations, but they will by used by ArcGIS" (OGR FileGDB docs). I wonder if these parameters are a significant factor here. – Mike T Jun 25 '18 at 4:00

Yes, it is because of setting the projection.

The original Shapefile comes without .prj and that is the reason why. I added the epsg and now seems fine.

Sorry for the trouble. this is the code I used

ogr2ogr -progress -overwrite -s_srs EPSG:**** -t_srs EPSG:**** -f "FileGDB" $HOME/MyData/Output.gdb "$HOME/MyData/MyShapefiles/"

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.