Java Mapserver app - queryLayerByPoint. How?

Jeresin info at JERESIN.CO.ZA
Wed Nov 14 06:36:15 EST 2007


Umberto Nicoletti wrote:
> 
> There is a queryByPoint code example here (before last paragraph):
> 
> http://mapserver.gis.umn.edu/docs/howto/javamapscript
> 
> HTH,
> Umberto
> 
> 


Hi Umberto, thanks for the reply

Yes, I'm using code very similar to that to query my layers...and I'm
getting results back from the layers. What I'd like to know if is there a
way of obtaining the data associated with the returned results? Let me give
you a clear example:

On a layer called "TOWNS" there are points (towns) as appearing in a .map
file. The TOWNS.shp file provides me with the actual points. However, there
is a TOWNS.dbf file which contains the town name, the population, the
addresses of certain facilities, and so on. It's *that* data that I want to
access and display. 

Currently, when I query the layer, I do get the shape (town) and I can get
the coordinates of the point, the shape index, and so on. That's no problem.
However, I would like to get hold of that *other* data, contained in the
.dbf file. Obviously the data is accessible, hence the fact that I can
display labels as text from the dbf, but I don't see a clear link between a
point query on the map and that data...perhaps by CLASSITEMs but that seems
an expensive work-around. As you see by my guessing, I clearly have no idea
;) The one solution - one that has been working but which I'd prefer /not/
to use - is by getting the shape index from the layer query and then, using
a 3rd party Java library, obtaining the data from the dbf file and matching
data sets with map entities. I'd actually prefer not to use the additional
library at all, it just feels so wrong.

Hope you understand my dilemma now, hope you can help...
-- 
View this message in context: http://www.nabble.com/Java-Mapserver-app---queryLayerByPoint.-How--tf4800141.html#a13745007
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list