Subscribe to this thread
Home - General / All posts - assign a coordinate system
cassini107 post(s)
#21-Oct-25 14:23

Hello everyone,

I would like to assign the same coordinate system to a folder containing multiple layers.

Do we have a set manipulation in Manifold 9? I have 50 layers and I'd like to avoid processing them one by one.

Thank you in advance for your help.

yves61
464 post(s)
#21-Oct-25 17:22

This SQL code will make changes to the mfd_meta table in the System Data by updating the FieldCoordSystem value of the specified geometry (in the example -> .Geom) , but will do so for ALL your drawings/layers ! Use CAREFULLY !

-- code

VALUE @TargetCoordSystem nvarchar = 'yourcoordsystem'

UPDATE (

SELECT mfd_id, Property, Value FROM [mfd_meta]

WHERE [Property] = 'FieldCoordSystem.Geom'

)

SET [Value] = @TargetCoordSystem

yves61
464 post(s)
#23-Oct-25 15:22

You might also try this coding.

-- code

-- define the folderPath

VALUE @myFolder nvarchar = 'yourfolderpath'

-- define the CoordSysytem

VALUE @TargetCoordSystem nvarchar = 'yourCoordSystem'

-- create a tempTable

DROP TABLE [myTemp Table]

SELECT * INTO [myTemp Table] FROM (

SELECT r.Name as rName, r.type as rType, o.* FROM [mfd_root] as r INNER JOIN (

SELECT

m.mfd_id,

m.Name as mName, m.Property as mProperty, m.Value as mValue,

n.nName, n.nProperty, n.nValue , n.nMfd_id

FROM [mfd_meta] as m

INNER JOIN (

SELECT

mfd_id as nMfd_id,

Name as nName,

Property as nProperty ,

Value as nValue

FROM [mfd_meta]

WHERE

[Property] = 'Folder'

AND Value = @myFolder

) as n ON m.Name = n.nName

WHERE StringStartsWith(m.Property,'FieldCoordSystem.') = true

) as o ON r.Name = o.mName

)

------------------------------------------

-- UPDATE [mfd_meta] table -->

------------------------------------------

UPDATE (

SELECT m.mfd_id, Property, Value

FROM [mfd_meta] as m

INNER JOIN [mytemp Table] as t

ON m.[mfd_id] = t.[mfd_id]

)

SET [Value] = @TargetCoordSystem

------------------------------------

-- DROP TABLE [myTemp Table]

Mike Pelletier


2,170 post(s)
#23-Oct-25 17:20

I haven't tried this, but another possible solution is to open the mfd_meta table and filter records by the property for fieldcoordsystem. Then select all the ones you want to change plus the one that is the desired coordinate system. Right click on the desired one and choose copy to selection.

Dimitri


7,593 post(s)
#24-Oct-25 05:31

Yes, I think for most people that's the easiest way to assign a coordinate system to many components at once.

Note that this is just a way of assigning a coordinate system. It won't reproject the component.

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.