jumpinjackie / fdotoolbox

A tool for working with various sources of geospatial data
GNU Lesser General Public License v2.1
27 stars 8 forks source link

Coordinate system issue copying SHP to SQL Server #5

Closed jumpinjackie closed 4 years ago

jumpinjackie commented 9 years ago

The following SHP files here could not be copied to SQL Server

http://www3.stats.govt.nz/digitalboundaries/annual/ESRI_Shapefile_Digital_Boundaries_2015_Generalised_Clipped.zip

The error log for the bulk copy operation shows:

------- EXCEPTION #1 -------
FdoToolbox.Core.FdoETLException: Failed to create pipeline GED: Error creating spatial context SCGeometry, coordinate system catalog does not contain entry for WKT 'PROJCS["NZGD_2000_New_Zealand_Transverse_Mercator",GEOGCS["GCS_NZGD_2000",DATUM["D_NZGD_2000",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",1600000.0],PARAMETER["False_Northing",10000000.0],PARAMETER["Central_Meridian",173.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]'  ---> OSGeo.FDO.Common.Exception: Error creating spatial context SCGeometry, coordinate system catalog does not contain entry for WKT 'PROJCS["NZGD_2000_New_Zealand_Transverse_Mercator",GEOGCS["GCS_NZGD_2000",DATUM["D_NZGD_2000",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",1600000.0],PARAMETER["False_Northing",10000000.0],PARAMETER["Central_Meridian",173.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]' 
   at OSGeo.FDO.Commands.SpatialContext.ICreateSpatialContextImp.Execute()
   at FdoToolbox.Core.Feature.FdoFeatureService.CreateSpatialContext(SpatialContextInfo ctx, Boolean updateExisting)
   at FdoToolbox.Core.ETL.Overrides.MsSqlCopySpatialContextOverride.Execute(ICollection`1 spatialContexts, FdoConnection target, Boolean overwrite)
   at FdoToolbox.Core.Utility.ExpressUtility.CopyAllSpatialContexts(ICollection`1 spatialContexts, FdoConnection target, Boolean overwrite)
   at FdoToolbox.Core.ETL.Specialized.FdoClassToClassCopyProcess.PreClassCopyModifyOperation.Execute(IEnumerable`1 rows)
   at FdoToolbox.Core.ETL.Pipelines.BasePipelineExecuter.PipelineToEnumerable(ICollection`1 pipeline, IEnumerable`1 rows)
   at FdoToolbox.Core.ETL.Pipelines.BasePipelineExecuter.Execute(String pipelineName, ICollection`1 pipeline)
   --- End of inner exception stack trace ---
------- EXCEPTION END -------
------- EXCEPTION #2 -------
FdoToolbox.Core.FdoETLException: Failed to create pipeline MED: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at FdoToolbox.Core.ETL.Specialized.FdoClassToClassCopyProcess.PreClassCopyModifyOperation.Execute(IEnumerable`1 rows)
   at FdoToolbox.Core.ETL.Pipelines.BasePipelineExecuter.PipelineToEnumerable(ICollection`1 pipeline, IEnumerable`1 rows)
   at FdoToolbox.Core.ETL.Pipelines.BasePipelineExecuter.Execute(String pipelineName, ICollection`1 pipeline)
   --- End of inner exception stack trace ---
------- EXCEPTION END -------
jumpinjackie commented 9 years ago

Something that may also be affecting it is that I was copying to a multi-schema SQL Server

jumpinjackie commented 4 years ago

Fixed with recently added spatial context override support in bulk copy