I'm rather new to oracle spatial. I'd like to restrict shapes to simple polygons. multiple polygons are ok. donuts are not. crossed edges are not. and all shapes must be separated by a tolerance.
SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT seems like a good place to start... but would appreciate any further insight on how to determine that I do not have donuts.
any insight appreciated.
found what I needed here:
https://spatialdbadvisor.com/oracle_spatial_tips_tricks/89/sdo_utilgetnumrings-an-alternative
with additional information from the documentation:
https://docs.oracle.com/cd/B28359_01/appdev.111/b28400/sdo_objrelschema.htm#SPATL020
Related
I have a part which has two exremums on one direction. These extremums can be surface, point or line depending on part shape.
I want to measure the distance between those two extremums on the direction which they are defined by.
I couldn't find anyway to measure distance.
i solved the broblem by creating a formula which is
distance(sadasd\Sketchplane,BOUNDARY BOX\extz-2)
I would like to plot the direction field for a system of 3 or more equations in SageMath using Maxima. I know how to do this for a system of 2 equations. I don't know what to modify so that I extend it to 3 or more equations. I tried the following example for a system of two equations
maxima('plotdf([x,-y],[x,y],[x,-2,2],[y,-2,2])')
I was thinking for the three or more equations I simply have to add more varibles like
maxima('plotdf([x,-y,z],[x,y,z],[x,-2,2],[y,-2,2],[z,-2,2])')
but its not working. I dont know what am missing.
The Maxima documentation for plotdf makes the syntax clear. I'm not sure what a slope/direction field would look like for more equations unless you had more variables, but then it would have to be in three dimensions, which is not supported.
In any case I'm surprised this worked from within Sage; you must have had wxmaxima or something analogous already there.
Finally, note that SageMath has slope fields natively, though this may not correspond with your workflow.
I have two questions;
What is the name of the graph (or circuit) which goes along the outer vertices of existing nodes.
What will be the formal definition of that graph.
for the simplicity, I have added a sample figure and the red highlighted graph is what I wanted.
If I show how I got this outer vertices;
I have set of sub graphs. So I got UNION and INTERSECTION, then got the DIFFERENCE. Do this one after the other, Finally I ended with a graph which is similar to MY RED EDGE GRAPH.
So the final graph which I got was {1,2,6,7,9,8,10,11,10,7,6,5,3,4,3,1} if i start from 1.
PLEASE TELL ME WHETHER I AM USING CORRECT THING OR NOT AS I AM COMING TO END OF MY WORK.
You may be trying to define some kind of geometric hull, but surely not a graph property. These two graphs are equivalent and indistinguishable a far as Graph Theory goes:
Edit
Perhaps this old answer of mine may help you
I'm working on a small design project, part of which involved writing out text in a given font such that the letters of a word are just touching each other on their right and left sides.
I've thought of implementing this as follows - create GlyphVectors of two letters, create Shape objects using vector.getOutline(), then create Area objects and intersect them.
The only thing I'm missing with this method is the ability to shift the second letter to the right until the intersect is empty.
Is there a way to do this, or do I need to use a different approach?
TIA
eta: ok, I've figured out I can use AffineTransform. Now, is there a way to tell the size (surface area) of the Area created by the intersection of two letters?
How precise do you want this to be? Pixel precision is much easier to attain than vector precision. Have you considered linearisation (usually done through
public PathIterator getPathIterator(AffineTransform at, double flatness)
) of outlines and then doing search in opposite directions among all points? This seems to be the most obvious solution even though it is not vector-precise.
We have an application that has a database full of polygons (currently stored as points) that a .net app pulls out and checks if they overlap.
I occurred to me that it would be much nicer to convert these point arrays to polygon / polyline objects within the database and use sql to get a bool of weather they overlap or not.
I have seen different methods suggested to do this but non of the examples given were quite in-line with my needs.
I would be very happy to receive input from those kind enough to offer their experience.
Additional:
In response to questions: It is indeed 2D. and yes any crossover of the two is considered true. The polygons have n points and can be concave. The polygons will be saved as 1 per row (after data conversion task) as polygons (i.e. the polygon type .. it might be called something else spatial / geom my memory is not on my side right now)
You can use .STIntersection with .STAsText() to test for overlapping polygons. (I really hate the terminology Microsoft has used (or whoever set the standard terms). "Touching," in my mind, should be a test for whether or not two geometry/geography shapes overlap at all, not just share a border.)
Anyway....
If #RadiusGeom is a geometry representing a radius from a point, the following will return a list of any two polygons where an intersection (a geometry that represents the area where two geometries overlap) is not empty.
SELECT CT.ID AS CTID, CT.[Geom] AS CensusTractGeom
FROM CensusTracts CT
WHERE CT.[Geom].STIntersection(#RadiusGeom).STAsText() <> 'GEOMETRYCOLLECTION EMPTY'
If your geometry field is spatially indexed, this runs pretty quickly. I ran this on 66,000 US CT records in about 3 seconds. There may be a better way, but since no one else had an answer, this was my attempt at an answer for you. Hope it helps!
Calculate and store the bounding rectangle of each polygon in a set of new fields within the row which is associated with that polygon. (I assume you have one; if not, create one.) When your dotnet app has a polygon and is looking for overlapping polygons, it can fetch from the database only those polygons whose bounding rectangles overlap, using a relatively simple SQL SELECT statement. Those polygons should be relatively few, so this will be efficient. Then, your dotnet app can perform the finer polygon overlap calculations in order to determine which ones of those really overlap.
Okay, I got another idea, so I am posting it as a different answer. I think my previous answer with the bounding polygons probably has some merit on its own, even if it was to reduce the number of polygons fetched from the database by a small percentage, but this one is probably better.
MSSQL supports integration with the CLR since version 2005. This means that you can define your own data type in an assembly, register the assembly with MSSQL, and from that moment on MSSQL will be accepting your user-defined data type as a valid type for a column, and it will be invoking your assembly to perform operations with your user-defined data type.
An example article for this technique on the CodeProject: Creating User-Defined Data Types in SQL Server 2005
I have never used this mechanism, so I do not know details about it, but I presume that you should be able to either define a new operation on your data type, or perhaps overload some existing operation like "less-than", so that you can check if one polygon intersects another. This is likely to speed things up a lot.