POST
|
Mike Thanks, and hope you're thriving. I've been working on this all day, and now have some things working. The processing is all straight Python/arcpy, and all the scripts used to work in 100.6 and still work in Pro 2.7. Between 100.6 and 100.9 Local Server has become much more picky about parameter passing. Things which worked when, for example, a boolean was passed back as a string now no longer work, but screwing down the parameters types has got me past that for some of my gpkx. The other areas which appear to have changed, and I'm still trying to find work-rounds are: The handling of the Scratch area. This works in Pro, but local server sets up its own temporary scratch areas. I used to get at those using %scratchFolder% which seems not to work any more. arcypy ListFeatureClasses() and ListTables() with no parameters seem to cause crashes (although the docn says they should work), and don't return what I'd expect when used to get, for example, feature_type='feature'. This may be down to the setting of arcpy.env.workspace not working as it used to, as that would definitely screw up those methods, but that's a problem for tomorrow. Would you prefer to move this onto e-mail, then we can put up a roundup of what we find for posterity? You might even like to put something about Geoprocessing in Local Server in the documentation....(hint, hint) Chris BB
... View more
02-02-2021
09:35 AM
|
0
|
0
|
865
|
POST
|
Hi, I have a set of Geoprocessing Packages, authored in Python in Pro 2.3 which work well with Local Server 100.6. They fail (fatal crash) when run under 100.9 (which I want to upgrade to, and use Runtime 100.10, if I can). I re-packaged the Geoprocessing tools in Pro 2.7, using both 'All version' and 2.6, which is the version advertised as being compatible with Local Server 100.9, without success in either case. Searching Release Notes for 100.8 and 100.9 don't yield any breaking changes. I have found no sensible error messages in the logs. VS 2019 reports: !message:socexit:{"error":"Worker process 'catalogfgdb_worker' exited while attempting to service request (attempt 1 of 1): endpoint='GPServer' headers={} params={jobId=j2a76b89b0beb4917a3819b76426d14ad, toolName=CatalogFGDB} res='' post=0 Crash dump path=","name":"catalogfgdb","processId":-1}. Attempting to put some logging into the Python (which works in Arc Pro) creates the log file but writes nothing into it before the package crashes. Anyone out there have any experience in updating gpkx to later versions of Local Server? Do I need to downgrade to a previous version of Pro to repackage them, and if so, which version? Or am I missing something obvious? Many thanks Chris BB
... View more
02-01-2021
09:39 AM
|
0
|
3
|
890
|
POST
|
Prashant That's very useful. I can work with that. Perhaps a more useful error message in a future build? Chris
... View more
05-30-2018
01:05 AM
|
0
|
0
|
860
|
POST
|
Prashant Many thanks. I’ll stop beating my head against it until 2.2 comes out. As a work-around, is there any way of specifying the Pyramid layer that the Raster is to use? If so I could use set the Extent and then use PixelBlocks to pull out the pixels at the resolution I need. As a side note, are you aware that if you try to export (SaveAs) the raster using JPG rather than TIFF the call returns a ‘Feature has empty geometry’ error? Chris
... View more
04-25-2018
08:07 AM
|
0
|
6
|
860
|
POST
|
I'm trying to export (SaveAs) a raster as a TIFF. Exporting the whole raster works. Setting the (geographic) extent and exporting works. But setting the Width and Height before exporting only sets teh Height. This is called from a button AddIn: System.Uri uri = new Uri("e:\\ESRI_GDB\\Southampton.gdb"); QueuedTask.Run(() => { FileGeodatabaseConnectionPath path = new FileGeodatabaseConnectionPath(uri); Geodatabase gdb = new Geodatabase(path); RasterDataset rasterDataset = gdb.OpenDataset<RasterDataset>("Raster_250"); Raster raster = rasterDataset.CreateFullRaster(); SpatialReference spatialReference = SpatialReferenceBuilder.CreateSpatialReference(27700); raster.SetSpatialReference(spatialReference); Envelope ext = EnvelopeBuilder.CreateEnvelope(400000, 100000, 450000, 150000, spatialReference); // select an area int W = raster.GetWidth(); // original raster is 4040 columns int H = raster.GetHeight(); // 3880 rows raster.SetWidth(500); // try to set the size of the output raster raster.SetHeight(500); W = raster.GetWidth(); // still 4040 columns H = raster.GetHeight(); // correct at 500 rows raster.SetExtent(ext); // select teh geographic area of interest FileSystemConnectionPath connectionPath = new FileSystemConnectionPath(new System.Uri(@"C:\Dummy"), FileSystemDatastoreType.Raster); FileSystemDatastore dataStore = new FileSystemDatastore(connectionPath); RasterStorageDef rasterStorageDef = new RasterStorageDef(); rasterStorageDef.SetPyramidLevel(0); // don't want pyramids raster.SaveAs("bbtest.tif", dataStore, "TIFF", rasterStorageDef); // creates long thin distorted raster of the correct geographic area }); I'm obviously doing something wrong because setting teh raster Width is so simple it shouldn't fail, but I can't for the life of me see what I'm doing wrong. Can anyone help? Thanks in advance Chris
... View more
04-23-2018
08:38 AM
|
0
|
8
|
1080
|
POST
|
Can anyone give me the syntax for loading a GeoPackage in Runtime 100 .NET? The only sample on GiTHub is in Java 10.2 and had a GeoPackage class which seems not to exist any longer. Code such as: String path = "e:\\GeoPackage\\SU.gpkg"; var gdb = await Geodatabase.OpenAsync(path); foreach (var table in gdb.GeodatabaseFeatureTables.ToList()) { var layer = new FeatureLayer { Id = table.TableName, FeatureTable = table }; _map.OperationalLayers.Add(layer); } yields an empty list of tables so no layers are created, and I can't get an error from OpenAsync to find out what is going wrong. Many thanks Chris
... View more
01-20-2017
05:03 AM
|
0
|
0
|
512
|
POST
|
Only some were copied. I now have a complete set and I can create a blank MapView in a dialog. However, I can't create a Map or a Raster as I would expect using code like this (using namespace Esri::ArcGISRuntime) Mapping::Map^ myMap = gcnew Mapping::Map(Mapping::Basemap::CreateStreets()); Globals::gwcMapView->Map = myMap; or Globals::myRaster = gcnew Rasters::Raster("E:\\Raw_Mapping\\Tif\\rgb\\Brisbane_Raster_250_RGB.tif"); Mapping::RasterLayer^ rasterLayer = gcnew Mapping::RasterLayer(Globals::myRaster); In both cases the error is this (in the Map case) 1>BBTest_MFCDlg.cpp(59): error C3252: 'RuntimeCoreNet::GeneratedWrappers::CoreWrapperBase::Finalize': cannot reduce accessibility of a virtual method in a managed type 1> BBTest_MFCDlg.cpp(59): note: This diagnostic occurred while importing type 'RuntimeCoreNet::GeneratedWrappers::CoreWrapperBase ' from assembly 'Esri.ArcGISRuntime, Version=100.0.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86'. 1> BBTest_MFCDlg.cpp(59): note: This diagnostic occurred while importing type 'RuntimeCoreNet::GeneratedWrappers::CoreMap ' from assembly 'Esri.ArcGISRuntime, Version=100.0.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86'. 1> BBTest_MFCDlg.cpp(59): note: This diagnostic occurred while importing type 'Esri::ArcGISRuntime::Mapping::Map ' from assembly 'Esri.ArcGISRuntime, Version=100.0.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86'. Searching the web for error C3252 doesn't help, and the Map (and Raster) are public so shouldn't throw this error. Any clues as to how to proceed?
... View more
12-22-2016
08:24 AM
|
0
|
4
|
1007
|
POST
|
One can normally host a WPF control in MFC using teh Interop described in like http://weblogs.thinktecture.com/cnagel/2010/04/mfc-and-wpf-interop.html. When I try this I get an exception in RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase. It appears that the .NET Runtime assumes there is some XAML to initialise the control. Has anyone successfully hosted a Runtime MapView in an MFC application? Code snippet: HWND GetHwnd(HWND parent, int x, int y, int width, int height) { System::Windows::Interop::HwndSourceParameters^ sourceParams = gcnew System::Windows::Interop::HwndSourceParameters("MFCWPFApp"); sourceParams->PositionX = x; sourceParams->PositionY = y; sourceParams->Height = height; sourceParams->Width = width; sourceParams->ParentWindow = IntPtr(parent); sourceParams->WindowStyle = WS_VISIBLE | WS_CHILD; Globals::gHwndSource = gcnew System::Windows::Interop::HwndSource(*sourceParams); Globals::gwcMapView = gcnew Esri::ArcGISRuntime::UI::Controls::MapView; // Fails here with // Additional information : The type initializer for 'RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase' threw an exception. FrameworkElement^ myPage = Globals::gwcMapView; Globals::gHwndSource->RootVisual = myPage; return (HWND)Globals::gHwndSource->Handle.ToPointer(); }
... View more
12-20-2016
07:30 AM
|
0
|
6
|
2502
|
POST
|
Hi, I need to create older version File GDB within my ArcObjects code. I know I could do it in Python but that isn't an option. I can't find any help on passing a parameter to the Create method, presumably via the IPropertySet parameter. The current code looks like this: HRESULT hr; CComPtr<IWorkspaceFactory> pWkspFact; hr = pWkspFact.CoCreateInstance(CLSID_FileGDBWorkspaceFactory); CComPtr<IWorkspaceName> pWSName; hr = pWkspFact->Create((bstr_t)theApp.GetSystemPrefs()->GetUser().GetGeoprocessingDir(), (bstr_t)sName, NULL /* IPropertySet*/, NULL, &pWSName); I'd like to pass Version="9.3" or similar, the out_version parameter of CreateFileGDB_management tool Thanks in advance Chris BB
... View more
10-01-2015
04:38 AM
|
0
|
0
|
2283
|
POST
|
I'm loading rasters into a file geodatabase in Engine code. Some of them need reprojecting so I'm trying the following code:
// I have an IRaster pointed to by pRaster and a required ISpatialReference pointed to by pSpatialRef
VARIANT vMissing;
vMissing.vt = VT_ERROR;
vMissing.scode = DISP_E_PARAMNOTFOUND;
// Create a RasterTransformionOp to do the re-projection
CComPtr<ITransformationOp> pTransform;
hr = pTransform.CoCreateInstance(CLSID_RasterTransformationOp);
// get the IGeoDataset of the original Raster
CComPtr<IGeoDataset> pInGeoDataset;
hr = pRaster.QueryInterface(&pInGeoDataset);
// Project it into the new Spatial Reference
CComPtr<IGeoDataset> pOutGeoDataset;
hr = pTransform->ProjectFast(pInGeoDataset, pSpatialRef, esriGeoAnalysisResampleCubic, &vMissing, &pOutGeoDataset);
// Get the resulting RasterDataset
CComPtr<IRasterDataset> pReprojRasterDataset;
hr = pOutGeoDataset.QueryInterface(&pReprojRasterDataset);
// Get the reprojected raster from the new dataset
CComPtr<IRaster> pReprojRaster;
hr = pReprojRasterDataset->CreateDefaultRaster(&pReprojRaster);
// Load it into the existing File Geodatabase
hr = pRasterLoader->Load(pRasterDataset, pReprojRaster);
However, the resultant raster isn't reprojected. Any clues as to what I am mis-understanding? Chris
... View more
09-10-2010
06:16 AM
|
0
|
1
|
867
|
Online Status |
Offline
|
Date Last Visited |
2 weeks ago
|