Virtual trip to Mars using NASA's Mars Trek



NASA has launched Mars Trek - an interactive Map viewer, that can be used to explore Mars, just like the way you explore earth on google earth! You can take a quick tour to familiarize yourself with the Map viewer. You can even view the surface in 3D! If you think it is scary to sign up for a one-way trip to Mars, count your lucky stars, you can now explore Mars with few clicks from our very own planet - the earth! 

Click on the link below to access NASA's Mars Trek:
NASA's Map Trek - an interactive Map viewer

Python code to export layers on Table of contents of mxd to pdf



# Name: layerstopdf.py
# Date: January 15, 2014
# Author: Sarbajit Gurung
# Description: Export each layer from Table of contents in ArcMap to a pdf document
# ---------------------------------------------------------------------------

# Import arcpy module
import arcpy

# if pdfs need dates attached to their names then use it, otherwise it can be excluded
import datetime
today = datetime.date.today()
yesterday = today - datetime.timedelta(days=1)

# Define mxd
mxd = arcpy.mapping.MapDocument(r"C:\input\test.mxd")

#set export path to export pdfs
path = r"C:\output\Maps\\"

# turn each layer on and off and export as pdf
for lyr in arcpy.mapping.ListLayers(mxd):
    if lyr.name == "LayerA":
        lyr.visible = True
        arcpy.RefreshTOC()
        arcpy.RefreshActiveView()
        arcpy.mapping.ExportToPDF(mxd, path + "LayerA_" + yesterday.strftime('%d%b%Y') + ".pdf")
        if lyr.name == "LayerA":
            lyr.visible = False
            arcpy.RefreshTOC()
            arcpy.RefreshActiveView()

    if lyr.name == "LayerB":
        lyr.visible = True
        arcpy.RefreshTOC()
        arcpy.RefreshActiveView()
        arcpy.mapping.ExportToPDF(mxd, path + "LayerB_" + yesterday.strftime('%d%b%Y') +".pdf")
        if lyr.name == "LayerB":
            lyr.visible = False
            arcpy.RefreshTOC()
            arcpy.RefreshActiveView()

# so on and so forth for other Layers on your mxd
# you can also store the layer names in an array and create a loop if you have many layers on TOC

# Release mxd
del mxd

Python code to export mxd to pdf with date value on the pdf



 

# Name: Exporttopdf.py
# Date: February 11, 2015
# Author: SGurung
# Description: This code creates pdf map from mxd file. The pdf file can have date value attached on # its name, e.g., "testmap_date.pdf". The code can be scheduled on task scheduler to run it at your
# desired time.
# ---------------------------------------------------------------------------

# import arcpy module
import arcpy

# import datetime module. Date value can be today, yesterday or as defined by user
import datetime
today = datetime.date.today()
yesterday = today - datetime.timedelta(days=1)

# Overwrite output file if it already exist
arcpy.OverWriteOutput =True

# Define the location of mxd
mxd = arcpy.mapping.MapDocument(r"C:\input\test.mxd")

# Define the output location and then date value as needed to be displayed on the pdf file
# %d = day of the month, %b = abbreviated month name, %y = year
pdf = r"C:\output\Maps\\" + "testmap_" + yesterday.strftime('%d%b%Y') + ".pdf"

# Set pdf parameters as per your requirement here:
data_frame = 'PAGE_LAYOUT'
resolution = "300"
image_quality = "NORMAL"
colorspace = "RGB"
compress_vectors = "True"
image_compression = "DEFLATE"
picture_symbol = 'RASTERIZE_BITMAP'
convert_markers = "False"
embed_fonts = "True"
layers_attributes = "NONE"
georef_info = "False"

# Export mxd to pdf
arcpy.mapping.ExportToPDF(mxd, pdf, data_frame, 640, 480, resolution, image_quality, colorspace, compress_vectors, image_compression, picture_symbol, convert_markers, embed_fonts, layers_attributes, georef_info)

# Release mxd
del mxd