Hot answers tagged

35

I've been exploring SciPy's signal.convolve approach (based on this cookbook), and am having some really nice success with the following snippet: import numpy as np from scipy.signal import fftconvolve def gaussian_blur(in_array, size): # expand in_array to fit edge of kernel padded_array = np.pad(in_array, size, 'symmetric') # build kernel ...


22

Gaussian blur is just a weighted focal mean. You can recreate it to high accuracy with a sequence of short-distance circular neighborhood (unweighted) means: this is an application of the Central Limit Theorem. You have a lot of choices. "Filter" is too limited--it's only for 3 x 3 neighborhoods--so don't bother with it. The best option for large DEMs is ...


14

GRASS is topology-aware. You can use v.generalize from the Processing toolbox to simplify polygons and if the input data is topologically correct so will the output.


14

The morphological operations Expand and Shrink were created for this kind of processing. Use ArcGIS (or GRASS or Mathematica) because R's "raster" library is too slow. Often it helps to experiment a little with the parameters: you have to decide how much expanding and shrinking is needed to clean an image; and usually you want to do as little as possible,...


13

There are many algorithms dedicated to building simplification. You may have a look at this website for an overview. See also this question. You could use: Building outline simplification: It consist in recursively deleting too short edges of the outline and lengthening the neighbor edges. Example: Smallest surrounding rectangle algorithm: It consist ...


12

you can use: Vector menu -> Geometry tools -> Simplify Geometries . Beside this you can use Douglas-Peucker algorithm in postgis too, so you can use in postgis then adding postgis layer to qgis. you can find some info here about Simplify: Reduce the weight of a geometry. SELECT simplify(the_geom,500) as simpgeom FROM neighborhoods i ...


10

As glennon mentioned, the standard algorithm for doing this is Douglas-Peucker, which is the default algorithm used in software such as PostGIS (i.e. GEOS) via St_Simplify, ArcGIS via Generalize and GRASS via v.generalize. The Wikipedia article also links to a Python implementation. GRASS supports a number of different algorithms, as explained in the help ...


10

This sounds like Tom Patterson's work on Resolution Bumping GTOPO 30 in Photoshop. The theory is described well enough to be adaptable to other software, though work needs to be done coming up with the specifics. The basic idea is to generalize (blur) one data set, a lot, to emphasize the general shape and hide specific detail and then blend the hi-res and ...


10

In traditional cartography, marker clustering is called aggregation or sometimes amalgamation. It is part of model generalization: When zooming out, some detailed concepts (e.g. the tree) disappear to be replaced by less detailed aggregated forms (e.g. the forest). Many good examples can be found in good cartography books. Here are two examples from this ...


10

Using the Spatial Analyst Extension, you can use some of the Generalization tools. Some of them perform similar tasks, so you might need to play around with a few to get the results to be how you want them. But, I would have a look at the Majority Filter tool and the Boundary Clean tool. Here is a page on the concepts of these two tools. I'm not sure how ...


10

1) create a new grid with 1 m spacing (fishnet) 2) use "spatial join" to aggregate the attributes of the points falling inside the polygons 3) create the centroids of the polygons 3b) Alternatively, you can make a spatial join between the centroids and your original points so that you can define more advanced merging rules (aka based on the distance)


9

Automatic generalization algorithms are not yet a complete solution, they still often make decisions a careful cartographer would abhor. Natural Earth has a good background article on how their approaches to generalizing features, a multi-step manual process. Axpand claims the Swiss Topography Office had an 80% success rate with automatic generalization ...


8

I use the ftools plugin in Quantum most of the time. I also use the v.generalize in GRASS. It has the advantage of giving you several different algortithms options for simplification, smoothing, and network generalization depending on what you are trying to do. http://grass.itc.it/gdp/html_grass64/v.generalize.html


8

I've also had luck using the QGIS Generalizer plugin (enable experimental plugins), and then: Vector > Geometry Tools > Polygons to lines Then use the Generalizer plugin to smooth the lines and vertices Plugins > Generalizer > Generalizer Algorithm: "Chaiken's Algorithm" Then turn the lines back into a polygons Vector > Geometry Tools &...


8

Aragon's answer is good for generalization. Bryan's answer is good for smoothing but is a little convoluted. Here are two alternatives for smoothing: Use the GRASS v.generalizer tool from the Processing toolbox. This is the module on which the QGIS Generalizer Plugin in Bryan's answer is built. The GRASS tool allows you to use polygons so you can avoid ...


7

If you're interested in learning more about this area, the problem is named cartographic displacement, and its one aspect of cartographic generalization. A couple of articles discussing displacement and approaches for handling the problem: Bader, Matthias. 2001. Energy Minimization Methods for Feature Displacement in Map Generalization. Steiniger, S Tefan ...


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

How you'll go about solving this problem really depends on the case, and how important the actual topology is to you (versus just the visuals/rendering time). Since your final goal is to generalize coastlines, you may find some ideas on generalization useful. One approach uses buffering, as seen here. I also had a similar problem a while ago and detailed my ...


7

There's a lot of options and in fact I struggled through the same question a while back on some of my applications. And for our different products we ended up with different solutions. So you have to ask yourself Are all of the singleton icons on the map of the same "kind" - same shape and color? If they're not, do they all live on 1 layer, or multiple ...


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

The name for this kink in a geometry is an "inversion". It is not a topology error per se (as explained in this answer), but it can be an indication of coordinate collapse (such as at the mouth of a harbor, etc.). I can't think of any elegant way to identify inversions. One possible solution (that I haven't tried) would convert the polygon rings to ...


6

I see "ArcGIS" is a tag, Jakub. Using Spatial Analyst you would simply compute a weighted average of the two hillshades. E.g., the 60-40 mixture could be generated with a calculation like this: (60*[Detailed hillshade] + 40*[Generalized hillshade]) / 100 If you need it, the Gaussian blur can be executed by running a few circular focal means over a ...


6

This can be seen as a preliminary to @Underdark's answer whereby you can clean the topology of the vector layer before generalizing. GRASS has a v.clean function which contains a number of tools to repair the layer such as: snap which 'snaps' lines to the nearest vertex rmdangle which removes any annoying dangles rmdupl which removes duplicated geometry ...


6

A quick and dirty solution would be to simply apply a Ramer-Douglas-Peucker filter to the road sections. Note that there are variations of the algorithm preserving topology: See for example here and there,with rivers. If you aim at developing more advanced generalisation for a better cartographic result, I am afraid no such tool exists (yet) in GRASS and ...


6

Use the Delete Identical (Data Management) tool in ArcGIS. You can see from the screenshots, I generated a uniform grid of points within the polygon extent and used the Delete Identical tool with a 10m XY tolerance to thin the points. Alternatively, use the Integrate (Data Management) tool to make points coincident at a certain XY tolerance.


6

I'm guessing you are using GRASS 6.4.x as there were issues regarding generalizing polygons with holes. This has been fixed in GRASS 7, although I do not have this version so cannot confirm it. A workaround would be to use the Fill holes tool from the Processing Toolbox on your original layer: Use the Difference tool on both the original and filled ...


5

You might investigage the Douglas–Peucker algorithm--a method for reducing the number of points in a curve approximated by a series of points. See: http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm Whether you overwrite your original geometry or create a secondary store will vary by use.


5

You should prepare different generalized versions of your data set for "full planet" zoom levels down to close-up zoom. A classic generalization algorithm is Douglas-Peucker algorithm. You'll have to connect the points to coast lines first if you haven't done that already.


5

You might obtain some inspiration from sunflower plots. This method, which has been in use for decades to represent clusters of points on scatterplots, capitalizes on research in visual cognition to produce markers that are rapidly and correctly discriminated as well as clearly related to the sizes of the clusters they represent. Here's an example done in ...


5

This is a really interesting question, especially in the context of today where the quest is usually for more detail, higher resolution, etc. To directly answer your question, I think you are performing the exact correct operation. As I see it, the reason for generalizing a layer is to reduce the size and complexity, for performance reasons. This might be ...



Only top voted, non community-wiki answers of a minimum length are eligible