I am trying to use ogr2ogr to convert a layer from PostGIS to a FileGDB. I want the layer to be created inside a Feature Dataset.
The spatial reference of the source layer is EPSG:3500. The spatial reference of the Feature Dataset within the FileGDB is as follows, copied from the properties page:
NAD_1983_StatePlane_California_VI_FIPS_0406_Feet WKID: 2230 Authority: EPSG Projection: Lambert_Conformal_Conic False_Easting: 6561666.666666666 False_Northing: 1640416.666666667 Central_Meridian: -116.25 Standard_Parallel_1: 32.78333333333333 Standard_Parallel_2: 33.88333333333333 Latitude_Of_Origin: 32.16666666666666 Linear Unit: Foot_US (0.3048006096012192) Geographic Coordinate System: GCS_North_American_1983 Angular Unit: Degree (0.0174532925199433) Prime Meridian: Greenwich (0.0) Datum: D_North_American_1983 Spheroid: GRS_1980 Semimajor Axis: 6378137.0 Semiminor Axis: 6356752.314140356 Inverse Flattening: 298.257222101
My assumption is that the WKID: 2230 with Authority: EPSG, means that this should be spatial reference EPSG:2230
I think the tricky part here is that the spatial reference is already determined with the Feature Dataset. I've seen errors rise before when trying to designate a spatial reference where the output is a Feature Dataset.
Given the above, I thought the best step would be to simply try to convert to
EPSG:2230 without specifying the output spatial reference. This resulted in an error.
Here is a sample command string and result:
ogr2ogr -overwrite -of "FileGDB" c:\fgdbData.gdb PG:"host=server port=5432 dbname=ib_data active_schema=ibcommunitydev user=gis_admin password=xxxx" cdpo_zoning -t_srs "EPSG:2230" -lco FEATURE_DATASET=fdCommunityDev ERROR 1: Error: Failed at creating table for \fdCommunityDev\cdpo_zoning (Invalid spatial reference.)
I tried a number of different combinations , including specifying the source spatial reference as
EPSG:2230 and letting it do a straight transformation, but nothing working. They all returned the same invalid spatial reference error.
I tried using the same source layer and exporting to the File GDB outside of the Feature Dataset using the following command string, and it worked fine.
This string has to contain the variable
-nlt MULTIPOLYGON, otherwise the table is imported as a non-spatial layer.
ogr2ogr -overwrite -f "FileGDB" c:\fgdbData.gdb PG:"host=server port=5432 dbname=ib_data active_schema=ibcommunitydev user=gis_admin password=xxxx" cdpo_zoning -t_srs "EPSG:2230" -nlt MULTIPOLYGON
The fact that the transformation to the spatial reference worked, leads me to believe it is an issue with the spatial reference of the Feature Dataset.