Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#393 closed defect (fixed)

Exception in FDO component when using feature information (Digitize Polygon)

Reported by: liuar Owned by: madair
Priority: P2 Milestone: 2.2
Component: Widgets Version: 1.1.1
Severity: Major Keywords:
Cc: madair@… Browser: All
External ID: 1313209 Operating System: All
state: New

Description

  1. Open the FWL from oracle feature source in a browers window.
  2. Click Feature Information
  3. Click the Polygon button in the Feature Information window
  4. Digitize a polygon.


Result: Exception Window appears (.Net framework error)

Attachments (1)

Ticket #393.patch (587 bytes ) - added by liuar 12 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by liuar, 12 years ago

This defect occus on oracle and sql spatial providers.

The reason of the defect is in featureinfomain.php, fuction OnPolyonDigitized(polygon)

in this function, the digitized geometry will be set as geometry fiter but the geometry text which describes the polygon is not a valid polygon, because the polygon is not closed.

        function OnPolyonDigitized(polygon) {
            var points = [];
            for (var i = 0; i < polygon.Count; i++) {
                points.push(polygon.Point(i).X+' '+polygon.Point(i).Y);
            }
            var geomText = 'POLYGON(('+points.join(',')+'))';
            
            SetSpatialFilter(geomText);
        }


to fix this defect we just need to make the geometry text close

       function OnPolyonDigitized(polygon) {
            var points = [];
            for (var i = 0; i < polygon.Count; i++) {
                points.push(polygon.Point(i).X+' '+polygon.Point(i).Y);
            }
            var geomText = 'POLYGON(('+points.join(',')+ ','+ polygon.Point(0).X +' '+ polygon.Point(0).Y +'))';
            
            SetSpatialFilter(geomText);
        }

comment:2 by liuar, 12 years ago

Cc: madair@… added

Hi Mike,

Could you review this ticket please?

Regards,
Arthur

comment:3 by madair, 12 years ago

I can't really comment because I can't reproduce the issue, but your fix sounds reasonable to me.

by liuar, 12 years ago

Attachment: Ticket #393.patch added

comment:4 by chrisclaydon, 12 years ago

Could you do it like this instead, so that we don't duplicate points unnecessarily if the handler is ever fixed to return a closed polygon?:

function OnPolyonDigitized(polygon) {
            var points = [];
            for (var i = 0; i < polygon.Count; i++) {
                points.push(polygon.Point(i).X+' '+polygon.Point(i).Y);
            }
            
            // Close the polygon if it isn't already closed
            if(polygon.Point(0).X != polygon.Point(polygon.Count - 1).X ||
               polygon.Point(0).Y != polygon.Point(polygon.Count - 1).Y) {
                points.push(polygon.Point(0).X+' '+polygon.Point(0).Y);
            }
            
            var geomText = 'POLYGON(('+points.join(',')+'))';
            
            SetSpatialFilter(geomText);
        }

comment:5 by madair, 12 years ago

Resolution: fixed
Status: newclosed

looks like this one is fixed at rev [2153]

comment:6 by madair, 12 years ago

Milestone: Future2.2
Note: See TracTickets for help on using tickets.