At 10, you can customize flex viewer to show photos taken with Windows Mobile application that are stored in raster field. If you need sample code feel free to let me know.
At 10, you can customize flex viewer to show photos taken with Windows Mobile application that are stored in raster field. If you need sample code feel free to let me know.
I�??d like to know is there any way we can load the jpg file to the Raster field in a feature class programmatically by using SQL script or .NET or the SDK...
using ESRI.ArcGIS.esriSystem; using ESRI.ArcGIS.Geodatabase; using ESRI.ArcGIS; using ESRI.ArcGIS.Carto; ... public byte[] GetRasterFieldAsJpg(int objectID, string featureClassName, string rasterFieldName) { #region ArcObjects License Initialization... RuntimeManager.Bind(ProductCode.Server); //** Check server license IAoInitialize aoInitialize = new AoInitializeClass(); if (aoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcServer) != esriLicenseStatus.esriLicenseCheckedOut) return null; //** License error #endregion #region Open the workspace and the feature class... // Create the workspace factory and instantiate the workspace. IPropertySet propertySet = new PropertySetClass(); propertySet.SetProperty("SERVER", "192.168.1.1"); //** DataBase server propertySet.SetProperty("INSTANCE", "sde:oracle11g:DBName"); propertySet.SetProperty("DATABASE", "DBName"); propertySet.SetProperty("USER", "username"); propertySet.SetProperty("PASSWORD", "password"); propertySet.SetProperty("VERSION", "SDE.DEFAULT"); Type workspaceFactoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory"); IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(workspaceFactoryType); IWorkspace workspace = workspaceFactory.Open(propertySet, 0); // Use the IFeatureWorkspace interface to open the workspace's feature class. IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)workspace; IFeatureClass featureClass = featureWorkspace.OpenFeatureClass("SchemaName." + featureClassName); #endregion #region Get the raster field as a JPG IFeature feature = featureClass.GetFeature(objectID); if (feature != null) { IRasterValue rasterValue = feature.get_Value(featureClass.FindField(rasterFieldName)) as IRasterValue; if (rasterValue == null) return null; IRaster raster = ((IRasterValue)feature.get_Value(featureClass.FindField(rasterFieldName))).Raster as IRaster; IRasterExporter rasterExporter = new RasterExporter(); return rasterExporter.ExportToBytes(raster, "JPG"); } return null; #endregion }
I am having partial success with using feature class attachments for photos in ArcPad 10.2 with a Trimble Geo 7X and it's built in camera. I have to access the attachment table in ArcCatalog and insert "RASTER" as the Default CONTENT_TYPE field and insert a value e.g. 15 as the Default DATA_SIZE field. I check the data out via Trimble Positions tools and move to device. Open ArcPad on device, start editing on the feature class with attachment, select a feature and open the Feature Properties window, click on the feature Attachment tab, add attachment record, click on the camera button in this window, take picture, save edits exit ArcPad, check data back into the geodatabase via Trimble Positions, in ArcMap, use the Identify button and click on the feature which I create an attachment record for in ArcMap, it is now listed but not accessible. It is like the image never gets imported into the geodatabase as an attachment.
If you don't put the Default values in as described, ArcPad will error out when taking the picture on the device. Any ideas on how to make this process work? Thanks.
This was a discussion about ArcGIS for Windows Mobile, and this is a complete different product than ArcPad.
So maybe you will be more succeeded in the right community.