kopia lustrzana https://github.com/n1ywb/python-hamtools
make geojson return qth as well so map can use it to set origin
rodzic
d00ba6d9ec
commit
83e62f4d3b
|
@ -205,15 +205,12 @@ class Log(object):
|
||||||
log.warning("Failed to georef call %s", qso['call'])
|
log.warning("Failed to georef call %s", qso['call'])
|
||||||
|
|
||||||
def geojson_dumps(self, *args, **kwargs):
|
def geojson_dumps(self, *args, **kwargs):
|
||||||
pointsFC, linesFC = self.geojson()
|
qth, pointsFC, linesFC = self.geojson()
|
||||||
|
r = dict(qth=qth, pointsFC=pointsFC, linesFC=linesFC)
|
||||||
strings = (
|
return gj.dumps(r)
|
||||||
gj.dumps(pointsFC, *args, **kwargs),
|
|
||||||
gj.dumps(linesFC, *args, **kwargs),
|
|
||||||
)
|
|
||||||
return strings
|
|
||||||
|
|
||||||
def geojson(self):
|
def geojson(self):
|
||||||
|
qth = gj.Feature(geometry=gj.Point((self.lon, self.lat)))
|
||||||
points = []
|
points = []
|
||||||
lines = []
|
lines = []
|
||||||
for qso in self.qsos:
|
for qso in self.qsos:
|
||||||
|
@ -231,7 +228,7 @@ class Log(object):
|
||||||
properties=qso))
|
properties=qso))
|
||||||
pointsFC = gj.FeatureCollection(points)
|
pointsFC = gj.FeatureCollection(points)
|
||||||
linesFC = gj.FeatureCollection(lines)
|
linesFC = gj.FeatureCollection(lines)
|
||||||
return pointsFC, linesFC
|
return qth, pointsFC, linesFC
|
||||||
|
|
||||||
def write_kml(self, file):
|
def write_kml(self, file):
|
||||||
dom = kml.KML()
|
dom = kml.KML()
|
||||||
|
|
Ładowanie…
Reference in New Issue