question

MarcoSalvatori-5288 avatar image
0 Votes"
MarcoSalvatori-5288 asked ·

Spatial data operations

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


dotnet-runtimedotnet-runtime-coredotnet-aspnetcore-webapidotnet-entity-framework-core
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers