====== Map Suite WebAPI Topology====== ===== Video Overview ===== {{youtube>2OwYwaaeyJ4|WebAPI Topology Sample}}
{{filehistory:webapieditionsample_topologyvalidation_cs_20151211.zip|C# Project}} [[source_code_webapieditionsample_topologyvalidation.zip|View Source]] [[http://samples.thinkgeo.com/WebApiEdition/SampleTemplates/TopologyValidation/leaflet/|Try It Online(Leaflet)]] [[http://samples.thinkgeo.com/WebApiEdition/SampleTemplates/TopologyValidation/openlayers/|Try It Online(Openlayers)]]
=====Overview===== Topology refers to the relationship between lines, points, and polygons. For more information about the concept of topology please visit [[https://en.wikipedia.org/wiki/Geospatial_topology|this Wikipedia article]]. Map Suite offers a set of static Map Suite APIs relating to topology, along with an application to validate topology rules. Topology can be very useful in GIS as it allows users to clean up data or to modify geometries to comply with different rules and restrictions. Below is a list of all of the topology cases this sample covers: *Lines End Point Must Be Covered By Points *Lines Must Be Covered By Boundary Of Polygons *Lines Must Be Covered By Feature Class Of Lines *Lines Must Be Larger Than Cluster Tolerance *Lines Must Be Single Part *Lines Must Not Have Dangles *Lines Must Not Have Pseudonodes *Lines Must Not Intersect Or Touch Interior *Lines Must Not Intersect *Lines Must Not Overlap With Lines *Lines Must Not Overlap *Lines Must Not Self Intersect *Lines Must Not Self Overlap *Points Must Be Covered By Boundary Of Polygons *Points Must Be Covered By EndPoint Of Lines *Points Must Be Covered By Lines *Points Must Be Properly Inside Polygons *Polygons Boundary Must Be Covered By Boundary Of Polygons *Polygons Boundary Must Be Covered By Lines *Polygons Must Be Covered By Feature Class Of Polygons *Polygons Must Be Covered By Polygons *Polygons Must Be Larger Than Cluster Tolerance *Polygons Must Contain Point *Polygons Must Cover Each Other *Polygons Must Not Have Gaps *Polygons Must Not Overlap With Polygons *Polygons Must Not Overlap ==== Lines End Point Must Be Covered By Points ==== The ends of lines in one feature must be covered by points in another feature. {{webapiedition:linesendpointmustbecoveredbypoints.png|Border}} ==== Lines Must Be Covered By Boundary Of Polygons ==== Lines in one feature must be covered by the boundaries of polygons in another feature. {{webapiedition:linesmustbecoveredbyboundaryofpolygons.png|Border}} ==== Lines Must Be Covered By Feature Class Of Lines ==== Lines in one feature class must be covered by lines in another feature. {{webapiedition:linesmustbecoveredbyfeatureclassoflines.png|Border}} ==== Lines Must Be Larger Than Cluster Tolerance ==== Cluster tolerance is the minimum distance between vertices of features. Vertices that fall within the cluster tolerance are defined as coincident and are snapped together. {{webapiedition:linesmustbelargerthanclustertolerance.png|Border}} ==== Lines Must Be Single Part ==== Lines within a feature must only have one part. {{webapiedition:linesmustbesinglepart.png|Border}} ==== Lines Must Not Have Dangles ==== The end of a line must touch any part of one other line or any part of itself within a feature. {{webapiedition:linesmustnothavedangles.png|Border}} ==== Lines Must Not Have Pseudonodes ==== The end of a line cannot touch the end of only one other line within a feature. The end of a line can touch any part of itself. {{webapiedition:linesmustnothavepseudonodes.png|Border}} ==== Lines Must Not Intersect Or Touch Interior ==== Lines can only touch at their ends and must not overlap each other within a feature. {{webapiedition:linesmustnotintersectortouchinterior.png|Border}} ==== Lines Must Not Intersect ==== Lines can only touch at their ends and must not overlap each other within a feature. {{webapiedition:linesmustnotintersect.png|Border}} ==== Lines Must Not Overlap ==== Lines must not overlap any part of another line within a feature. Lines can touch, intersect, and overlap themselves. {{webapiedition:linesmustnotoverlap.png|Border}} ==== Lines Must Not Overlap With Lines ==== Lines in one feature must not overlap any part of another line in another feature. {{webapiedition:linesmustnotoverlapwithlines.png|Border}} ==== Lines Must Not Self Intersect ==== Lines must not cross or overlap themselves within a feature. Lines can touch themselves and touch, intersect, and overlap other lines. {{webapiedition:linesmustnotselfintersect.png|Border}} ==== Lines Must Not Self Overlap ==== Lines must not overlap themselves within a feature. Lines can touch, intersect, and overlap lines in another feature. {{webapiedition:linesmustnotselfoverlap.png|Border}} ==== Points Must Be Covered By Boundary Of Polygons ==== Points in one feature must touch boundaries of polygons from another feature. {{webapiedition:pointsmustbecoveredbyboundaryofpolygons.png|Border}} ==== Points Must Be Covered By EndPoint Of Lines ==== Points in one feature must be covered by the ends of lines in another feature. {{webapiedition:pointsmustbecoveredbyendpointoflines.png|Border}} ==== Points Must Be Covered By Lines ==== Points in one feature must be covered by lines in another feature. {{webapiedition:pointsmustbecoveredbylines.png|Border}} ==== Points Must Be Properly Inside Polygons ==== Points in one feature must be inside polygons of another feature. {{webapiedition:pointsmustbeproperlyinsidepolygons.png|Border}} ==== Polygons Boundary Must Be Covered By Boundary Of Polygons ==== The boundaries of polygons in one feature must be covered by the boundaries of polygons in another feature. {{webapiedition:polygonsboundarymustbecoveredbyboundaryofpolygons.png|Border}} ==== Polygons Boundary Must Be Covered By Lines ==== Polygon boundaries in one feature must be covered by the lines of another feature. {{webapiedition:polygonsboundarymustbecoveredbylines.png|Border}} ==== Polygons Must Be Covered By Feature Class Of Polygons ==== The polygons in the first feature must be covered by the polygons of the second feature. {{webapiedition:polygonsmustbecoveredbyfeatureclassofpolygons.png|Border}} ==== Polygons Must Be Covered By Polygons ==== Polygons in one feature must be covered by a single polygon from another feature. {{webapiedition:polygonsmustbecoveredbypolygons.png|Border}} ==== Polygons Must Be Larger Than Cluster Tolerance ==== Cluster tolerance is the minimum distance between vertices of features. Vertices that fall within the cluster tolerance are defined as coincident and are snapped together. {{webapiedition:polygonsmustbelargerthanclustertolerance.png|Border}} ==== Polygons Must Contain Point ==== Each polygon must contain exactly one point. Each point must fall within a polygon. {{webapiedition:polygonsmustcontainpoint.png|Border}} ==== Polygons Must Cover Each Other ==== All polygons in the first feature and all polygons in the second feature must cover each other. {{webapiedition:polygonsmustcovereachother.png|Border}} ==== Polygons Must Not Have Gaps ==== Polygons must not have a void between them within a feature. {{webapiedition:polygonsmustnothavegaps.png|Border}} ==== Polygons Must Not Overlap ==== Polygons of the first feature must not overlap polygons of the second feature. {{webapiedition:polygonsmustnotoverlap.png|Border}} ==== Polygons Must Not Overlap With Polygons ==== Polygons of the first feature must not overlap polygons of the second feature. {{webapiedition:polygonsmustnotoverlapwithpolygons.png|Border}}