[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #SAS-209673]: NetCDF with a rotated cartesian grid

Good morning Zander,

You have contacted the correct email address, insofar as we can be of help with 
the netCDF portion of your question.  So, no worries!  Data projection is 
typically an issue handled by visualization software; the coordinates of the 
data will normally be projected onto the canvas displayed by the program, and 
the program handles canvas rotation, etc..  I'm unfamiliar with QGIS, but I 
find the following after a bit of research:

* Rotating the Canvas in GIS: 

The accepted answer here is that this feature is available in QGIS 2.8.  Is 
this not what you are trying to do, or are you perhaps using an earlier version 
of QGIS?

Regarding coordinate variables. You are correct that coordinate variables are 
only one-dimensional; each coordinate variable will correlate to a particular 
dimension.  So, you would define two coordinate variables, one for each 
coordinate dimension that QGIS is using to plot the data.  Although I'm unclear 
how QGIS is extracting the coordinate data from the netCDF file; you mention 
what happens if you don't supply any coordinate information, and your question 
regarding coordinate variables.  Does this mean that your resultant netCDF file 
currently lacks any coordinate information and QGIS is providing a north-up 
projection by default?

A quick search for QGIS projections turns up the following references:

* http://www.qgistutorials.com/en/docs/working_with_projections.html

I confess that I lack the context to really understand the details, but as a 
domain expert perhaps it will be helpful for you?

If we knew for sure how to tell QGIS to use particular data from the file to 
use for the coordinate system, calculating a rotation matrix and using it to 
project your X/Y data into the new, rotated space would be pretty 
straightforward.  Have you contacted QGIS support and asked them about rotating 
2D imagery generated by QGIS?

With that, I'm really not sure how to proceed beyond talking with the QGIS 
people;  as mentioned above, I can envision generating a rotated coordinate 
system *if* we know how to specify the coordinates from the file for QGIS to 
use.  The optimal solution would be to use integrated QGIS functionality for 
rotating data; this is a really standard feature in visualization software and 
it appears that QGIS has it.

Hopefully the QGIS people can point you in the right direction; if I can answer 
further questions based on what they tell you, or if i can elaborate on 
anything I outlined above, please let me know.  I'm sorry I couldn't provide an 
immediately applicable solution for you!

Have a great day,


> Good morning
> I am writing for some support with generating a NetCDF file of data. I
> have searched online through various forums and support sites and
> apologise in advance if I am requesting through the wrong avenue.
> Perhaps you could direct me to the correct resource area if I am.
> In essence, my problem is that I have a 2-D cartesian grid of survey data
> (x,y) which has a rotation. I can generate a NetCDF file of the data
> which can be viewed in QGIS. However, I can see no way of rotating the
> grid within the NetCDF file such that QGIS will display it correctly.
> I define the data with two dimensions and if I don't supply any coordinate
> information the data grid gets displayed north up - as expected. But I
> can only see the option to define coordinate variables as one dimension,
> which also forces the grid to be north up.
> I can obviously define x and y as variables with two dimensions but this
> doesn't position the data values at the correct location, it simply adds
> two more variables to a north up display.
> I have attached an image of what I am trying to achieve as well as a
> snippet of code to show how I am assigning data and coordinates. The
> snippet generates a north up grid - it is a rotated grid I am trying
> to achieve.
> Many thanks for taking the time to look at this and apologies again if
> I have misused this email address.
> Zander Sneddon
> Edinburgh, Scotland

Ticket Details
Ticket ID: SAS-209673
Department: Support netCDF
Priority: Normal
Status: Closed

NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.