[mapserver-users] projections [shpmidx] [shpmidy]

Steve Lime steve.lime at dnr.state.mn.us
Sat Sep 14 12:53:08 EDT 2002


Another little issue that has bothered me over time. Should shpmidx and
other similar parameters be returned in the map projection or their
native projection. You've found out that the latter is the current
behavior. I'd appreciate opinions one way or another. I've always viewed
query output as being pure, but if you look at the way WMS works you
certainly have that control. I'd like to get this resolved for 3.7.

Projection-wise, you'll definitely see better performance if you
pre-project. On windows I don't know a tool, other than ArcView and such
that you can do this with. I submitted a perl script to the Wiki to do
this with MapScript on the UNIX side of things. If you've got a linux
box laying around you could make use of that.

What I, or someone else should do is set up a projection service on a
website. Upload a shapefile with a projection definition and return a
new shapefile.
Anyone? Anyone? (it would be easy with that perl script...)

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> "Marco" <marco at mediaeval.nl> 09/11/02 02:14AM >>>
Hi list,

If the next question is a stupid one, excuse me. I am newbe.

context:

I use mapserv CGI (no mapscript) and a Apache webserver with PHP (on a
windows machine for testing). I am building a web-application with
dynamic maps. 

problem:

I use a template file to get information about the map-features on the
current map. The tags [shpmidx] and [shpmidy] provides information on
the exact position of a feature (see
http://mapserver.gis.umn.edu/doc36/template-reference.html ).

With simple lineair algebra it is possible to calculate the xy-position
of this feature on the actual generated image. (a lineair transformation
from "real world" lat-lon coordinates to "image" x-y pixelcoordinates).
I use these information to create some kind of javascript rollover
interface; if the mouse hovers a feature, the webapplication respons
immediately, without the need of connecting to the server.

So far so good. Everything works fine. So now for the problem. If I
deploy a projection ("proj=stere") Nothing works anymore. That is
because [shpmidx] and [shpmidy] gives the lon-lat stuff, but i need the
xy coordanates on the generated image of the map. Sure it should be
possible to write transformations for projected maps (a lot of sinus and
cosinus, arctangens etcetera i suppose) but i believe that's a ticket to
the nearest snake pit.

Is there a solution for this (withhout the need of writing my own
transformation formulas)

Or, if I have to write transformation, does anybody now the formulas
for this projection:

PROJECTION

"proj=stere"

"lat_0=52.156160556"

"lon_0=5.387638889"

"k=0.0000999908"

"x_0=0.000"

"y_0=0.000"

"ellps=bessel"

END




Cheers,

Marco




Marco Pieck, marco at mediaeval.nl 
Mediaeval Vorm & Visie
http://www.mediaeval.nl/ 
postbus 1050, 6501 BB  Nijmegen,  the Netherlands 
tel: ++ 31 24-3818196, fax: ++ 31 24-3818183




More information about the mapserver-users mailing list