public static void spatial_context(IConnection con) { string wkt = "GEOGCS[\"LL-ASTRLA66-Grid\",DATUM[\"ASTRLA66-Grid\",SPHEROID[\"AUSSIE\",6378160.000,298.25000000]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]"; osgeo_command.SpatialContext.ICreateSpatialContext cscontext = con.CreateCommand(CommandType.CommandType_CreateSpatialContext) as osgeo_command.SpatialContext.ICreateSpatialContext; cscontext.CoordinateSystemWkt = wkt; cscontext.Name = "CoOrdinate"; cscontext.Extent = new byte[] { 0, 0, 0, 0 }; cscontext.Description = "Description goes here"; cscontext.XYTolerance = 0.0; cscontext.ZTolerance = 0.0; cscontext.Execute(); }
public static void spatial_context(IConnection connect1) { //create spatial context //AcMapMap currentMap = AcMapMap.GetCurrentMap(); string wkt = "GEOGCS[\"LL-ASTRLA66-Grid\",DATUM[\"ASTRLA66-Grid\",SPHEROID[\"AUSSIE\",6378160.000,298.25000000]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]"; osgeo_command.SpatialContext.ICreateSpatialContext cscontext = connect1.CreateCommand(CommandType.CommandType_CreateSpatialContext) as osgeo_command.SpatialContext.ICreateSpatialContext; cscontext.CoordinateSystemWkt = wkt; cscontext.Name = ""; cscontext.Extent = new byte[] { 0, 0, 0, 0 }; cscontext.Description = "Description goes here"; cscontext.XYTolerance = 0.0; cscontext.ZTolerance = 0.0; cscontext.Execute(); //apply schema //IApplySchema applysch = connect1.CreateCommand(CommandType.CommandType_ApplySchema) as IApplySchema; //applysch.FeatureSchema = Schema; //applysch.Execute(); }