[mapserver-users] Re: JOIN in a mapfile from a shapefile to a MySQL database

Minka Stoyanova minka.stoyanova at gmail.com
Thu Sep 18 09:35:18 EDT 2008


Dear Charles, dear list,

As I said, I used your piece of map-file code and made the connection. Now I
try the same but with another shapefile to another table in the same
database, and I receive a segmentation fault of the Apache!

Here follows the code from the map-file:

- this works just fine - the simple layer from the shapefile:

   LAYER # States point layer 1 begins here from the shapefile
    NAME         "cpoints"
    DATA         controlpoints_v04
    STATUS       ON
    TYPE         POINT
    CLASS
      SYMBOL 'circle'
      SIZE 8
      COLOR 0 0 255
      OUTLINECOLOR 243 255 17
    END
  END # States point layer 1 ends here

- this works fine:

LAYER # States point layer 1 begins here
    NAME         "synoptic_stations"
    CONNECTIONTYPE ogr
    CONNECTION "../data/ESRI/UTM/synoptic_stations.shp"
    DATA "SELECT * FROM synoptic_stations LEFT JOIN
'MYSQL:meteo,host=myhost,user=mysqluseraccount,password=mysqluserpasswd'.bgc
ON synoptic_stations.A = bgc.sin_kod"
    STATUS       ON
    TYPE         POINT
    CLASS
      SYMBOL 'circle'
      SIZE 8
      COLOR 255 0 0
      OUTLINECOLOR 0 0 0
    END
  END # States point layer 1 ends here

- this fails with a segmentation fault:

LAYER # States point layer 1 begins here
    NAME         "cpoints"
    CONNECTIONTYPE ogr
    CONNECTION "../data/ESRI/mt/controlpoints_v04.shp"
    DATA "SELECT * FROM controlpoints_v04 LEFT JOIN
'MYSQL:meteo,host=myhost,user=mysqluseraccount,password=mysqluserpasswd'.controlpoint
ON controlpoints_v04.ID=controlpoint.CODENUM"
    STATUS       ON
    TYPE         POINT
    CLASS
      SYMBOL 'circle'
      SIZE 8
      COLOR 255 0 0
      OUTLINECOLOR 0 0 0
    END
  END # States point layer 1 ends here

So: the database is the same, mysql user and passwd are the same, the
connection is from the same Apache server with the same php mapscript
application. The shapefiles are different and the tables in the database are
different.

Where could be the problem?

Thanks!
Minka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080918/ed13fb20/attachment.html


More information about the mapserver-users mailing list