Permalink
Browse files

Extraction process now forced to 'native' if open map and dataset hav…

…e different projection orientations.
  • Loading branch information...
1 parent 726049f commit 53a1b90a240190e25f02dfb70cafc7dd337054a7 chris committed May 15, 2009
View
18 Dapple/Extract/DownloadOptions.cs
@@ -46,6 +46,7 @@ internal enum DuplicateFileCheckResult
protected WorldWind.GeographicBoundingBox m_oViewedAoi;
protected WorldWind.GeographicBoundingBox m_oMapAoi;
protected string m_strMapProjection;
+ protected string m_strLayerProjection;
protected ErrorProvider m_oErrorProvider;
#endregion
@@ -126,11 +127,21 @@ internal DownloadOptions(Dapple.LayerGeneration.DAPQuadLayerBuilder oDAPLayer) :
m_oViewedAoi = WorldWind.GeographicBoundingBox.FromQuad(MainForm.WorldWindowSingleton.CurrentAreaOfInterest);
m_oMapAoi = MainForm.MapAoi;
m_strMapProjection = MainForm.MapAoiCoordinateSystem;
+ m_strLayerProjection = MainForm.MontajInterface.GetProjection(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName);
}
#endregion
- #region Public Methods
- /// <summary>
+ #region Properties
+
+ public string Projection
+ {
+ get { return m_strLayerProjection; }
+ }
+
+ #endregion
+
+ #region Public Methods
+ /// <summary>
/// Save the current contents of these controls to an xml file
/// </summary>
/// <param name="oDatasetElement"></param>
@@ -170,10 +181,9 @@ internal virtual ExtractSaveResult Save(System.Xml.XmlElement oDatasetElement, s
// --- get the dataset coordinate system ---
- string strSrcCoordinateSystem = MainForm.MontajInterface.GetProjection(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName);
+ string strSrcCoordinateSystem = m_strLayerProjection;
if (string.IsNullOrEmpty(strSrcCoordinateSystem))
return ExtractSaveResult.Ignore;
-
// --- get the dataset extents ---
View
8 Dapple/Extract/DownloadSettings.cs
@@ -334,7 +334,13 @@ private void bDownload_Click(object sender, EventArgs e)
oDatasetElement = oExtractDoc.CreateElement("dataset");
}
- switch (m_oDownloadSettings[count].Save(oDatasetElement, cFolderControl.Value, eCS))
+ DownloadCoordinateSystem eCSForLayer = eCS;
+
+ // --- Don't 'reproject to original map' if their projections have different orientations ---
+ if (eCS == DownloadSettings.DownloadCoordinateSystem.OriginalMap && !MainForm.MontajInterface.ProjectionsHaveSameOrientation(MainForm.MapAoiCoordinateSystem, m_oDownloadSettings[count].Projection))
+ eCSForLayer = DownloadSettings.DownloadCoordinateSystem.Native;
+
+ switch (m_oDownloadSettings[count].Save(oDatasetElement, cFolderControl.Value, eCSForLayer))
{
case DownloadOptions.ExtractSaveResult.Cancel:
SetActivePage(count);
View
2 Dapple/Extract/Grid.cs
@@ -72,7 +72,7 @@ internal override void SetDefaultResolution()
double dXOrigin, dYOrigin, dXCellSize, dYCellSize;
int iSizeX, iSizeY;
- string strCoordinateSystem = MainForm.MontajInterface.GetProjection(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName);
+ string strCoordinateSystem = m_strLayerProjection;
MainForm.MontajInterface.GetGridInfo(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName, out dXOrigin, out dYOrigin, out iSizeX, out iSizeY, out dXCellSize, out dYCellSize);
oResolution.Setup(false, strCoordinateSystem, dXOrigin, dYOrigin, iSizeX, iSizeY, dXCellSize, dYCellSize);
View
2 Dapple/Extract/HyperMAP.cs
@@ -76,7 +76,7 @@ internal override void SetDefaultResolution()
double dMinX, dMaxX, dMinY, dMaxY;
SortedList<double, int> oResolutionList;
- string strCoordinateSystem = MainForm.MontajInterface.GetProjection(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName);
+ string strCoordinateSystem = m_strLayerProjection;
MainForm.MontajInterface.GetExtents(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName, out dMaxX, out dMinX, out dMaxY, out dMinY);
MainForm.MontajInterface.GetMapInfo(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName, out oResolutionList);
View
2 Dapple/Extract/PersonalDataset.cs
@@ -29,7 +29,7 @@ internal override DownloadOptions.ExtractSaveResult Save(XmlElement oDatasetElem
if (MainForm.MontajInterface.HostHasOpenMap())
{
- string strSrcCoordinateSystem = MainForm.MontajInterface.GetProjection(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName);
+ string strSrcCoordinateSystem = m_strLayerProjection;
if (string.IsNullOrEmpty(strSrcCoordinateSystem))
return ExtractSaveResult.Ignore;
double dMinX, dMinY, dMaxX, dMaxY;
View
2 Dapple/Extract/Picture.cs
@@ -73,7 +73,7 @@ internal override void SetDefaultResolution()
double dXOrigin, dYOrigin, dXCellSize, dYCellSize;
int iSizeX, iSizeY;
- string strCoordinateSystem = MainForm.MontajInterface.GetProjection(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName);
+ string strCoordinateSystem = m_strLayerProjection;
MainForm.MontajInterface.GetGridInfo(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName, out dXOrigin, out dYOrigin, out iSizeX, out iSizeY, out dXCellSize, out dYCellSize);
oResolution.Setup(true, strCoordinateSystem, dXOrigin, dYOrigin, iSizeX, iSizeY, dXCellSize, dYCellSize);
View
2 Dapple/Extract/SectionGrid.cs
@@ -69,7 +69,7 @@ internal override void SetDefaultResolution()
double dXOrigin, dYOrigin, dXCellSize, dYCellSize;
int iSizeX, iSizeY;
- string strCoordinateSystem = MainForm.MontajInterface.GetProjection(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName);
+ string strCoordinateSystem = m_strLayerProjection;
MainForm.MontajInterface.GetGridInfo(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName, out dXOrigin, out dYOrigin, out iSizeX, out iSizeY, out dXCellSize, out dYCellSize);
oResolution.Setup(false, strCoordinateSystem, dXOrigin, dYOrigin, iSizeX, iSizeY, dXCellSize, dYCellSize);
View
2 Dapple/Extract/SectionPicture.cs
@@ -69,7 +69,7 @@ internal override void SetDefaultResolution()
double dXOrigin, dYOrigin, dXCellSize, dYCellSize;
int iSizeX, iSizeY;
- string strCoordinateSystem = MainForm.MontajInterface.GetProjection(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName);
+ string strCoordinateSystem = m_strLayerProjection;
MainForm.MontajInterface.GetGridInfo(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName, out dXOrigin, out dYOrigin, out iSizeX, out iSizeY, out dXCellSize, out dYCellSize);
oResolution.Setup(false, strCoordinateSystem, dXOrigin, dYOrigin, iSizeX, iSizeY, dXCellSize, dYCellSize);
View
2 Dapple/Extract/Voxel.cs
@@ -71,7 +71,7 @@ internal override void SetDefaultResolution()
SortedList<double, int> oY;
SortedList<double, int> oZ;
- string strCoordinateSystem = MainForm.MontajInterface.GetProjection(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName);
+ string strCoordinateSystem = m_strLayerProjection;
MainForm.MontajInterface.GetExtents(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName, out dMaxX, out dMinX, out dMaxY, out dMinY);
MainForm.MontajInterface.GetVoxelInfo(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName, out oResolutionList, out oX, out oY, out oZ);
View
BIN ExtAssemblies/MontajRemote.dll
Binary file not shown.

0 comments on commit 53a1b90

Please sign in to comment.