<div dir="ltr"><div dir="ltr"><div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 2, 2022 at 2:31 PM Alan Snow <<a href="mailto:alansnow21@gmail.com">alansnow21@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Michael,</div><div><br></div><div>I don't claim to be an expert in the projection you are using or what the GDAL team would like to do in this scenario, but hopefully the information presented here will be helpful to you.</div><div><br></div></div></blockquote><div><br></div><div><br></div> excellent, thanks so much Alan this clarifies. <div><br></div><div>Best, Mike<br><div><br></div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>The grid mapping name "Oblique Mercator (LV95 - CH1903+)" in the netCDF file does not appear to be in the list of supported grid mappings:</div><div><a href="http://cfconventions.org/cf-conventions/cf-conventions.html#appendix-grid-mappings" target="_blank">http://cfconventions.org/cf-conventions/cf-conventions.html#appendix-grid-mappings</a></div><div><br></div><div>Using pyproj to dump EPSG;2056 to CF parameters (<a href="https://pyproj4.github.io/pyproj/latest/build_crs_cf.html" target="_blank">https://pyproj4.github.io/pyproj/latest/build_crs_cf.html</a>), the grid mapping name is "oblique_mercator":</div><div>>>> from pyproj import CRS</div><div>>>> crs = CRS("EPSG:2056")</div><div>>>> crs.to_cf()<br></div><div>{'azimuth_of_central_line': 90.0,<br> 'false_easting': 2600000.0,<br> 'false_northing': 1200000.0,<br> 'geographic_crs_name': 'CH1903+',<br> 'grid_mapping_name': 'oblique_mercator',<br> 'horizontal_datum_name': 'CH1903+',<br> 'inverse_flattening': 299.1528128,<br> 'latitude_of_projection_origin': 46.95240555555556,<br> 'longitude_of_prime_meridian': 0.0,<br> 'longitude_of_projection_origin': 7.439583333333333,<br> 'prime_meridian_name': 'Greenwich',<br> 'projected_crs_name': 'CH1903+ / LV95',<br> 'reference_ellipsoid_name': 'Bessel 1841',<br> 'scale_factor_at_projection_origin': 1.0,<br> 'semi_major_axis': 6377397.155,<br> 'semi_minor_axis': 6356078.962818189}</div><div><br></div><div>If
the pyproj version is correct, I am wondering if the appropriate action
in this scenario is to contact the provider of the netCDF file to look
into and potentially address the issue?</div><div><br></div><div>If the swiss oblique
mercator differs from the regular oblique mercator and is not correctly
represented by the current grid mappings in the CF conventions, it may be worth opening an issue here to add it to the CF
conventions: <a href="https://github.com/cf-convention/cf-conventions" target="_blank">https://github.com/cf-convention/cf-conventions</a>. Once the change is accepted there, I imagine a PR to GDAL will likely be welcome.<br></div><div><br></div><div>Best,</div><div>Alan</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 1, 2022 at 6:57 PM Michael Sumner <<a href="mailto:mdsumner@gmail.com" target="_blank">mdsumner@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello, I'm looking at the constants for CF_PT_* projection families in <div><br></div><div>frmts/netcdf/netcdf_cf_constants.h</div><div><br></div><div>I have a grid_mapping variable with attributes: </div><div><br></div><div> # float swiss_lv95_coordinates ;<br> # swiss_lv95_coordinates:_FillValue = -1.f ;<br> # swiss_lv95_coordinates:grid_mapping_name = "Oblique Mercator (LV95 - CH1903+)" ;<br> # swiss_lv95_coordinates:longitude_of_projection_center = 7.43958333 ;<br> # swiss_lv95_coordinates:latitude_of_projection_center = 46.9524056 ;<br> # swiss_lv95_coordinates:false_easting = 2600000. ;<br> # swiss_lv95_coordinates:false_northing = 1200000. ;<br> # swiss_lv95_coordinates:inverse_flattening = 299.1528128 ;<br> # swiss_lv95_coordinates:semi_major_axis = 6377397.155 ;<br> <br clear="all"><div>and by my understanding this would require something like</div><div><br></div><div>#define CF_PT_LV95 "Oblique Mercator (LV95 - CH1903+)"</div><div><br></div><div>and then attendant logic in the driver for that case, this is "EPSG:2056". </div><div><br></div><div>It seems like this is a very long project of collating specific values used for a crs name ... where the more general case would use those parameters to build an Oblique Mercator - but this is Swiss oblique mercator with a simpler set of initialization params. </div><div><br></div><div>Is it a case of needing a very specific else if to match this case, or is there some more to this? </div><div><br></div><div>Is it worth contributing cases as PRs?</div><div><br></div><div>(I'm inclined to advise "use -a_srs 'EPSG:2056'". )</div><div><br></div><div>Cheers, Mike</div><div><br></div><div dir="ltr">Michael Sumner<br>Software and Database Engineer<br>Australian Antarctic Division<br>Hobart, Australia<br>e-mail: <a href="mailto:mdsumner@gmail.com" target="_blank">mdsumner@gmail.com</a></div></div></div>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font style="font-family:arial,helvetica,sans-serif">Alan Snow</font><br></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Michael Sumner<br>Software and Database Engineer<br>Australian Antarctic Division<br>Hobart, Australia<br>e-mail: <a href="mailto:mdsumner@gmail.com" target="_blank">mdsumner@gmail.com</a></div></div>