[mapserver-users] csv join in mapscript/OGR

Minka Stoyanova minka.stoyanova at gmail.com
Mon Jul 1 05:17:17 PDT 2013


Hello,

I have a point shape layer and I would like to color each point according
to a number in a  csv file= The csv file is:

id,color
1080,2
1090,4
11,2
12,5


The ID column is the same as the NUMBER column in the shape file.

This is my layer:
LAYER # Stations point layer 1 begins here
    NAME         "meteo_oper"
    CONNECTIONTYPE ogr
    CONNECTION "../data/ESRI/meteo_oper.shp"
    DATA "SELECT * FROM meteo_oper LEFT JOIN 'CSV:SPI201301.csv' ON
meteo_oper.NUMBER=SPI201301.id"
    STATUS ON
    TYPE point
       CLASS
        SYMBOL 'circle'
        SIZE 8
        COLOR 0 255 0
        OUTLINECOLOR 0 0 0
      END
  DEBUG ON
  END # Stations point layer 1 ends here

And when I use OGR from command line to test my map-file:
shp2img -m watersheds.map -o tr.png

I receive:
msDrawMap(): Image handling error. Failed to draw layer named 'meteo_oper'.
<br>
msOGRFileOpen(): OGR error. ExecuteSQL(SELECT * FROM meteo_oper LEFT JOIN
'CSV:SPI201301.csv' ON meteo_oper.NUMBER=SPI201301.id) failed.
SELECT from table CSV:SPI201301.csv failed, no such table/featureclass. <br>
Segmentation fault

Any idea?
Minka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20130701/6510513f/attachment.html>


More information about the mapserver-users mailing list