Skip to content

Commit

Permalink
Merge pull request #206 from pkgw/more-polish
Browse files Browse the repository at this point in the history
A little more release polish
  • Loading branch information
pkgw authored Feb 11, 2022
2 parents ad0ac45 + 94df3f6 commit e521d63
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
24 changes: 15 additions & 9 deletions WWTExplorer3d/Healpix/HealpixTile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ private void createGeometry()
static bool galMatInit = false;
static Matrix3d galacticMatrix = Matrix3d.Identity;

public string GetDirectory(IImageSet dataset, int level, int x, int y)
public new string GetDirectory(IImageSet dataset, int level, int x, int y)
{
StringBuilder sb = new StringBuilder();

Expand All @@ -345,7 +345,7 @@ public string GetDirectory(IImageSet dataset, int level, int x, int y)

public string GetFilename()
{
string extention = GetHipsFileExtention();
string extention = GetHipsFileExtension();

StringBuilder sb = new StringBuilder();
sb.Append(Properties.Settings.Default.CahceDirectory);
Expand Down Expand Up @@ -439,10 +439,9 @@ public static void GenerateLevel2(string filename)
}
}

public string GetUrl(IImageSet dataset, int level, int x, int y)
public new string GetUrl(IImageSet dataset, int level, int x, int y)
{
string returnUrl = "";
string extention = GetHipsFileExtention();
string extension = GetHipsFileExtension();

int tileTextureIndex = -1;
if (level == 0)
Expand All @@ -453,6 +452,7 @@ public string GetUrl(IImageSet dataset, int level, int x, int y)
{
tileTextureIndex = this.face * nside * nside / 4 + this.tileIndex;
}

StringBuilder sb = new StringBuilder();

int subDirIndex = tileTextureIndex / 10000;
Expand All @@ -467,12 +467,18 @@ public string GetUrl(IImageSet dataset, int level, int x, int y)
sb.Append("0");
}

returnUrl = string.Format(dataset.Url, level.ToString(), sb.ToString(), tileTextureIndex.ToString() + extention);

return returnUrl;
// Add a query string component to help the HiPS services do analytics on their traffic.
// Here on Windows we could use a user-agent, but that isn't an option for the web-based
// client(s), and it'll keep things simpler to use the same mechanism across platforms.
return string.Format(
dataset.Url,
level.ToString(),
sb.ToString(),
tileTextureIndex.ToString() + extension + "?client=wwt6windows"
);
}

private string GetHipsFileExtention()
private string GetHipsFileExtension()
{
// The extension will contain either a list of type or a single type
// The imageset can be set to the perfrered file type if desired IE: FITS will never be chosen if others are avaialbe,
Expand Down
2 changes: 1 addition & 1 deletion WWTExplorer3d/WmsLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public TimeSpan TimeStep
}
}

string serviceUrl = "http://svs.gsfc.nasa.gov/cgi-bin/wms?";
string serviceUrl = "https://gibs.earthdata.nasa.gov/wms/epsg4326/best/wms.cgi?";

[LayerProperty]
public string ServiceUrl
Expand Down
2 changes: 1 addition & 1 deletion WWTExplorer3d/WmsLayerWizard.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions WWTExplorer3d/WmsLayerWizard.resx
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="serialPort1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="serialPort1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

0 comments on commit e521d63

Please sign in to comment.