Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2681 closed defect (fixed)

ValidateProjection() does not recognize Mercator_2SP

Reported by: mrosen Owned by: warmerdam
Priority: normal Milestone: 1.5.4
Component: OGR_SRS Version: unspecified
Severity: normal Keywords: validate
Cc:

Description

Follow up on #2678: OGRSpatialReference::Validate() fails on PROJCS/..."EXTENSION"

Thanks for the prompt fix on this. Sadly, I think I've found another issue here.

When I try to validate the SRS, the "Extension" is ok but validation still fails b/c there's no entry in the papszProjWithParms array for SRS_PT_MERCATOR_2SP.

This seems to fix (in ogr_srs_validate.cpp, around line 302):

SRS_PT_MERCATOR_1SP, SRS_PP_LATITUDE_OF_ORIGIN, SRS_PP_CENTRAL_MERIDIAN, SRS_PP_SCALE_FACTOR, SRS_PP_FALSE_EASTING, SRS_PP_FALSE_NORTHING, NULL,

+ (http://www.remotesensing.org/geotiff/proj_list/mercator_2sp.html) + SRS_PT_MERCATOR_2SP, + SRS_PP_STANDARD_PARALLEL_1, + SRS_PP_LATITUDE_OF_ORIGIN, + SRS_PP_CENTRAL_MERIDIAN, + SRS_PP_FALSE_EASTING, + SRS_PP_FALSE_NORTHING, + NULL,

SRS_PT_MOLLWEIDE, SRS_PP_CENTRAL_MERIDIAN, SRS_PP_FALSE_EASTING, SRS_PP_FALSE_NORTHING, NULL,

Change History (2)

comment:1 Changed 11 years ago by Even Rouault

Component: defaultOGR_SRS
Keywords: validate added
Milestone: 1.5.4
Resolution: fixed
Status: newclosed

I've added your fix for validation of SRS_PT_MERCATOR_2SP, and also fixed a regression introduced in r13427 (trunk only, NULL missing after each projection and parameter list), and another older bug (r8860) where the papszProjWithParms[] array was not ended with double NULL thus leading place to possible crash if the projection was referenced in papszProjectionSupported[] but not in papszProjWithParms[]

Fixed in trunk in r15737 and in branches/1.5 in r15738

comment:2 Changed 11 years ago by Even Rouault

Test added in r15739

Note: See TracTickets for help on using tickets.