小编Stu*_*ber的帖子

KML IconStyle 颜色输入为蓝色,但在 Google 地球中显示为红色

我使用十六进制颜色来标记图标。对于蓝色,我使用0000ff. 在 KML 文件中,它是<color>ff0000ff</color>. 但是,当在 Google 地球中打开 KML 时,图标地标为红色。

查看https://developers.google.com/kml/documentation/kmlreference我的看法是颜色应该编码为ff+ hexadecimal number,因此黑色表示为ff000000,这有效,但ff0000ff蓝色则不然。

我尝试了各种样式和图标选项,但没有成功。我已经阅读并看到了如何合并图标和颜色的分层效果。似乎使用wht-blank.png将是一个中性画布来应用颜色,但我怀疑它可能会产生干扰。

下面是我的测试kml。

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
    <Document>
        <name>kml_test</name>
        <Placemark>
            <name>uniq_name</name>
            <Style>
                <IconStyle>
                    <scale>1</scale>
                    <color>ff0000ff</color>
                    <Icon>
                        <href>http://maps.google.com/mapfiles/kml/paddle/wht-blank.png</href>
                    </Icon>
                </IconStyle>
            </Style>
            <LabelStyle>
                <color>ffffffff</color>
                <scale>0.6</scale>
            </LabelStyle>
            <LookAt>
                <longitude>-118.000000</longitude>
                <latitude>34.000000</latitude>
                <range>1000</range>
            </LookAt>
            <Point>
                <altitudeMode>clampToGround</altitudeMode>
                <extrude>0</extrude>
                <coordinates>-118.000000,34.000000,0</coordinates>
            </Point>
        </Placemark>
    </Document>
</kml>
Run Code Online (Sandbox Code Playgroud)

我希望<color>ff0000ff</color>在 Google Earth 中打开 kml 时显示蓝色图标,而不是红色图标。

kml google-earth kmz

3
推荐指数
1
解决办法
4935
查看次数

Biopython从变量而不是文件解析

import gzip
import io
from Bio import SeqIO

infile = "myinfile.fastq.gz"
fileout = open("myoutfile.fastq", "w+")
with io.TextIOWrapper(gzip.open(infile, "r")) as f:
    line = f.read()
fileout.write(line)
fileout.seek(0)

count = 0
for rec in SeqIO.parse(fileout, "fastq"): #parsing from file
    count += 1
print("%i reads" % count)
Run Code Online (Sandbox Code Playgroud)

当"line"被写入文件并且该文件被提供给解析器时,上面的工作正常,但是下面不起作用.为什么不能直接读取行?有没有办法直接将"line"提供给解析器而不必先写入文件?

infile = "myinfile.fastq.gz"
#fileout = "myoutfile.fastq"
with io.TextIOWrapper(gzip.open(infile, "r")) as f:
    line = f.read()
#myout.write(line)

count = 0
for rec in SeqIO.parse(line, "fastq"): #line used instead of writing from file
    count += 1
print("%i reads" % …
Run Code Online (Sandbox Code Playgroud)

python biopython

2
推荐指数
2
解决办法
534
查看次数

标签 统计

biopython ×1

google-earth ×1

kml ×1

kmz ×1

python ×1