Hot answers tagged topology
22
If your software doesn't support multi-part features you may have to go to extraordinary and complicated lengths to execute spatial operations. For example, the intersection of two polygons can, in general, have more than one connected component. It is convenient, both algorithmically and conceptually, to suppose that such an intersection returns a single ...
15
You could use ST_Touches instead:
ST_Touches — Returns TRUE if the geometries have at least one point in common, but their interiors do not intersect.
ST_Touches returns TRUE for eg
Getting the counts should work something like this:
SELECT a.id, count(*)
FROM polygon_table as a
JOIN polygon_table as b
ON ST_Touches(a.the_geom,b.the_geom)
GROUP ...
12
PostGIS topology has been a big topic in last weekend's 6th QGIS Developer Meeting
Sandro was able to relay a lot of incredibly useful and detailed insight into the PostGIS topological data model to other developers which will prove invaluable in the future as we adopt this new PostGIS capability within QGIS.
More information is available on Sandro ...
7
This is a problem that everyone solves with a slight difference. IMHO, Yahoo did a great job with WOEIDs.
As far as what is the most efficient way, it seems the answer is too subjective and dependent on your application.
7
There is a discussion about this on r-sig-geo. For a definitive answer you should ask there, cause there are peoples which know the insights of spatial R.
But, you can also do this in GIS desktop applications (export the shape using writeOGR command from rgdal or writePolyShape() from maptools) like QuantumGIS, GRASS or SAGA.
For QuantumGIS use Vector / ...
7
You can use the GRASS Toolbox for that.
Cleaning of topology of a SHAPE file using the GRASS Toolbox
Load the SHAPE file into QGIS
Use existing GRASS mapset (or create a new one) with matching projection settings
Now you have to transfer the SHAPE file from QGIS to GRASS using Toolbox -> File management -> Import into GRASS -> Import vector ...
6
Besides PostGIS, you could also use a topological open source GIS (GRASS):
Download and install
Start and select the Location manager, use the tool to generate a new project database from your SHAPE file (called "GRASS Location"), see here for a step-by-step guide
Import the SHAPE file
Use the "v.clean" tool which offers a series of options
Export map back ...
6
Ben Reilly recently posted a link on another question to his utilitynetwork Python package, which uses the OGR bindings to convert data into networkx DiGraphs.
6
Imagine joining population data to a table of single-part polygons representing countries. Depending on how you do the join, either every island would get the full population of that country or only one polygon of the set would get the full population. Without representing the country as a multi-part polygon you have to either apportion the population ...
6
This can be done using a MapTopology.
Although you cannot create or edit geodatabase topologies with ArcView
(only ArcEditor and ArcInfo), you can create and edit map topologies
in ArcView.
Create a new Add-in button and copy the code from below.
Add the roads layer to the map and start editing. Open the topology toolbar and create a map ...
5
I think what is happening is that your self-intersecting polygons becomes MULTIPOLYGONS when buffering.
you have two options:
1 remove the constraint "enforce_geotype_the_geom", you can do that in pgAdmin
2 put the result in a new table instead of updating the old. that is often a good way of doing things because then you don't change anything in your ...
5
Use the return value of the Intersect method instead of the TopologicalOperator. Try the following instead (I use C#, not VB.NET, so hopefully this works. The casting business is really confusing):
Dim topoOp As ITopologicalOperator = TryCast(pTestPoly2, ITopologicalOperator)
Dim pOutPointCol As IPointCollection = ...
5
For a solution avoiding ArcGIS, use pysal. You could get the weights directly from shapefiles using:
w = pysal.rook_from_shapefile("../pysal/examples/columbus.shp")
or
w = pysal.queen_from_shapefile("../pysal/examples/columbus.shp")
Head for the docs for more info.
5
Yes, you can write back to the same source file geodatabase and you can even write back to the same featureclass. In the workspace below, I read in the featureclass EsriCitiesDetailed as the Clipee, then write out the clipped features right back to a featureclass with the same name in the same geodatabase.
The key is to drop the target table before you ...
5
Assuming that the convex hull idea doesn't pan out, what about something like this:
convert the polygon vertices to points
convert the polygon to lines
split each line at each vertex (so you have line segments)
calculate the distance and angle of each vertex to the road
for each polygon, find the closest point (aka vertex) to the road
select the lines ...
5
If you have an ArcEditor or ArcInfo license, you can use ArcGIS' Parcel Fabric tool.
In the parcel fabric, parcels can be divided by area to create new
parcels. Using the parcel division tool, you can divide parcels using
the following area-based division methods:
In equal widths
By proportional area
Into equal areas
I assume you ...
4
That document is confusing to read but it is consistent. Its definitions on p. 2 all rely ultimately on the "definition" of boundary, which is not a definition at all ("The boundary of a geometry object is a set of geometries of the next lower dimension"). (I suspect it is intended to be a continuation of one or more of its references.) The only clear ...
4
If you have one target geometry with a batch of many test geometries, try using a prepared geometry. See this page for a good description of a prepared geometry.
4
For ArcGIS 9x
Export Topology Exceptions
This code will export Topology Error Exceptions to a feature class. This is useful when one needs to archive Exceptions. When the exceptions are exported to the feature class they can be treated just like any other feature (attribute update/notes, identify).
Then Export to Shapefile for your other users.
...
4
There are a few ways to do this. I have completed this in the past with great results using a combination of attributes and raster processing. The premise of the process is to assign each feature with a value of n (1, 2, 4, 8, 16, 32, 64, etc.). Assigning these values ensures that when you subtract layer one (1985) from layer 2 (1997) you get a unique ...
3
if you have access to Safe Fme tools you will find useful the transformer called spikeRemover, give it a look. You may try a downloadable limited version of SAFE FME or check your ArcGis license for "FME Extension for ArcGIS"
http://docs.safe.com/fme/html/FME_Transformers/content/transformers/spikeremover.htm
...
3
Routing is a graph problem, not a pure geometry problem per se (I am using a bit loose terms here for the sake of clarity). What that means is that you have to grab the original geometries from your features - potentially from various different spatial tables (aka Feature Classes in ESRI speak) and build a graph representation (aka Network Topology ) that is ...
3
I would have commented rather than answered, because there are already several good answers, but I don't have enough reputation yet to comment!
Caveat: I have to think hard when working with the DE-9IM and may have misunderstood your question, or the documents that I looked at.
You said you're testing the intersection of a point and a line. This answer, ...
3
For 9.3.1 the PDF Poster explains it well:
http://webhelp.esri.com/arcgisdesktop/9.3/pdf/Topology_rules_poster.pdf
You must use a Personal or File Geodatabase to create the topology rules.
Tip: Clean and Build are in ArcCatalog (use properties to find it on the feature)
Starting Point:
...
3
You could emulate Arc/Node topology by creating "nodes" from the endpoints of each road. Years ago I wrote an Avenue script which did this - you may be able to recreate this for ArcGIS 10 using VBA or Python.
Once you have a set of nodes, iterate through each node and use the Select By Location function to count the number of arcs which are connected. If ...
3
My understanding of the problem is as follows:
If a polyline endpoint intersects a polygon then the polyline needs to be connected (by adding or adjusting vertices) to all additional polyline endpoints that intersect the same polygon.
Some polyline endpoints don't intersect a polygon, being undershoots, but these should be connected as above.
This answer ...
3
The help file under Common Polygon Editing Tasks and the section Filling in donut holes in polygons may help.
You could also try the "must not have gaps" rule to actually find the donut polygons. I've had mixed success with automatically creating polygons to fill the gap, when using the Topology edit toolbar.
Either way, once you've filled the holes you ...
3
Could you use Simplify Polygon (from the Cartography toolbox) and select the Bend_simplify option rather than the Point Remove, which will help you maintain the shape of the polygons. Use the 'Maximum Allowable Offset' to set your tolerance. The 'Maximum Area' setting will allow you to kill tiny polygons if they fall below the practical (soil sampling) ...
3
Answer to the question
You want a new dynamic layer based on another given layer.
I would advise the following steps :
put your country layer in a database (PostGIS for exemple)
create a function (sql/plpgsql) in the database to derive states from a country. This function's complexity depends on the needed method.
generate a state table by computing ...
3
I am using ST_relate_summary function, acting as the requested ST_Relate_readable(), that I posted into code.google as simple a SQL/PostGIS code. It is not from a standard library, neither a systematically tested or optimized one.
Thanks to Mike about JTS Topology Suite: JTS offers a (very good!) graphical interface, reporting spatial predicates... I need ...
Only top voted, non community-wiki answers of a minimum length are eligible


