2012-12-18 99 views
1

我正在使用新澤西郵政編碼製作熱圖,但我使用的幾何信息對於兩個郵政編碼不正確。有誰知道我可以去哪裏獲取這兩個特定郵政編碼的KML信息?我在這裏看到了很多關於KML數據使用哪些資源的帖子,但他們都非常先進,我不知道如何挖掘論壇上其他人鏈接到的數據庫。需要幫助查找特定郵政編碼的KML數據

具體而言,我需要ZIP碼的KML郵政編碼數據08559和08757.以下是這些ZIP代碼的有缺陷的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> 
+0

這是怎樣的一個GIS問題。這是錯誤的地方問... –

回答

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 tool,它生成KML Placemarks,每個KML Placemarks的數字標籤對應於一行或多邊形中的每個點,並給定一些KML作爲輸入。有用的,如果有很長的點,並需要輕鬆識別它們。

1

如何與多個郵政編碼

census.gov所有美國郵政編碼
  1. 下載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/


  • 打開這個巨大的(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> 
    

  • 造清潔KML文件並移動<Polygon>到該文件。以下是帶有兩個郵政編碼多邊形的KML文件(service-delivery-area.kml)的示例。谷歌有一個偉大的KML Reference

    <?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> 
    

  • 轉到https://www.google.com/mymaps/並創建新的地圖。點擊「添加新圖層」,然後點擊「導入」,然後上傳您的KML文件。如果多邊形不正確,則可以編輯地圖上的多邊形。

  • 你的地圖應該有這樣的結果:https://www.google.com/maps/d/u/0/embed?mid=1zop5GMD1b2afmOvObQIi7YvF1d4