我有以下格式的纬度,经度和data_val的ASCII文件。
35-13.643782N, 080-57.190157W, 118.6
...
我有一个GeoTiff图像文件,可以轻松查看它。
我想在ASCII文件中找到的特定纬度/经度位置上,在图像上放置“大头针”(可以是点/标记/星号,或者最简单的东西)。
到目前为止,这是我设法做到的:
我的源图像如下所示:
Driver: GTiff/GeoTIFF
Files: /tmp/Charlotte SEC 100.tif
Size is 16867, 12358
Coordinate System is:
PROJCS["Lambert Conformal Conic",
GEOGCS["NAD83",
DATUM["North_American_Datum_1983",
SPHEROID["GRS 1980",6378137,298.2572221010042,
AUTHORITY["EPSG","7019"]],
AUTHORITY["EPSG","6269"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4269"]],
PROJECTION["Lambert_Conformal_Conic_2SP"],
PARAMETER["standard_parallel_1",38.66666666666666],
PARAMETER["standard_parallel_2",33.33333333333334],
PARAMETER["latitude_of_origin",34.11666666666667],
PARAMETER["central_meridian",-78.75],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]]]
Origin = (-365041.822331817995291,240536.419747152860509)
Pixel Size = (42.334586069440391,-42.334898968590878)
Metadata:
AREA_OR_POINT=Area
TIFFTAG_DATETIME=2016:06:24 12:46:45
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
TIFFTAG_SOFTWARE=Adobe Photoshop CS5 Windows
TIFFTAG_XRESOLUTION=300
TIFFTAG_YRESOLUTION=300
Image Structure Metadata:
COMPRESSION=LZW
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( -365041.822, 240536.420) ( 82d48'55.43"W, 36d13' 4.92"N)
Lower Left ( -365041.822, -282638.262) ( 82d35'10.11"W, 31d30'17.00"N)
Upper Right ( 349015.641, 240536.420) ( 74d51'46.40"W, 36d13'26.16"N)
Lower Right ( 349015.641, -282638.262) ( 75d 4'55.60"W, 31d30'36.99"N)
Center ( -8013.091, -21050.921) ( 78d50'12.11"W, 33d55'36.35"N)
Band 1 Block=16867x1 Type=Byte, ColorInterp=Palette
Color Table (RGB with 256 entries)
0: 255,255,255,255
...
这是我在Python中设法拼凑而成的内容:
from osgeo import gdal, osr
src_filename = '/tmp/Charlotte SEC 100.tif'
dst_filename = '/tmp/foo.tiff'
# Opens source dataset
src_ds = gdal.Open(src_filename)
format = "GTiff"
driver = gdal.GetDriverByName(format)
# Open destination dataset
dst_ds = driver.CreateCopy(dst_filename, src_ds, 0)
# Specify raster location through geotransform array
# (upperleftx, scalex, skewx, upperlefty, skewy, scaley)
# Scale = size of one pixel in units of raster projection
# this example below assumes 100x100
gt = [-365041.822, 100, 0, 240536.420, 0, -100]
# Set location
dst_ds.SetGeoTransform(gt)
# Get raster projection
epsg = 4269 # http://spatialreference.org/ref/sr-org/lambert_conformal_conic_2sp/
srs = osr.SpatialReference()
srs.ImportFromEPSG(epsg)
dest_wkt = srs.ExportToWkt()
# Set projection
dst_ds.SetProjection(dest_wkt)
# Close files
dst_ds = None
src_ds = None
但是,我不太清楚如何在35-13.643782N,080-57.190157W处放置“红点”
我必须在这里学习一些新的细节(有关GIS的术语)。
您可能需要调查的主题是地理配准。
—
PolyGeo
谢谢。。我使用术语地理配准进行了一些Google搜索。那很有帮助。一半是要知道技术术语来使用..
—
布拉德·沃克
我确定我丢失了某些内容,但是您是否考虑过将数据转换为KML或其他内容?
—
barrycarter
您可能需要将DD-MM.mmmmH坐标转换为十进制度数。您需要解析半球信息W或S表示负值(将其作为最后一步)。分钟数必须除以60,然后与度数部分相加或相加。
—
mkennedy