[Mapserver-users] Map projections continued

Krzysztof Chodak k.chodak at autoguard.pl
Fri Mar 28 01:51:39 EST 2003


Got he answer: screen Y axis has growing values from top to bottom in
contrary to map latitude so the calculation should look like
img_pixel_x = round ( (mercator_symbol_x - mercator_extent_min_x) *
image_width_in_pixels / (mercator_extent_max_x - mercator_extent_min_x) )
and
img_pixel_x = image_width_in_pixels - round ( (mercator_symbol_x -
mercator_extent_min_x) * image_width_in_pixels / (mercator_extent_max_x -
mercator_extent_min_x) )

Stupid mistake.

----- Original Message -----
From: "Krzysztof Chodak" <k.chodak at autoguard.pl>
To: <Mapserver-users at lists.gis.umn.edu>
Sent: Thursday, March 27, 2003 6:14 PM
Subject: [Mapserver-users] Map projections continued


> Hello again,
>
> after some theoretical problems now I got practical one. Maybe someone
have
> an idea...
>
> I use MapServer to serve some maps in Mercator. In server response I got
an
> extent.
> My task is to tell in which coordinate of map image I should place another
> symbol.
> I got geographic coordinated of that symbol but non-projected (in WGS84
> datum).
> My first idea was to convert coordinates of that symbol into Mercator and
> then compute image coordinates using simple proportion:
> img_pixel_x = round ( (mercator_symbol_x - mercator_extent_min_x) *
> image_width_in_pixels / (mercator_extent_max_x - mercator_extent_min_x) )
> and similar one for y-coordinate.
>
> As my symbols are floating around proper position on map image I know that
a
> have made a mistake.
> Can anyone point it out for me?
>
> Thanks in advance for any information,
>
> Best regards,
>
> Krzysztof Chodak
>
> _______________________________________________
> 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