Opened 7 years ago

Closed 7 years ago

Last modified 7 years 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 7 years ago.
path for adding stereographic support
isis3_vicar_stereographic.patch (3.5 KB ) - added by swalter75 7 years 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 7 years ago.
What about PDS?
vicar_pds_stereographic.patch (3.0 KB ) - added by swalter75 7 years 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)

by swalter75, 7 years ago

path for adding stereographic support

comment:1 by Even Rouault, 7 years ago

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 by thare, 7 years ago

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 by swalter75, 7 years ago

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 by swalter75, 7 years ago

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

comment:5 by thare, 7 years ago

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.

by swalter75, 7 years 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...

by swalter75, 7 years ago

Attachment: pds_stereographic.patch added

What about PDS?

comment:6 by thare, 7 years ago

all looks good to me - thanks for pushing.

comment:7 by Even Rouault, 7 years ago

  • 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 by swalter75, 7 years ago

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 7 years ago by swalter75 (previous) (diff)

by swalter75, 7 years ago

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

comment:9 by Even Rouault, 7 years ago

Resolution: fixed
Status: newclosed

In 38592:

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

comment:10 by Even Rouault, 7 years ago

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 by Even Rouault, 7 years ago

In 38596:

Remove tabulations (refs #6893)

Note: See TracTickets for help on using tickets.