Finding the center point of a city

試著忘記壹切 提交于 2019-12-13 12:22:29

问题


We are purchasing a database of zip codes and their corresponding Lat/Long. I want to store cities in a separate table with a lat/long point representing the center of the city. Can I calculate that based on taking all of the zips that belong to that city, getting the min/max points for each direction, and taking the center point of the resulting rectangle?

Is there a more accurate method? I want to avoid purchasing another DB. We haven't purchased the full DB yet so I can't just try it and compare the results to Google Maps.


回答1:


Well actually ZIP codes do not always encompass cities. Zip codes are arbitrary regions used to defined postal addresses.

Edit: Not always your assumption that the sum of all ZIP Codes will correspond to the city boundary or will retrieve you the correct centroid.

Your best bet is to get a countys table with spatial data in it.

In PostGIS a simple ST_Centroid(GeometryField) would suffice to get you the centroid of a polygon. That works out for any type of polygons.

If you are in the US, probably exists a public county/cities/states dataset availuable on the internet. Consider GIS tools for doing this work.




回答2:


Would that be very helpful? That might give you something that approximates the geographic center, but normally when you talk about the center of the city, you are talking about the town square, or the commercial center, or the historical center.

Go to google maps for example. If you search for New York, it will take you directly to Times Square. Isn't that really what you expect if you search for the center of that City.




回答3:


Well, the center of a city is impossible to calculate exactly, as there are probably as many views on what the center is as there are people...

Instead of using just the min/max points of the zip code areas, you could get the average of all positions, that would give you a more weighted position.

If you have an approximate number of people for each zip code you could use that as weight for the points, that would give you a "gravital center" of the population.




回答4:


City Hall is always used to define the city center, used by the National Transportation and Highways division, all globes and maps.



来源:https://stackoverflow.com/questions/1313607/finding-the-center-point-of-a-city

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!