[Mapserver-users] shape bounds for map and layer with different projections
Lowell Filak
lfilak at medinaco.org
Thu Aug 14 10:03:29 PDT 2003
What if you did a grep against the epsg file itself using the epsg:xxxx
result?
It should return all the parameters, ie.
grep "<200>" /usr/local/share/proj/epsg
=
<200> +proj=tmerc +lat_0=0.000000000 +lon_0=-62.000000000 +k=0.999500
+x_0=400000.000 +y_0=0.000 +ellps=clrk80 +units=m no_defs <>
Lowell
The following message was sent by Armin Burger <armin.burger at libero.it>
on Thu, 14 Aug 2003 17:38:40 +0100.
> Hi
>
> I found a problem with map and layer having different projections:
>
> For queries I want to display the result with a link that allows a zoom
> to the respective feature in the map. In MapScript I use the function
> $shape->bounds
> to get the shape extent used for the zoom-to-feature. This works well,
> when layers are in the same projection as the map.
>
> If the layer, however, has a different projection, then the shape bounds
> are returned in the layer projection, not in the map projection. This
> way, you cannot use this extent rectangle to make a zoom in because it
> typically is of a completely different dimension compared to the map
> projection.
>
> I was thinking of a workaround by re-projecting the shape extent
> rectangle. For that I have to get the map projection and apply this
> projection to the rectangle. This may work when the projection is defined
> explicitely with all parameters (lat_0, lon_0, ellipsoid, etc) but not
> when using the 'init=epsg:xxxx' notation. With epsg, the request
> $map->getProjection() just retrieves the string 'init=epsg:xxxx'. But to
> define a new projection object (ms_newprojectionobj) I have to define the
> projection with all the single parameters and not just the epsg.
>
> I hope that I expressed this small 'problem' in an understandable way
>
> Is there a solution possible to solve that? The best would be to have the
> '$shape->bounds' return the extent in map projection. A maybe simpler
> solution might be to have the ability to define a projection object via
> epsg. Perhaps this would be similar to the 'setWKTProjection()' method
> that exists for layers and maps.
>
> Any thoughts about it?
>
> Regards
>
> Armin
>
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list