ora2pg
ora2pg copied to clipboard
Geospatial field issue
Hello, I was experiencing a problem when using WKT format export from Oracle, that I solved modifying the code of the file Ora2Pg.pm . The problem I think was caused by the fact that ins subroutine format_data_row is evaluating if there is at least a gemotry field with : $has_geom = 1 if (grep(/^(SDO_GEOMETRY|ST_|STGEOM_)/, @$src_data_types)); That was causing of having all the fields, of a table with at least a geometry in that way : $row->[$idx] = "ST_Geometry('" . $row->[$idx] . "', $self->{spatial_srid}{$table}->[$idx])"; In order to avoid such behaviour I added the evaluation of has_geom variable inside the "for" cycle that is checcking all data types of the routine format_data_row : for (my $idx = 0; $idx <= $#{$data_types}; $idx++) { if ($src_data_types->[$idx] =~ /SDO_GEOMETRY/i) { $has_geom = 1 }else{ $has_geom = 0 } In attach the file.