Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#1335 closed defect (fixed)

Mapserver WFS crashes on DWithin request

Reported by: bartvde@… Owned by: assefa
Priority: high Milestone:
Component: WFS Server Version: 4.4
Severity: normal Keywords:
Cc:

Description

Version 4.4.2.

When performing a DWithin request with a polygon on Mapserver WFS using a
Mapinfo TAB file through an OGR connection, Mapserver crashes (internal server
error).

Converting the TAB file to shp, everything works fine, no crash.

Will attach a testcase.

The following request is posted to Mapserver WFS:

<GetFeature service="WFS" version="1.0.0" xmlns="http://www.opengis.net/wfs"
xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.opengis.net/wfs/1.0.0 WFS-basic.xsd"><Query
xmlns=""
typename="percelen"><ogc:Filter><ogc:DWithin><ogc:PropertyName>Geometry</ogc:PropertyName><gml:Polygon
srsName="EPSG:28992"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>75573.721950,447403.122950
75567.634950,447411.316100 75560.670000,447422.655050 75555.331050,447429.333050
75555.289050,447429.372950 75567.391950,447440.655900 75573.568050,447434.415050
75576.370950,447437.083100 75583.462050,447429.901100 75585.075000,447431.426050
75594.613050,447421.648100 75604.717950,447411.288100 75602.734050,447410.136950
75583.726050,447399.103900 75583.203000,447398.792050 75582.637050,447398.570150
75582.504000,447398.534100 75582.370950,447398.505050 75578.971050,447404.106100
75576.610050,447403.478900 75575.752950,447404.632150
75573.721950,447403.122950</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon><ogc:Distance
units="m">5</ogc:Distance></ogc:DWithin></ogc:Filter></Query></GetFeature>

Attachments (2)

1335.TGZ (975.4 KB ) - added by bartvde@… 19 years ago.
Mapinfo file used (shapefile can be created using ogr2ogr)
1335a.TGZ (357.2 KB ) - added by bartvde@… 19 years ago.
shapefile source for crash

Download all attachments as: .zip

Change History (14)

comment:1 by bartvde@…, 19 years ago

Layer definition used:

LAYER
  NAME "percelen"
  GROUP GBKN
  METADATA
    wms_title "Percelen"
    wfs_title "Percelen"
  END
  STATUS ON
  DUMP TRUE
  TYPE POLYGON
  CONNECTIONTYPE OGR
  CONNECTION
"d:\websites\DemoData\Naaldwijk\Data/Basis/geo/bug/1335/mapinfo/percelen.TAB"
  #DATA
"d:\websites\DemoData\Naaldwijk\Data/Basis/geo/bug/1335/shapefile/percelen.shp"
  MINSCALE 0
  MAXSCALE 1000
  PROJECTION
    "init=epsg:28992"
  END
  LABELITEM SECNUM
  LABELANGLEITEM HOEK

  CLASS
    OUTLINECOLOR 150 150 150
    SIZE 1
    MINSCALE 500
    MAXSCALE 1000
  END

  CLASS
    OUTLINECOLOR 150 150 150
    SIZE 1
    MINSCALE 0
    MAXSCALE 500
    LABEL
      TYPE truetype
      FONT "arial"
      SIZE 7
      COLOR 0 0 200
      POSITION auto
    END
  END
  TEMPLATE "xmlqueries\percelenxml.html"
  HEADER "GEMCOD SECTIE NUMMER"
END

by bartvde@…, 19 years ago

Attachment: 1335.TGZ added

Mapinfo file used (shapefile can be created using ogr2ogr)

comment:2 by bartvde@…, 19 years ago

Crash with a shapefile as datasource.

Layer defintion:

LAYER
  NAME "bislocaties"
  GROUP BIS
  METADATA
    wms_title "BIS locaties"
    wfs_title "BIS locaties"
  END
  STATUS ON
  DUMP TRUE
  TYPE POLYGON
  #CONNECTIONTYPE OGR
  #CONNECTION "d:\websites\DemoData\Naaldwijk\Data/Bis/geo/bis_loc.TAB"
  DATA "d:\websites\DemoData\Naaldwijk\Data/Bis/geo/bis_loc.shp"
  MAXSCALE 6000
  PROJECTION
    "init=epsg:28992"
  END
  TOLERANCE 10
  TOLERANCEUNITS METERS
  TRANSPARENCY 50
  LABELITEM loc_code

  CLASS
    COLOR 51 153 0
    OUTLINECOLOR 51 153 0
    SIZE 1
    MINSCALE 0
    MAXSCALE 2000
    LABEL
      TYPE TRUETYPE
      FONT "Arial"
      SIZE 10
      COLOR 0 0 0
    END
  END

  CLASS
    COLOR 51 153 0
    OUTLINECOLOR 51 153 0
    SIZE 1
    MINSCALE 2000
    MAXSCALE 6000
  END
  TEMPLATE "xmlqueries\bislocatiesxml.html"
  HEADER "Loc_code"
END

Request used:

<GetFeature maxfeatures="100" service="WFS" version="1.0.0"
xmlns="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.opengis.net/wfs/1.0.0 WFS-basic.xsd"><Query
xmlns=""
typename="bislocaties"><ogc:Filter><ogc:DWithin><ogc:PropertyName>Geometry</ogc:PropertyName><gml:Polygon
srsName="EPSG:28992"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>73999.999950,446376.397950
74013.112050,446359.819150 74031.775050,446374.369000 74074.128000,446321.128050
74005.396050,446262.444950 73999.999950,446260.640000 73998.679950,446260.199000
73971.634050,446263.116950 73968.018000,446264.092050 73920.037950,446320.924000
73921.153050,446322.223900 73951.420950,446348.322000 73964.763000,446359.727100
73995.931050,446381.542950
73999.999950,446376.397950</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon><ogc:Distance
units="m">5</ogc:Distance></ogc:DWithin></ogc:Filter></Query></GetFeature>

Will add shapefile after this.

by bartvde@…, 19 years ago

Attachment: 1335a.TGZ added

shapefile source for crash

comment:3 by assefa, 19 years ago

Cc: mapserver-bugs@… added
Owner: changed from mapserverbugs to assefa
looking into this ...

comment:4 by assefa, 19 years ago

There was a missing call to msInitShape in function msQueryByShape. I have 
corrected this the cvs head.

I have tested it only with the tab data.

Bart, are you able to test it with latest Mapserver ?

comment:5 by assefa, 19 years ago

Resolution: fixed
Status: newclosed
Fixed in cvs head as well as the 4.4.x branch.


comment:6 by bartvde@…, 19 years ago

Resolution: fixed
Status: closedreopened
Assefa,

I am reopening this bug since I was just trying the same request with a
different geometry in it and it makes Mapserver still crash using data from the
first attachment (even with a generated shapefile from the Mapinfo file). Can
you try with the following request:

<GetFeature maxfeatures="100" service="WFS" version="1.0.0"
xmlns="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.opengis.net/wfs/1.0.0 WFS-basic.xsd"><Query
xmlns=""
typename="percelen"><ogc:Filter><ogc:DWithin><ogc:PropertyName>Geometry</ogc:PropertyName><gml:Polygon
srsName="EPSG:28992"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>73999.999950,446376.397950
74013.112050,446359.819150 74031.775050,446374.369000 74074.128000,446321.128050
74005.396050,446262.444950 73999.999950,446260.640000 73998.679950,446260.199000
73971.634050,446263.116950 73968.018000,446264.092050 73920.037950,446320.924000
73921.153050,446322.223900 73951.420950,446348.322000 73964.763000,446359.727100
73995.931050,446381.542950
73999.999950,446376.397950</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon><ogc:Distance
units="m">5</ogc:Distance>
</ogc:DWithin></ogc:Filter></Query>
</GetFeature>

Bart

comment:7 by bartvde@…, 19 years ago

Assefa,

4.6 beta1 does not crash anymore (using your latest mapquery.c from CVS).

I do have problems though getting distance to work, it seems it is not
interpreted ????

Bart

comment:8 by bartvde@…, 19 years ago

Summary: DWithin on Mapinfo TAB crashes (through OGR)DWithin, distance not being interpreted.
I have found the cause for the distance not being interpreted and patched it in
my local sources, I also tested:

mapogcfilter.c (second argument was NULL instead of the distance).

Updating bug report summary (maybe I should have opened a new bug Assefa?).

    else if (FLTIsLineFilter(psNode) || FLTIsPolygonFilter(psNode))
    {
        bShapeQuery = 1;
        // Bart, use distance!
        psQueryShape = FLTGetShape(psNode, &dfDistance);
    }

comment:9 by assefa, 19 years ago

Bart,

 I think a new bug would be more appropriate.

comment:10 by bartvde@…, 19 years ago

Agreed, will you open a new bug or should I do it?

comment:11 by bartvde@…, 19 years ago

Resolution: fixed
Status: reopenedclosed
Summary: DWithin, distance not being interpreted.Mapserver WFS crashes on DWithin request
Changing summary back. Closing this bug. Although with 4.4.2 it is still an
issue, but I am able to move to 4.6 beta1.

comment:12 by bartvde@…, 19 years ago

For completeness, the newly opened bug is:

http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1336
Note: See TracTickets for help on using tickets.