Skip to content

Request: Please support CurvePolygons or at least simple circles encoded as CurvePolygons? #18

@jamesra

Description

@jamesra

I understand CurvePolygons are not supported at this time. I'm creating this issue as a request to at least support CurvePolygons that encode simple circles. Naturally the research lab I work for has an annotation database with millions of circles encoded as CurvePolygons:

CURVEPOLYGON (CIRCULARSTRING (40288.3829913593 59811.5850000016, 41716.865 61240.0670086423, 43145.3470086407 59811.5850000016, 41716.865 58383.1029913609, 40288.3829913593 59811.5850000016))

Currently I am unable to find a way to read rows with CurvePolys using EF Core+NetTopologySuite. I asked Stack Overflow as well with no answer so far.

Using a converter via Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter does not work as the GeoParseException thrown for an unsupported type prevents the converter from being invoked. I've been unable to figure out how to intercept the column to convert it to an alternate representation.

My workaround will be to see if I can pull down the geometry columns as byte[], and if that doesn't work I'll have to fork a custom SqlServerBytes and use app-specific logic to workaround (Ewww...).

I'm not sure what a general solution would be but I'd love to see a way forward for future users. Unfortunately NetTopologySuite does not appear to support the circle as a geometry primitive. If it did I would argue for a special case that detects and supports CurvePolygons representing Circles as I expect they are likely the most common case.

An alternate approach would be a mechanism to invoke a handler when an unsupported type is decoded. Then a similar mechanism to encode geometry manually. Neither option feels great to me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions