public IEnumerator GeometryVisionGetsCreatedWithoutFactory( [ValueSource(typeof(TestUtilities), nameof(TestUtilities.GetSimpleTestScenePathsForEntities))] string scenePath) { TestUtilities.SetupScene(scenePath); for (int i = 0; i < 50; i++) { yield return null; } var geoVision = Instantiate(new GameObject("geoVision")); geoVision.transform.position = new Vector3(0f, 0f, -6f); geoVision.AddComponent<GeometryVision>(); var geometryVisionComponent = geoVision.GetComponent<GeometryVision>(); geometryVisionComponent.GameObjectBasedProcessing.Value = true; geometryVisionComponent.EntityProcessing.Value = true; yield return null; int amountOfObjectsInScene = 0; IGeoProcessor processor = geoVision.GetComponent<GeometryVision>().Runner.GetProcessor<GeometryVisionProcessor>(); IGeoProcessor processorEntities = geoVision.GetComponent<GeometryVision>().Runner .GetProcessor<GeometryVisionEntityProcessor>(); amountOfObjectsInScene = processor.CountSceneObjects(); yield return null; Assert.True(amountOfObjectsInScene > 0); amountOfObjectsInScene = processorEntities.CountSceneObjects(); Assert.True(amountOfObjectsInScene > 0); }
public IEnumerator GeometryVisionGetsCreatedWithFactory( [ValueSource(typeof(TestUtilities), nameof(TestUtilities.GetSimpleTestScenePathsForEntities))] string scenePath) { TestUtilities.SetupScene(scenePath); for (int i = 0; i < 50; i++) { yield return null; } var geoVision = TestUtilities.SetupGeoVision(new Vector3(0f, 0f, -6f), new GeometryVisionFactory(factorySettings)); yield return null; int amountOfObjectsInScene = 0; IGeoProcessor processor = geoVision.GetComponent<GeometryVision>().Runner.GetProcessor<GeometryVisionProcessor>(); IGeoProcessor processorEntities = geoVision.GetComponent<GeometryVision>().Runner .GetProcessor<GeometryVisionEntityProcessor>(); amountOfObjectsInScene = processor.CountSceneObjects(); yield return null; Assert.True(amountOfObjectsInScene > 0); amountOfObjectsInScene = processorEntities.CountSceneObjects(); Assert.True(amountOfObjectsInScene > 0); }
public void refreshCatalog(string path) { IGPUtilities2 gpUtl = new GPUtilitiesClass() as IGPUtilities2; IGeoProcessor gp = getGP(); IGPDataType nm = new GPDateTypeClass(); object dt = ""; IDataElement dtE = gp.GetDataElement(path, ref dt); gpUtl.RefreshCatalog(dtE); }
public void addToolBox(IGeoProcessor gp, string path) { try { gp.AddToolbox(path); } catch (Exception e) { Console.WriteLine(e.ToString()); } }
public IGpEnumList listDatasetsFGDB(IGeoProcessor iGeoProcessor) { try { // List all TIFF files in the workspace and build pyramids. iGeoProcessor.SetEnvironmentValue("workspace", @"E:\gisdata\FM\GIS\mewasco\datasource\MERU.gdb"); IGpEnumList datasets = iGeoProcessor.ListDatasets("*", "All"); return datasets; } catch (Exception) { throw; } }
public IGpEnumList listDatasets(IGeoProcessor iGeoProcessor) { try { // List all TIFF files in the workspace and build pyramids. iGeoProcessor.SetEnvironmentValue("workspace", getSetIWorkspace.ToString()); IGpEnumList datasets = iGeoProcessor.ListDatasets("*", "Feature"); return datasets; } catch (Exception ex) { throw ex; } }
public bool deleteGeoDatabase(string dbPath) { bool x = true; try { IGeoProcessor gp = getGP(); gp.OverwriteOutput = true; param.RemoveAll(); param.Add(dbPath); IGeoProcessorResult rslt = gp.Execute("Delete_management", param, null); Console.WriteLine(getMessages(rslt)); } catch (Exception e) { x = false; Console.WriteLine("Error: " + e.ToString()); } return(x); }
public string createNewRasterDataset(string geoDatabase, string name, string cellSize, string pixelType, string coordSystem, string bands, string keywords, string pyramids, string tileSize, string compression, string pyramidRefPoint) { IGeoProcessor gp = getGP(); gp.OverwriteOutput = true; param.RemoveAll(); param.Add(geoDatabase); param.Add(name); param.Add(cellSize); param.Add(pixelType); param.Add(coordSystem); param.Add(bands); param.Add(keywords); param.Add(pyramids); param.Add(tileSize); param.Add(compression); param.Add(pyramidRefPoint); IGeoProcessorResult rslt = gp.Execute("createraster_management", param, null); string x = getMessages(rslt); return(x); }
public void addToolBox(IGeoProcessor gp, string path) { try { gp.AddToolbox(path); } catch(Exception e) { Console.WriteLine(e.ToString()); } }
public void listFeatureClasses(IGeoProcessor iGeoProcessor) { // List all feature classes in the workspace starting with d. iGeoProcessor.SetEnvironmentValue("workspace", @"C:\Uc2003\Portland_OR.gdb"); IGpEnumList fcs = iGeoProcessor.ListFeatureClasses("d*", "", ""); string fc = fcs.Next(); while (fc != "") { Console.WriteLine(fc); fc = fcs.Next(); } }
public IGpEnumList listFeatureClassesFGDB(IGeoProcessor iGeoProcessor,string dataset) { try { // List all feature classes in the workspace starting with d. iGeoProcessor.SetEnvironmentValue("workspace", @"E:\gisdata\FM\GIS\mewasco\datasource\MERU.gdb"); IGpEnumList fcs = iGeoProcessor.ListFeatureClasses("*", "", dataset); return fcs; } catch (Exception) { throw; } }
public void removeToolBox(string path) { IGeoProcessor gp = getGP(); gp.RemoveToolbox(path); }