[Mapserver-users] Dynamic point creation problems - setXY yields error

Lars V. Nielsen LVN at gispro.dk
Mon Dec 9 06:01:43 EST 2002


This is a multi-part message in MIME format.

------=_NextPart_000_0026_01C29F7A.BDB77AA0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Hi List,

I'm sure this problem's been touched on before, and as far as I can see I'm doing it by the book. But it still errors.

I'm trying to dynamically display points from a MS/SQL using PHP/MapScript, and I've run into a peculiar error:

Code snippet:
while ($row = mssql_fetch_row($rs)) {
     $px = $row[1]; // Easting
     $py = $row[2]; // Northing
     fputs ($fp, "  Coordinate (utm32): ".$px." , ".$py."\r\n");
     $pt = ms_newPointObj() or die("Cannot create new point object");
     $pt->setXY($px,$py) or die("Cannot assign XY to new point object"); // adding 3rd parameter doesn't help !
...

It aborts with
    Cannot assign XY to new point object
but the previous dump statement produces a valid output:
    Coordinate (utm32): 724192.12 , 6175749.4

Is this a projection issue ? I haven't set any specifically, but all runs in UTM zone 32 North.
I'm simply at my wit's end on this.

Mapserver 3.6.3 on Win2K

Best regards/Med venlig hilsen
Lars V. Nielsen
GisPro, Denmark
http://www.gispro.dk/
http://hjem.get2net.dk/lars-online/
WGS84: 10.20'40"E 55.20'20"N
------=_NextPart_000_0026_01C29F7A.BDB77AA0
Content-Type: text/x-vcard;
	name="Lars hos GisPro.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="Lars hos GisPro.vcf"

BEGIN:VCARD
VERSION:2.1
N:Nielsen;Lars;V.
FN:Lars hos GisPro
ORG:GisPro
TITLE:Company Manager
TEL;WORK;VOICE:+45 70 23 9876
TEL;WORK;FAX:+45 6595 9877
ADR;WORK:;;Ugletoften 309;Odense S;;DK-5260;Denmark
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Ugletoften 309=0D=0AOdense S DK-5260=0D=0ADenmark
X-WAB-GENDER:2
URL;HOME:http://hjem.get2net.dk/lars-online/
URL;WORK:http://www.gispro.dk
EMAIL;PREF;INTERNET:lvn at gispro.dk
REV:20021209T110143Z
END:VCARD

------=_NextPart_000_0026_01C29F7A.BDB77AA0--




More information about the mapserver-users mailing list