Showing posts with label WMS. Show all posts
Showing posts with label WMS. Show all posts

Monday, October 7, 2019

Add Mars Web Mapping Tile Server datasets from NASA to QGIS

NASA publishes Mars dataset such as the Viking Color Mosaic or the Mars Orbiter Laser Altimeter Color Hillshade  for public access at this web site https://api.nasa.gov/api.html. The dataset are published as OGC RESTful Web Mapping and Tile Services - hence they can be pulled down and displayed in QGIS.

For convenience, the full list of the dataset extracted from the service is shown below:
Layer Url
Viking Color Mosaic - Global Map https://api.nasa.gov/mars-wmts/catalog/Mars_Viking_MDIM21_ClrMosaic_global_232m/1.0.0//default/default028mm/{z}/{y}/{x}.jpg
CTX Mosaic - Curiosity Landing Site https://api.nasa.gov/mars-wmts/catalog/curiosity_ctx_mosaic/1.0.0//default/default028mm/{z}/{y}/{x}.png
HiRISE Mosaic - Curiosity Landing Site https://api.nasa.gov/mars-wmts/catalog/curiosity_hirise_mosaic/1.0.0//default/default028mm/{z}/{y}/{x}.png
HiRISE Mosaic - ESP_040776_2115 https://api.nasa.gov/mars-wmts/catalog/ESP_040776_2115_RED_A_01_ORTHO/1.0.0//default/default028mm/{z}/{y}/{x}.png
HiRISE Mosaic - ESP_042252_1930_RED_B_01_ORTHO https://api.nasa.gov/mars-wmts/catalog/ESP_042252_1930_RED_B_01_ORTHO/1.0.0//default/default028mm/{z}/{y}/{x}.png
HiRISE Mosaic - ESP_042647_1760_RED_B_01_ORTHO https://api.nasa.gov/mars-wmts/catalog/ESP_042647_1760_RED_B_01_ORTHO/1.0.0//default/default028mm/{z}/{y}/{x}.png
HRSC Mosaic - Martian East https://api.nasa.gov/mars-wmts/catalog/HRSC_Martian_east/1.0.0//default/default028mm/{z}/{y}/{x}.png
HRSC Color Mosaic - MC11 https://api.nasa.gov/mars-wmts/catalog/MC11E_HRMOSCO_COL/1.0.0//default/default028mm/{z}/{y}/{x}.png
HRSC Mosaic - MC11 https://api.nasa.gov/mars-wmts/catalog/MC11E_HRMOSND_ND5/1.0.0//default/default028mm/{z}/{y}/{x}.png
HiRISE Mosaic - Spirit Landing Site https://api.nasa.gov/mars-wmts/catalog/spirit_hirise_mosaic/1.0.0//default/default028mm/{z}/{y}/{x}.png
HiRISE Mosaic - Opportunity Landing Site https://api.nasa.gov/mars-wmts/catalog/opportunity_hirise_mosaic/1.0.0//default/default028mm/{z}/{y}/{x}.png
HiRISE Mosaic - Phoenix Landing Site https://api.nasa.gov/mars-wmts/catalog/phoenix_hirise_mosaic/1.0.0//default/default028mm/{z}/{y}/{x}.png
HiRISE Mosaic - Sojourner Landing Site https://api.nasa.gov/mars-wmts/catalog/sojourner_hirise_mosaic/1.0.0//default/default028mm/{z}/{y}/{x}.png
Albedo Mosaic - Thermal Emission Spectrometer https://api.nasa.gov/mars-wmts/catalog/Mars_MGS_TES_Albedo_mosaic_global_7410m/1.0.0//default/default028mm/{z}/{y}/{x}.png
DEM Grayscale - Mars Orbiter Laser Altimeter https://api.nasa.gov/mars-wmts/catalog/Mars_MGS_MOLA_DEM_mosaic_global_463m_8/1.0.0//default/default028mm/{z}/{y}/{x}.png
Color Hillshade - Mars Orbiter Laser Altimeter https://api.nasa.gov/mars-wmts/catalog/Mars_MGS_MOLA_ClrShade_merge_global_463m/1.0.0//default/default028mm/{z}/{y}/{x}.jpg
Experience Curiosity - Curiosity Landing Site https://api.nasa.gov/mars-wmts/catalog/mars_pahrump_patch_8k_256m/1.0.0//default/default028mm/{z}/{y}/{x}.png
Atlas Mosaic - Mars Orbiter Camera https://api.nasa.gov/mars-wmts/catalog/msss_atlas_simp_clon/1.0.0//default/default028mm/{z}/{y}/{x}.png
Infrared Night - Thermal Emission Imaging System https://api.nasa.gov/mars-wmts/catalog/Mars_MO_THEMIS-IR-Night_mosaic_60N60S_100m_v14_clon0_ly/1.0.0//default/default028mm/{z}/{y}/{x}.jpg
Infrared Day - Thermal Emission Imaging System https://api.nasa.gov/mars-wmts/catalog/Mars_MO_THEMIS-IR-Day_mosaic_global_100m_v12_clon0_ly/1.0.0//default/default028mm/{z}/{y}/{x}.jpg
HRSC Mosaic - Mawrth Vallis https://api.nasa.gov/mars-wmts/catalog/hrsc_mawrth_vallis/1.0.0//default/default028mm/{z}/{y}/{x}.png
HRSC Color Mosaic - Mawrth Vallis https://api.nasa.gov/mars-wmts/catalog/hrsc_mawrth_vallis_color/1.0.0//default/default028mm/{z}/{y}/{x}.png

To add a MARS dataset to QGIS, do the following:
  1. Start QGIS. In the Browser panel, mouse right click on the Tile Server (XYZ). Select New Connection.


     
  2.  In the New XYZ tile layer, type in the URL for the chosen dataset, e.g. https://api.nasa.gov/mars-wmts/catalog/Mars_MGS_MOLA_ClrShade_merge_global_463m/1.0.0//default/default028mm/{z}/{y}/{x}.jpg

  3. Click OK.
  4. Type in the name of the tile layer, e.g. Color Hillshade - Mars Orbiter Laser Altimeter.

  5. Click OK.

    The tile layer connection is added to the Tile Server (XYZ) node.
  6. Mouse right click on the newly added tile server node. Choose Add layer.

    The selected layer is displayed in QGIS.

Monday, November 26, 2018

How to add a Singapore OneMap tile layer to QGIS

Singapore OneMap provides a wide range of tile maps in difference color schemes that can be used in web map applications (with the proper attribution, of course). For more information about OneMap, visit the website https://docs.onemap.sg/maps/original.html

QGIS has functions to load and display maps from map tile providers such as OneMap. The following shows a few simple steps to connect and add a OneMap original tile layer to the map pane of QGIS.
  1. Start up QGIS.

  2. In the Browser panel, mouse left-click on the Tile Server (XYZ) node. Choose New Connection.

    The New XYZ tile layer dialog box appears.
  3. In the text field, type in the URL of a OneMap tile layer, e.g. https://www.onemap.gov.sg/maps/tiles/Original/{z}/{x}/{y}.png.
  4. Click OK.

    The New XYZ tile layer dialog box appears.
  5. In the text field, type in a meaningful name, e.g. OneMap. Click OK.

    The tile layer is added to the Browser panel.
  6. To display it in the map view, mouse double click on the added layer in the Browser panel.

    The OneMap tile layer is displayed.


Monday, June 13, 2011

GeoMedia C# code snippet to connect to a WMS server

Recently I was asked to look at some C# code to connect and display a feature from a Web Mapping Service (WMS) server. I wrote some driving GeoMedia code to test out the connection.



//...cut...

//Create the connection to the WMS server
PClient.Connection conn = null;    //connection to the WMS server
MapviewLib.GMMapView map = (MapviewLib.GMMapView) mapWindow.MapView;
conn = (PClient.Connection) this.Application.CreateService("GeoMedia.Connection");
conn.Name = "WMS";
conn.Type = "WMS.GDatabase";
conn.Mode = 0;
conn.Description = "WMS";
conn.Location = "Not used";
conn.ConnectInfo = @"NOCSFFOUND=FAIL;URI=http://some.wms.com/wms.aspx";
conn.Connect();

//Now create a recordset to a WMS feature
PClient.OriginatingPipe OP;
conn.CreateOriginatingPipe(out OP);
OP.Table = "Feature1";

//Build a transformation path to/fro the map view coordinate system and the WMS and store the paths in the map view's CoordSystemsMgr object
PCSS.CoordSystem objCS = null;
PClient.ServerTransService objSTS = (PClient.ServerTransService)this.Application.CreateService("GeoMedia.ServerTransService");
PCSS.AltCoordSystemPath objAltCoordSystemPath = null;
PClient.GField objGeomFld = OP.OutputRecordset.GFields["Geometry"];
objSTS.CreateCSFromGeometryField( objGeomFld, out objCS);
objSTS.CreateSimpleTransFromCSMtoCS(map.CoordSystemsMgr, objCS, out objAltCoordSystemPath);

//Transform the WMS recordset to the map view's coordinate system
PDBPipe.CSSTransformPipe objXPipe = (PDBPipe.CSSTransformPipe)this.Application.CreateService("GeoMedia.CSSTransformPipe");
objXPipe.InputRecordset = (PDBPipe.GRecordset) OP.OutputRecordset;
objXPipe.InputGeometryFieldName = "Geometry";
objXPipe.CoordSystemsMgr = map.CoordSystemsMgr;
objXPipe.OutputCSGUID = map.CoordSystemsMgr.CoordSystem.GUID;

//Now we can use the transformed WMS recordset
PDBPipe.GRecordset wmsRS = objXPipe.OutputRecordset

//...etc...