Skip to content

Commit

Permalink
save GIS incoming SpatialReference to ContextStack; delete Revit orig…
Browse files Browse the repository at this point in the history
…in implementation for now
  • Loading branch information
KatKatKateryna committed Jun 25, 2024
1 parent 8cc400c commit c110112
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ CancellationToken cancellationToken
// Prompt the UI conversion started. Progress bar will swoosh.
onOperationProgressed?.Invoke("Converting", null);

// Receive geo-located data in the correct place
// 1. From Revit
CRSorigin? dataOrigin = CRSorigin.FromRevitData(rootObject);
// Browse for any trace of geolocation in non-GIS apps (e.g. Revit: implemented, Blender: todo on Blender side, Civil3d: ?)
CRSorigin? dataOrigin = null; // e.g. CRSorigin.FromRevitData(rootObject);

// save SpatialReference, use it for dataset writing
// save SpatialReference (overwrite default Map.SpatialRef), use it for dataset writing
if (dataOrigin is CRSorigin crsOrigin)
{
SpatialReference incomingSpatialRef = crsOrigin.CreateCustomCRS();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public FeatureClass Convert(VectorLayer target)
wktString = target.crs.wkt.ToString();
}
ACG.SpatialReference spatialRef = ACG.SpatialReferenceBuilder.CreateSpatialReference(wktString);
_contextStack.Current.Document.IncomingSpatialReference = spatialRef;

// create Fields
List<FieldDescription> fields = _fieldsUtils.GetFieldsFromSpeckleLayer(target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public CRSorigin(double latDegrees, double lonDegrees)

public static CRSorigin? FromRevitData(Base rootObject)
{
// rewrite function to take into account Local reference point in Revit, and Transformation matrix
foreach (KeyValuePair<string, object?> prop in rootObject.GetMembers(DynamicBaseMemberType.Dynamic))
{
if (prop.Key == "info")
Expand Down

0 comments on commit c110112

Please sign in to comment.