ora2pg
ora2pg copied to clipboard
Bogus ERROR messages on generating points in geometry
In Ora2PG::GEOM::createPoint the line:
$self->logit("ERROR: SDO_ELEM_INFO for Point starting offset $sOffset inconsistent with ordinates length " . ($#{$coords} + 1));
is triggered regulary because the sOffset is tested against the size of the coordinates array without taking in account the dimension as happens in other similar functions. The message itself (and several other locations) also reports the incorrect length. Some locations where '$length' is calculated parentesis are missing causing a the calculation to be off.
The "Point" in the error message was added by me to distinguish between several identical error messages in the code.
Can you provide me an Oracle SQL script with DDL and DML to be able reproduce this issue as well as the other geometry related issues? This will help me a lot for fixing them.
I have updated a number of functions which I am currently testing. I'll add them once testing is finished. But I am mainly concentrating on Collection and Polygon. The above errors are 'obvious' and don't realy need an example as @coords is derived from @ordinates and is dimension times smaller.
I uploaded my version including some comments marked as #AD. Main 'feature' is that it loads a number of layers now without Postgres giving an error. It stops on a missing (lost) SRID after > 100 tables most of which containing geometries. A quick verification of two tables showed to be good. But no extensive verification has been done yet.
Commit 5e82256 applies your patch.
@duursma does your fixes in GEOM.pm fix also #1455 ?
I would hope so. That is, the errors are gone and generated geometries are accepted by postgres.