Spatial operations

Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Spatial operations

popovictamara
Hello,

I am trying to write a spatial query on .sdf database to return all polygons
inside of another polygon B, even the polygons touching the boundary of the
B polygon on the inside. Contains and Within only return polygons that are
completely inside of polygon B, and polygons that are touching the boundary
are ignored.

Can anyone help?




--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Spatial operations

Martin Morrison
What software are you using to write this query?



-----Original Message-----
From: fdo-users <[hidden email]> On Behalf Of popovictamara
Sent: Thursday, December 13, 2018 7:41 AM
To: [hidden email]
Subject: [fdo-users] Spatial operations

Hello,

I am trying to write a spatial query on .sdf database to return all polygons inside of another polygon B, even the polygons touching the boundary of the B polygon on the inside. Contains and Within only return polygons that are completely inside of polygon B, and polygons that are touching the boundary are ignored.

Can anyone help?




--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Spatial operations

popovictamara
I am using FDO API for C#



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Spatial operations

popovictamara
Any help, please?



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Spatial operations

Flipper
Did you try Intersect, as well as inside? It's been a very long time since I
have done FDO code but I thought you could OR on the two



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Spatial operations

GordonL
In reply to this post by popovictamara
Can you share the key part of the code that is the problem?





--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Spatial operations

popovictamara
This post was updated on .
Sorry for my delayed reply.

This is a part of the code where I need to examine spatial position of my
geometry:

           while (reader.ReadNext())
                            {
                                string guidCheck = reader.GetString("GUID");
                                if (!guids.Contains(guidCheck))
                                {
                                    //1. check for spatial condition
                                    var geometryByte =
reader.GetGeometry("Geometry");
                                    var geometryFeature =
geomFactory.CreateGeometryFromFgf(geometryByte);
                                    bool spatialMet = false;
                                   
                                   
                                    if (spatialCondition ==
ProjectManager.SpatialCondition.Inside)
                                    {
                                       
                                        spatialMet =
SpatialUtility.Evaluate(geometryFeature,
SpatialOperations.SpatialOperations_Inside, conditionGeometry);
                                    }
                                    else
                                    {
                                        spatialMet =
SpatialUtility.Evaluate(geometryFeature,
SpatialOperations.SpatialOperations_Intersects, conditionGeometry);
                                    }
                                    }
}

Here is the example of what I need:
I have Municipality boundary and I need to return all of the Cadastral Units
within that Municipality using spatial condition. But I can't figure out how
to achive this.




--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
fdo-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Spatial operations

popovictamara
Perhaps I'm not being clear enough. I will try this one more time. I tried
all spatial operation types and none of them won't return all of the
polygons inside polygon B. They won't return polygons that are touching the
boundary of polygon B on the inner side. Is there way to do this. I wanted
to do a buffer polygon and then inside operation. But buffer functions
doesn't seem to be exposed to .NET. Am I right? Thank you...



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Spatial operations

Orest Halustchak-2
You can find a good explanation of the various spatial operators here: https://en.wikipedia.org/wiki/DE-9IM

I think the operator that you are looking for is Covers or CoveredBy. I think Fdo supports CoveredBy. Did you try that one?

Which fdo provider are you using?

-----Original Message-----
From: fdo-users <[hidden email]> On Behalf Of popovictamara
Sent: January 24, 2019 4:44 AM
To: [hidden email]
Subject: Re: [fdo-users] Spatial operations

Perhaps I'm not being clear enough. I will try this one more time. I tried all spatial operation types and none of them won't return all of the polygons inside polygon B. They won't return polygons that are touching the boundary of polygon B on the inner side. Is there way to do this. I wanted to do a buffer polygon and then inside operation. But buffer functions doesn't seem to be exposed to .NET. Am I right? Thank you...



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Spatial operations

popovictamara
I am using FDO provider for sdf (Autodesk). I looked up for the explanations
and I tried all spatial operators provided for sdf. But none of them worked
as I wanted... It does seem like the Covered by and Inside are what would be
the solution, but as I remember I think that Covered By Is not supported for
my provider. Will try again today...


Greetings



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Spatial operations

popovictamara
Hello,

I couldn't find a direct solution, so I found a workaround. Here is what I
did maybe someone will be in the same trouble:
I used NetTopologySuite lib(https://github.com/NetTopologySuite) to
calculate polygon buffer. I offsetted polygon boundary to be just a little
bit bigger than the original and than used Inside spatial operator.




--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users