-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(arcgis): overhaul of arcgis connector and converter patterns to enable data extraction #439
refactor(arcgis): overhaul of arcgis connector and converter patterns to enable data extraction #439
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## arcgis_refactor #439 +/- ##
===============================================
Coverage 9.43% 9.43%
===============================================
Files 223 223
Lines 4208 4208
Branches 487 487
===============================================
Hits 397 397
Misses 3795 3795
Partials 16 16 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Few change requests
- Mostly questions
@clairekuang happy to do live PR review together over my comments
} | ||
|
||
return gisLayer; | ||
parentCollection.elements.Add(collection); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like we pass parentCollection
to just add it at the end of function. I would put it outside and rename function CreateAddMapMemberCollection
for single responsibilty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -16,14 +16,12 @@ | |||
<Compile Include="$(MSBuildThisFileDirectory)HostApp\CSiSendCollectionManager.cs" /> | |||
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\CSiRootObjectBuilder.cs" /> | |||
<Compile Include="$(MSBuildThisFileDirectory)Plugin\CSiPluginBase.cs" /> | |||
<Compile Include="$(MSBuildThisFileDirectory)Plugin\SpeckleFormBase.cs"> | |||
<SubType>Form</SubType> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, why removed underlying Form? maybe missing context here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will remove all csi related changes
@@ -0,0 +1,21 @@ | |||
namespace Speckle.Converters.ArcGIS3.Extensions; | |||
|
|||
public static class SpeckleApplicationIdExtensions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like these classes over host apps which application ids are mystery
@@ -8,17 +8,14 @@ public class GeometryToHostConverter : ITypedConverter<IReadOnlyList<Base>, ACG. | |||
{ | |||
private readonly ITypedConverter<List<SOG.Polyline>, ACG.Polyline> _polylineConverter; | |||
private readonly ITypedConverter<List<SOG.Point>, ACG.Multipoint> _multipointConverter; | |||
private readonly ITypedConverter<List<SOG.Polygon>, ACG.Polygon> _polygonConverter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity what is the difference Polygon and Polyline apart from isClosed
prop
break; | ||
|
||
default: | ||
yield break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we log?
|
||
for (int i = 0; i < points.Count; i++) | ||
{ | ||
if (i >= 2 && (i + 1) % 3 == 0) // every 3 new points is a new triangle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar thoughts as above comment
} | ||
|
||
private SOG.Mesh GetMeshFromTriangleFanPatch(List<ACG.MapPoint> points) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to know what are they and from what to what
we are trying to convert. mostly it is a question for @KatKatKateryna. could you document these scenarios on figma by giving some examples with shapes or real scenarios?
GeometryEngine.Instance.Project(target, _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference) | ||
is not MapPoint reprojectedPt | ||
ACG.GeometryEngine.Instance.Project(target, _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference) | ||
is not ACG.MapPoint reprojectedPt | ||
) | ||
{ | ||
throw new ValidationException( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i know this was pre-existing but curious what is the ValidationException
, don't we suppose to use some conversion typed exceptions
Dictionary<string, object?> properties = _propertiesExtractor.GetProperties(target); | ||
|
||
// get application id. test for subtypes before defaulting to base type. | ||
string applicationId = target is ACD.Row row |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conditions a bit confusing but...
{ | ||
if (target["attributes"] is Base attributes) | ||
if (target["fields"] is Dictionary<string, string> attributes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we attach properties to collections in arcgis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, some applications like arcgis and navis have meaningful properties on collections (not just objects) - we don't have a convention for handling this, could be some DataCollection: Collection (IDataCollection:IProperties)
class in the future
…up-arcgis-to-enable-data-workflows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Color Proxies are sending wrong colors for some objects: https://latest.speckle.systems/projects/2af60ce1b6/models/f537cf39e4@cc67e77a17
and https://latest.speckle.systems/projects/2af60ce1b6/models/f537cf39e4@ccff19500a
["name"] = sr.Name, | ||
["unit"] = sr.Unit.Name, | ||
["centralMeridian"] = sr.CentralMeridian, | ||
["wkt"] = sr.Wkt, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Authority ID ("Wkid" property) seems to be removed, and I believe should be added back (it's a universal identifier of the coordinate system, and will always exist unless the user created a custom CRS)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at the same time, CentralMeridian doesn't seem to be that important
* registed layer unpacker * nested layers logic moved to layerUnpacker * killed VectorLayerConverter * exposed Feature converter and Attributes in RootObjBuilder * send clean GisObject * refactor Rasters and PointClouds * send everything through 1 converter * proper object type * clean GIS objects and conversions * better layer names on Receive * fix raster position on send * switching to GIS layer, removing native geometry type checks (but keeping field check) * fix revit materials on child objects * remove IGisFeature interface * typo * remove empty converter * switch from attributes to properties * add required keyword * required attribute fix * attach dynamic "geometry" field to converted Polygons * refactor(arcgis): overhaul of arcgis connector and converter patterns to enable data extraction (#439) * rework 1 * additional restructuring of root object builder and converters * finalizes classes and patterns for converter and connector * fixes build errors * Update ArcGISHostObjectBuilder.cs * fixes some polygon conversions * refactor color manager to separate color unpacker * Delete GISLayerGeometryType.cs * disables receive * pr review issues * Update ArcGISRootObjectBuilder.cs * Update ArcGISRootObjectBuilder.cs * Update ArcGISRootObjectBuilder.cs * Update ArcGISRootObjectBuilder.cs * fixed color bugs * Update ArcGISLayerUnpacker.cs * don't cache repeated layers * Revert "don't cache repeated layers" This reverts commit 48af025. * remove flattened layers from root commit builder * Revert "remove flattened layers from root commit builder" This reverts commit e0e7b1f. * layer order and duplication fixed * fix applicationIds * fix raster appId * yield; add comment * move appId to extensions --------- Co-authored-by: Claire Kuang <[email protected]>
Description & motivation
This pr is a big refactor of the arcgis connector to enable data extraction workflows (sending
ArcgisObject: IDataObject
). It includes the following changes to align arcgis with all other data extractor patterns:CoreObjectBase
type are now passed to the singleTopLevelConverter
. Previously, this was a mixture of objevcts and layersLasDatasetLayer
s were passed to the converter. These are now passing individual points to the converter, instead of sending the layer as a pointcloudDisplayValueExtractor
andPropertiesExtractor
classes added to the converter to assist in object creation in the top level converter.ColorUnpacker
class added to connector to handle color proxy creation during mapmember iterationSome async logic was refactored in the connector to improve safety.
Some poor conversion logic in the converters was removed to improve performance.
Reduced complexity in root object builder, removed pragma warning disable.
Note: receive needs an equally large refactor to handle
DataObject
s only. This pr will disable the receive binding until that refactor is completed. Metrics from qgis v2 show that sending is much more common than receiving (~2500 incidents vs 220). Arcgis currently has 1 MAU.Changes:
To-do before merge:
Screenshots:
In arcgis file:
With this pr:
https://latest.speckle.systems/projects/2295cb26a0/models/874439f06c
Validation of changes:
Tested sending the sample arcgis file. Note: our pro license does not include 3d extensions, meaning I couldn't test point clouds.