SharpMap.Data.Providers.OracleSpatial/Oracle.UDT/sdogeometry.cs (possible) bug?

Topics: Data Access
Editor
Jun 30, 2014 at 10:43 AM
Function

public IGeometry AsGeometry()

in version 1.0
(https://sharpmap.codeplex.com/SourceControl/latest#Branches/1.0/SharpMap.Data.Providers.OracleSpatial/Oracle.UDT/sdogeometry.cs)
....
 if (_elemArray[1] == 2) //Line
                {
                    return GeometryServiceProvider.Instance.CreateGeometryFactory().CreateLineString(coords.ToArray());
                }

                if (_elemArray[1] == 1003)
                {
                    if (_elemArray[2] == 1)
                    {
                        //Check that the polygon is self-enclosing, else fix
                        var seq = GeometryServiceProvider.Instance.DefaultCoordinateSequenceFactory.Create(coords.ToArray());
                        
                        coords.EnsureValidRing();
                        return GeometryServiceProvider.Instance.CreateGeometryFactory().CreatePolygon(seq);
Was not working beacause seq is not "ensuredvalidring" so if polygon is not closed fire an error


in version 1.1
(https://sharpmap.codeplex.com/SourceControl/latest#Branches/1.1/SharpMap.Data.Providers.OracleSpatial/Oracle.UDT/sdogeometry.cs)
if (_elemArray[1] == 2) //Line
                {
                    return GeometryServiceProvider.Instance.CreateGeometryFactory().CreateLineString(coords.ToArray());
                }
                else if (_elemArray[1] == 1003)
                {
                    if (_elemArray[2] == 1)
                    {
                        return GeometryServiceProvider.Instance.CreateGeometryFactory().CreatePolygon(coords.ToArray());
                    }
                    else if (_elemArray[2] == 3)
                    {
Is not ensured that is a valid ring

I'm using version 1.0 changed as here:
 if (_elemArray[1] == 1003)
                {
                    if (_elemArray[2] == 1)
                    {
                        //Check that the polygon is self-enclosing, else fix
                        var seq = GeometryServiceProvider.Instance.DefaultCoordinateSequenceFactory.Create(coords.ToArray());
                        
                        coords.EnsureValidRing();
                        //return GeometryServiceProvider.Instance.CreateGeometryFactory().CreatePolygon(seq);
                        return GeometryServiceProvider.Instance.CreateGeometryFactory().CreatePolygon(coords.ToArray());
Coordinator
Jul 7, 2014 at 6:50 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.