[Mapserver-users] query

Srinivas Reddy csr at rboxtech.com
Thu Mar 6 01:10:07 PST 2003


Thanks for replay Mr.Antti Roppola,
I traid which u explained in such way. Still i did not get the result.so
what i will do for this.
csreddy

----- Original Message -----
From: <Antti.Roppola at brs.gov.au>
To: <csr at rboxtech.com>
Cc: <Mapserver-users at lists.gis.umn.edu>
Sent: Thursday, March 06, 2003 2:30 PM
Subject: RE: [Mapserver-users] query


> I have only taken a cursory glance at your code but:
>
> $mappointq->setXY($map_x,$map_y);
> $mappointq->setXY($map->width / 2,$map->height / 2);
>
> Won't this set your query point to *only* the latter?
> And this won't be in map coordinates, but page coordinates.
>
> Maybe try manually setting to known coordinates and test that
> you are actually getting results back before trying to read them:
>
> $mappointq->setXY(-36.25,145.30); // pick a known good coordinate
>
> for ($ilayer=0; $ilayer<=$map->numlayers; $ilayer++)
> {
> $selLayer = $map->GetLayer($ilayer);
> // you'll get output in your web browser here if no
> // results are being returned.
> $selLayer->queryByPoint($mappointq, MS_MULTIPLE, -1);
> }
>
> Hope this helps,
>
> Antti
>
> -----Original Message-----
> From: Srinivas Reddy [mailto:csr at rboxtech.com]
> Sent: Thursday, 6 March 2003 3:34 PM
> To: Mapserver-users at lists.gis.umn.edu
> Subject: Re: [Mapserver-users] query
>
>
> Thanks Eric, But i like to display the query resutls in the same page. I
> written like this
> $mappointq = ms_newpointObj();
> $mappointq->setXY($map_x,$map_y);
> $mappointq->setXY($map->width / 2,$map->height / 2);
>
>
>  for ($ilayer=0; $ilayer<=$map->numlayers; $ilayer++)
>  {
>    $selLayer = $map->GetLayer($ilayer);
>
>   $queryResult = $selLayer->queryByPoint($mappointq, MS_MULTIPLE, -1);
> }
>
> for the above code i did not get any results. So how can i get the results
> form the layer? Can anyone help this point.
>
> ----- Original Message -----
> From: "Eric Bridger" <eric at gomoos.org>
> To: <csr at rboxtech.com>
> Sent: Wednesday, March 05, 2003 4:54 PM
> Subject: Re: [Mapserver-users] query
>
>
> You will need to define a TEMPLATE "template.html" in your LAYERS.  Even
> if you do not want to use the templates.html to display the results, you
> still need to have a TEMPLATE in the layer.  The html does not even to
> exist.
>
> Hope this helps.
> Eric
>
>
> On Wed, 2003-03-05 at 12:45, Srinivas Challa wrote:
> >
> > Hi Daniel,
> > Thanks for the replay, I need ,?When I am clicking on map selected at
> point or in rectangle area content recognitions with PHP.  I had written
the
> map file like this
> > MAP
> >   NAME "New Demo"
> >   STATUS ON
> >   EXTENT 184861.560567497 88197.0005976087 2380774.92575433
> 826403.167230631
> >   SIZE 800 480
> >   SHAPEPATH "data"
> >   IMAGECOLOR 255 255 255
> >   UNITS meters
> >
> >   WEB
> >     IMAGEPATH "/apache/htdocs/tmp/"
> >     IMAGEURL "/tmp/"
> >
> >   METADATA
> >       "WMS_TITLE"     "New Demo"
> >       "WMS_ABSTRACT"  "Information system"
> >       "WMS_ACCESSCONSTRAINTS"    "none"
> >       "WMS_ONLINERESOURCE"    "http://localhost:81/demo/demo.phtml"
> >       "WMS_SRS"    "EPSG:26915"
> >     END
> >   END
> >   #
> >   # Start of reference map
> >   #
> >   REFERENCE
> >     STATUS ON
> >     IMAGE "graphics/refreance2.gif"
> >     SIZE 200 80
> >     COLOR -1 -1 -1
> >     OUTLINECOLOR 0 0 255
> >     MARKERSIZE 3
> >     EXTENT 184861.560567497 88197.0005976087 2380774.92575433
> 826403.167230631
> >
> >   END
> >
> >   QUERYMAP
> >     STATUS ON
> >     SIZE 400 400
> >     STYLE HILITE
> >     COLOR 255 0 0
> >
> >   END
> >   #
> >   # Start of legend
> >   #
> >   LEGEND
> >     KEYSIZE 18 12
> >     LABEL
> >       TYPE BITMAP
> >       SIZE MEDIUM
> >       COLOR 0 0 89
> >     END
> >     STATUS ON
> >   END
> >
> >   #
> >   # Start of scalebar
> >   #
> >   SCALEBAR
> >     STATUS TRUE
> >     COLOR 0 0 0
> >     IMAGECOLOR 255 255 255
> >     OUTLINECOLOR 0 0 0
> >     UNITS kilometers
> >     INTERVALS 5
> >     SIZE  200 5
> >     STYLE 0
> >     LABEL
> >       SIZE tiny
> >       COLOR 0 0 0
> >     END
> >   END
> >   #
> >   # Start of symbol definitions (we're only using a few)
> >   #
> >   SYMBOL
> >     NAME "circle"
> >     TYPE ELLIPSE
> >     FILLED TRUE
> >     POINTS
> >        1 1
> >     END
> >   END
> >
> >   # Start of layer definitions
> >   LAYER
> >     NAME "Boundary"
> >     STATUS ON
> >     CONNECTIONTYPE OGR
> >     CONNECTION "data/Boundary.tab"
> >     TYPE POLYGON
> >     CLASSITEM "NAME"
> >     LABELITEM "NAME"
> >     METADATA
> >       "DESCRIPTION"   "Daerah"
> >       "RESULT_FIELDS" "Name"
> >       "WMS_TITLE"    "Selected Information"
> >       "WMS_ABSTRACT"    "more information."
> >       "WMS_SRS"    "EPSG:26915"
> >     END
> >     CLASS
> >      COLOR 255 255 200
> >      OUTLINECOLOR 0 0 0
> >      LABEL
> >           MINFEATURESIZE 40
> >           MINDISTANCE 150
> >           POSITION CC
> >           SIZE TINY
> >           COLOR  0 0 200
> >     END
> >
> >     END
> > End
> >
> >  LAYER
> >     NAME "Fed_Rd"
> >     STATUS ON
> >     CONNECTIONTYPE OGR
> >     CONNECTION "data/Fed_Rd.TAB"
> >     TYPE LINE
> >     #STYLEITEM "AUTO"
> >     CLASSITEM "NAME"
> >     LABELITEM "Name"
> >     METADATA
> >       "WMS_TITLE"    "Selected Information"
> >       "WMS_ABSTRACT"    "more information."
> >       "WMS_SRS"    "EPSG:26915"
> >     END
> >     CLASS
> >      COLOR 255 0 0
> >      #OUTLINECOLOR 255 0 0
> >     LABEL
> >           #MINFEATURESIZE 40
> >           #MINDISTANCE 150
> >           POSITION CC
> >           SIZE tiny
> >           COLOR  10 100 100
> >   #SHADOWCOLOR  80 80 80
> >   #SHADOWSIZE 1 1
> >     END
> >     END
> >   END
> >
> >  LAYER
> >     NAME "Highway"
> >     STATUS ON
> >     CONNECTIONTYPE OGR
> >     CONNECTION "data/Highway.TAB"
> >     TYPE LINE
> >    # STYLEITEM "AUTO"
> >     CLASSITEM "NAME"
> >     LABELITEM "NAME"
> >
> >     METADATA
> >       "WMS_TITLE"    "Selected Information"
> >       "WMS_ABSTRACT" "more information."
> >       "WMS_SRS"    "EPSG:26915"
> >     END
> >
> >     CLASS
> > #SYMBOL "MYSYMBOL"
> > COLOR  46 210 200
> >     LABEL
> >           MINFEATURESIZE 40
> >           MINDISTANCE 150
> >           POSITION CC
> >           SIZE TINY
> >           COLOR  0 800 200
> >     END
> >     END
> >   END
> >
> >
> >
> >  LAYER
> >     NAME "Railways"
> >     STATUS ON
> >     CONNECTIONTYPE OGR
> >     CONNECTION "data/Railway.TAB"
> >     TYPE LINE
> >  STYLEITEM "AUTO"
> >         CLASSITEM "NAME"
> >  LABELITEM "NAME"
> >
> >     METADATA
> >       "WMS_TITLE"    "Selected Information"
> >       "WMS_ABSTRACT"    "more information."
> >       "WMS_SRS"    "EPSG:26915"
> >     END
> >     CLASS
> >   NAME "Rail Lines"
> >   COLOR 0 0 0
> >   OVERLAYSYMBOL dashed2
> >   OVERLAYCOLOR 0 0 0
> >   OVERLAYSIZE 3
> > LABEL
> >   MINFEATURESIZE 40
> >   MINDISTANCE 150
> >   POSITION CC
> >   SIZE TINY
> >   COLOR 100 0 200
> > END
> >     END
> >   END
> >
> >
> >  LAYER
> >     NAME "State_Rd"
> >     STATUS ON
> >     CONNECTIONTYPE OGR
> >     CONNECTION "data/State_Rd.TAB"
> >     TYPE LINE
> >     #STYLEITEM "AUTO"
> >     CLASSITEM "NAME"
> >     LABELITEM "NAME"
> >
> >     METADATA
> >       "WMS_TITLE"    "Selected Information"
> >       "WMS_ABSTRACT"    "more information."
> >       "WMS_SRS"    "EPSG:26915"
> >     END
> >     CLASS
> > COLOR 180 180 180
> >     LABEL
> >           MINFEATURESIZE 40
> >           MINDISTANCE 150
> >           POSITION CC
> >           SIZE TINY
> >           COLOR  220 100 0
> >     END
> >     END
> >   END
> >     # Seven Layer Under tesing Process...  sucessed
> >  LAYER
> >     NAME "Towns"
> >     STATUS ON
> >     CONNECTIONTYPE OGR
> >     CONNECTION "data/ Towns.TAB"
> >     TYPE POINT
> >     CLASSITEM "TOWN"
> >     LABELITEM "Town"
> >
> >    METADATA
> >       "DESCRIPTION"   " Towns"
> >       "RESULT_FIELDS" "Town"
> >       "WMS_TITLE"    "Selected Information"
> >       "WMS_ABSTRACT"    "more information."
> >       "WMS_SRS"    "EPSG:26915"
> >     END
> >     CLASS
> >         SYMBOL 'symbols/town.gif'
> >       LABEL
> >           MINFEATURESIZE 100
> >           MINDISTANCE 450
> >           POSITION LC
> >           SIZE TINY
> >           COLOR 40 100 40
> >       END
> >     END
> >   END
> >
> >
> >
> > # End of the map
> > END
> > For the above map Script is working fine. But while I am querying  I did
> not getting the results. How can query the map using PHP at point and
> selected rectangle area.
> > Is any one can send the script for this.
> >
> > In this project i am not using applets. Just Map querying on 7 layers
> using php.
> >
> > srinivasa reddy Challa
> >
> >
> >
> > Srinivas Reddy wrote:
> > >
> > > Now am new to this technologies but I had done some of project with
> > > the reference of DM solutions map reference. In DM
> > > solutions they are done using SHP data files. But  I am using  "*.Tab"
> > > data. How can I query the content of the "*.TAB"layers
> > > using php and mapscript.  This is my problem. This is my email id :
> > > csr at rboxtech.com or reddy_challa at yahoo.com
> >
> >
> > You will have to provide more details on what you are trying to do
> > exactly if you want anyone to be able to help.
> >
> > If by "query the contents of .tab layers" you mean clicking on a map
> > image and selecting features from a TAB layer then this works the same
> > way for shapefiles and for .tab files.  The only difference is that you
> > need MapServer with OGR support, and you define an OGR CONNECTION in
> > your LAYER.  For more details on using OGR CONNECTIONS, see the OGR
> > HOWTO at http://mapserver.gis.umn.edu/doc36/ogr-howto.html
> >
> > Daniel
> > --
> > ------------------------------------------------------------
> >  Daniel Morissette               morissette at dmsolutions.ca
> >  DM Solutions Group              http://www.dmsolutions.ca/
> > ------------------------------------------------------------
> > _______________________________________________
> > Mapserver-users mailing list
> > Mapserver-users at lists.gis.umn.edu
> > http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> >
> >
> >
> >
> > _______________________________________________
> > Mapserver-users mailing list
> > Mapserver-users at lists.gis.umn.edu
> > http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> >
>
>
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>
> _______________________________________________
> 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