Tuesday, March 19, 2013

WGS84 to Web Mercator Transforms

Handy:


private void ToGeographic(ref double x, ref double y)
{
    if (Math.Abs(x) < 180 && Math.Abs(y) < 90)
        return;

    if ((Math.Abs(x) > 20037508.3427892) || (Math.Abs(y) > 20037508.3427892))
        return;

    double x = x;
    double y = y;
    double num3 = x / 6378137.0;
    double num4 = num3 * 57.295779513082323;
    double num5 = Math.Floor((double)((num4 + 180.0) / 360.0));
    double num6 = num4 - (num5 * 360.0);
    double num7 = 1.5707963267948966 - (2.0 * Math.Atan(Math.Exp((-1.0 * y) / 6378137.0)));
    x= num6;
    y= num7 * 57.295779513082323;
}

private void ToWebMercator(ref double lon, ref double lat)
{
    if ((Math.Abs(lon) > 180 || Math.Abs(lat) > 90))
        return;

    double num = lon* 0.017453292519943295;
    double x = 6378137.0 * num;
    double a = lat* 0.017453292519943295;

    lon= x;
    lat= 3189068.5 * Math.Log((1.0 + Math.Sin(a)) / (1.0 - Math.Sin(a)));
}

Tuesday, March 12, 2013

Geocoding

batchgeo.com provides easy batch geocoding.


  • Copy and paste entries from an Excel document containing addresses (city and state is good enough).
  • Click "Validate & Set Options" and select the desired settings.
  • Click "Make Map."
  • Once the map has been made, complete the fields and proceed.
  • When the finalized map is displayed, scroll to the bottom and click "Download as KML."
  • In ArcMap, import the KML as a point file.
  • Add X,Y coordinates using XTools.
  • Export to Excel using XTools.

Friday, March 8, 2013

Setting up 3D Vision Pro glasses

After installing drivers for 3D Vision Pro glasses, right click on the desktop and select NVIDIA Control Panel.

Under 3D Settings, select Manage 3D settings. Make sure that "Stereo - Display mode" is set to "Generic active stereo (with NVIDIA 3D Vision)".

Under Stereoscopic 3D, select Manage 3D Vision Pro and add the glasses.

Right click on the desktop again and select Screen resolution. Make sure that the 3D Vision ready display is set to 120 Hz.

In the NVIDIA Control Panel, launch the test application to ensure the glasses have been successfully paired.