Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#6893 closed defect (fixed)

Stereographic projection not supported in ISIS3 write driver

Reported by: swalter75 Owned by: warmerdam
Priority: normal Milestone: 2.3.0
Component: default Version: unspecified
Severity: normal Keywords:
Cc: thare@…

Description

Please see proposed patch. Are there an reasons for it being left out?

Attachments (4)

gdal_isis3_stereographic.patch (1.5 KB) - added by swalter75 14 months ago.
path for adding stereographic support
isis3_vicar_stereographic.patch (3.5 KB) - added by swalter75 14 months ago.
Here is a new patch for ISIS3 and VICAR. It checks for Stereographic AND center_lat==90 and changes Proj. to Polar_Stereographic. I also optimized the NoData? handling in VICAR a bit…
pds_stereographic.patch (658 bytes) - added by swalter75 14 months ago.
What about PDS?
vicar_pds_stereographic.patch (3.0 KB) - added by swalter75 14 months ago.
This one only changes the VICAR and PDS drivers to change the Stereographic projection to Polar_Stereographic if (lat_0 = +-90)

Download all attachments as: .zip

Change History (15)

Changed 14 months ago by swalter75

path for adding stereographic support

comment:1 Changed 14 months ago by Even Rouault

Trent, do you confirm that ISIS3 supports Stereographic ? Is there a reference for projections supported by ISIS3 ? Googling for "ISIS3 projections" brought me to http://jlaura.github.io/isis3/class_isis_1_1_projection.html which has a list of projections and I cannot see Stereographic in it

comment:2 Changed 14 months ago by thare

For whatever reason, ISIS3 was setup to only support "Polar Stereographic" not more generically just "Stereographic". I haven't looked at the code to see if there are differences in the equations but ISIS3 has a specific check such that the center lat cannot be 0. Thus mapping a "GDAL" Stereographic to an ISIS3 PolarStereographic? should probably not be done. Keep this patch around but don't include yet. I will see if we can introduce "Stereographic" into ISIS3 but it will take some time to get it pushed in (if accepted).

resources: https://isis.astrogeology.usgs.gov/Object/Developer/group___map_projection.html polar St: https://isis.astrogeology.usgs.gov/Object/Developer/class_isis_1_1_polar_stereographic.html#details

comment:3 Changed 14 months ago by swalter75

Then we could at least check for "Stereographic" and abs(lat_0)=90 for the case that some software (like Vicar) does not always puts "polar_stereographic" in the label but only "stereographic" instead.

comment:4 Changed 14 months ago by swalter75

Or should we change the Vicar driver to check for the lat_0 and change the projection to "polar_stereographic"?

comment:5 Changed 14 months ago by thare

that is a good compromise - can you reissue the patch? I think I prefer the check "Stereographic" and abs(lat_0)=90.

Polar Stereo vs Stereo has always been a little confusing - thus updating the vicar driver might be good also.

Changed 14 months ago by swalter75

Here is a new patch for ISIS3 and VICAR. It checks for Stereographic AND center_lat==90 and changes Proj. to Polar_Stereographic. I also optimized the NoData? handling in VICAR a bit...

Changed 14 months ago by swalter75

Attachment: pds_stereographic.patch added

What about PDS?

comment:6 Changed 14 months ago by thare

all looks good to me - thanks for pushing.

comment:7 Changed 14 months ago by Even Rouault

  • Do we need in isis3_vicar_stereographic.patch the special case for EQUAL(pszProjection, SRS_PT_STEREOGRAPHIC) and abs(oSRS.GetNormProjParm?(SRS_PP_LATITUDE_OF_ORIGIN, 0.0)) == 90 ? This is probably correct, but shouldn't such parameters already be mapped to SRS_PT_POLAR_STEREOGRAPHIC in GDAL ?
  • Please use fabs() instead of abs() (holds for pds_stereographic.patch also)
  • In vicardataset.cpp the value = poDS->GetKeyword?("BLTYPE"); line doesn't seem to be used since afterwards there is if ( EQUAL(poDS->GetKeyword?("BLTYPE"),"M94_HRSC") ) afterwards

comment:8 Changed 14 months ago by swalter75

If these cases are handled everywhere in GDAL we can omit changing the ISIS3 driver (I tried a quick test with gdalwarp and it also automatically changes "Stereographic" to "Polar_Stereographic" at poles).

Please see my new patch for the other two points (now only VICAR and PDS drivers are changed).

Last edited 14 months ago by swalter75 (previous) (diff)

Changed 14 months ago by swalter75

This one only changes the VICAR and PDS drivers to change the Stereographic projection to Polar_Stereographic if (lat_0 = +-90)

comment:9 Changed 14 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 38592:

PDS: map STEREOGRAPHIC with fabs(lat)=90 to Polar_Stereographic (patch by Sebastian Walter, fixes #6893)

comment:10 Changed 14 months ago by Even Rouault

Milestone: 2.3.0

trunk r38591 VICAR: optimize nodata handling, and map STEREOGRAPHIC with fabs(lat)=90 to Polar_Stereographic (patch by Sebastian Walter, ixes #6893)

comment:11 Changed 14 months ago by Even Rouault

In 38596:

Remove tabulations (refs #6893)

Note: See TracTickets for help on using tickets.