Created
June 18, 2020 06:51
-
-
Save sasapurin/94aa8b0f89b12e938266ad514780f960 to your computer and use it in GitHub Desktop.
地理院地図用KP-KML作成
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN{ | |
FS="," | |
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>" | |
print "<kml xmlns=\"http://www.opengis.net/kml/2.2\">" | |
print " <Document>" | |
print " <Style id=\"PolyStyle1\">" | |
print " <IconStyle>" | |
print " <Icon>" | |
print " <href>https://maps.gsi.go.jp/portal/sys/v4/symbols/080.png</href>" | |
print " </Icon>" | |
print " <scale>1</scale>" | |
print " </IconStyle>" | |
print " </Style>" | |
} | |
NR>1{ | |
latitude_hours = $9; | |
latitude_minute = $10; | |
latitude_second = $11; | |
latitude_deg = latitude_hours+(latitude_minute/60)+(latitude_second/3600); | |
longitude_hours = $12; | |
longitude_minute = $13; | |
longitude_second = $14; | |
longitude_deg = longitude_hours+(longitude_minute/60)+(longitude_second/3600); | |
print " <Placemark>" | |
print " <name>"$8"KP</name>" | |
print " <styleUrl>#PolyStyle1</styleUrl>" | |
print " <Point>" | |
print " <coordinates>"longitude_deg","latitude_deg"</coordinates>" | |
print " </Point>" | |
print " </Placemark>" | |
} | |
END{ | |
print " </Document>" | |
print "</kml>" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
道路基準点案内システム
http://www.road-refpoint.jp/kijunten/]http://www.road-refpoint.jp/kijunten/
からダウンロードできる基準点(キロポスト)のCSVファイルを地理院地図にプロットできるよう、KML形式に変換するawkスクリプト。中身はXML形式なので拡張子を自分でKMLにしてやればテキストエディタでも作成は可能。