ThinkGeo.com    |     Documentation    |     Premium Support

Error getting feature - Geometry collection of Point and Polygon

Hello,

I am having a problem loading a particular geometry from Oracle:

The geometry is a geometry collection comprised of a Point and Polygon.
Both the point and polygon work in isolation, as does geometry collection of many polygons or many points (multipoint).
But not Point and Polygon…

Error message mentions curves/circle but polygon doesn’t use that.

oracleLayer.FeatureSource.GetAllFeatures(columns)
throws an error:
Message:
“The Curve and Circle are not supported in this feature”
StackTrace:
at OracleApiWrapper.OracleFeatureParser.GetOracleFeatureWkb(SdoGeometry geometry)
at OracleApiWrapper.OracleApiWrapper.GetFeature(OracleDataReader dataReader, IEnumerable1 columnNames) at OracleApiWrapper.OracleApiWrapper.GetAllFeatures(IEnumerable1 returningColumnNames)

Here is the offending geometry from Oralce as WellKnownText:
GEOMETRYCOLLECTION (POINT (140.269075 -28.1513119992145), POLYGON ((140.101255 -27.862391, 140.109588 -27.862388, 140.109588 -27.856833, 140.112366 -27.856833, 140.112366 -27.815052, 140.148988 -27.815052, 140.148988 -27.798386, 140.182325 -27.798386, 140.182325 -27.797111, 140.190141 -27.797111, 140.190141 -27.794333, 140.195697 -27.794333, 140.195697 -27.792944, 140.20403 -27.792944, 140.20403 -27.787388, 140.205419 -27.787388, 140.205419 -27.779055, 140.198991 -27.779055, 140.198991 -27.765055, 140.215658 -27.765055, 140.215658 -27.748388, 140.248991 -27.748388, 140.248994 -27.715055, 140.265658 -27.715055, 140.265658 -27.681833, 140.279027 -27.681833, 140.27903 -27.887388, 140.101255 -27.887391, 140.101255 -27.862391)))

It is worth noting that if I put the above well known text into Feature.CreateFeatureFromWellKnownData(wkt) it works and I can then call GetGeoJson() on the Feature and I get the composite Point+Polygon feature that I expected.

Is there a trick to getting GetAllFeatures to work for this shape?

Hi Andrew,

I was unable to recreate this issue, it seems that the issue is caused by the invalid shape. Currently, the OralceFeatureLayer supports only the following shape types:
Point,
MultiPoint,
Line,
MulitLine,
Polygon,
MultiPolygon.

Could you please share the data for us? We will focus on this and any updates I will keep you posted.

Thanks,
Emil

I have created a work around to get by the issue with non-supported geometry.

When saving, I receive a collection of GeoJson features which I combine into a single geometry.

Rather than using Feature.CreateFeatureFromGeoJson and unioning them together, I created a function that checks if the geoJson for “type: Point” and returns the feature bounding box (minimum size rectangle). These are unioned together to create a polygon collection rather than point-polygon mixture.

This is then saved to Oracle.

This can be loaded correctly into an OracleFeatureLayer.

Before returning this as GeoJson to the client, I iterate through all of the features and recreate the features which are or contain polygons smaller than a minimum size as points.

This is not the most efficent way to do this I’m sure but it works and the speed hit is negligable for the number of geometries we are using.

Cheers,

Andrew

Hi Andrew,

Thanks for sharing your idea here. It may help the other guys who encounter the same issue.

In the other hand, we have put it(an enhancement for OracleFeatureLayer to make it support the Collection type) into the TODO list and we are trying to implement it.

Thanks,
Peter