I have a table containing polygons that I will want to search by areas and centers. There are postgresql methods that calculate the area and centers of polygons, but as I intend to search on them, should I be writing the data to the table to prevent calculation and speed up searches, or would the data be redundant?
Related
My goal is to have labels in the center of polygons.
Currently the polygons are being added via a vector tile source.
In order to have labels centered on polygons, it seems I must add a point source that has geometries representing the polygon centroids. (based on this answer)
When getting geometries via vector tiles, would it possible to dynamically create this point source, or must it be another vector source, one dedicated solely to centroid points?
The usual approach is to generate the labels separately, using geojson-polygon-labels.
Attempting to do it dynamically would be pretty tricky, although perhaps not impossible.
I'm trying to figure out how to use PostGIS (since I have my polygons stored there already) to generate a set of nonoverlapping polygons.
The source table has two columns (geometry and occurences), geometry is always a valid polygon, occurences is an integer.
The polygons in the table can overlap. For all the overlapping regions (there can generally be more than 2 intersecting polygons) I would like to generate a new polygon (as with ST_Intersection) AND apply an aggregation to the occurences column (MIN/MAX/AVG would be enough)
I can find pairs of overlaps by using ST_Intersects and handle the pairs, but I have trouble reducing multiple intersections.
In the following example, the 3 source rows would actually end up being 7 separate polygons (imagine the circle is actually a POLYGON geometry), the occurences then would be averaged from all interesecting polygons in each case.
I am designing a water supply distribution network. I have various pipes represented by Lines. Each start and end point of Line is a Junction (Node).
I have created Thiessen Polygons (Voronoi) using QGIS for each Junction (The Thiessen Polygon represents flow area for its corresponding Junction.)
I also have various Ward Boundaries (also represented as irregular Polygons), with each Ward having different Population.
My requirement : I want to calculate area of intersection between each Thiessen Polygon and each Ward and get a table, so that I can calculate the exact population within each Thiessen Polygon.
Example of Thiessen Polygons (The Dot within polygon represents corresponding Junction) :-
Example of Wards (also represented as Closed Polygons) :-
Final output desired :-
I have found the solution in ARCGIS -> Intersect Tool where it intersects Two Shapefiles (each having multiple polygons) and gives intersection results.
I think the same is not possible in QGIS as of now.
I have a Postgres database of U.S. zipcodes and their lat/long data.
My requirement is to divide these zipcodes into non overlapping regions.
All regions have some center zipcode. All regions grow outward, starting from it's center until they intersect with another region.
I do not know the radius/size of each region. All I know is the list of zipcodes that can be considered as centers of the regions.
How can I achieve this?
You can use a voronoi diagram. It's the dual of the delaunay triangulation.
You can also download zip code tabulation area shape files. See https://www.census.gov/geo/maps-data/data/cbf/cbf_zcta.html
Having data points in a 3D neighbourhood (see attached picture), I would like to define a measure of spatial spread to accept or reject the data set as a candidate for further analysis. One measure could be how many of the cells in the 3D subvolume (the bounding box) are occupied by the neighbourhood. Another would be how the data stretches along each of the axis. Are there other and better criteria for measuring the spatial spread ?
Thanks