[fdo-users] How does FDO handle invalid fgf geometries?

Jackie Ng jumpinjackie at gmail.com
Fri Aug 22 10:02:31 EDT 2008


For reference:

http://trac.osgeo.org/fdo/ticket/382

- Jackie


Dan Stoica wrote:
> 
> This is a bug and needs fixing. It is a bug because GetText() is supposed
> to do a simple dump. What a dump has to do with topological validation?
> None.
> 
> Therefore, filing a ticket is the right thing to do.
> 
> Dan.
> 
> -----Original Message-----
> From: fdo-users-bounces at lists.osgeo.org
> [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Jackie Ng
> Sent: Thursday, August 21, 2008 11:57 PM
> To: fdo-users at lists.osgeo.org
> Subject: RE: [fdo-users] How does FDO handle invalid fgf geometries?
> 
> 
> I strongly suspected that it was some other error than running out of
> memory.
> 
> Good to know my suspicions are confirmed.
> 
> - Jackie
> 
> 
> Dan Stoica wrote:
>>
>> Did some investigations on this matter. Turns out that:
>>
>> a) the polygon in question has a ring which is not closed.
>> b) the geometry factory throws an appropriate exception "Open ring"
>> c) the exception is not caught by GetText()
>> d) for some odd reason the exception is turned into "memory allocation
>> error"
>>
>> Therefore, the quick solution for Jackie is to catch the exception.
>>
>> Going forward, we might want to get rid of the 'is polygon closed?'
>> test...
>>
>>
>> Dan.
>>
>> -----Original Message-----
>> From: fdo-users-bounces at lists.osgeo.org
>> [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Mateusz Loskot
>> Sent: Thursday, August 21, 2008 10:51 AM
>> To: FDO Users Mail List
>> Subject: Re: [fdo-users] How does FDO handle invalid fgf geometries?
>>
>> Jackie Ng wrote:
>>> Hi All,
>>>
>>> How does FDO handle invalid FGF binary data?
>>
>> Jackie,
>>
>>  From my experience, I've observed that FDO does not strictly
>> validate FGF/WKB input on geometry creation.
>> Actually, GeometryFactory checks if WKB stream has minimal length of 9
>> bytes and it does not prevent to create geometry from bytes stream of
>> garbage.
>>
>> Here is a small test of valid and invalid WKB input (see main function):
>>
>> http://mateusz.loskot.net/tmp/fdo/test_geometry_factory.cpp.html
>>
>> This is the result of 3 test cases included in the test:
>>
>> Expected WKT: POINT(15.123 21.456)
>> Output WKT  : POINT (-7.84591113289983e+298 0)
>>
>> Expected WKT: POINT(15.123 21.456)
>> Output WKT  : POINT (15.123 21.456)
>>
>> *** FDO Error:
>>    *** (.\Src\Geometry\Fgf\GeometryFactory.cpp: 568)
>> FDO_1_INVALID_INPUT_ON_CLASS_CREATION
>>
>>
>> Best regards,
>> --
>> Mateusz Loskot, http://mateusz.loskot.net
>> Charter Member of OSGeo, http://osgeo.org
>> _______________________________________________
>> fdo-users mailing list
>> fdo-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/fdo-users
>>
>> _______________________________________________
>> fdo-users mailing list
>> fdo-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/fdo-users
>>
>>
> 
> --
> View this message in context:
> http://n2.nabble.com/How-does-FDO-handle-invalid-fgf-geometries--tp738279p742019.html
> Sent from the FDO Users mailing list archive at Nabble.com.
> 
> _______________________________________________
> fdo-users mailing list
> fdo-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fdo-users
> _______________________________________________
> fdo-users mailing list
> fdo-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fdo-users
> 
> 

-- 
View this message in context: http://n2.nabble.com/How-does-FDO-handle-invalid-fgf-geometries--tp738279p759570.html
Sent from the FDO Users mailing list archive at Nabble.com.



More information about the fdo-users mailing list