Skip to content
Browse files

Actually fix the geojson plotter to return the correct values

The first set of changes (in 232628c) switch
cleaned -> inferred. But that was actually in code where we get the locations
for the section.

The actual sections are retrieved as part of the cleaned timeline.

So the potential fixes are:
- we can create a new inferred timeline that combines inferred sections with
  cleaned stops. This is not strictly hard to do; see
  `` but then we need to
  think about whether we should also have the stops be inferred stops...

- just replace the mode (which is the only thing different between the
  sections) with the mode from the corresponding inferred section. This is easy
  and it works.
  • Loading branch information...
shankari committed Feb 23, 2018
1 parent 2cd8328 commit a4f623e7e15e53c4366e8f7c3bb70f039dd9cbdc
Showing with 13 additions and 2 deletions.
  1. +13 −2 emission/analysis/plotting/geojson/
@@ -19,6 +19,7 @@

import as esdt
import as esda
import as esds
import as esdtl

import emission.core.wrapper.location as ecwl
@@ -114,7 +115,7 @@ def section_to_geojson(section, tl):
ts = esta.TimeSeries.get_time_series(section.user_id)
entry_it = ts.find_entries(["analysis/recreated_location"],

# TODO: Decide whether we want to use Rewrite to use dataframes throughout instead of python arrays.
@@ -147,9 +148,19 @@ def section_to_geojson(section, tl):
# Update works on dicts, convert back to a section object to make the modes
# work properly = ecwcs.Cleanedsection(["feature_type"] = "section"["sensed_mode"] = str(

if eac.get_section_key_for_analysis_results() == esda.INFERRED_SECTION_KEY:
ise = esds.cleaned2inferred_section(section.user_id, section.get_id())
logging.debug("mapped cleaned section %s -> inferred section %s" %
(section.get_id(), ise.get_id()))
logging.debug("changing mode from %s -> %s" %
(,["sensed_mode"] = str(
else:["sensed_mode"] = str(

_del_non_derializable(, ["start_loc", "end_loc"])

# feature_array.append(gj.FeatureCollection(points_feature_array))

0 comments on commit a4f623e

Please sign in to comment.
You can’t perform that action at this time.