Commits

Anonymous committed 4e4d98e

Part of #416: Some improvements to MOSS saving so it actually saves out the LEs.

Comments (0)

Files changed (2)

maproomlib/plugin/Line_point_layer.py

                     insert_index = insert_index,
                 )
 
-        self.parent.children_metadata = metadata
+        non_contour_metadata = filter(
+            lambda item: not item[ 0 ].startswith( "FORECAST" ),
+            self.parent.children_metadata
+        )
+
+        self.parent.children_metadata = metadata + non_contour_metadata
 
         self.outbox.send(
             request = "end_progress",

maproomlib/plugin/Moss_saver.py

     points = points_layer.points
 
     for le_index in xrange( points_layer.add_index ):
+        if np.isnan( points.z[ le_index ] ):
+            z = 0
+        else:
+            z = points.z[ le_index ]
+
         save_file.write( "".join( (
             str( -( le_index + 1 ) ).ljust( LE_HEADER_ID_CHAR_COUNT ),
             LE_HEADER_LABEL_AND_FLAG,
             "\n",
-            ( points.x[ le_index ] ).ljust( LE_LONGITUDE_CHAR_COUNT ),
-            ( points.y[ le_index ] ).ljust( LE_LATITUDE_CHAR_COUNT ),
-            ( points.z[ le_index ] ).ljust( LE_DEPTH_CHAR_COUNT ),
+            str( points.x[ le_index ] ).ljust( LE_LONGITUDE_CHAR_COUNT ),
+            str( points.y[ le_index ] ).ljust( LE_LATITUDE_CHAR_COUNT ),
+            str( z ).ljust( LE_DEPTH_CHAR_COUNT ),
             "\n",
         ) ) )
 
                     uncertainty_le_property_save_file = open(
                         ".".join( ( dest_base_filename, UNCERTAINTY_LE_PROPERTY_FILE_EXTENSION ) ), "wb",
                     )
-                save_LEs( uncertainty_le_save_file, uncertainty_le_property_save_file, child )
+                save_LEs( uncertainty_le_save_file, uncertainty_le_property_save_file, child.points_layer )
             else:
-                save_LEs( le_save_file, le_property_save_file, child )
+                save_LEs( le_save_file, le_property_save_file, child.points_layer )
 
     return ".".join( ( dest_base_filename, POLYGON_FILE_EXTENSION ) )
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.