ora2pg icon indicating copy to clipboard operation
ora2pg copied to clipboard

Bogus ERROR messages on generating points in geometry

Open duursma opened this issue 3 years ago • 7 comments

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.

duursma avatar Jul 15 '22 13:07 duursma

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.

gilles-migops avatar Jul 15 '22 16:07 gilles-migops

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.

duursma avatar Jul 15 '22 20:07 duursma

geom.zip

duursma avatar Jul 16 '22 20:07 duursma

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.

duursma avatar Jul 16 '22 20:07 duursma

Commit 5e82256 applies your patch.

darold avatar Aug 01 '22 08:08 darold

@duursma does your fixes in GEOM.pm fix also #1455 ?

darold avatar Aug 01 '22 12:08 darold

I would hope so. That is, the errors are gone and generated geometries are accepted by postgres.

duursma avatar Aug 01 '22 15:08 duursma