[mapserver-users] Using Mapserver as standalone WFS - GetFeature fails

Lars I. Nielsen lin at hvenegaard.dk
Fri Nov 15 04:48:16 PST 2013


Thanks Jukka,

I've had multiple problems to deal with in this setup, but I finally got it right :)

I had to define a 64 bit DSN, introduce an OVL file, and in it add "feature.STAsBinary() as wkb_geom" to the selection (and set that as my WKB geometry feature), before it worked.

The result is public here: http://hvmgo01.hvenegaard.dk/mswfs/?map=BallerupGO_WFS.map&service=WFS&version=1.0.0&request=getcapabilities


One thing puzzles me though:

If I run request=describefeaturetype on any of the three typename in my setup, it returns its list of attributes as it should.

But if I omit the typename, wanting Mapserver to return a description of all three typenames (which is a valid request), it only returns the attributes for the first !??

Is this WAD, or is Mapserver forgetting to return attributes for the latter two typenames (as I suspect) ?


Cheers.


Kind regards / Med venlig hilsen
Lars I. Nielsen
----------------------------------------------------------------
Landinspektør, Senior GIS Programmør og Konsulent
Hvenegaard og Jens Bo Landinspektører A/S
Rugaardsvej 55, DK-5000 Odense C
Denmark
Tel. +45 6313 5050
http://www.hvenegaard.dk<http://www.hvenegaard.dk/>

Fra: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] På vegne af Rahkonen Jukka
Sendt: 8. november 2013 15:31
Til: 'mapserver-users at lists.osgeo.org'
Emne: Re: [mapserver-users] Using Mapserver as standalone WFS - GetFeature fails

Hi,

With WFS it is good to start from the basics

http://localhost/mswfs/mapserv.exe?map=WFS.map&service=WFS&version=1.0.0&request=GetCapabilities
http://localhost/mswfs/mapserv.exe?map=WFS.map&service=WFS&version=1.0.0&request=DescribeFeatureType&typename=xxxx
http://localhost/mswfs/mapserv.exe?map=WFS.map&service=WFS&version=1.0.0&request=getfeature&typename=xxxx&maxfeatures=10

You said you have done all of this. Only simple thing that comes to my mind is to check if your typename really is "GO_Punkter". It may be if it takes the name from "ows_title" and you can check it from GetCapabilities. There is also "wfs_name" metadata item for setting the typename.

-Jukka Rahkonen-




Lars I. Nielsen wrote:

Hi again,

I'm trying to access a handful of tables in an MS/SQL 2008 database, using a Mapserver as a standalone WFS server.

I'm attempting to use the OGR method, as the mssql2008 plugin fails to load for some reason.

I managed to get it to respond to GetCapabilities and DescribeTypeName request, but GetFeature requests fails completely.

My request is as follows:

http://localhost/mswfs/mapserv.exe?map=WFS.map&service=WFS&version=1.0.0&request=getfeature&typename=GO_Punkter&maxfeatures=10&bbox=711500,6183000,712500,6184000

The layer metadata is as follows:

METADATA
"ows_title"             "GO_Punkter"
"ows_srs"               "EPSG:25832"
"wfs_include_items"     "all"
"gml_featureid"         "MI_PRINX"
"wfs_enable_request"    "*"
"gml_types"             "auto"
"ows_extent"            "700000 6170000 720000 6190000"
END

My layer is defined as follows:

TYPE POINT
STATUS ON
CONNECTIONTYPE OGR
CONNECTION "MSSQL:Server=xxxxxxxxxxxxxxxxxxxxx,1433;Database=xxxxxxxxxxxxxxxxxxxxxx;UID=xxxxxxxxx;PWD=xxxxxxx;Trusted_Connection=No;Tables=D00001_POINTS(feature);"

The error I get in the Mapserver error log is as follows:

CGI Request 1 on process 6252
msOGRFileOpen(): OGR error. Open failed for OGR connection in layer `GO_Punkter'.  File not found or unsupported format.
msWFSGetFeature(): WFS server error. ms_error->code not found
mapserv request processing time (msLoadMap not incl.): 0.018s
msFreeMap(): freeing map at 01628CF8.

I read that I could debug the connection using "ogrinfo.exe -al", but that works perfectly, and returns all features:

C:\Mapserver.640>ogrinfo -al "MSSQL:Server=xxxxxxxxxxxxxxxxxxxxx,1433;Database=xxxxxxxxxxxxxxxxxxxxxx;UID=xxxxxxxxx;PWD=xxxxxxx;Trusted_Connection=No;Tables=D00001_POINTS(feature);"
INFO: Open of `MSSQL:Server=xxxxxxxxxxxxxxxxxxxxx,1433;Database=xxxxxxxxxxxxxxxxxxxxxx;UID=xxxxxxxxx;PWD=xxxxxxx;Trusted_Connection=No;Tables=D00001_POINTS(feature);'
      using driver `MSSQLSpatial' successful.

Layer name: D00001_POINTS
Geometry: Unknown (any)
Feature Count: 33541
Extent: (705463.862800, 6177660.915000) - (715176.650800, 6184543.444000)
Layer SRS WKT:
PROJCS["ETRS89 / UTM zone 32N",
    GEOGCS["ETRS89",
        DATUM["European_Terrestrial_Reference_System_1989",
            SPHEROID["GRS 1980",6378137,298.257222101,
                AUTHORITY["EPSG","7019"]],
            TOWGS84[0,0,0,0,0,0,0],
            AUTHORITY["EPSG","6258"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4258"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",9],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH],
    AUTHORITY["EPSG","25832"]]
FID Column = MI_PRINX
Geometry Column = feature
valid_from: DateTime (23.0)
valid_to: DateTime (23.0)
sectioncode: String (50.0)
element_code: String (10.0)
element_subcode: String (50.0)
carename: String (50.0)
mi_style: String (250.0)
symbology: String (8000.0)
labeltext: String (250.0)
OGRFeature(D00001_POINTS):1
  valid_from (DateTime) = (null)
  valid_to (DateTime) = (null)
  sectioncode (String) = 03-001-001-009
  element_code (String) = 7e
  element_subcode (String) = Legeudstyr
  carename (String) = (null)
  mi_style (String) = Symbol (36,12615935,8,"Map Symbols",0,0)
  symbology (String) = (null)
  labeltext (String) = (null)

etc. etc.

Can anyone point me towards a solution for this issue ?

Am I missing something obvious here ?


Kind regards / Med venlig hilsen
Lars I. Nielsen
----------------------------------------------------------------
Landinspektør, Senior GIS Programmør og Konsulent
Hvenegaard og Jens Bo Landinspektører A/S
Rugaardsvej 55, DK-5000 Odense C
Denmark
Tel. +45 6313 5050
http://www.hvenegaard.dk<http://www.hvenegaard.dk/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20131115/96a75ddc/attachment-0001.html>


More information about the mapserver-users mailing list