I am working on an application where I want to change central meridian so that if the user is looking at data near the IDL, the data is in the center of the map and there isn't an issue where data must wrap around.I am adding the data to the feature class using standard central meridian = 0. I then get the dataset extent's and then setting the map's spatialreference central merian to the midpoint of the extent.I have tried a variety of simple things such as setting the same modified spatial reference to the map layers. I have removed and re-added the layers to the map.Is there a simple solution for this or do I need to retrieve each piece of geometry of each feature and somehow apply a transformation for the new central meridian?Also looking at the documentation for ILayer::putref_SpatialReference the Remarks say:This property is only used for map display, setting this property does not change the spatial reference of the layer's underlying data. The ArcGIS framework uses this propert to pass the spatial reference from the map to the layer in order to support on-the-fly projection.To me, this sounds like exactly what I want. I want to add the data to the feature class, change the map's spatial reference and see the data projected correctly.What am I missing?I load and display the world shape file (from the sample data) and this projects exactly like I would expect when changing the central meridian.I have tested this on 9.2 SP5 and 9.3.1 SP 2 on Solaris.Thanks,Gary
Hi Melita,Your understanding of the problem sounds correct but I may not be attempting to solve it properly. If you have any samples source code that I can look at, I would appreciate it.Just to clarify what i m attempting: I am reading data from our DB, creating features in several feature classes that exist in in-memory-workspaces, After building all of the feature classes, I want to center the map on the visible features.The original data is stored in decimal degrees but the map is displayed using Mercator projection with meter units. I am able to project the original data to mercator without any issue.After all the data has been processed, I want to cener the map on the visible data. I am attempting to do this by changing the central meridian from 0, to an appropriate value. This seems to be where my problem is. I am calculating the visible data by examing the extent of certain feature classes of my data.While running the application, I can reload some data and I want to repopulate some (but not all) of the feature classes and re-center on this data. For performance reasons, I am attempting to leave some of the feature classes alone and not re-load / re-process this data.On the map, I am displaying the sample world shape file that came with the sample application data. When I recenter the map, the shape file displays correctly, with the new central meridian. My feature class data does not appear correct. For example, if I change the central meridian to 180 degrees, the IDL of the shape file is displayed on the center of my map. The coordinates that I display tracking the mouse movement are correct as well. It is just the features related to the feature classes I created, that do not display correctly.Any ideas on what I am doing wrong?Thanks,Gary
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.