I'm having a interesting problem that I've been working on for a few days now where in windows I get a blank png response back however in linux with an almost identical map file I get the expected out put. I had MapServer set up in Linux using Apache as a WMS server and it was working perfectly, However I'm sadly needing to switch to Windows and IIS.
I have a small sqlite database with a bunch of points that I'm trying to get MapServer to display. I'm using the same sqlite database in linux and windows.
Here's the Linux setup: (Works)
ogrinfo on sqlite db:
root@sweatshop:/usr/lib/cgi-bin# ogrinfo CountiesAR.sqlite ArkPointGeo -summary
INFO: Open of `CountiesAR.sqlite' using driver `SQLite' successful.
Layer name: ArkPointGeo
Geometry: Unknown (any)
Feature Count: 1004
Extent: (-94.515743, 33.069850) - (-89.870035, 36.495504)
Layer SRS WKT:
(unknown)
FID Column = _rowid_
Geometry Column = GeoPoint
PK_UID: Integer (0.0)
PK_UID:1: Integer (0.0)
DocumentID: String (0.0)
Latitude: Real (0.0)
Longitude: String (0.0)
I get the expected png when I run shp2img with the command:
shp2img -m Test.map -o test.png -all_debug 5
The Map File: http://hastebin.com/iyerudipes.vhdl
And the URL I use to access:
http://www.zachatrocity.com/cgi-bin/mapserv?mode=map&map=Test.map&layer=Points
If you follow that link you can see it displayed. With this set up everything works as expected.
The Windows set up: (not working)
ogrinfo on sqlite db:
C:\path\to\gdal-ogr>ogrinfo C:\pathto\data\CountiesAR.sqlite ArkPointGeo -summary
INFO: Open of `C:\pathto\data\CountiesAR.sqlite'
using driver `SQLite' successful.
Layer name: ArkPointGeo
Geometry: Unknown (any)
Feature Count: 1004
Extent: (-94.515743, 33.069850) - (-89.870035, 36.495504)
Layer SRS WKT:
(unknown)
FID Column = _rowid_
Geometry Column = GeoPoint
PK_UID: Integer (0.0)
PK_UID:1: Integer (0.0)
DocumentID: String (0.0)
Latitude: Real (0.0)
Longitude: String (0.0)
When I run shp2img on the Windows machine I get the following for every point in my db:
msOGRFileNextShape: Rejecting feature (shapeid = 999, tileid=0) of incompatible type for this layer (feature wkbType 0, layer type 0)
Notice I did not get any error with the equivalent command in Linux.
The Map File: http://hastebin.com/subabefuxo.vhdl
and the URL I use:
http://localhost:1020/cgi-bin/mapserv.exe?mode=map&map=C:\path\to\Test.map&layer=Points
Finally, the debug text:
[Thu Aug 28 09:19:31 2014].373000 CGI Request 1 on process 6584
[Thu Aug 28 09:19:31 2014].380000 msDrawMap(): rendering using outputformat named png (AGG/PNG).
[Thu Aug 28 09:19:31 2014].380000 msDrawMap(): WMS/WFS set-up and query, 0.000s
[Thu Aug 28 09:19:31 2014].404000 msDrawMap(): Layer 0 (Points), 0.024s
[Thu Aug 28 09:19:31 2014].404000 msDrawMap(): Drawing Label Cache, 0.000s
[Thu Aug 28 09:19:31 2014].404000 msDrawMap() total time: 0.031s
[Thu Aug 28 09:19:33 2014].103000 msSaveImage(stdout) total time: 1.699s
[Thu Aug 28 09:19:33 2014].104000 mapserv request processing time (loadmap not incl.): 1.732s
[Thu Aug 28 09:19:33 2014].105000 msFreeMap(): freeing map at 02A40048.
Any ideas as to why this would work on my Linux server but not my Windows one? I'm at a loss.
Solved this with section 4.1 of the Spatialite documentation. I had an invalid SRID in my data due to it being imported from a shapefile. I also think it has something to do with this bug with GDAL/OGR because it still works in linux. No matter, it can be fixed with the SetSrid() function.