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
Related
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´m new to QGIS, lately I got 2 Shapefiles one showing the polygons for some areas that represent street blocks, and another shapefile with the points that represent the number of comercial stores in the area, so sometimes we have one and others we have 90, depending on which street the survey was done.
The problem is that the points layer shows only one point where there should be more than one, that is because all points corresponding to a certain street or block are asigned the centroid of that polygon as coordinates. Is there a way to distribute all points automatically inside the polygons so if there is only one the points stays in the centroid and if there are more the points shift position in order to show how many points are exactly? Added a screencap for references
Working on the Pacific Ocean, i am dealing with huge polygons covering the whole area. Some of them are quite simple and are defined by 4 points in my shapefile.
However, when i import them into SQL server 2008 r2 as new geographies, due to the shape of the earth, i end up with curved lines while I would like the North and South boundaries to stick to some specific latitudes: for example, the north boundaries should follow the 30N latitude from 120E to 120W.
How can i force my polygons to follow the latitudes? Converting them as geometry could have been an option but since i will need to do some length and area calculations, i need to keep them as geography.
Do i need to add additional vertices along my boundaries to force the polygon to stay on a specific latitude? What should be the interval between each vertex?
Thanks for your help
Sylvain
You have already answered this yourself. Long distances between latitude coordinates will create curved lines to match the Earth's curvature. Therefore if you need to "anchor" them along a specific latitude you will need to manually insert points. As for the interval, there's no right or wrong, a little experimentation here (and considering how "anal" you want to be about it hugging the line) will give you the result you desire. 1 coordinate per degree should do it, might even be a little overkill.
That said, I do question why you would want to anchor them to create a projected "straight" line as this will skew the results of length and area calculations, the bigger the polygon, the bigger the skew.
I would like know if there are any tools/commands in MATLAB or any other software that helps to cut the dendrogram (where points represent states) at a certain height and represent it in a geographical map like the one in the below images.
Could you please let me know if there is any better way to do it
Thank you.
You can draw polar dendrogram (as on your example) with File Exchange submission - Draw a Polar Dendrogram.
To apply threshold to distance between nodes and get the cluster data you can use CLUSTER or CLUSTERDATA function.
Then you can use USAMAP function from Mapping Toolbox to draw the states and apply colors based on your clusters. See the example 3 in the documentation.
(source: hiveworkshop.com)
In the above picture, I have 20 arbitrary points split into 5 clusters. On the right is a circle that defines the max cluster size. On the top right is the maximum points per cluster. I want to be able to take any arbitrary set of points k and split them into clusters of max sizes n with max radii r. I need the algorithm to retrieve the most full clusters possible (in the above example, as many clusters of 4 as possible). Any given point can only belong to 1 cluster and clusters may not overlap.
It would also be helpful if the algorithm could add/remove points to an existing set and update the clusters.
I am totally lost on how to accomplish this. My best idea so far was calculating centers for sets of points and then using those centers for binary space partitioning, but the best I could hope with using that approach would be evenly distributed clusters.
Any help would be appreciated :).
edit
Don't overlap as in the shapes that regions form don't intersect with the shapes other regions form and that regions are not located inside of other regions (circles in circles for example). In the above picture, each region has a shape to it. None of these shapes intersect and no region is inside of another region.