Loading a spatial layer into GIS:
- For my 1-page introduction to GIS, see here.
In QGIS it's straight-forward: if you have a raster layer then you'll need to do
Layer -> Add Layer -> Add Raster Layer ...
...if you have a vector layer it's:
Layer -> Add Layer -> Add Vector Layer ...
...and if your data is just a list of points it's:
Layer -> Add Layer -> Add XYZ Layer ...
Problems 1 and 2 below can happen to any of these data types. If you've got raster data, see more detail below (some of this may apply to vector data too).
- For my 1-page introduction to GIS, see here.
In QGIS it's straight-forward: if you have a raster layer then you'll need to do
Layer -> Add Layer -> Add Raster Layer ...
...if you have a vector layer it's:
Layer -> Add Layer -> Add Vector Layer ...
...and if your data is just a list of points it's:
Layer -> Add Layer -> Add XYZ Layer ...
Problems 1 and 2 below can happen to any of these data types. If you've got raster data, see more detail below (some of this may apply to vector data too).
Problem 1: layer does not appear over Panama, but very large at a location with the NW corner fixed at a location in the ocean south of Ghana (this is called Null Island)
|
Problem 2: layer does not appear over Panama, but very tiny at a location in the ocean south of Ghana (this is called Null Island)
|
Got it right: layer is positioned over Panama.
|
Loading a NetCDF (raster) layer into GIS:
Loading a GeoTIFF into GIS packages like QGIS or ArcGIS is straight-forward (see e.g. first few min of this video). However, not so straight-forward is how to load a NetCDF file *. It's a bit fiddly, but only takes a few seconds if you follow these steps (please don't follow advice to convert a NetCDF to GeoTIFF first because that usually involves throwing away a lot of information!):
Say your NetCDF file is $FILE1 (my example here is a bit of hydrological data from Panama, in 2D variable rflow), which is a 2D grid where the spatial dimensions are called lon and lat. Now follow the instructions below for either QGIS or ArcGIS:
* Nowadays, the standard for raster layers is shifting towards the wide use of NetCDF files (which I believe will soon supplant GeoTIFF, HDF and all other forms of raster).
Loading a GeoTIFF into GIS packages like QGIS or ArcGIS is straight-forward (see e.g. first few min of this video). However, not so straight-forward is how to load a NetCDF file *. It's a bit fiddly, but only takes a few seconds if you follow these steps (please don't follow advice to convert a NetCDF to GeoTIFF first because that usually involves throwing away a lot of information!):
Say your NetCDF file is $FILE1 (my example here is a bit of hydrological data from Panama, in 2D variable rflow), which is a 2D grid where the spatial dimensions are called lon and lat. Now follow the instructions below for either QGIS or ArcGIS:
* Nowadays, the standard for raster layers is shifting towards the wide use of NetCDF files (which I believe will soon supplant GeoTIFF, HDF and all other forms of raster).
QGIS: Open up a blank, default global map in QGIS ("New Empty Project"). Right-click in the middle -> Copy Coordinate, you will see that the Map CRS is EPSG:4326. Now, you have two options:
(OPTION 1) SET THE PROJECT CRS TO A GCS (e.g. EPSG:4326) and make all imported layers conform to that: - Go to Settings -> Options and you will see 2 options for the project: Change it from "Use CRS from first layer added" to "Use a default CRS" and set the default to EPSG:4326. Also, change "CRS for Layers" to be "Use project CRS". - Layer -> Add Layer -> Add XYZ Layer -> XYZ Connections -> OpenStreetMap -> Add -> Close - Layer -> Add Layer -> Add Raster Layer ... -> Put $FILE1 as the Raster Dataset -> Leave HONOUR_VALID_RANGE, IGNORE_XY_AXIS_NAME_CHECKS, VARIABLES_AS_BANDS, ASSUME_LONGLAT and PRESERVE_AXIS_UNITS_IN_CRS as <Default> -> Add. A list of variables will appear: select rflow -> Close. If the layer appears, but enormously large with the NW corner on Null Island (see Problem 1 above), this is most likely because your file does not have dimension variables (i.e. the spatial axes are just values 1,2,3,... and do not have any 'dimension variable' telling QGIS what these mean, e.g. 53.5, 54.0, 54.5, ... degE, so you need to generate that dimension variable (e.g. as I have to do for JULES output data)). - Right-click the $FILE1 layer -> Properties -> Symbology -> Band rendering -> Change the render type to "Singleband pseudocolor" and change the Color Ramp to "Turbo" (and if you data have extreme missing values like + or - 1e20 then you will also need to modify the display range, e.g. to 0.0-0.000001 as I have to do for rflow data). (OPTION 2) SET THE PROJECT CRS TO A PCS (e.g. EPSG:3857) and make all imported layers conform to that: - Go to Settings -> Options and you will see 2 options for the project: Change it from "Use a default CRS" to "Use CRS from first layer added". Also, change "CRS for Layers" to be "Use project CRS". - Layer -> Add Layer -> Add XYZ Layer -> XYZ Connections -> OpenStreetMap -> Add -> Close. Right-click in the middle -> Copy Coordinate, you will see that the Map CRS has changed to EPSG:3857. - Layer -> Add Layer -> Add Raster Layer ... -> Put $FILE1 as the Raster Dataset -> Leave HONOUR_VALID_RANGE, IGNORE_XY_AXIS_NAME_CHECKS, VARIABLES_AS_BANDS, ASSUME_LONGLAT and PRESERVE_AXIS_UNITS_IN_CRS as <Default> -> Add. A list of variables will appear: select rflow -> Close. Your layer should appear as a very tiny layer (see Problem 2 above). Now go to the Processing Toolbox (right) and open tool GDAL -> Raster projections -> Warp (reproject) -> Put $FILE1 as the Input Layer, source CRS as EPSG:4326, target CRS as EPSG:3857 (i.e. the map projection) -> Run -> Close -> The new layer "Reprojected" will be correctly aligned with OpenStreetMap. Right-click on new layer "Reprojected" and rename to something more similar to the name of $FILE1. - Right-click the $FILE1 layer -> Properties -> Symbology -> Band rendering -> Change the render type to "Singleband pseudocolor" and change the Color Ramp to "Turbo". By following options (1) or (2), you can get the layer displayed correctly (see 'Got it right' above), but the project CRS is different in (1) and (2). All other things being equal, I find (1) more straight-forward, so that's what I use, but I suspect surveyors would prefer (2). ANIMATING THE LAYER: Having done either option #1 or #2 above, now proceed to these steps: - Select Plugins -> Manage and Install Plugins… -> Search for RasterTimeseriesManager -> Install. The 'Temporal Controller' controls should appear at the top of your map (see e.g. "In the second menu bar at the top of the screen there should be a Clock image ..." on here for a screenshot). - Right-click on the new raster layer -> Properties... -> Temporal tab -> Change Configuration to "Fixed Time Range Per Band". This brings up a table where every row is a 'band' (=timepoint of your data) -> Click the epsilon button bottom right of the table -> Calculate Beginning by Expression -> Edit the expression offered to be "make_datetime(2010,1,1,0,0,0) + make_interval(days:=@band)" where the first date is correct for your data (say date D, which will not necessarily be 1st Jan 2010) -> Do the same for the end dates -> OK. - Go back to the Temporal Controller toolbar -> Select 'Animated temporal navigation' (not 'Fixed range temporal navigation' or 'Animated movie') -> Put Date D for the start of the Animation Range and the correct end date too -> Check the step is right for your data (usually 1.0 days or 1.0 hours) -> Now you can click play on the time controls to see an animation of the layer. - (from step #11 on here): Add a timestamp to the map view by going to View -> Decorations -> Title Label -> Click the checkbox to enable it and click Insert an Expression button and enter e.g. "format_date(@map_start_time, 'yyyy-MMM-dd')" to display year-month-day. - Follow step #14 onwards from here to export as an animation using EZGIF (or see here for alternative options). |
ArcGIS: Instructions to come, but essentially you use Multidimension Tools.
|