ogr and mysql help!

lemay tzzbzzgf at HOTMAIL.COM
Tue Aug 8 01:47:18 PDT 2006


hi,all:
   I use ogr to connect mysql database and shp file with "left join" clause.and i only want to select some part of data from a mysql table ,how can i do ? Does ogr support "left join" and "where" clause together?

MAP
  IMAGETYPE      PNG
  #EXTENT         73 10 137 53
  EXTENT         116 27 124 35.5
  UNITS          DD
  SIZE           400 300
  #FONTSET "fonts/fonts.list"
  SHAPEPATH      "data"
  IMAGECOLOR     255 255 255

LAYER # States polygon layer begins here
    DEBUG        ON    
    NAME         jiangsu
    STATUS       DEFAULT
    TYPE         polygon
    DEBUG        ON

    CONNECTIONTYPE ogr
    CONNECTION "/ms4w/apps/gmap/data/jiangsu.shp"
    #DATA "SELECT jiangsu_pro.*,test.* FROM jiangsu_pro left join 'MYSQL:test,host=localhost,user=root,password=491025,table types=memory'.test ON jiangsu_pro.JIANGSU_ID= test.Id" 

    #DATA "SELECT jiangsu_pro.*,mysqltest.* FROM jiangsu_pro left join 'MYSQL:test,host=localhost,user=root,password=491025,table types=memory'.mysqltest ON jiangsu_pro.JIANGSU_ID= mysqltest.Id where mysqltest.Area_data='3'" 
    DATA "SELECT * FROM jiangsu" 

    PROJECTION
      "init=epsg:4609"
    END

   #CLASSITEM "test.Area_name"
   #CLASSITEM "mysqltest.area_name"
   CLASS 
   #   EXPRESSION   'Ganyu'
      COLOR        255 0 255
      OUTLINECOLOR 0 132 32
   END
   
 END # States polygon layer ends here


END # end of map file/object
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060808/9c4de9ad/attachment.htm>


More information about the MapServer-users mailing list