I was wondering if I can copy a shapefile layer style from one to another in the map work space just like how ESRI has the option of importing a layer style to another.
Hi,
if you want to apply one style to another SHP file (or different data surce in general) - that is not possible just with a mouse click. You can save a style in layer file but to apply the layer file to a different SHP you need to modify the layer file (xml) manually.
There is a small tool available for free - unfortunatly only for Map 2010 - that copies a layer style from one data source to another:
http://www.fig-tech.com/resources/ --> "Style Management"
The request for being able to copy a style to a different data source has come up a few times - maybe someone drops that company a line to ask if they would update their tool for newer Map versions or publish it as open source,
Good Luck, Rob
Hi,
free tool from Robert message works well on my MAP 3D 2012 64 bits (french)
Olivier
Thanks Rob!
Unfortunately I have AutoCAD Map3d 2013 and will be using 2014 in the near future. It would be nice to get that company to upgrade their version for 2013 or 2014.
Tram
Hello
An other idea :
1) Export the FDO layer as a .layer file
2) Edit the XML file and changes the source informations ...
3) Import the .layer file
Bye, Pat
Patrice BRAUD
Hi,
I'm not aware of a step by step guide.
You need to check at least <FeatureName> and <ResourceID>. If the column names are different you need to check the XML file for those as well.
In general - there is a (old) PDF file explaing the basics of a Map/MapGuide layer files. Search for "Building Symbol Libraries with Autodesk MapGuide" on the internet. The document covers the stylization aspect of layer files and doesn't say anything about data sources etc. But it's the only good introduction I'm aware of. It's certainly helpful if you want to modify xml layer files.
Further information can be found in the XML definition for the layer file type:
http://trac.osgeo.org/mapguide/browser/branches/2.1/MgDev/Common/Schema/LayerDefinition-1.3.0.xsd
1.3.0 is not the latest version but I can't find a better link. When you save your layer as XML it will show you the release number your Map version supports (e.g.: xsi:noNamespaceSchemaLocation="LayerDefinition-2.4.0.xsd" ). It contains few information about what the xml tags mean in a layer file.
Good luck, Rob
A step by step guide to copy a layer style
1. in display manger savesas layer
2. open that .layer file in notepad
3. use FIND REPLACE to change all the connection names For example FIND "SDF_1" REPLACE "SDF_2" (the cube icon in leftpane)
4. use FIND REPLACE to change all the class names For example FIND "LanduseOld" REPLACE "LanduseNew" (the cube or paper icon in right pane)
5. scroll down to the bottom and look for <FeatureName> tag there should be a path somewhere between <FeatureName> and </FeatureName>
6. Change the path to wherever your GIS datastore is
7. If the original datastore is, for example, a Shapfile and the new datastore is SDF you need to change the contents of the FDO provider tag too
8. saveas a new .layer file
9. in display manger choose load layer
One thing I found was to make sure the filename and the class name are the same so it is less find+replace work for you. IF this is unclear I can post some screen shots or a video