[mapserver-users] nquery against mysql is ignoring 1 row from resultset

P. R.M. romero619 at hotmail.com
Thu Mar 26 00:46:21 EDT 2009


I need help figuring out why mapserver is ignoring one row from my resultset.
Ive attached all of the necessary files.
 
testdata.sql - sql commands to setup a simple mysql table with some test data
test.map - my mapfile
test.ovf - the ogr/mysql file
testmap.html - the html template file
out.html - the resulting html output
 
my output, out.html, should be an html imagemap with 4 'areas'that match the 4 rows in my db table, but only three areas are being created. 
 
mapserver is correctly drawing 4 symbols for the 4 rows in my database table, but it misses the 2nd row in the output when parsing the [featureset][/featureset] sections of the html template file.
 
Can anyone reproduce this problem?
 
Im running the latest version of mapserver on linux, built from source.
 
Please help,
Thanks
P.Romero
_________________________________________________________________
Internet Explorer 8 – Now Available. Faster, safer, easier.
http://clk.atdmt.com/MRT/go/141323790/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090325/d9145b38/out-0001.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090325/d9145b38/testmap-0001.html
-------------- next part --------------
# example map file for creating image maps with mapserver
MAP
  NAME 'basic'
  SIZE 600 600
  EXTENT -100 10  -60 30
  IMAGECOLOR 167 200 255
  SHAPEPATH "/data/shp"
  UNITS DD
  
  PROJECTION
    "init=epsg:4326"
  END

  IMAGETYPE "AGG"
  
  OUTPUTFORMAT
    NAME 'AGG'
    DRIVER AGG/PNG
    IMAGEMODE RGB
  END
  
  OUTPUTFORMAT
    NAME 'html'
    DRIVER 'TEMPLATE'
    MIMETYPE 'text/html'
    FORMATOPTION 'FILE=/data/www/html/test/testmap.html'
  END


  QUERYMAP
    STATUS ON
    STYLE NORMAL
  END

  WEB
    QUERYFORMAT 'html'  
  END

  WEB
    IMAGEPATH "/tmp/"
    IMAGEURL "/tmp/"
    MAXSCALE 15500000
  END

LAYER
  NAME "mypoints"
  STATUS DEFAULT
    CONNECTIONTYPE OGR
    CONNECTION "test.ovf"
    DATA "mypoints"
  TYPE POINT
  TEMPLATE "/data/www/html/test/testmap.html"
    CLASS 
       NAME "None"
	   STYLE
	       SYMBOL 'circle'
           SIZE 14
	       COLOR 0 255 0
	   END
    END

END

# Symbols ###################

SYMBOL
  NAME 'circle'
  TYPE ELLIPSE
  POINTS 1 1 END
  FILLED TRUE
END

END
-------------- next part --------------
<OGRVRTDataSource>
    <OGRVRTLayer name="mypoints">
        <SrcDataSource>MYSQL:surf,user=root,password='',host=localhost,port=3306,tables=testdata</SrcDataSource>
        <SrcSQL>SELECT * FROM surf.testdata order by id asc</SrcSQL>
        <GeometryType>wkbPoint</GeometryType>
        <GeometryField encoding="PointFromColumns" x="lng" y="lat"/>
    </OGRVRTLayer>
</OGRVRTDataSource>
-------------- next part --------------
-- phpMyAdmin SQL Dump
-- version 3.1.3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 25, 2009 at 11:35 PM
-- Server version: 5.0.51
-- PHP Version: 5.2.6

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `surf`
--

-- --------------------------------------------------------

--
-- Table structure for table `testdata`
--

CREATE TABLE IF NOT EXISTS `testdata` (
  `id` int(11) NOT NULL auto_increment,
  `name` char(10) NOT NULL,
  `lat` double NOT NULL,
  `lng` double NOT NULL,
  `angl` double NOT NULL,
  `val1` double NOT NULL,
  `val2` double NOT NULL,
  `val3` double NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

--
-- Dumping data for table `testdata`
--

INSERT INTO `testdata` (`id`, `name`, `lat`, `lng`, `angl`, `val1`, `val2`, `val3`) VALUES
(1, 'test1', 21.25, -86.75, 190, 20.5, 12, 5),
(2, 'test2', 30.5, -80.3, 50, 12, 5, 2),
(3, 'test3', 27, -95, 33, 3365, 4, 3),
(4, 'test4', 17, -90, 15, 74, 4, 6);


More information about the mapserver-users mailing list