Solved

Align dwg with arbitrary coordinates to CanQ-M8

  • 5 November 2019
  • 4 replies
  • 5 views

Badge +2

I have a dwg file (AutoCad) with apparently no coordinates system. It looks like it is using a sort of arbitrary coordinates.

I am looking for a way to Aling that drawing on a CanQ-M8 coordinates system.

I know that I will probably need to offset the coordinates, rotate the map and maybe strech or shrink the drawing to make it fit.

Is there any tools to do it ?

Attached is the dwg drawing that I want to align on the base map (also attached)

I only need the layer 41 of the dwg map.

Thank you

Mathieu.

 

icon

Best answer by daveatsafe 5 November 2019, 19:25

View original

4 replies

Userlevel 2
Badge +17

Hi @mlupien,

The AffineWarper transformer can help you out with the alignment. It will calculate an affine transformation (combination of offset, rotation and scale) to align the original DWG data with the Mapinfo base map. To use the transformer, please follow these steps:

Examine both datasets in the FME Data Inspector, and find at least four common points between the two datasets.

Enter the coordinates of these common points into Excel, or other spreadsheet app, with one point per row, in the order DWG_X, DWG_Y, Mapinfo_X, Mapinfo_Y. Save as a CSV file.

Create a new DWG to DWG workspace, with Dynamic Schema set in the Generate dialog. Set Explode Blocks to No in the Reader Parameters. Set the writer template file to be the source DWG file. This should produce a very simple workspace, with a single input and output feature type.

Add a CSV reader to the workspace, using the CSV file you created of the common points. Connect this to a VertexCreator to create a point form the DWG X and Y values. Add a second VertexCreator to add a point from the Mapinfo X and Y values. These will be your control vectors.

Connect the output from the second VertexCreator to the Control port of an Affine Warper. Connect the source DWG feature type to the Observed port, and the destination DWG feature type to the output Corrected port.

 

Badge +2

Hi @mlupien,

The AffineWarper transformer can help you out with the alignment. It will calculate an affine transformation (combination of offset, rotation and scale) to align the original DWG data with the Mapinfo base map. To use the transformer, please follow these steps:

Examine both datasets in the FME Data Inspector, and find at least four common points between the two datasets.

Enter the coordinates of these common points into Excel, or other spreadsheet app, with one point per row, in the order DWG_X, DWG_Y, Mapinfo_X, Mapinfo_Y. Save as a CSV file.

Create a new DWG to DWG workspace, with Dynamic Schema set in the Generate dialog. Set Explode Blocks to No in the Reader Parameters. Set the writer template file to be the source DWG file. This should produce a very simple workspace, with a single input and output feature type.

Add a CSV reader to the workspace, using the CSV file you created of the common points. Connect this to a VertexCreator to create a point form the DWG X and Y values. Add a second VertexCreator to add a point from the Mapinfo X and Y values. These will be your control vectors.

Connect the output from the second VertexCreator to the Control port of an Affine Warper. Connect the source DWG feature type to the Observed port, and the destination DWG feature type to the output Corrected port.

 

Wow @daveatsafe !! it is the closest I was able to get so far !!

both maps are now overlapping instead of being kilometers apart !

The only problem now is that It looks like I need a rotation of some sort.

Let me know if the way I took My 4 points is correct since I don't have any point geometries that are common, I used the FME Data Inspector option "Copy Ground coordinates" to build my CSV.

So I pin pointed 4 spots in the corners of both maps.

Here is my CSV and WorkBench. let me know what I am doing worng.

Thank you.

Mathieu.

 

VertexConverter_DWG_Mapinfo.csv

Align_sect_elect_sur_base_map.fmw

Userlevel 2
Badge +17

Wow @daveatsafe !! it is the closest I was able to get so far !!

both maps are now overlapping instead of being kilometers apart !

The only problem now is that It looks like I need a rotation of some sort.

Let me know if the way I took My 4 points is correct since I don't have any point geometries that are common, I used the FME Data Inspector option "Copy Ground coordinates" to build my CSV.

So I pin pointed 4 spots in the corners of both maps.

Here is my CSV and WorkBench. let me know what I am doing worng.

Thank you.

Mathieu.

 

VertexConverter_DWG_Mapinfo.csv

Align_sect_elect_sur_base_map.fmw

Hi @mlupien,

I have a workspace that tries to do a better job on the text and blocks:

 

m_align-sect-elect-sur-base-map.fmw

 

However, it doesn't quite get it exactly right.

I think you might have better luck using this workspace to extract the adjustment parameters, then using them to Scale, Rotate and Move within AutoCAD itself:

 

getadjustments.fmw

I suggest using the commands in the order Scale, Rotate, then Move. The base point for all three should be 0,0

Badge +2

Hi @mlupien,

The AffineWarper transformer can help you out with the alignment. It will calculate an affine transformation (combination of offset, rotation and scale) to align the original DWG data with the Mapinfo base map. To use the transformer, please follow these steps:

Examine both datasets in the FME Data Inspector, and find at least four common points between the two datasets.

Enter the coordinates of these common points into Excel, or other spreadsheet app, with one point per row, in the order DWG_X, DWG_Y, Mapinfo_X, Mapinfo_Y. Save as a CSV file.

Create a new DWG to DWG workspace, with Dynamic Schema set in the Generate dialog. Set Explode Blocks to No in the Reader Parameters. Set the writer template file to be the source DWG file. This should produce a very simple workspace, with a single input and output feature type.

Add a CSV reader to the workspace, using the CSV file you created of the common points. Connect this to a VertexCreator to create a point form the DWG X and Y values. Add a second VertexCreator to add a point from the Mapinfo X and Y values. These will be your control vectors.

Connect the output from the second VertexCreator to the Control port of an Affine Warper. Connect the source DWG feature type to the Observed port, and the destination DWG feature type to the output Corrected port.

 

Actually, your first suggestion works now !! I added a coordinate system of XY-M to my DWG reader and the drawing is almost perfectly alligned now !

Reply