#328 closed defect (fixed)
Query: Polygon query doesn't work against SQL Server Spatial Provider
Reported by: | jennyhe | Owned by: | madair |
---|---|---|---|
Priority: | P2 | Milestone: | Future |
Component: | Widgets | Version: | 1.1.1 |
Severity: | Major | Keywords: | |
Cc: | christine.bao@…, Chris.Claydon@… | Browser: | All |
External ID: | 1277852 | Operating System: | All |
state: | New |
Description
Report from Autodesk QA Steps:
- Load the package.
- Re-connect SQL Server Spatial
Service: acrdmapdb3 User/Pwd: sa/sql2008
- Do one Polygon Query.
Results: No matched result listed. Please refer to the attached png file.
Expected results: All points should be returned in result list.
Attachments (2)
Change History (8)
by , 15 years ago
Attachment: | 1277730.mgp added |
---|
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Some providers don't have this requirement, such as SDF. Test on SDF and polygon query also works.
by , 15 years ago
Attachment: | CreatePolygon.patch added |
---|
comment:3 by , 15 years ago
Attach patch http://trac.osgeo.org/fusion/attachment/ticket/328/CreatePolygon.patch for fixing this defect. Please review.
comment:4 by , 15 years ago
Cc: | added |
---|
Hi Chris, would you please review this patch? This defect is nominated for Beta 1, so it's appreciated if you can finish it in this week. Thank you!
comment:5 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This patch is tested against SQL Server Spatial, ODBC, SDF, SHP providers on Query widget, and it works.
Commit the patch for fixing.
The problem of this defect is: Some providers such as SQL Server Spatial, ODBC etc requires the polygon's start point must be the same as end point when executing spatial query. When this defect happens, there is an exception:
Because the spatial query fail, there is no result output.
Polygon query has this defect because the input geometry text (for example click 3 points) is as following:
The start point is different from the end point.
Rectangle query doesn't have this defect because the input geometry text (for example) is:
As you can see, the start point is the same as end point.
To fix this defect, the function CreatePolygonFromGeomText($geomText) should be enhanced:
if the first point is not the same as last one, create another one which is the same as first one and append to the coordinate collection.