Spatial data operations

Marco Salvatori 191 Reputation points
2021-01-14T10:50:45.65+00:00

Hello,

I have to migrate some routines written in VBNET in WPF environment on AZURE (webapi net core).

In these routines spatial operations such as union, intersection, etc. take place.

here is an example:

Private Sub example(ByVal sender As System.Object, ByVal e As System.EventArgs)  
        Dim myGeom1 As SqlGeometry = SqlGeometry.STGeomFromText(New SqlString("POLYGON((0 10, 10 10, 10 0, 0 0, 0 10))"), 0)  
        Dim myGeom2 As SqlGeometry = SqlGeometry.STGeomFromText(New SqlString("POLYGON((0 0, 4 0, 4 4, 0 4, 0 0))"), 0)  
        'Dim myGeom2 As SqlGeometry = SqlGeometry.STGeomFromText(New SqlString("POLYGON((1 -1, 1 5, 3 5, 3 -1, 1 -1))"), 0)  
        Dim myGeom3 As SqlGeometry = SqlGeometry.STGeomFromText(New SqlString("POLYGON((5 0, 8 0, 8 1, 5 1, 5 0))"), 0)  
        MsgBox(myGeom1.STArea)  
        MsgBox(myGeom2.STArea)  
        MsgBox(myGeom3.STArea)  
  
        Dim union As SqlGeometry = myGeom2.STUnion(myGeom3)  
        MsgBox(union.STArea)  
        Dim intersect As SqlGeometry = myGeom1.STIntersection(union)  
        MsgBox(intersect.STArea)  
        Dim difference As SqlGeometry = myGeom1.STSymDifference(union)  
        MsgBox(difference.STArea)  
    End Sub  

I wanted to migrate to use Microsoft.Spatial but it does not contain methods to recover the area for example microsoft.spatial.spatialoperations

more similar methods can be found in the System.Data.Entity.Spatial system.data.spatial.dbspatialservices.getarea

I read that Microsoft.Spatials will be more supported but at the moment they don't solve the problems for me.

how do you recommend to proceed?

Thanks

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,157 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,119 questions
0 comments No comments
{count} votes