Make Zip code boundaries in Google Map API

后端 未结 3 1644
别跟我提以往
别跟我提以往 2021-01-31 06:16

I have seen all the responses to a similar question, however, they are all either old, or no one has answered them.

I have been given the task to obtain zip codes and di

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-31 06:51

    There is not an easy answer to this that I know of. But here is a high level design of how to do it.

    All of the shape files for zip codes can be found at the census site and can be downloaded from this ftp server. However, that's a ton of data, so you need a place to store it. I recommend using the PostgreSQL database with the PostGIS add on. It is free and open source and generally awesome. It has a utility for converting .shp files (the type in the census shape files) into PostGIS geometry form. PostGIS let's you retrieve the shapes back out as KML.

    You can either a) retrieve a shape from the database as KML when it is needed and display it on the map or b) pre-generate a kml file for every zip code ahead of time and retrieve a file as it is needed (this would take up quite a bit of space).

提交回复
热议问题