jfcorbett Posted April 20, 2011 Posted April 20, 2011 Is there any way to script/automate the Map Editor's functionality? I'm mainly interested in clipping maps into various shapes and sizes, as is possible in the WAsP Map Editor. Any alternative suggestions are also welcome!
Ray Posted April 20, 2011 Posted April 20, 2011 Hi,Map Editor does not provide any automation features. You could however achieve map clipping through WAsP scripting. The IVectorMap interface provides a CutWindow method which will do the trick. Here is some sample code that will clip the selected map (I used Waspdale) in WAsP. Set Rvea0086Factory = CreateObject("Rvea0086.ObjectFactory")Set Map = ReportingAssistant.TypeCaster_ .CastMemberToVectorMap(ReportingAssistant.SelectedHierarchyMember)Set Rect = Rvea0086Factory.CreateRectangle(25000, 35000, 30000, 40000)Set ClippedMap = Map.CutWindow(Rect)You could of course then export the map to file and even add it back into the workspace:' export map to fileMapFilename = "C:\WaspdaleClipped.map"Set Exportable = ReportingAssistant.TypeCaster.CastObjectToRveaPreservableObject(ClippedMap)Exportable.PreserveToFile MapFilename' add map to workspace Set InsertedMap = CurrentWorkspace.AsIHierarchyMember_ .Insertions.FromFile.ByClassID(ehmcVectorMap).Execute(MapFilename, Nothing)
jfcorbett Posted April 20, 2011 Posted April 20, 2011 Aha! Thanks for this answer.I don't suppose there's any way to clip it in an ellipse or some other shape?
Ray Posted April 21, 2011 Posted April 21, 2011 Ellipse clipping is a nice idea. Unfortunately, however, this cannot be done with WAsP.
jfcorbett Posted May 4, 2011 Posted May 4, 2011 Is there a way to transform the projection of .maps in an automated/scripted way? Fairly often, I have to convert a large number of .map files back and forth between metric and lat-lon, in order to interface with other applications e.g. Google Earth. Being able to script this would be a huge relief.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now