[Mapserver-users] query

Srinivas Challa csr at rboxtech.com
Wed Mar 5 07:45:25 EST 2003


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







More information about the mapserver-users mailing list