[Mapserver-users] RE: need some help with queryByPoint()

Charlton Purvis cpurvis at asg.sc.edu
Mon Aug 4 13:34:26 EDT 2003


Hi, Bhavana:

OK, you REALLY need to at least cc the list w/ your questions rather
than email directly.  There are other people who can answer your
questions, and there are other folks who might benefit from them as well
as any answers.  

I've looked at your code, and I'm trying to understand what the problem
is.  I think I understand that you don't get query hits when you think
you should, right?  But according to your message, I get the impression
that you don't want to have the mouse-click georeferenced, but that
doesn't make sense.  Why wouldn't you want the new mouse-click to be
georeferenced w/ your new extent?

Off the top-of-my-head, though, I can imagine that unless you are saving
your current extents, you are not always referencing the proper domain.

Here is a sequence of events that works for me (not sure if you are or
are not doing them):
* enter your page, you have extents hardcoded, no problem
* user clicks to zoom
* compute georeferenced x/y coordinates
* zoomtopoint
* save new_extents in a hidden variable
* on reload check to see if you need to avoid using your hardcoded
extents if new_extents have been passed (if new_extents, then set them
before you do anything)

It is possible that you're not setting the extents properly w/ every new
instance.

I'm happy to help, but I won't help unless you cc the list.  Sorry to be
preachy, but private emails aren't in the spirit of open source.

Charlton

-----Original Message-----
From: Bhavana Rakesh [mailto:Bhavana.Rakesh at noaa.gov] 
Sent: Wednesday, July 30, 2003 5:19 PM
To: Charlton Purvis
Subject: Re: need some help with queryByPoint()

Hi Charlton,
Thanks for you reply.  I figured out the problem with slapping the
image.
It's actually not a mapscript problem. I was more a java script
problem(oops!).  I've fixed it up, but now am having a different
problem.

When I zoom_in/zoom_out/pan pan on the image, and then try to query the
image, I don't think the x,y co-ordinates that I'm passing is right.  My
guess is, the x/y co-ordinates are with respect to the new
zoomed_in/zoom_out/panned image and not with respect to the original
image.
Hence when  I geo reference this new point and try to query it, the dbf
file
does not return any results.  Would you have any pointers how to fix
this.
I have attached the phtml code with this email.  Please take a look at
it if
you can spare some time.  I really appreciate your help.
Thanks - Bhavana

Charlton Purvis wrote:

> Hi, Bhavana:
>
> cc. the list since there are plenty of people smarter than I that
might
> be able to nail it on the first shot.
>
> But here goes.  I can't remember much about legends off the top of my
> head.  I got down and dirty w/ them before, and now it's all
automated.
> So here are a couple of guesses:
>
> * In your .map, does your LEGEND have a TEMPLATE associated w/ it?
> * If processquerytemplate is supposed to return a path (don't
remember),
> is it creating that .png, i.e. is there a
>
/home/http/development/html/bhavana/test_bh/tmp/SNMAPPING1058992693.png
> and does it look right if you open it by hand?  If you are passing the
> path to the image and not the image itself, it needs to be relative to
> your website.  If your path is truly what you said above, then your
> browser would be trying to display the equivalent of
>
http://your.server.com/home/http/development/html/bhavana/test_bh/tmp/SN
> MAPPING1058992693.png.  And I'm not 100% sure you mean for it to do
> that.
>
> Charlton
>




More information about the mapserver-users mailing list