2

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.

  • Have you tried EPSG:102646? spatialreference.org/ref/esri/… – evv_gis Nov 13 '14 at 20:46
  • @ew_gis - Yes, I tried that as well, and it didn't work. – Get Spatial Nov 13 '14 at 21:05
  • Based on prior experiences, I strongly suspect the problem is in the literal name string. I note ArcGIS calls 2230 "NAD_1983_StatePlane_California_VI_FIPS_0406_Feet" per above, but EPSG calls it "[NAD83 / California zone 6 (ftUS)]"(spatialreference.org/ref/epsg/2230/html). Arc has given me trouble in the past where I was using the "same" projection, but in one case it was named with a dash and in the other that same character was an underscore - Arc said hey, these aren't the same thing ERROR. You might check this by looking at the properties of your import that worked outside the FD. – Chris W Nov 13 '14 at 23:34
  • @ChrisW - What is odd though, is that if I create the layer outside the feature dataset and do the t_srs transformation to 2230, it is able to do it with no problem. If you look in properties, it assigns the same spatial reference as the feature dataset is using. I am wondering though, if some parameter is slightly different in the feature dataset that is causing it to fail. – Get Spatial Nov 13 '14 at 23:38
  • Maybe vertical coordinate system issue not just horizontal? Can you move/copy the feature class that was successfully written outside the FD into it? – Chris W Nov 13 '14 at 23:53

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.