Q&A - Question

How to find if there is Gap between 2 shapes?

Question
SohT asked on February 10, 2017, keyword: Developer Kernel

Is there anyway to find out if there is a Gap between 2 shapes?

or

Is there anyway to find out the count of touches between 2 shapes? since Gap usually occurs in 2 or more touches

Either way works

Answers
Monika Pencierzynska (TatukGIS) replied February 10, 2017
The "gaps between polygons" is a nontrivial topological problem, there is no single method that would give you the answer. However, you can solve it by performing several topological operations using the TGIS_Topology class. First you need to check if the polygons only touch and not overlap using the TGIS_Topology.Overlap method (you can skip this step if topological correctness of the input data is not relevant). Then you need to sum the two shapes using the TGIS_Topology.Union method and check the number of holes. For example, if the first shape has 2 holes, the second 3 holes, and the sum 5 holes then there are no gaps between these shapes. To verify if a part is the main part, an island or a hole use the TGIS_Topology.PartStatus method.
 
If you would like to answer the question please Sign In.
*
*
Please review our recent Privacy Policy.
If you have any questions or requests, please contact us.
Rules
The Questions and Answers (Q & A) is intended to provide a means of communication between TatukGIS customers.
 
  1. Licensed users (with active maintenance play) of TatukGIS products may contribute to the Q & A content. Read-only access is available to anyone.
  2. Keep the content positive and professional.
  3. Be courteous to others by posting information when a question or issue asked on the Q & A is answered or resolved by other means (such as with help from TatukGIS technical support). Offer others at least a hint how the posted question was answered or the issue was resolved.
  4. The Q & A is not a replacement for TatukGIS technical support. TatukGIS team may or may not regularly follow or contribute content.