1

我正在使用新泽西邮政编码制作热图,但我使用的几何信息对于两个邮政编码不正确。有谁知道我可以去哪里获取这两个特定邮政编码的 KML 信息?我在这里看到了很多关于 KML 数据使用哪些资源的帖子,但它们非常先进,我不知道如何挖掘论坛上其他人链接到的数据库。

具体来说,我需要邮政编码 08559 和 08757 的 KML 邮政编码数据。以下是这些邮政编码的有缺陷的 KML 数据:

08559:

<Polygon><outerBoundaryIs><LinearRing><coordinates>-74.892528,40.414294,0.0 -74.967386,40.39857,0.0 -75.060361,40.420788,0.0 -75.064463,40.500774,0.0 -75.06583,40.517523,0.0 -75.068223,40.457705,0.0 -74.991314,40.481632,0.0 -74.88911,40.47001,0.0 -74.892528,40.414294,0.0</coordinates></LinearRing></outerBoundaryIs></Polygon>

08757:

<Polygon><outerBoundaryIs><LinearRing><coordinates>-74.190432,39.946002,0.0 -74.221537,39.932329,0.0 -74.322374,39.946002,0.0 -74.234185,40.008896,0.0 -74.26905,39.986678,0.0 -74.206839,39.952154,0.0 -74.19761,39.949762,0.0 -74.190432,39.946002,0.0</coordinates></LinearRing></outerBoundaryIs></Polygon>
4

2 回答 2

1

对于美国邮政编码,可从美国人口普查中获得数据: http ://www.census.gov/geo/www/cob/z52000.html#ascii

下载新泽西州或其他 50 个州的 ASCII 数据集。

您可以在小文件(例如 zt34_d00a.dat)中查找您的邮政编码的索引

 317
 "08559"
 "08559"
 "Z5"
 "5-Digit ZCTA"

然后在大文件中找到匹配的经纬度坐标列表。

317      -0.749719256389896E+02       0.404391641604938E+02
      -0.750611840000000E+02       0.404766960000000E+02
      -0.750607720000000E+02       0.404766880000000E+02
      -0.750620530000000E+02       0.404692640000000E+02
      -0.750637010000000E+02       0.404652440000000E+02
...
      -0.750622670000000E+02       0.404709200000000E+02
      -0.750611840000000E+02       0.404766960000000E+02
END

第一个值是经度,第二个值是纬度,都是十进制度。

注意某些点可能有问题(或错误),因此您可能需要在转换为 KML 后对其进行清理。帮助调试点和删除坏点的一个方便的工具是KML Number-the-points 工具,该工具生成 KML 地标,每个地标都有对应于线或多边形中每个点的数字标签,给定一些 KML 作为输入。如果有很长的点列表并且需要轻松识别它们,则很有用。

于 2012-12-19T14:26:11.083 回答
1

如何创建具有多个邮政编码的区域地图

  1. 从census.gov下载包含所有美国邮政编码的 KML 文件。该站点上的最新文件是:http ://www2.census.gov/geo/tiger/GENZ2015/kml/cb_2015_us_zcta510_500k.zip 。如果此链接损坏,请在 Google 上搜索site:census.gov KML ZIP。另一种选择:https ://www.filosophy.org/post/17/zipcodes_in_kml/


  1. 在纯文本编辑器中打开这个巨大的 (175MB) 文本文件,然后搜索您想要的邮政编码并复制该<Polygon>部分。这是搜索时的结果>94117

    <Placemark id="cb_2015_us_zcta510_500k.kml">
    <name>&lt;at&gt;&lt;openparen&gt;&lt;closeparen&gt;</name>
    <visibility>1</visibility>
    <description><![CDATA[<center><table><tr><th colspan='2' align='center'><em>Attributes</em></th></tr><tr bgcolor="#E3E3F3">
    <th>ZCTA5CE10</th>
    <td>94117</td>
    </tr><tr bgcolor="">
    <th>AFFGEOID10</th>
    <td>8600000US94117</td>
    </tr><tr bgcolor="#E3E3F3">
    <th>GEOID10</th>
    <td>94117</td>
    </tr><tr bgcolor="">
    <th>ALAND10</th>
    <td>4373059</td>
    </tr><tr bgcolor="#E3E3F3">
    <th>AWATER10</th>
    <td>1625</td>
    </tr></table></center>]]></description>
    <LookAt>
    <longitude>-102</longitude>
    <latitude>38.5</latitude>
    <range>7000000</range>
    <tilt>10</tilt>
    <heading>0</heading>
    </LookAt>
    <styleUrl>#KMLStyler</styleUrl>
    <ExtendedData>
    <SchemaData schemaUrl="#kml_schema_ft_cb_2015_us_zcta510_500k">
    <SimpleData name="ZCTA5CE10">94117</SimpleData>
    <SimpleData name="AFFGEOID10">8600000US94117</SimpleData>
    <SimpleData name="GEOID10">94117</SimpleData>
    <SimpleData name="ALAND10">4373059</SimpleData>
    <SimpleData name="AWATER10">1625</SimpleData>
    </SchemaData>
    </ExtendedData>
    <Polygon>
    <extrude>0</extrude>
    <tessellate>1</tessellate>
    <altitudeMode>clampToGround</altitudeMode>
    <outerBoundaryIs>
    <LinearRing>
    <coordinates>-122.477297,37.766069,0 -122.477379,37.765482,0 -122.458405,37.76616,0 -122.45779,37.766015,0 -122.457536,37.763566,0 -122.455999,37.763904,0 -122.456994,37.761842,0 -122.459173,37.761912,0 -122.455944,37.760239,0 -122.456603,37.759235,0 -122.454002,37.758785,0 -122.451817,37.759453,0 -122.447682,37.75919,0 -122.446783,37.761781,0 -122.445309,37.76188,0 -122.442915,37.763648,0 -122.443347,37.765333,0 -122.441242,37.765271,0 -122.4382,37.767159,0 -122.435624,37.767328,0 -122.435794,37.769058,0 -122.429128,37.769456,0 -122.428426,37.770452,0 -122.429178,37.774181,0 -122.429929,37.777909,0 -122.430115,37.778842,0 -122.444967,37.776958,0 -122.44478,37.776017,0 -122.446471,37.775802,0 -122.446846,37.777669,0 -122.453188,37.776853,0 -122.45281,37.774995,0 -122.463749,37.773624,0 -122.464611,37.77244,0 -122.459162,37.771314,0 -122.459901,37.770442,0 -122.464402,37.769669,0 -122.467004,37.768013,0 -122.469758,37.769209,0 -122.472245,37.76861,0 -122.473124,37.767116,0 -122.477297,37.766069,0 </coordinates>
    </LinearRing>
    </outerBoundaryIs>
    </Polygon>
    </Placemark>
    


  1. 创建一个干净的 KML 文件并将其移至<Polygon>该文件。下面是一个service-delivery-area.kml包含两个邮政编码多边形的 KML 文件 ( ) 示例。谷歌有一个很棒的KML 参考

    <?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://www.opengis.net/kml/2.2">
      <Document>
        <name>Service Delivery Area</name>
        <open>0</open>
        <Placemark>
          <name>94117</name>
          <Polygon>
            <outerBoundaryIs>
              <LinearRing>
                <coordinates>
                  -122.477297,37.766069,0 -122.477379,37.765482,0 -122.458405,37.76616,0 -122.45779,37.766015,0 -122.457536,37.763566,0 -122.455999,37.763904,0 -122.456994,37.761842,0 -122.459173,37.761912,0 -122.455944,37.760239,0 -122.456603,37.759235,0 -122.454002,37.758785,0 -122.451817,37.759453,0 -122.447682,37.75919,0 -122.446783,37.761781,0 -122.445309,37.76188,0 -122.442915,37.763648,0 -122.443347,37.765333,0 -122.441242,37.765271,0 -122.4382,37.767159,0 -122.435624,37.767328,0 -122.435794,37.769058,0 -122.429128,37.769456,0 -122.428426,37.770452,0 -122.429178,37.774181,0 -122.429929,37.777909,0 -122.430115,37.778842,0 -122.444967,37.776958,0 -122.44478,37.776017,0 -122.446471,37.775802,0 -122.446846,37.777669,0 -122.453188,37.776853,0 -122.45281,37.774995,0 -122.463749,37.773624,0 -122.464611,37.77244,0 -122.459162,37.771314,0 -122.459901,37.770442,0 -122.464402,37.769669,0 -122.467004,37.768013,0 -122.469758,37.769209,0 -122.472245,37.76861,0 -122.473124,37.767116,0 -122.477297,37.766069,0
                </coordinates>
              </LinearRing>
            </outerBoundaryIs>
          </Polygon>
        </Placemark>
        <Placemark>
          <name>94102</name>
          <Polygon>
            <outerBoundaryIs>
              <LinearRing>
                <coordinates>
                  -122.429929,37.777909,0 -122.429178,37.774181,0 -122.428426,37.770452,0 -122.42822,37.769441,0 -122.426402,37.769596,0 -122.419334,37.77521,0 -122.419219,37.775316,0 -122.418704,37.775645,0 -122.404743,37.786778,0 -122.406399,37.786615,0 -122.406771,37.788499,0 -122.408595,37.789226,0 -122.411886,37.788808,0 -122.414807,37.78652,0 -122.414242,37.783724,0 -122.419182,37.783101,0 -122.420689,37.781955,0 -122.420906,37.782883,0 -122.422287,37.781752,0 -122.424108,37.782477,0 -122.427396,37.782057,0 -122.426829,37.779258,0 -122.429929,37.777909,0
                </coordinates>
              </LinearRing>
            </outerBoundaryIs>
          </Polygon>
        </Placemark>
      </Document>
    </kml>
    


  1. 转到https://www.google.com/mymaps/并创建一个新地图。单击“添加新图层”,然后单击“导入”,然后上传您的 KML 文件。如果多边形不正确,您可以在地图上编辑多边形。


  1. 您的地图应该有这样的结果:https ://www.google.com/maps/d/u/0/embed?mid=1zop5GMD1b2afmOvObQIi7YvF1d4
于 2016-05-04T19:36:47.753 回答