[mapserver-users] Create Dynamic Pt Layer, then queryByPoint()
Azimuth, E. Perik
perik at azimuth.nl
Mon Mar 4 02:55:28 PST 2002
Hi Dan,
Not able to query the points when you created shapefile and database
file,....strange. I guess this should work though.
Maybe check your coding.
So you want to add the info dynamic to the map/image and retreive the info
from a SQL database if i am correct.
Maybe to use your dynamicly created points for a query you could use
something like:
Point-query:
1) get the point (xy, pixels)
2) translate pixel-coords to geo-coords
3) search in the database for closest point
Rectangle query:
1) get the points of the rectangle (xy, pixels)
2) translate pixel-coords to geo-coords
3) search in the database for points inside the rectangle
Erwin
At 23:59 3-3-02 -0800, Dan Barron wrote:
>Thanks for the reply Erwin. I tried your suggestion, and was able to
>create the shapefile and dbf file, but still unable to query after turning
>the layer on. Apache also began crashing on me while trying this test,
>not sure if it was my scripting or not that caused the latter. I also
>prefer to avoid creating this amount of disk i/o if possible, no
>additional disk i/o would be my goal, seems it should be possible.
>
>Dan
>
>At 02:14 PM 3/3/2002 +0100, E Perik wrote:
>>Hi Dan,
>>
>>Could you not create a new-shapefile of your points and then add this
>>'name' in the Map-layer. Then add the new-shapefile to the map through a
>>dummy-layer.
>>
>>I used similar to retrieve a shape-object from an existing shapefile and
>>then:
>>
>>1) Get shapeobject from existing-shapefile (through its index)
>>2) Put it in new-shapefile
>>3) Create dbf-file with name of new-shapefile
>>4) Clear new-shapefile
>>5) Add new-layer to map-object (default of this layer is set to OFF)
>>6) Show new-layer
>>7) Draw the map (now includes newly created shapefile ;-) )
>>
>>In part 1) yours would differ. Her you create the shape-object (points)
>>from the SQL-database. Part 3) is needed, because mapscript does not
>>make a dbf-file.
>>
>>
>>Erwin
=================
Azimuth Geodetic
Koldingweg 8
9723 HK Groningen
tel. 050-5493454
fax. 050-5497217
=================
www.azimuth.nl
perik at azimuth.nl
=================
More information about the MapServer-users
mailing list