#1648 closed defect (fixed)
WFS extraction misses feature
| Reported by: | Owned by: | sdlime | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | MapServer C Library | Version: | 4.8 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
One of my features in a shapefile is refused to be processed by Mapserver (WMS or WFS). To replicate, issue the following type of GetFeature request: /cgi-bin/mapserv480?map=/data/OGC_UMN_services/test.map&SERVICE=WFS&VERSION=1.0.0&TYPENAME=AAA35&request=get feature&filter=<Filter><BBOX><PropertyName>msGeometry</PropertyName><gml:Box srsName=''><coordinates> 116620.71605,579118.419753 140194.790124,593262.864198 </coordinates></gml:Box></BBOX></Filter> I will attach a shapefile and a MAP file.
Attachments (1)
Change History (13)
by , 19 years ago
| Attachment: | bodemkaart50.zip added |
|---|
comment:1 by , 19 years ago
| Status: | new → assigned |
|---|
comment:2 by , 19 years ago
Bart: If I try a vanilla mapfile with your shapefile (that is, none of the metadata, straight shp2img) I get the feature to draw, no problem. You did say WMS wouldn't render the feature, right? I'll try WMS/WFS now and report back... Steve
comment:3 by , 19 years ago
Hi Steve, sorry for the confusion, I just retried and drawing a map works fine, only the WFS GetFeature request returns an incomplete set of features. Bart
comment:4 by , 18 years ago
Very puzzling. A straight MapServer nquery works fine. I get all 63 features + attributes. The only thing I can think of is that the GML writer is bailing on the feature for some reason. In looking that the shapefile the feature in question plus a few others have multiple parts. - Do other multipart polygons show up in the the output? - If you ask for GML 3.1 output, is the feature still missing? - If you do a GetFeatures with no filter (should return all features) do you still loose the feature. Looking throught the GML 2 writer I do see a small problem with duplicate code being run twice (cut and paste error), but that shouldn't cause the problem. Still working on it in my spare time- sorry it's taking so long. Steve
comment:5 by , 18 years ago
It's definitely in the GML writer. For some reason the code is not computing the proper number of outer rings for the feature in question. *ugh* Steve
comment:6 by , 18 years ago
Bart: There was definitely a flaw in the code that computed an outer ring list. In certain cases it could miss an outer ring based on the location of holes within that ring. In your case that's what happened so no geometry was written. I implemented a new method tonite and committed it to 4.9. When I run a WFS query on a shapefile with just the feature causing problems I now seem to get valid output- 1 outer ring with 6 inner rings. Can you test with the data you have and let me know how the output looks? Steve
comment:7 by , 18 years ago
Hi Steve,
this might help as a reference, the GML that Ionic WFS creates for the feature
is, if I am counting right it is 1 outerboundary and 6 innerboundaries:
<au1:GEOMETRY> <gml:Polygon srsName="EPSG:28992">
<gml:outerBoundaryIs>
<gml:LinearRing srsName="EPSG:28992">
<gml:coordinates>127027.0078125,586653.0 127060.0,586663.0
127257.0078125,586178.0 127379.0,585874.0 127435.0,585728.0 127474.0,585637.0
127497.0078125,585571.0 127509.0078125,585514.0 127525.0078125,585469.9375
127546.0,585427.0 127571.0,585396.0 127596.0078125,585382.0
127570.0078125,585380.0 127530.0,585380.0 127502.0,585395.0 127464.0,585423.0
127436.0,585441.0 127408.0,585451.0 127372.0078125,585451.0 127321.0,585449.0
127263.0078125,585428.0 127146.0078125,585395.0 127044.0,585360.0
126928.0078125,585331.9375 126818.0078125,585316.0 126760.0078125,585327.0
126714.0,585318.9375 126638.0078125,585296.0 126399.0078125,585230.0
126333.0078125,585205.0 126313.0078125,585187.0 126303.0078125,585174.0
126303.0078125,585151.0 126313.0078125,585118.0 126341.0078125,585080.0
126364.0,585032.0 126356.0078125,585014.0 126341.0078125,585007.0
126323.0,585007.0 126295.0,585024.0 126270.0,585045.0 126257.0078125,585073.0
126242.0,585116.0 126206.0078125,585146.0 126171.0,585164.0 126128.0,585167.0
126049.0078125,585161.0 125922.0,585128.0 125871.0078125,585116.0
125807.0,585080.0 125752.0,585037.0 125708.0078125,585004.0 125655.0,584976.0
125592.0078125,584953.0 125536.0078125,584940.0 125510.0078125,584933.0
125490.0,584933.0 125477.0,584943.0 125477.0,584963.0 125495.0078125,584986.0
125533.0,585004.0 125617.0,585027.0 125645.0,585037.0 125658.0,585050.0
125658.0,585067.0 125647.0078125,585090.0 125627.0,585098.0
125592.0078125,585093.0 125520.0,585067.0 125416.0078125,585014.0
125388.0078125,584989.0 125373.0078125,584961.0 125373.0078125,584930.0
125393.0,584895.0 125432.0,584874.0 125480.0078125,584869.0
125569.0078125,584880.0 125655.0,584890.0 125746.0078125,584895.0
125792.0,584887.0 125810.0,584872.0 125810.0,584852.0 125790.0078125,584836.0
125762.0078125,584824.0 125548.0,584824.0 125477.0,584819.0 125406.0,584801.0
125332.0078125,584773.0 125279.0,584758.0 125226.0,584753.0 125185.0,584763.0
125144.0,584788.0 125104.0,584819.0 125071.0,584859.0 125048.0,584882.0
125028.0,584890.0 125010.0078125,584890.0 124987.0,584880.0
124982.0078125,584859.0 124995.0078125,584839.0 125007.0078125,584813.0
125015.0,584803.0 125005.0,584780.0 124992.0,584758.0 124979.0,584758.0
124949.0,584783.0 124941.0078125,584788.0 124929.0078125,584778.0
124845.0078125,584687.0 124786.0078125,584618.0 124741.0,584587.0
124692.0078125,584565.0 124619.0078125,584539.0 124550.0078125,584516.0
124504.0,584483.0 124449.0,584432.0 124415.0078125,584407.0
124382.0078125,584392.0 124365.0,584387.0 124352.0,584387.0 124347.0,584397.0
124355.0078125,584422.0 124375.0,584460.0 124421.0,584506.0
124482.0078125,584552.0 124548.0,584595.0 124601.0,584628.0
124649.0078125,584656.0 124682.0,584679.0 124718.0078125,584714.0
124776.0078125,584808.0 124845.0078125,584918.0 124863.0,584961.0
124870.0078125,584984.0 124870.0078125,585012.0 124855.0078125,585047.0
124837.0,585075.0 124830.0078125,585095.0 124830.0078125,585123.0
124883.0078125,585225.0 124936.0,585291.0 124972.0,585306.0 124990.0,585322.0
125030.0,585349.0 125091.0078125,585418.0 125144.0,585469.0 125213.0,585512.0
125297.0,585570.0 125315.0078125,585578.0 125340.0,585532.0
125358.0078125,585517.0 125376.0,585517.0 125391.0,585522.0 125419.0,585548.0
125449.0,585583.0 125490.0,585652.0 125505.0,585700.0 125746.0078125,585824.0
125787.0078125,585835.0 125688.0078125,585745.9375 125622.0078125,585685.0
125604.0,585654.0 125589.0,585634.0 125617.0,585647.0 125691.0078125,585680.0
125782.0,585730.0 125830.0078125,585756.0 125934.0,585824.0 126155.0,585972.0
126328.0078125,586084.0 126455.0078125,586172.0 126554.0078125,586232.9375
126567.0078125,586244.0 126567.0078125,586258.9375 126575.0,586269.0
126587.0,586269.0 126600.0,586266.0 126610.0078125,586266.0 126630.0,586284.0
126648.0078125,586307.0 126666.0078125,586320.0 126679.0078125,586320.0
126691.0078125,586315.0 126709.0,586315.0 126735.0078125,586330.0
126770.0,586357.9375 126829.0078125,586381.0 126851.0,586388.0
126857.0078125,586401.0 126864.0,586419.0 126887.0078125,586434.0
126900.0078125,586442.0 126915.0078125,586442.0 126928.0078125,586437.0
126948.0,586447.0 127017.0,586487.0 127029.0,586500.0 127037.0078125,586515.0
127044.0,586543.0 127022.0078125,586559.0 127019.0,586581.9375 127004.0,586630.0
127027.0078125,586653.0</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing srsName="EPSG:28992">
<gml:coordinates>127164.0078125,586269.0 127156.0,586307.0
127141.0,586330.0 127105.0078125,586373.0 127088.0,586391.0
127070.0078125,586391.0 127050.0078125,586386.0 127042.0078125,586388.0
127027.0078125,586409.0 127011.0078125,586419.0 126991.0,586409.0
126953.0078125,586383.0 126910.0078125,586350.0 126884.0078125,586335.0
126841.0078125,586315.0 126821.0,586297.0 126801.0078125,586271.9375
126765.0,586258.9375 126735.0078125,586249.0 126722.0078125,586239.0
126712.0,586213.0 126686.0,586195.0 126653.0078125,586170.0 126628.0,586165.0
126610.0078125,586167.0 126597.0078125,586167.0 126572.0,586155.0
126270.0,585974.0 125894.0,585743.0 125848.0,585725.0 125830.0078125,585703.0
125830.0078125,585687.0 125840.0,585677.0 125863.0,585677.0 125909.0,585692.0
126084.0,585745.9375 126148.0078125,585769.0 126176.0078125,585784.0
126201.0,585796.0 126295.0,585804.0 126315.0078125,585804.0 126336.0,585812.0
126369.0078125,585830.0 126384.0078125,585831.9375 126397.0078125,585831.9375
126417.0078125,585830.0 126435.0,585830.0 126476.0,585842.0
126526.0078125,585857.0 126582.0078125,585868.0 126663.0078125,585880.0
126846.0078125,585916.0 126999.0078125,585951.0 127088.0,585962.0
127133.0078125,585969.0 127166.0078125,585992.0 127199.0,586020.0
127222.0078125,586051.0 127230.0078125,586078.0 127230.0078125,586109.0
127212.0,586162.0 127164.0078125,586269.0</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing srsName="EPSG:28992">
<gml:coordinates>126163.0078125,585672.0 126123.0078125,585667.0
126098.0,585662.0 126033.0,585642.0 125942.0078125,585617.0 125904.0,585602.0
125885.0078125,585589.0 125871.0078125,585567.0 125874.0078125,585540.0
125884.0078125,585516.0 125903.0,585495.0 125927.0078125,585486.0
125948.0,585489.0 125980.0078125,585500.0 126021.0078125,585511.0
126052.0078125,585520.0 126073.0,585524.0 126110.0078125,585525.0
126199.0,585550.0 126262.0078125,585558.0 126328.0078125,585565.0
126397.0078125,585565.0 126435.0,585573.0 126463.0,585591.0 126493.0,585603.0
126549.0078125,585603.0 126572.0,585611.0 126600.0,585626.0
126620.0078125,585634.0 126636.0078125,585629.0 126648.0078125,585629.0
126661.0078125,585634.0 126686.0,585647.0 126702.0078125,585662.0
126717.0078125,585662.0 126730.0078125,585654.0 126740.0,585647.0
126755.0,585647.0 126783.0,585659.0 126811.0,585669.0 126834.0,585669.0
126851.0,585659.0 126874.0078125,585664.0 126925.0078125,585677.0
127006.0,585690.0 127065.0078125,585700.0 127161.0078125,585730.0
127227.0,585753.0 127298.0,585761.0 127334.0078125,585771.0
127344.0078125,585786.0 127344.0078125,585809.0 127352.0,585835.0
127352.0,585865.0 127332.0078125,585880.0 127309.0,585901.0
127291.0078125,585941.0 127273.0078125,585954.0 127253.0,585959.0
127189.0078125,585954.0 127108.0078125,585936.0 127009.0078125,585908.0
126902.0078125,585883.0 126778.0078125,585847.0 126714.0,585824.0
126646.0078125,585809.0 126587.0,585809.0 126549.0078125,585799.0
126498.0078125,585776.0 126453.0078125,585766.0 126412.0078125,585751.0
126323.0,585713.0 126275.0078125,585697.0 126211.0,585685.0
126163.0078125,585672.0</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing srsName="EPSG:28992">
<gml:coordinates>126605.0078125,585537.0 126536.0078125,585530.0
126323.0,585489.0 125924.0078125,585405.0 125592.0078125,585344.0
125574.0,585339.0 125574.0,585281.0 125584.0,585235.0 125604.0,585195.0
125642.0,585169.0 125693.0078125,585151.0 125741.0,585156.0
125833.0078125,585174.0 126346.0078125,585278.0 126605.0078125,585331.9375
126737.0,585360.0 126950.0,585410.0 127344.0078125,585512.0 127380.0,585522.0
127420.0,585527.0 127431.0078125,585553.0 127431.0078125,585570.0
127418.0,585581.0 127387.0078125,585598.0 127367.0,585620.9375
127362.0078125,585644.0 127354.0,585657.0 127283.0,585664.0
127192.0078125,585680.0 127159.0,585680.0 127128.0,585669.0 127098.0,585654.0
127050.0078125,585647.0 126999.0078125,585647.0 126976.0,585642.0
126943.0078125,585626.0 126895.0,585614.0 126829.0078125,585603.0
126778.0078125,585596.0 126752.0,585583.0 126724.0,585558.0
126702.0078125,585548.0 126656.0,585548.0 126605.0078125,585537.0</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing srsName="EPSG:28992">
<gml:coordinates>125609.0078125,585408.0 125678.0078125,585421.0
125741.0,585441.0 125795.0,585466.0 125818.0078125,585482.0 125820.0,585489.0
125818.0078125,585509.0 125772.0078125,585601.0 125759.0078125,585620.9375
125739.0,585624.0 125706.0078125,585609.0 125442.0078125,585484.0
125424.0078125,585469.0 125424.0078125,585464.0 125432.0,585438.0
125444.0078125,585416.0 125467.0078125,585413.0 125508.0078125,585408.0
125609.0078125,585408.0</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing srsName="EPSG:28992">
<gml:coordinates>125160.0078125,585278.0 125180.0078125,585289.0
125246.0078125,585324.0 125282.0,585349.0 125305.0078125,585385.0
125317.0078125,585410.0 125299.0078125,585421.0 125279.0,585421.0
125244.0078125,585408.0 125188.0078125,585388.0 125142.0,585362.0
125119.0078125,585342.0 125119.0078125,585316.0 125132.0078125,585294.0
125144.0,585278.0 125160.0078125,585278.0</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing srsName="EPSG:28992">
<gml:coordinates>125343.0078125,585080.0 125419.0,585106.0
125482.0078125,585123.0 125543.0,585139.0 125564.0078125,585149.0
125564.0078125,585169.0 125546.0,585205.0 125495.0078125,585294.0
125482.0078125,585306.0 125447.0,585311.0 125312.0,585263.0
125271.0078125,585243.0 125241.0,585212.0 125216.0078125,585172.0
125205.0078125,585149.0 125205.0078125,585136.0 125221.0078125,585121.0
125259.0078125,585088.0 125305.0078125,585080.0
125343.0078125,585080.0</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
</gml:Polygon>
</au1:GEOMETRY>
comment:8 by , 18 years ago
That looks like what I'm getting now for that feature except we ouput a multipolygon in cases where you don't explicitly ask for a polygon. Steve
comment:9 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Okay, Steve, then this seems to be fixed. Thanks a lot for digging into this! Sounds like a difficult one. Setting status to FIXED.
comment:10 by , 18 years ago
| Cc: | added |
|---|
I need to back port to 4.8 and 4.6 I think. The effects are pretty obvious in the output XML but I'm not sure folks would notice in some cases. CC'ing Dan for his comments on that. Steve
comment:11 by , 18 years ago
I agree that it's probably worth backporting to 4.8. Do you think it's worth going back to 4.6 even if we may never release a new 4.6.x?
comment:12 by , 18 years ago
I tweaked the function to be a bit more efficient and commited it to CVS head and to 4.8. I didn't bother with 4.6 but if we ever did release a new one I'd add this... Steve
Note:
See TracTickets
for help on using tickets.

shapefile plus map file