changed to python2 for jnes
This commit is contained in:
2
Pipfile
2
Pipfile
@@ -10,4 +10,4 @@ gpxpy = "*"
|
|||||||
pykml = "*"
|
pykml = "*"
|
||||||
|
|
||||||
[requires]
|
[requires]
|
||||||
python_version = "3.8"
|
python_version = "2"
|
||||||
|
|||||||
9
Pipfile.lock
generated
9
Pipfile.lock
generated
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"_meta": {
|
"_meta": {
|
||||||
"hash": {
|
"hash": {
|
||||||
"sha256": "e7873caaf0610728fd1dc747926f29729da4eedc84d5bd30b9b3826e794c7955"
|
"sha256": "a925c1eb278671d6afc5297751c941521a902a8dbe83c7ec3edcf49a96a24cea"
|
||||||
},
|
},
|
||||||
"pipfile-spec": 6,
|
"pipfile-spec": 6,
|
||||||
"requires": {
|
"requires": {
|
||||||
"python_version": "3.8"
|
"python_version": "2"
|
||||||
},
|
},
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
@@ -18,10 +18,10 @@
|
|||||||
"default": {
|
"default": {
|
||||||
"gpxpy": {
|
"gpxpy": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:0832041899cdfdc5a607291bbef3d73042e16ffcecc3f2cb9631b699db0bb53f"
|
"sha256:b09e3212c9af83188d308214428c20c57b4ec1d45c3a3fc40f4b3d49c758aebf"
|
||||||
],
|
],
|
||||||
"index": "pypi",
|
"index": "pypi",
|
||||||
"version": "==1.4.2"
|
"version": "==1.3.5"
|
||||||
},
|
},
|
||||||
"lxml": {
|
"lxml": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
@@ -57,6 +57,7 @@
|
|||||||
"sha256:ecc930ae559ea8a43377e8b60ca6f8d61ac532fc57efb915d899de4a67928efd",
|
"sha256:ecc930ae559ea8a43377e8b60ca6f8d61ac532fc57efb915d899de4a67928efd",
|
||||||
"sha256:f161af26f596131b63b236372e4ce40f3167c1b5b5d459b29d2514bd8c9dc9ee"
|
"sha256:f161af26f596131b63b236372e4ce40f3167c1b5b5d459b29d2514bd8c9dc9ee"
|
||||||
],
|
],
|
||||||
|
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
|
||||||
"version": "==4.5.2"
|
"version": "==4.5.2"
|
||||||
},
|
},
|
||||||
"pykml": {
|
"pykml": {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import logging
|
|||||||
|
|
||||||
def export_coordinates_gpx_file_as_string(file, prepend_file_name=False):
|
def export_coordinates_gpx_file_as_string(file, prepend_file_name=False):
|
||||||
gpx_file = open(file, "r")
|
gpx_file = open(file, "r")
|
||||||
logging.info(f"opening {gpx_file}")
|
logging.info("opening {}".format(gpx_file))
|
||||||
gpx = gpxpy.parse(gpx_file)
|
gpx = gpxpy.parse(gpx_file)
|
||||||
|
|
||||||
str = "<LineString><coordinates>"
|
str = "<LineString><coordinates>"
|
||||||
@@ -46,14 +46,16 @@ def insert_coordinates_into_kml_file(kml_file, search_string, coordinate_string,
|
|||||||
|
|
||||||
for filename in os.listdir(os.getcwd()):
|
for filename in os.listdir(os.getcwd()):
|
||||||
if filename.lower().endswith(".xml") or filename.lower().endswith(".gpx"):
|
if filename.lower().endswith(".xml") or filename.lower().endswith(".gpx"):
|
||||||
|
print("handling >{}<".format(filename))
|
||||||
coords_string = export_coordinates_gpx_file_as_string(filename)
|
coords_string = export_coordinates_gpx_file_as_string(filename)
|
||||||
|
print("inserting into europa_testkarte.kml")
|
||||||
insert_coordinates_into_kml_file("europa_testkarte.kml", filename.split('.', 1)[0], coords_string)
|
insert_coordinates_into_kml_file("europa_testkarte.kml", filename.split('.', 1)[0], coords_string)
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
|
|
||||||
def export_coordinates_gpx_file(file):
|
def export_coordinates_gpx_file(file):
|
||||||
gpx_file = open(file, "r")
|
gpx_file = open(file, "r")
|
||||||
logging.info(f"opening {gpx_file}")
|
logging.info("opening {}".format(gpx_file))
|
||||||
gpx = gpxpy.parse(gpx_file)
|
gpx = gpxpy.parse(gpx_file)
|
||||||
|
|
||||||
coords = list()
|
coords = list()
|
||||||
|
|||||||
Reference in New Issue
Block a user