Skip to content

v0.2.49..v0.2.50 changeset OsmGeoJsonReader.cpp

Garret Voltz edited this page Nov 6, 2019 · 1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/io/OsmGeoJsonReader.cpp b/hoot-core/src/main/cpp/hoot/core/io/OsmGeoJsonReader.cpp
index b8cd4d5..d4f1f3e 100644
--- a/hoot-core/src/main/cpp/hoot/core/io/OsmGeoJsonReader.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/io/OsmGeoJsonReader.cpp
@@ -30,10 +30,10 @@
 // hoot
 #include <hoot/core/Hoot.h>
 #include <hoot/core/io/HootNetworkRequest.h>
-#include <hoot/core/util/HootException.h>
-#include <hoot/core/util/Log.h>
 #include <hoot/core/schema/MetadataTags.h>
 #include <hoot/core/util/Factory.h>
+#include <hoot/core/util/HootException.h>
+#include <hoot/core/util/Log.h>
 #include <hoot/core/util/StringUtils.h>
 
 // Boost
@@ -101,6 +101,7 @@ bool OsmGeoJsonReader::isSupported(const QString& url)
 void OsmGeoJsonReader::read(const OsmMapPtr& map)
 {
   _map = map;
+  _map->appendSource(_url);
   if (_isFile)
   {
     QTextStream instream(&_file);
@@ -149,6 +150,10 @@ void OsmGeoJsonReader::_parseGeoJson()
   {
     /*Envelope env = */_parseBbox(_propTree.get_child("bbox"));
   }
+  if (_propTree.not_found() != _propTree.find(MetadataTags::Source().toStdString()))
+  {
+    _map->replaceSource(QString(_propTree.get_child(MetadataTags::Source().toStdString()).data().c_str()));
+  }
 
   // If we don't have a "features" child then we should just have a single feature
   if (_propTree.not_found() != _propTree.find("features"))
Clone this wiki locally