[mapserver-users] SV: Projection and mapquery
Morten Sickel
Morten.Sickel at nrpa.no
Thu Jan 28 11:38:35 PST 2010
Sorry, forgot to say
mapserver version 5.2.2 from osgeo4w php 5.2.5 if that matters
Morten
________________________________________
Fra: mapserver-users-bounces at lists.osgeo.org [mapserver-users-bounces at lists.osgeo.org] på vegne av Morten Sickel [Morten.Sickel at nrpa.no]
Sendt: 28. januar 2010 19:37
Til: mapserver-users at lists.osgeo.org
Emne: [mapserver-users] Projection and mapquery
I presently have a set up in which I plot some measurements on some background maps. Things work fine, but I want to add the possibility to query the measurement data set by clicking on a measurement. The measurements have coordinates in lat lon and I only manage to query those data if I plot the entire map in the same projection. I have tried to reproject the query point using code like
$mapproj=$map->getProjection();
$layerproj=$map->getlayerbyname('mobil')->getProjection();
if($mapproj!=$layerproj){
$mapproj=ms_newProjectionObj($mapproj);
$layerproj=ms_newProjectionObj($layerproj);
debug(array($geopoint->x,$geopoint->y));
$geopoint->project($mapproj, $layerproj);
// projects the point from the projection of the map to the projection of layer
debug(array($geopoint->x,$geopoint->y));
}
the debug function just dumps the data and it is clear that the point is correctly reprojected, but anyhow
$map->queryByPoint($geopoint, MS_MULTIPLE, 1);
never gives anything if the mobil-layer and the map are in different projections.
Are there any ways to overcome this? As I am mostly working on maps from 60 deg north and upwards, geographical projection is not the projection of choise and I would prefer not having to reproject the measurement data.
M._______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list