NetTopologySuite / NetTopologySuite.IO.Oracle

Oracle IO module for NTS.
0 stars 5 forks source link

Can't load multipoint geometry if it contains only one point. #15

Closed gosimowicz closed 2 weeks ago

gosimowicz commented 1 month ago

If there is a multipoint geometry which contains only one point then SDO_INTERPRETATIONis equal to 1, because of that method OracleGeometryReader.CreateMultiPoint(GeometryFactory factory, int dim, int lrs, double[] elemInfo, int elemIndex, List<Coordinate> coords) return null. Which results in null pointer exception in method OracleGeometryReader.Read.

First of it may be confusing why you have multipoint geometry with only one point but most of the software doesn't allow to mix different type of geometries in one feature class (table), additionally my test table was created with GDAL which supports such cases.

I suggest to not throw null if SDO_INTERPRETATION == 1, additionally Read method must be prepared that Create method will return null.

gosimowicz commented 1 month ago

While fixing (and testing) also I have noticed that if I save MultiPoint geometry with one point it will be saved as Point - changing type is unacceptable from my point of view.