[Chameleon] RE: Locate widget - unknown projection id
McGraw, Joanne
mcgrawj at AGR.GC.CA
Thu Aug 18 16:25:21 EDT 2005
I sent this out twice and went to view the text on line to see if anyone had responded and the message was "scrubbed". I think there might be a problem with my logo signature. I'm trying to send this again (without the logo) to see if it goes through properly.
Sorry for any inconvenience,
jtm
-----Original Message-----
From: McGraw, Joanne
Sent: Tuesday, August 16, 2005 3:00 PM
To: 'chameleon at lists.maptools.org'
Subject: Locate widget - unknown projection id
I'm just passing along some findings in the hopes that if anyone is aware that my workaround will cause other problems they'll let me know.
In the Locate widget, the lines that use the following code: ms_newprojectionobj ($szTmpMapProj);
where $szTmpMapProj was returned by $oMap->getProjection (); returns an error when the projection returned from $oMap is a custom projection.
My application's map has a custom projection. When I use the Locate widget and try to zoom in, for example, to a selected location I get an error "msProcessProjection(): unknown projection id". The problem turned out to be that the string returned by the Map's getProjection() could not be used as input to instantiate a new projection object with ms_newprojectionobj().
In my application, after:
$szTmpMapProj = $oMap->getProjection ();
$szTmpMapProj holds the string "proj=lcc +lat_0=0 +lat_1=49 +lat_2=77 +lon_0=-91.8666 +datum=NAD83"
The ms_newprojectionobj() function expects commas between each of the projection definition items in the string it is passed. So, to get around the problem, I inserted a line of code to replace the spaces between all the parameters with commas, like this:
$szTmpMapProj = $oMap->getProjection ();
$szTmpMapProj = str_replace(" ", ",", $szTmpMapProj);
:
$projOutObj = ms_newprojectionobj ($szTmpMapProj);
And it worked. This won't affect any returned epsg projections, but will if affect some other type of returned projection?
I'm not certain if this would be considered a MapServer problem or a Chameleon problem (that the returned string from getProjection() cannot then be used to create a new projection object). It is certainly possible (and I have no idea) that the string returned by getProjection() CAN be used as it is returned for a custom projection when it is passed to some other function. In that case, fixing the returned string to include the commas would simply break something else. Certainly this is a problem in Chameleon's Locate widget if the map has a custom projection.
Cheers,
jtm
Joanne T. McGraw
Spatial Data Visualization Specialist / Spécialiste en visualisation des données spatiales
Agriculture and Agri-Food Canada / Agriculture et Agroalimentaire Canada
Telephone/Téléphone: (613) 759-6103
Facsimile/Télécopieur: (613) 759-1937
960 Carling Ave, #1136
Ottawa, Ontario
K1A 0C6
mcgrawj at agr.gc.ca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20050818/20b0da12/attachment.html
More information about the Chameleon
mailing list