[MAPSERVER-USERS] Using OGR to plot x,y data from MySQL with Attribute Data

fastturtle beckjoh at KNOLOGY.NET
Fri May 30 20:33:43 PDT 2008


Hi!

I am new user to MapServer and I think I have a simple task.  
I have a MySQL table called data1 with x,y (Lat, Long) data stored in two
fields and attribute data stored in another field called SPECIFIC.  The
SPECIFIC field has three values that can be an option for a point (bad,
good, excellent).  

I have successfully used OGR to plot my points using the following code,
however I cannot find an example of how to map the points based on the
attribute in the SPECIFIC fields. I really need to color
code the points by the attibute field.  For example, I would color all
points with a bad rating as red, good as blue and excellent as green.  How
can I alter my code in the map file to accomplish this task?

<OGRVRTDataSource>
    <OGRVRTLayer name="data">
       
<SrcDataSource>MYSQL:test,user=user,password=password,port=3306,tables=data1</SrcDataSource> 
        <SrcSQL>SELECT * FROM data1</SrcSQL> 
        <GeometryType>wkbPoint</GeometryType>
        <GeometryField encoding="PointFromColumns" x="Long" y="Lat"/> 
    </OGRVRTLayer>
</OGRVRTDataSource>

#
  # Start of layer definitions
  #
 
  LAYER
    NAME "MyAqui"
    STATUS DEFAULT
    TYPE POINT
    CONNECTIONTYPE OGR  
    CONNECTION "aquidata.ovf"
    DATA "data"
    CLASS 
       NAME "MyClass"
           STYLE
               SYMBOL 'circle'
               SIZE 15
               COLOR 0 255 0
           END
    END
END


Thanks so much for any help in advance.

-- 
View this message in context: http://www.nabble.com/Using-OGR-to-plot-x%2Cy-data-from-MySQL-with-Attribute-Data-tp17571551p17571551.html
Sent from the Mapserver - User mailing list archive at Nabble.com.




More information about the MapServer-users mailing list