POST
|
Hello, We are exporting kml/kmz to be read in ArcGIS Earth. This same kml worked for Google Earth, so my question is, "Does AE support the Schema and schemaData tags? When we click on a feature we receive the message. "This is an invalid xsi:type 'kmlSchema'". <.............snip..................> <kml:Schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="kmlSchema" name="" id="data_schema"> <kml:SimpleField type="string" name="storage_s"> <kml:displayName>storage_s</kml:displayName> </kml:SimpleField> <kml:SimpleField type="string" name="type"> <kml:displayName>type</kml:displayName> </kml:SimpleField> ..... </kml:Schema> ....... <kml:ExtendedData> <kml:SchemaData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="kmlSchemaData" schemaUrl="#data_schema"> <kml:SimpleData name="storage_s">PRIMARY</kml:SimpleData> <kml:SimpleData name="type">document</kml:SimpleData> <..................snip................> Thanks, -Bill
... View more
09-20-2023
12:19 PM
|
0
|
1
|
305
|
POST
|
Wishful thinking. As ancient and limited as shapefiles are, they will never go away. ❤️
... View more
05-19-2023
06:31 PM
|
1
|
0
|
584
|
BLOG
|
Is there a planned enhancement to support collada models for 3D multipatch models in the near future.
... View more
04-13-2023
12:02 AM
|
0
|
0
|
86
|
POST
|
Hello, I would expect the Projection Engine to transform Z. It appears not to. I have an input vertical coordinate system with international feet [FOOT .3048] and an output of WGS84 meters [METER 1.0]. Here is some sample code, and the Z is not changed after the transform. private static int PackGeometry( int layer_index, Feature feature, bool modify, bool selectable, bool editable) { Geometry geom = feature.GetShape(); if (geom == null) return -1; // Reserve space for count - backfill with actual count at end. int num_bytes = 0; int start_offset = _offset; _offset += sizeof(int); // Everything goes to SOCET GXP as WGS84/ellipsoid. SfaLayer layer = SfaSettings.Layers[layer_index]; // internal class Geometry projected_geom = null; if (layer.SpatialRef.HasVcs) { // input of layer spatial ref is feet, output Util.GeoCS is WGS84 meters. // Z = 5908.123 ProjectionTransformation proj_trans = ProjectionTransformation.CreateWithVertical(layer.SpatialRef, Util.GeoCS); projected_geom = GeometryEngine.Instance.ProjectEx(geom, proj_trans); // Z still = 5908.123 } else { projected_geom = GeometryEngine.Instance.Project(geom, Util.GeoCS); } if (projected_geom == null) return -1;
... View more
11-15-2022
01:48 AM
|
1
|
1
|
468
|
POST
|
While this is nice to have a time analysis function in AE, it shouldn't be the default. This is an old ESRI dataset that I have used for testing for years. I forgot there was even a date-time attribute in the data. The user should have to setup which attribute they want time analysis done on. I'm sure some Product Owner was excited about introducing the feature and it may be buried in a release note, but myself and a member of my test team wasted a couple of days tracing down how we broke our KML output. It is not intuitive for a normal user. Now do we put a release note out about exporting to AE? Frustrated.
... View more
09-07-2022
09:16 AM
|
0
|
0
|
428
|
POST
|
This KML used to draw in ArcGIS Earth, but not anymore. I can see it in Google Earth, so I believe the KML is well formed. For the RoadL layer, one feature out of 43 does draw. (strange) If I click on the feature it will highlight, and the attribute dots appear if I turn on the attribute layer, so they are there. The properties shows the line width as 2 which mean it should draw. I'm attaching the KML and a couple of screen shots. I am really puzzled by this one. Any suggestions are greatly appreciated.e
... View more
09-01-2022
11:48 AM
|
2
|
3
|
506
|
POST
|
I'm not sure what happened, but I just added a bunch more logging statements, rebuilt, and the stupid thing worked. I'm sure I will have future posts when we re-arch to get this working with ArcGIS Pro 3.0
... View more
07-20-2022
09:29 PM
|
2
|
0
|
2061
|
POST
|
Thanks Wolf, I usually have that exception on and nothing is being thrown. It did step over all of my code to send the features though. Let me be clear that we didn't change anything except for rebuilding. Name and location of dll is the same. Our apps are talking to each other via RPC. No exceptions being thrown. I can paste the code below for the heck of it, but I don't think we need to worry about this right now since we have a workaround. What we are doing is updating all Z's that aren't valid from our DTM. They are updating just not being sent back to us, since we changed some logic to "smartly refresh" graphics. LOL. We have a button in ArcGISPro that sends them all over with brute force and that works. I think we will hold off this issue for now and soon start working on making changes to work with ArcGIS Pro 3.0. A little birdy told me that all Addins are going to break in that version. I really appreciate having 2 senior developers weighing in on this. Thanks Charles and Wolf!! Anyways, here is the method that just steps to the end in the debugger. All formatting is gone and everything is left justified. LOL. public void SendFeatureGraphics( Coordinate2D ll, Coordinate2D ur, bool xform = false, int index = -1) { QueuedTask.Run(() => { MapView mapview = MapView.Active; if (mapview == null) { SfaLogger.Log("Unable to send feature graphics - mapview is null."); return; } SfaSettings.FeaturesRequested = false; // processing request int command = SfaConstants.API_SFA_DRAW_GRAPHICS; int select = 0; int data_len = 0; bool features_sent = false; int total_features_sent = 0; Envelope extent = EnvelopeBuilder.CreateEnvelope(ll, ur, (xform) ? GeoCS : MapCS); if (xform) { extent = GeometryEngine.Instance.Project(extent, MapCS) as Envelope; } CIMMap map = mapview.Map.GetDefinition(); ClippingMode clipping_mode = map.ClippingMode; string clip_uri_str = map.CustomClippingShapeURI; string[] layers_excluded = map.LayersExcludedFromClipping; Polygon clip_poly = null; if (clipping_mode.Equals(ClippingMode.CustomShape)) { try { // find the clipping custom shape file in the temporary directory for now string temp_directory = Path.GetTempPath(); string clip_folder_path = clip_uri_str.Substring(clip_uri_str.IndexOf("=") + 1); string[] sub_directories = Directory.GetDirectories(temp_directory); string full_file_path = ""; foreach (string sub_folder in sub_directories) { if (File.Exists((sub_folder + "\\" + clip_folder_path))) { full_file_path = sub_folder + "\\" + clip_folder_path; } } if (full_file_path.Length != 0) { byte[] buffer = File.ReadAllBytes(full_file_path); EsriShapeImportFlags importFlags = EsriShapeImportFlags.esriShapeImportDefaults; clip_poly = GeometryEngine.Instance.ImportFromEsriShape(importFlags, buffer, SpatialReferences.WGS84) as Polygon; } } catch (Exception ex) { SfaLogger.Log(ex.Message); } } else if (clipping_mode.Equals(ClippingMode.MapExtent)) { // get the custom extent from the Map Extent clip_poly = PolygonBuilder.CreatePolygon(mapview.Map.GetCustomFullExtent()); } Polygon sgxp_polygon = PolygonBuilder.CreatePolygon(extent); Polygon polygon_intersection = sgxp_polygon; // only send feature that are within the intersect regions if (clip_poly != null && sgxp_polygon != null) { // check to see if the clipping extent in Pro intersects with // the extent in SGXP if (!GeometryEngine.Instance.Intersects(sgxp_polygon, clip_poly)) { return; } // get the intersecting extent where the custom extent // and SGXP intersect polygon_intersection = GeometryEngine.Instance.Intersection(sgxp_polygon, clip_poly) as Polygon; if (polygon_intersection == null) { return; } } IEnumerable<FeatureLayer> layers = mapview.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>(); foreach (FeatureLayer fl in layers) { using (FeatureClass fc = fl.GetFeatureClass()) { // Test for valid layer index int layer_index = GetSfaLayerIndex(fc); if (layer_index < 0) continue; if (index >= 0 && layer_index != index) continue; SfaLayer layer = SfaSettings.Layers[layer_index]; layer.IsVisible = fl.IsVisible; layer.IsDrawn = fl.IsVisible; if (!layer.IsDrawn) { SfaLogger.Log( "Skipping feature graphics for layer: " + layer.Name); continue; } bool selectable = fl.IsSelectable; bool editable = fl.IsEditable; SpatialQueryFilter spatial_filter = new SpatialQueryFilter(); spatial_filter.FilterGeometry = polygon_intersection; spatial_filter.SpatialRelationship = SpatialRelationship.Intersects; if (!clipping_mode.Equals(ClippingMode.None)) { foreach (string lay in layers_excluded) { // if layer is excluded, send all features for that layer if (lay == fl.URI) { spatial_filter.FilterGeometry = sgxp_polygon; } } } List<int> features_to_send = new List<int>(); List<int> features_already_present = new List<int>(); using (RowCursor rows = fl.Search(spatial_filter)) { int i = 1; do { int reserve = 3 * sizeof(int); SfaBuffer.BeginFeatureBlock(true, true, reserve); try { while (rows.MoveNext()) { using (Feature feature = rows.Current as Feature) { int feature_id = (int)feature.GetObjectID(); if (layer.FeaturesSent.Contains(feature_id)) { features_already_present.Add(feature_id); continue; } features_to_send.Add(feature_id); if (!layer.HasSymbol) { layer.LookupSymbol(feature); } SfaBuffer.PackFeature( layer_index, feature, true, editable, selectable); feature.Dispose(); } if (SfaBuffer.DataLength > (SfaBuffer.GetBuffer().Length - SfaConstants.BUFFER_CUSHION)) { // We are close to filling the buffer, send what we have. //rows.Current.Dispose(); break; } } } catch (Exception e) { SfaLogger.Log("Exception occured: " + e.Message); } if (SfaBuffer.NumFeatures > 0) { features_sent = true; total_features_sent += SfaBuffer.NumFeatures; SfaBuffer.EndFeatureBlock(); int ftr_data_len = SfaBuffer.DataLength; // We reserved space at the beginning of the buffer for these. SfaBuffer.PrependBuffer(BitConverter.GetBytes(command), sizeof(int)); SfaBuffer.PrependBuffer(BitConverter.GetBytes(select), sizeof(int)); SfaBuffer.PrependBuffer(BitConverter.GetBytes(ftr_data_len), sizeof(int)); data_len = ftr_data_len + reserve; if (SfaSettings.FeaturesRequested) { // If a new reload request is made, need to stop this request SfaLogger.Log("Starting new feature refresh query"); return; } SendMessage(SfaBuffer.GetBuffer(), data_len); } i++; } while (rows.Current != null); foreach (var ftr_id in features_to_send) { SfaSettings.Layers[layer_index].FeaturesSent.Add(ftr_id); } } } } if (!features_sent) { // Inform SOCET GXP that refresh graphics is finished. Needed // when nothing is sent in order to reset a flag in SOCET GXP. SfaLogger.Log("There were no features to send for current extent."); select = 99; ResetBuffer(); AppendBuffer(BitConverter.GetBytes(command), sizeof(int)); AppendBuffer(BitConverter.GetBytes(select), sizeof(int)); AppendBuffer(BitConverter.GetBytes(data_len), sizeof(int)); SendMessage(_buf, _buf_pos); } else { Dictionary<MapMember, List<long>> selection = mapview.Map.GetSelection(); // Preserve any selections in the ArcMap canvas if (selection.Count > 0) { Thread.Sleep(500); //07-21-2022 BillSmith - this looks suspect, why are we sleeping? SendSelection(mapview.Map.GetSelection()); } } }); }
... View more
07-20-2022
09:02 PM
|
0
|
1
|
2062
|
POST
|
Thanks Charles, I did try that and it does eliminate the warning messages, but it still didn't work. I am on 2.9.3, so this change was made at 2.8 I see. I will give it another look tomorrow though and check out the sdk FAQ. Thanks!
... View more
07-18-2022
08:02 PM
|
0
|
0
|
2133
|
POST
|
Hello, I have a toolbar Addin which stopped working once we moved from Visual Studio 2017 to VS 2019. It basically sends all features over to another photogrammetry software package for editing and then sends them back. After I rebuilt it, it stopped sending over features. I'm trying to debug it, but was wondering if anyone else has had this issue. The output from the build is below. The target was AnyCPU, which caused the first 4 warnings. I changed it to 64 bit, which eliminated those warnings, but to no avail. It still doesn't work. Rebuild started... 1>------ Rebuild All started: Project: SfaProClient, Configuration: Debug Any CPU ------ 1> Clean Addin... 1> Execute RegisterAddIn.exe "{97281cd9-589c-421b-8106-95484b67c7b7}" /u... 1>C:\TrustedApps\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "ArcGIS.Desktop.Catalog", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. 1>C:\TrustedApps\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "ArcGIS.Desktop.Core", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. 1>C:\TrustedApps\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "ArcGIS.Desktop.Framework", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. 1>C:\TrustedApps\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "ArcGIS.Desktop.GeoProcessing", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. 1>C:\TrustedApps\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "ArcGIS.Desktop.Mapping", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. 1> SfaProClient -> V:\Repos\socetgxp\BuildOut\Config\Esri\SfaProClient.dll 1> ZipIntermediatePath Name: obj\Debug\temp_archive\... 1> IntermediateOutputPath Name: obj\Debug\... 1> CleanFile Name: SfaProClient.csproj.FileListAbsolute.txt... 1> ProjectDir Name: V:\Repos\socetgxp\tap_source\CscSrc\SfaCap\SfaProClient\... 1> AssemblyName Name: SfaProClient... 1> TargetFileName Name: SfaProClient.dll... 1> RootNamespace: SfaProClient... 1> TargetFolder Name: ..\..\..\..\BuildOut\Config\Esri\... 1> PackageType Name: Addin... 1> Install dir: C:\Program Files\ArcGIS\Pro\ 1> RelativePaths: SfaProClient.dll 1> RelativePaths: SfaProClient.pdb 1> ConvertToRelativePath Task, TargetDir: V:\Repos\socetgxp\BuildOut\Config\Esri\ 1> Deploying Addin... 1> ArcGISFolder Name: C:\Program Files\ArcGIS\Pro\... 1> Execute RegisterAddIn.exe "V:\Repos\socetgxp\BuildOut\Config\Esri\SfaProClient.esriAddinX" /s... ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ========== Thanks in advance, -Bill
... View more
07-18-2022
03:19 PM
|
2
|
7
|
2195
|
POST
|
That s a great catch. Thank you. I think I have seen this problem before with the projection engine casting to the wrong types but didn't catch it.
... View more
05-24-2022
12:01 AM
|
0
|
0
|
600
|
POST
|
Yes, We are doing something very similar when setting the Shape attribute. Coordinate3D pt; pt.X = BitConverter.ToDouble(data, offset); offset += sizeof(double); pt.Y = BitConverter.ToDouble(data, offset); offset += sizeof(double); pt.Z = BitConverter.ToDouble(data, offset); MapPointBuilder builder = new MapPointBuilder(pt, _sfa_util.GeoCS); builder.HasZ = layer.HasZ; builder.HasM = layer.HasM; if (builder.HasM) { builder.M = 0.0; } MapPoint geom = builder.ToGeometry() as MapPoint; Coordinate3D projected_geom; if (layer.SpatialRef.HasVcs) { ProjectionTransformation proj_trans = ProjectionTransformation.CreateWithVertical(_sfa_util.GeoCS, layer.SpatialRef); projected_geom = (Coordinate3D)GeometryEngine.Instance.ProjectEx(geom, proj_trans); } else { projected_geom = (Coordinate3D)GeometryEngine.Instance.Project(geom, layer.SpatialRef); } layer.map_point = geom; attributes[layer.GeomField] = projected_geom; It returns true and the exact same point is sent into ArcGIS Desktop, via another plugin, which works fine. The same code is called for lines and polygons and they draw fine. Thanks anyways.
... View more
05-21-2022
05:44 AM
|
0
|
2
|
623
|
POST
|
This code is being executed and it returns true. The new point feature says it has been added and you can see it in the attribute table. Yet it won't draw or jump to the point like any others that were added in ArcGIS Pro directory. Any ideas? Thanks, -Bill Code snippet. var edit_op = new EditOperation(); edit_op.Name = $"Create {layer.Name}"; edit_op.SelectNewFeatures = true; edit_op.Create(layer.FeatureLayer, attributes); bool result = edit_op.Execute(); SfaLogger.Log("Return from insert operation is: " + result.ToString()); BTW: I have something very similar in ArcGIS Desktop using ArcObject code and the same point inserts and is drawn fine in ArcMap. The point coming into the API from our software is identical in both cases.
... View more
05-17-2022
11:12 PM
|
2
|
4
|
853
|
Title | Kudos | Posted |
---|---|---|
1 | 05-19-2023 06:31 PM | |
1 | 11-15-2022 01:48 AM | |
2 | 09-01-2022 11:48 AM | |
2 | 07-20-2022 09:29 PM | |
2 | 07-18-2022 03:19 PM |
Online Status |
Offline
|
Date Last Visited |
12-21-2023
09:01 AM
|