ImportError: No module named bitarray - python-2.7

I am trying to implement fuzzy c means algorithm in Python..I have used the builtin function to do the same in Matlab.I would like to know whether there is any such simple method in Python also.I tried
http://peach.googlecode.com/hg/doc/build/html/tutorial/fuzzy-c-means.html
I have tried this :
from numpy import *
import peach as p
x = array( [
[ 0., 0. ], [ 0., 1. ], [ 0., 2. ], [ 1., 0. ], [ 1., 1. ], [ 1., 2. ],
[ 2., 0. ], [ 2., 1. ], [ 2., 2. ], [ 5., 5. ], [ 5., 6. ], [ 5., 7. ],
[ 6., 5. ], [ 6., 6. ], [ 6., 7. ], [ 7., 5. ], [ 7., 6. ], [ 7., 7. ] ] )
mu = array( [
[ 0.7, 0.3 ], [ 0.7, 0.3 ], [ 0.7, 0.3 ], [ 0.7, 0.3 ], [ 0.7, 0.3 ],
[ 0.7, 0.3 ], [ 0.7, 0.3 ], [ 0.7, 0.3 ], [ 0.7, 0.3 ], [ 0.3, 0.7 ],
[ 0.3, 0.7 ], [ 0.3, 0.7 ], [ 0.3, 0.7 ], [ 0.3, 0.7 ], [ 0.3, 0.7 ],
[ 0.3, 0.7 ], [ 0.3, 0.7 ], [ 0.3, 0.7 ] ] )
m = 2.0
fcm = p.FuzzyCMeans(x, mu, m)
print "After 20 iterations, the algorithm converged to the centers:"
print fcm(emax=0)
print "The membership values for the examples are given below:"
print fcm.mu
but getting * ImportError: No module named bitarray *
Can anyone help?

I had this problem. Forgot the sudo when doing pip install bitarray

Sometimes it is just because you are in the installed folder of the package so that you could not import it. Try to go somewhere else and rerun it.

Related

normalized_boxes are bigger then one(1) - AWS SageMaker JumpStart SSD VGG16 Atrous 300

I deployed SSD VGG16 Atrous 300 model(COCO 2017, from Gluon CV) by AWS SageMaker JumpStart. Response from pretrained model contains normalized_boxes with values bigger than one(1), e.g.
"normalized_boxes": [
[
0.4935379866715316,
0.20722445845603943,
0.7275399344308036,
0.7329685688018799
],
[
1.9931350875686813,
0.15846982598304749,
2.275825517256181,
0.5962902307510376
],
...
"classes": [
0,
0,
...
"scores": [
0.344256728887558,
0.4128507971763611,
...
"labels": [
"person",
"bicycle",
...
"mxnet_model_output": [
[
[
[
0
],
[
0
],
...
[
[
[
0.9202409386634827
],
[
0.9055193662643433
],
...
[
[
[
1551.213134765625,
589.4755249023438,
1808.19921875,
878.4844360351562
],
[
1557.686767578125,
310.9128112792969,
1805.559814453125,
587.8072509765625
],
...
How to read those bounding boxes?
I didn't manage to find the answer on gluon(https://cv.gluon.ai/model_zoo/detection.html)
The model can be fine-tuned, the rules how to prepare annotations(available in model description):
"The annotations.json file should should have information for bounding_boxes and their class labels. It should have a dictionary with keys "images" and "annotations". Value for the "images" key should be a list of entries, one for each image of the form {"file_name": image_name, "height": height, "width": width, "id": image_id}. Value of the 'annotations' key should be a list of entries, one for each bounding box of the form {"image_id": image_id, "bbox": [xmin, ymin, xmax, ymax], "category_id": bbox_label}."
names of attributes are the same as in the COCO dataset - https://www.immersivelimit.com/tutorials/create-coco-annotations-from-scratch/#coco-dataset-format
only this part is not consistent with COCO: "[xmin, ymin, xmax, ymax]" as I found, COCO has "[x_min, y_min, width, height]"(https://albumentations.ai/docs/getting_started/bounding_boxes_augmentation/)
I tired also SSD VGG16 Atrous 512(pre-trained on VOC dataset) and faced the same problem, additionally, I received bbox value with a minus:
"normalized_boxes": [
[
0.9567698719737294,
-0.14875292778015137,
1.0963617010430975,
0.5834765434265137
],
...
How to deal with values smaller than 0?

Error while executing commands like " rosmsg show sensor_msgs/ " after creation of a custom message type in ROS Melodic

I created a custom message type in msg package which I saved in CMakeLists.txt after which catkin build was successful. But on trying rosmsg show command,"
Unable to load msg [custom_msg_python/SensorInformation]: Cannot locate message [SensorInformation]: unknown package [custom_msg_python] on search path
[
{
"rosconsole":[
"/opt/ros/melodic/share/rosconsole/msg"
],
"compressed_depth_image_transport":[
"/opt/ros/melodic/share/compressed_depth_image_transport/msg"
],
"catkin":[
"/opt/ros/melodic/share/catkin/msg"
],
"rviz_visual_tools":[
"/opt/ros/melodic/share/rviz_visual_tools/msg"
],
"moveit_planners_chomp":[
"/opt/ros/melodic/share/moveit_planners_chomp/msg"
],
"urdf":[
"/opt/ros/melodic/share/urdf/msg"
],
"rosgraph":[
"/opt/ros/melodic/share/rosgraph/msg"
],
"rqt_py_console":[
"/opt/ros/melodic/share/rqt_py_console/msg"
],
"nodelet_topic_tools":[
"/opt/ros/melodic/share/nodelet_topic_tools/msg"
],
"rqt_graph":[
"/opt/ros/melodic/share/rqt_graph/msg"
],
"nodelet_tutorial_math":[
"/opt/ros/melodic/share/nodelet_tutorial_math/msg"
],
"qt_gui":[
"/opt/ros/melodic/share/qt_gui/msg"
],
"filters":[
"/opt/ros/melodic/share/filters/msg"
],
"ompl":[
"/opt/ros/melodic/share/ompl/msg"
],
"eigen_conversions":[
"/opt/ros/melodic/share/eigen_conversions/msg"
],
"moveit_ros_planning_interface":[
"/opt/ros/melodic/share/moveit_ros_planning_interface/msg"
],
"srdfdom":[
"/opt/ros/melodic/share/srdfdom/msg"
],
"smclib":[
"/opt/ros/melodic/share/smclib/msg"
],
"roslib":[
"/opt/ros/melodic/share/roslib/msg"
],
"geneus":[
"/opt/ros/melodic/share/geneus/msg"
],
"roscpp_serialization":[
"/opt/ros/melodic/share/roscpp_serialization/msg"
],
"diagnostic_msgs":[
"/opt/ros/melodic/share/diagnostic_msgs/msg"
],
"rosbuild":[
"/opt/ros/melodic/share/rosbuild/msg"
],
"rosclean":[
"/opt/ros/melodic/share/rosclean/msg"
],
"tf":[
"/opt/ros/melodic/share/tf/msg"
],
"rqt_publisher":[
"/opt/ros/melodic/share/rqt_publisher/msg"
],
"roslang":[
"/opt/ros/melodic/share/roslang/msg"
],
"geometric_shapes":[
"/opt/ros/melodic/share/geometric_shapes/msg"
],
"smach_ros":[
"/opt/ros/melodic/share/smach_ros/msg"
],
"rqt_web":[
"/opt/ros/melodic/share/rqt_web/msg"
],
"shape_msgs":[
"/opt/ros/melodic/share/shape_msgs/msg"
],
"trajectory_msgs":[
"/opt/ros/melodic/share/trajectory_msgs/msg"
],
"moveit_kinematics":[
"/opt/ros/melodic/share/moveit_kinematics/msg"
],
"diagnostic_aggregator":[
"/opt/ros/melodic/share/diagnostic_aggregator/msg"
],
"image_view":[
"/opt/ros/melodic/share/image_view/msg"
],
"moveit_msgs":[
"/opt/ros/melodic/share/moveit_msgs/msg"
],
"visualization_msgs":[
"/opt/ros/melodic/share/visualization_msgs/msg"
],
"moveit_ros_robot_interaction":[
"/opt/ros/melodic/share/moveit_ros_robot_interaction/msg"
],
"resource_retriever":[
"/opt/ros/melodic/share/resource_retriever/msg"
],
"rqt_topic":[
"/opt/ros/melodic/share/rqt_topic/msg"
],
"laser_filters":[
"/opt/ros/melodic/share/laser_filters/msg"
],
"moveit_resources_panda_moveit_config":[
"/opt/ros/melodic/share/moveit_resources_panda_moveit_config/msg"
],
"rqt_action":[
"/opt/ros/melodic/share/rqt_action/msg"
],
"control_toolbox":[
"/opt/ros/melodic/share/control_toolbox/msg"
],
"rqt_top":[
"/opt/ros/melodic/share/rqt_top/msg"
],
"rqt_rviz":[
"/opt/ros/melodic/share/rqt_rviz/msg"
],
"kdl_parser_py":[
"/opt/ros/melodic/share/kdl_parser_py/msg"
],
"rosgraph_msgs":[
"/opt/ros/melodic/share/rosgraph_msgs/msg"
],
"moveit_ros_planning":[
"/opt/ros/melodic/share/moveit_ros_planning/msg"
],
"rosboost_cfg":[
"/opt/ros/melodic/share/rosboost_cfg/msg"
],
"genmsg":[
"/opt/ros/melodic/share/genmsg/msg"
],
"xacro":[
"/opt/ros/melodic/share/xacro/msg"
],
"turtle_tf2":[
"/opt/ros/melodic/share/turtle_tf2/msg"
],
"rqt_robot_dashboard":[
"/opt/ros/melodic/share/rqt_robot_dashboard/msg"
],
"pluginlib":[
"/opt/ros/melodic/share/pluginlib/msg"
],
"rqt_msg":[
"/opt/ros/melodic/share/rqt_msg/msg"
],
"gazebo_dev":[
"/opt/ros/melodic/share/gazebo_dev/msg"
],
"gl_dependency":[
"/opt/ros/melodic/share/gl_dependency/msg"
],
"rqt_service_caller":[
"/opt/ros/melodic/share/rqt_service_caller/msg"
],
"rqt_gui_py":[
"/opt/ros/melodic/share/rqt_gui_py/msg"
],
"xmlrpcpp":[
"/opt/ros/melodic/share/xmlrpcpp/msg"
],
"rosmaster":[
"/opt/ros/melodic/share/rosmaster/msg"
],
"qt_dotgraph":[
"/opt/ros/melodic/share/qt_dotgraph/msg"
],
"warehouse_ros":[
"/opt/ros/melodic/share/warehouse_ros/msg"
],
"rosnode":[
"/opt/ros/melodic/share/rosnode/msg"
],
"rqt_pose_view":[
"/opt/ros/melodic/share/rqt_pose_view/msg"
],
"bond":[
"/opt/ros/melodic/share/bond/msg"
],
"self_test":[
"/opt/ros/melodic/share/self_test/msg"
],
"laser_assembler":[
"/opt/ros/melodic/share/laser_assembler/msg"
],
"rospack":[
"/opt/ros/melodic/share/rospack/msg"
],
"transmission_interface":[
"/opt/ros/melodic/share/transmission_interface/msg"
],
"image_rotate":[
"/opt/ros/melodic/share/image_rotate/msg"
],
"chomp_motion_planner":[
"/opt/ros/melodic/share/chomp_motion_planner/msg"
],
"rqt_image_view":[
"/opt/ros/melodic/share/rqt_image_view/msg"
],
"roslisp":[
"/opt/ros/melodic/share/roslisp/msg"
],
"rqt_console":[
"/opt/ros/melodic/share/rqt_console/msg"
],
"mk":[
"/opt/ros/melodic/share/mk/msg"
],
"rviz_plugin_tutorials":[
"/opt/ros/melodic/share/rviz_plugin_tutorials/msg"
],
"tf2_msgs":[
"/opt/ros/melodic/share/tf2_msgs/msg"
],
"python_qt_binding":[
"/opt/ros/melodic/share/python_qt_binding/msg"
],
"laser_geometry":[
"/opt/ros/melodic/share/laser_geometry/msg"
],
"rviz":[
"/opt/ros/melodic/share/rviz/msg"
],
"gencpp":[
"/opt/ros/melodic/share/gencpp/msg"
],
"rqt_gui_cpp":[
"/opt/ros/melodic/share/rqt_gui_cpp/msg"
],
"rqt_bag":[
"/opt/ros/melodic/share/rqt_bag/msg"
],
"rqt_gui":[
"/opt/ros/melodic/share/rqt_gui/msg"
],
"qt_gui_py_common":[
"/opt/ros/melodic/share/qt_gui_py_common/msg"
],
"graph_msgs":[
"/opt/ros/melodic/share/graph_msgs/msg"
],
"roscpp_traits":[
"/opt/ros/melodic/share/roscpp_traits/msg"
],
"rosout":[
"/opt/ros/melodic/share/rosout/msg"
],
"diagnostic_common_diagnostics":[
"/opt/ros/melodic/share/diagnostic_common_diagnostics/msg"
],
"rostopic":[
"/opt/ros/melodic/share/rostopic/msg"
],
"smach_msgs":[
"/opt/ros/melodic/share/smach_msgs/msg"
],
"message_generation":[
"/opt/ros/melodic/share/message_generation/msg"
],
"moveit_tutorials":[
"/home/sanket/ws_moveit/src/moveit_tutorials/msg",
"/home/sanket/ws_moveit/devel/share/moveit_tutorials/msg"
],
"camera_calibration":[
"/opt/ros/melodic/share/camera_calibration/msg"
],
"ros_environment":[
"/opt/ros/melodic/share/ros_environment/msg"
],
"qwt_dependency":[
"/opt/ros/melodic/share/qwt_dependency/msg"
],
"polled_camera":[
"/opt/ros/melodic/share/polled_camera/msg"
],
"joy":[
"/opt/ros/melodic/share/joy/msg"
],
"rostime":[
"/opt/ros/melodic/share/rostime/msg"
],
"urdf_tutorial":[
"/opt/ros/melodic/share/urdf_tutorial/msg"
],
"kdl_conversions":[
"/opt/ros/melodic/share/kdl_conversions/msg"
],
"rqt_nav_view":[
"/opt/ros/melodic/share/rqt_nav_view/msg"
],
"roslint":[
"/opt/ros/melodic/share/roslint/msg"
],
"rosservice":[
"/opt/ros/melodic/share/rosservice/msg"
],
"moveit_ros_manipulation":[
"/opt/ros/melodic/share/moveit_ros_manipulation/msg"
],
"rosunit":[
"/opt/ros/melodic/share/rosunit/msg"
],
"turtle_tf":[
"/opt/ros/melodic/share/turtle_tf/msg"
],
"roscpp_tutorials":[
"/opt/ros/melodic/share/roscpp_tutorials/msg"
],
"turtle_actionlib":[
"/opt/ros/melodic/share/turtle_actionlib/msg"
],
"python_orocos_kdl":[
"/opt/ros/melodic/share/python_orocos_kdl/msg"
],
"stage":[
"/opt/ros/melodic/share/stage/msg"
],
"moveit_core":[
"/opt/ros/melodic/share/moveit_core/msg"
],
"visualization_marker_tutorials":[
"/opt/ros/melodic/share/visualization_marker_tutorials/msg"
],
"bondcpp":[
"/opt/ros/melodic/share/bondcpp/msg"
],
"rosconsole_bridge":[
"/opt/ros/melodic/share/rosconsole_bridge/msg"
],
"pluginlib_tutorials":[
"/opt/ros/melodic/share/pluginlib_tutorials/msg"
],
"forward_command_controller":[
"/opt/ros/melodic/share/forward_command_controller/msg"
],
"camera_info_manager":[
"/opt/ros/melodic/share/camera_info_manager/msg"
],
"camera_calibration_parsers":[
"/opt/ros/melodic/share/camera_calibration_parsers/msg"
],
"roslz4":[
"/opt/ros/melodic/share/roslz4/msg"
],
"rqt_dep":[
"/opt/ros/melodic/share/rqt_dep/msg"
],
"moveit_resources_panda_description":[
"/opt/ros/melodic/share/moveit_resources_panda_description/msg"
],
"rosmsg":[
"/opt/ros/melodic/share/rosmsg/msg"
],
"moveit_simple_controller_manager":[
"/opt/ros/melodic/share/moveit_simple_controller_manager/msg"
],
"turtlesim":[
"/opt/ros/melodic/share/turtlesim/msg"
],
"rqt_robot_monitor":[
"/opt/ros/melodic/share/rqt_robot_monitor/msg"
],
"rosparam":[
"/opt/ros/melodic/share/rosparam/msg"
],
"controller_interface":[
"/opt/ros/melodic/share/controller_interface/msg"
],
"diagnostic_analysis":[
"/opt/ros/melodic/share/diagnostic_analysis/msg"
],
"stereo_msgs":[
"/opt/ros/melodic/share/stereo_msgs/msg"
],
"pcl_msgs":[
"/opt/ros/melodic/share/pcl_msgs/msg"
],
"interactive_markers":[
"/opt/ros/melodic/share/interactive_markers/msg"
],
"object_recognition_msgs":[
"/opt/ros/melodic/share/object_recognition_msgs/msg"
],
"diagnostic_updater":[
"/opt/ros/melodic/share/diagnostic_updater/msg"
],
"pybind11_catkin":[
"/opt/ros/melodic/share/pybind11_catkin/msg"
],
"panda_moveit_config":[
"/home/sanket/ws_moveit/src/panda_moveit_config/msg",
"/home/sanket/ws_moveit/devel/share/panda_moveit_config/msg"
],
"pcl_conversions":[
"/opt/ros/melodic/share/pcl_conversions/msg"
],
"rviz_python_tutorial":[
"/opt/ros/melodic/share/rviz_python_tutorial/msg"
],
"tf2":[
"/opt/ros/melodic/share/tf2/msg"
],
"rqt_runtime_monitor":[
"/opt/ros/melodic/share/rqt_runtime_monitor/msg"
],
"urdf_sim_tutorial":[
"/opt/ros/melodic/share/urdf_sim_tutorial/msg"
],
"position_controllers":[
"/opt/ros/melodic/share/position_controllers/msg"
],
"rospy":[
"/opt/ros/melodic/share/rospy/msg"
],
"rosbash":[
"/opt/ros/melodic/share/rosbash/msg"
],
"rqt_reconfigure":[
"/opt/ros/melodic/share/rqt_reconfigure/msg"
],
"rqt_bag_plugins":[
"/opt/ros/melodic/share/rqt_bag_plugins/msg"
],
"image_publisher":[
"/opt/ros/melodic/share/image_publisher/msg"
],
"eigenpy":[
"/opt/ros/melodic/share/eigenpy/msg"
],
"rqt_plot":[
"/opt/ros/melodic/share/rqt_plot/msg"
],
"topic_tools":[
"/opt/ros/melodic/share/topic_tools/msg"
],
"rostest":[
"/opt/ros/melodic/share/rostest/msg"
],
"control_msgs":[
"/opt/ros/melodic/share/control_msgs/msg"
],
"tf_conversions":[
"/opt/ros/melodic/share/tf_conversions/msg"
],
"interactive_marker_tutorials":[
"/opt/ros/melodic/share/interactive_marker_tutorials/msg"
],
"cpp_common":[
"/opt/ros/melodic/share/cpp_common/msg"
],
"nodelet":[
"/opt/ros/melodic/share/nodelet/msg"
],
"actionlib_msgs":[
"/opt/ros/melodic/share/actionlib_msgs/msg"
],
"stage_ros":[
"/opt/ros/melodic/share/stage_ros/msg"
],
"rqt_robot_steering":[
"/opt/ros/melodic/share/rqt_robot_steering/msg"
],
"dynamic_reconfigure":[
"/opt/ros/melodic/share/dynamic_reconfigure/msg"
],
"genpy":[
"/opt/ros/melodic/share/genpy/msg"
],
"actionlib_tutorials":[
"/opt/ros/melodic/share/actionlib_tutorials/msg"
],
"tf2_geometry_msgs":[
"/opt/ros/melodic/share/tf2_geometry_msgs/msg"
],
"compressed_image_transport":[
"/opt/ros/melodic/share/compressed_image_transport/msg"
],
"controller_manager_msgs":[
"/opt/ros/melodic/share/controller_manager_msgs/msg"
],
"rqt_shell":[
"/opt/ros/melodic/share/rqt_shell/msg"
],
"std_msgs":[
"/opt/ros/melodic/share/std_msgs/msg"
],
"realtime_tools":[
"/opt/ros/melodic/share/realtime_tools/msg"
],
"moveit_ros_move_group":[
"/opt/ros/melodic/share/moveit_ros_move_group/msg"
],
"rqt_launch":[
"/opt/ros/melodic/share/rqt_launch/msg"
],
"angles":[
"/opt/ros/melodic/share/angles/msg"
],
"joint_state_controller":[
"/opt/ros/melodic/share/joint_state_controller/msg"
],
"webkit_dependency":[
"/opt/ros/melodic/share/webkit_dependency/msg"
],
"cv_bridge":[
"/opt/ros/melodic/share/cv_bridge/msg"
],
"gazebo_ros":[
"/opt/ros/melodic/share/gazebo_ros/msg"
],
"rosbag_storage":[
"/opt/ros/melodic/share/rosbag_storage/msg"
],
"roswtf":[
"/opt/ros/melodic/share/roswtf/msg"
],
"std_srvs":[
"/opt/ros/melodic/share/std_srvs/msg"
],
"joint_state_publisher_gui":[
"/opt/ros/melodic/share/joint_state_publisher_gui/msg"
],
"moveit_ros_warehouse":[
"/opt/ros/melodic/share/moveit_ros_warehouse/msg"
],
"joint_state_publisher":[
"/opt/ros/melodic/share/joint_state_publisher/msg"
],
"octomap":[
"/opt/ros/melodic/share/octomap/msg"
],
"stereo_image_proc":[
"/opt/ros/melodic/share/stereo_image_proc/msg"
],
"bondpy":[
"/opt/ros/melodic/share/bondpy/msg"
],
"moveit_ros_benchmarks":[
"/opt/ros/melodic/share/moveit_ros_benchmarks/msg"
],
"tf2_kdl":[
"/opt/ros/melodic/share/tf2_kdl/msg"
],
"smach":[
"/opt/ros/melodic/share/smach/msg"
],
"genlisp":[
"/opt/ros/melodic/share/genlisp/msg"
],
"class_loader":[
"/opt/ros/melodic/share/class_loader/msg"
],
"message_filters":[
"/opt/ros/melodic/share/message_filters/msg"
],
"tf2_py":[
"/opt/ros/melodic/share/tf2_py/msg"
],
"hardware_interface":[
"/opt/ros/melodic/share/hardware_interface/msg"
],
"cmake_modules":[
"/opt/ros/melodic/share/cmake_modules/msg"
],
"moveit_ros_visualization":[
"/opt/ros/melodic/share/moveit_ros_visualization/msg"
],
"pcl_ros":[
"/opt/ros/melodic/share/pcl_ros/msg"
],
"nav_msgs":[
"/opt/ros/melodic/share/nav_msgs/msg"
],
"rosmake":[
"/opt/ros/melodic/share/rosmake/msg"
],
"image_proc":[
"/opt/ros/melodic/share/image_proc/msg"
],
"roscpp":[
"/opt/ros/melodic/share/roscpp/msg"
],
"rqt_moveit":[
"/opt/ros/melodic/share/rqt_moveit/msg"
],
"theora_image_transport":[
"/opt/ros/melodic/share/theora_image_transport/msg"
],
"rqt_py_common":[
"/opt/ros/melodic/share/rqt_py_common/msg"
],
"depth_image_proc":[
"/opt/ros/melodic/share/depth_image_proc/msg"
],
"actionlib":[
"/opt/ros/melodic/share/actionlib/msg"
],
"moveit_ros_occupancy_map_monitor":[
"/opt/ros/melodic/share/moveit_ros_occupancy_map_monitor/msg"
],
"franka_description":[
"/opt/ros/melodic/share/franka_description/msg"
],
"octomap_msgs":[
"/opt/ros/melodic/share/octomap_msgs/msg"
],
"qt_gui_cpp":[
"/opt/ros/melodic/share/qt_gui_cpp/msg"
],
"eigen_stl_containers":[
"/opt/ros/melodic/share/eigen_stl_containers/msg"
],
"tf2_ros":[
"/opt/ros/melodic/share/tf2_ros/msg"
],
"librviz_tutorial":[
"/opt/ros/melodic/share/librviz_tutorial/msg"
],
"robot_state_publisher":[
"/opt/ros/melodic/share/robot_state_publisher/msg"
],
"image_geometry":[
"/opt/ros/melodic/share/image_geometry/msg"
],
"moveit_fake_controller_manager":[
"/opt/ros/melodic/share/moveit_fake_controller_manager/msg"
],
"message_runtime":[
"/opt/ros/melodic/share/message_runtime/msg"
],
"image_transport":[
"/opt/ros/melodic/share/image_transport/msg"
],
"diff_drive_controller":[
"/opt/ros/melodic/share/diff_drive_controller/msg"
],
"moveit_commander":[
"/opt/ros/melodic/share/moveit_commander/msg"
],
"gazebo_msgs":[
"/opt/ros/melodic/share/gazebo_msgs/msg"
],
"moveit_visual_tools":[
"/opt/ros/melodic/share/moveit_visual_tools/msg"
],
"roscreate":[
"/opt/ros/melodic/share/roscreate/msg"
],
"moveit_planners_ompl":[
"/opt/ros/melodic/share/moveit_planners_ompl/msg"
],
"rospy_tutorials":[
"/opt/ros/melodic/share/rospy_tutorials/msg"
],
"moveit_ros_control_interface":[
"/opt/ros/melodic/share/moveit_ros_control_interface/msg"
],
"random_numbers":[
"/opt/ros/melodic/share/random_numbers/msg"
],
"gazebo_plugins":[
"/opt/ros/melodic/share/gazebo_plugins/msg"
],
"rqt_srv":[
"/opt/ros/melodic/share/rqt_srv/msg"
],
"urdfdom_py":[
"/opt/ros/melodic/share/urdfdom_py/msg"
],
"map_msgs":[
"/opt/ros/melodic/share/map_msgs/msg"
],
"moveit_setup_assistant":[
"/opt/ros/melodic/share/moveit_setup_assistant/msg"
],
"roslaunch":[
"/opt/ros/melodic/share/roslaunch/msg"
],
"tf2_eigen":[
"/opt/ros/melodic/share/tf2_eigen/msg"
],
"rqt_tf_tree":[
"/opt/ros/melodic/share/rqt_tf_tree/msg"
],
"gazebo_ros_control":[
"/opt/ros/melodic/share/gazebo_ros_control/msg"
],
"moveit_ros_perception":[
"/opt/ros/melodic/share/moveit_ros_perception/msg"
],
"controller_manager":[
"/opt/ros/melodic/share/controller_manager/msg"
],
"rqt_logger_level":[
"/opt/ros/melodic/share/rqt_logger_level/msg"
],
"kdl_parser":[
"/opt/ros/melodic/share/kdl_parser/msg"
],
"gennodejs":[
"/opt/ros/melodic/share/gennodejs/msg"
],
"media_export":[
"/opt/ros/melodic/share/media_export/msg"
],
"geometry_msgs":[
"/opt/ros/melodic/share/geometry_msgs/msg"
],
"urdf_parser_plugin":[
"/opt/ros/melodic/share/urdf_parser_plugin/msg"
],
"joint_limits_interface":[
"/opt/ros/melodic/share/joint_limits_interface/msg"
],
"sensor_msgs":[
"/opt/ros/melodic/share/sensor_msgs/msg"
],
"orocos_kdl":[
"/opt/ros/melodic/share/orocos_kdl/msg"
],
"rosbag":[
"/opt/ros/melodic/share/rosbag/msg"
],
"rosbag_migration_rule":[
"/opt/ros/melodic/share/rosbag_migration_rule/msg"
]
}
]
as error and after that rosmsg show is not working for msgs which are standard. I was following a tutorial on EdX by TU Delft when I came across. What should I do to proceed?

how to separate a list and map from map item in dart

I'm trying to separate a list from map item and also another map which is exist on my map item i'm beginner on dart?
someone help me how can do it?
Here is my list
var studentList2 = [
{
"Name": "Gias Uddin Samir",
"Id": "110",
"Result": [
{"Phy": "3.0", "Che": "4.0"}
],
"Completed": ["sp-2017", "sum-2017", "fall-2017"]
},
{
"Name": "Gias Uddin Samir",
"Id": "110",
"Result": [
{"Phy": "3.0", "Che": "4.0"}
],
"Completed": ["sp-2018", "sum-2018", "fall-2018"]
},
{
"Name": "Gias Uddin Samir",
"Id": "110",
"Result": [
{"Phy": "3.0", "Che": "4.0"}
],
"Completed": ["sp-2019", "sum-2019", "fall-2019"]
}
];
I want to separate Result list
"Result": [
{"Phy": "3.0", "Che": "4.0"}
],
ans also
"Completed": ["sp-2019", "sum-2019", "fall-2019"]
Maybe through the map method:
final results = studentList2.map((item) => item['Result']).toList();
print(results);
// [[{Phy: 3.0, Che: 4.0}], [{Phy: 3.0, Che: 4.0}], [{Phy: 3.0, Che: 4.0}]]
final completed = studentList2.map((item) => item['Completed']).toList();
print(completed);
// [[sp-2017, sum-2017, fall-2017], [sp-2018, sum-2018, fall-2018], [sp-2019, sum-2019, fall-2019]]

Multipolygon won't upload in Google BigQuery GIS

I am trying to convert shapes that I serialized into GeoJSON string format back into GEOGRAPHY with Google BigQuery GIS.
SELECT ST_GEOGFROMGEOJSON( BlockGroupShape ) AS tmp from dataset.blockgroup_shape
It was successful for ~90% of the shapes, however, it seems to be failing (only?) on the multipolygons with this error (I have ~10k of these failed ones...):
ST_GeogFromGeoJSON failed: Polygon should have only one shell, holes must be inside the shell. Polygon hole 1 is outside of the shell
Example geography:
{ "type": "MultiPolygon", "coordinates": [ [ [ [ -81.790922, 26.156442 ], [ -81.790924, 26.156640 ], [ -81.791073, 26.156640 ], [ -81.791079, 26.156954 ], [ -81.791092, 26.157640 ], [ -81.790950, 26.157703 ], [ -81.790950, 26.157840 ], [ -81.790958, 26.158269 ], [ -81.790960, 26.158425 ], [ -81.790985, 26.159858 ], [ -81.790987, 26.160142 ], [ -81.790996, 26.160414 ], [ -81.791002, 26.160560 ], [ -81.791009, 26.161166 ], [ -81.791013, 26.161445 ], [ -81.791040, 26.161454 ], [ -81.791072, 26.161486 ], [ -81.791090, 26.161527 ], [ -81.791096, 26.161577 ], [ -81.791096, 26.161640 ], [ -81.791100, 26.161898 ], [ -81.791167, 26.162077 ], [ -81.791185, 26.162806 ], [ -81.791189, 26.163029 ], [ -81.791040, 26.163018 ], [ -81.791043, 26.163137 ], [ -81.791051, 26.163485 ], [ -81.791055, 26.163674 ], [ -81.791060, 26.163890 ], [ -81.791064, 26.164114 ], [ -81.791069, 26.164454 ], [ -81.791075, 26.164800 ], [ -81.790692, 26.164778 ], [ -81.790699, 26.165209 ], [ -81.791081, 26.165198 ], [ -81.791090, 26.165451 ], [ -81.791092, 26.165647 ], [ -81.791094, 26.165881 ], [ -81.791107, 26.166456 ], [ -81.791116, 26.166579 ], [ -81.791122, 26.166668 ], [ -81.791133, 26.166812 ], [ -81.791149, 26.167013 ], [ -81.791191, 26.167464 ], [ -81.791223, 26.167751 ], [ -81.791240, 26.167985 ], [ -81.791272, 26.168303 ], [ -81.791302, 26.168589 ], [ -81.791313, 26.168742 ], [ -81.791337, 26.169281 ], [ -81.791354, 26.169732 ], [ -81.791361, 26.170141 ], [ -81.791365, 26.170405 ], [ -81.791373, 26.170804 ], [ -81.791379, 26.171023 ], [ -81.791381, 26.171228 ], [ -81.791388, 26.171595 ], [ -81.791396, 26.171767 ], [ -81.791404, 26.171880 ], [ -81.791407, 26.172017 ], [ -81.791407, 26.172162 ], [ -81.791407, 26.172477 ], [ -81.791407, 26.172675 ], [ -81.791409, 26.172844 ], [ -81.791421, 26.173196 ], [ -81.791423, 26.173257 ], [ -81.791429, 26.173342 ], [ -81.791447, 26.173512 ], [ -81.791449, 26.173661 ], [ -81.791451, 26.173749 ], [ -81.791459, 26.174266 ], [ -81.791453, 26.175174 ], [ -81.791451, 26.175379 ], [ -81.791449, 26.175731 ], [ -81.791331, 26.175731 ], [ -81.790510, 26.175725 ], [ -81.790544, 26.176437 ], [ -81.790555, 26.177320 ], [ -81.790893, 26.177314 ], [ -81.791450, 26.177310 ], [ -81.791458, 26.177473 ], [ -81.791460, 26.177524 ], [ -81.791465, 26.177903 ], [ -81.791471, 26.178571 ], [ -81.791489, 26.180027 ], [ -81.791491, 26.180180 ], [ -81.791496, 26.180371 ], [ -81.791498, 26.180472 ], [ -81.791504, 26.180892 ], [ -81.791504, 26.181074 ], [ -81.791506, 26.181561 ], [ -81.791517, 26.182158 ], [ -81.791678, 26.182153 ], [ -81.791690, 26.182621 ], [ -81.791705, 26.183187 ], [ -81.791736, 26.184391 ], [ -81.791748, 26.184895 ], [ -81.791762, 26.185437 ], [ -81.791765, 26.185572 ], [ -81.791782, 26.186238 ], [ -81.791804, 26.187134 ], [ -81.791809, 26.187409 ], [ -81.791828, 26.188171 ], [ -81.791836, 26.188478 ], [ -81.791846, 26.188807 ], [ -81.791850, 26.188946 ], [ -81.791856, 26.189186 ], [ -81.791859, 26.189298 ], [ -81.791862, 26.189393 ], [ -81.791866, 26.189540 ], [ -81.791949, 26.192615 ], [ -81.791954, 26.193090 ], [ -81.791961, 26.193329 ], [ -81.792014, 26.195537 ], [ -81.792020, 26.195617 ], [ -81.792025, 26.195783 ], [ -81.792031, 26.196048 ], [ -81.792046, 26.196625 ], [ -81.792148, 26.196628 ], [ -81.792234, 26.196670 ], [ -81.792153, 26.196708 ], [ -81.792048, 26.196710 ], [ -81.791891, 26.196710 ], [ -81.791898, 26.197247 ], [ -81.791903, 26.197681 ], [ -81.791907, 26.197968 ], [ -81.791913, 26.198385 ], [ -81.791915, 26.198523 ], [ -81.791917, 26.198734 ], [ -81.791938, 26.200014 ], [ -81.791938, 26.200078 ], [ -81.791941, 26.200317 ], [ -81.791949, 26.200911 ], [ -81.791995, 26.200978 ], [ -81.792015, 26.201007 ], [ -81.792034, 26.201041 ], [ -81.792049, 26.201100 ], [ -81.792051, 26.201484 ], [ -81.792119, 26.201677 ], [ -81.792120, 26.201744 ], [ -81.792128, 26.202208 ], [ -81.792129, 26.202250 ], [ -81.792158, 26.204339 ], [ -81.792161, 26.204556 ], [ -81.792165, 26.204782 ], [ -81.792172, 26.205331 ], [ -81.792175, 26.205526 ], [ -81.792178, 26.205772 ], [ -81.792182, 26.206009 ], [ -81.792218, 26.208468 ], [ -81.792042, 26.208603 ], [ -81.792081, 26.208610 ], [ -81.792109, 26.208622 ], [ -81.792130, 26.208640 ], [ -81.792148, 26.208673 ], [ -81.792152, 26.208717 ], [ -81.792152, 26.208833 ], [ -81.792165, 26.208963 ], [ -81.792179, 26.209015 ], [ -81.792224, 26.209159 ], [ -81.792228, 26.209224 ], [ -81.792242, 26.209467 ], [ -81.792257, 26.209732 ], [ -81.792276, 26.210112 ], [ -81.792300, 26.210609 ], [ -81.792301, 26.210727 ], [ -81.792303, 26.210901 ], [ -81.792308, 26.211295 ], [ -81.792209, 26.211292 ], [ -81.792133, 26.211294 ], [ -81.791723, 26.211275 ], [ -81.791412, 26.211272 ], [ -81.791028, 26.211276 ], [ -81.790524, 26.211280 ], [ -81.790406, 26.211278 ], [ -81.790254, 26.211275 ], [ -81.790057, 26.211275 ], [ -81.789715, 26.211273 ], [ -81.789525, 26.211273 ], [ -81.789438, 26.211270 ], [ -81.788712, 26.211268 ], [ -81.788414, 26.211265 ], [ -81.788293, 26.211264 ], [ -81.788214, 26.211264 ], [ -81.787656, 26.211272 ], [ -81.787240, 26.211276 ], [ -81.785905, 26.211303 ], [ -81.785811, 26.211338 ], [ -81.785692, 26.211361 ], [ -81.785534, 26.211372 ], [ -81.785164, 26.211380 ], [ -81.785099, 26.211389 ], [ -81.785045, 26.211416 ], [ -81.784999, 26.211453 ], [ -81.784348, 26.211464 ], [ -81.783256, 26.211482 ], [ -81.782915, 26.211482 ], [ -81.781403, 26.211511 ], [ -81.780802, 26.211519 ], [ -81.780426, 26.211522 ], [ -81.780449, 26.211450 ], [ -81.780454, 26.211377 ], [ -81.780453, 26.210966 ], [ -81.780460, 26.210750 ], [ -81.780555, 26.210736 ], [ -81.780951, 26.210615 ], [ -81.781092, 26.210566 ], [ -81.781277, 26.210508 ], [ -81.781538, 26.210444 ], [ -81.781761, 26.210416 ], [ -81.782043, 26.210371 ], [ -81.782333, 26.210344 ], [ -81.782547, 26.210348 ], [ -81.782570, 26.210546 ], [ -81.782570, 26.210718 ], [ -81.782600, 26.210794 ], [ -81.782669, 26.210863 ], [ -81.782730, 26.210892 ], [ -81.782799, 26.210905 ], [ -81.782990, 26.210903 ], [ -81.783127, 26.210888 ], [ -81.783180, 26.210869 ], [ -81.783257, 26.210773 ], [ -81.783706, 26.210692 ], [ -81.783735, 26.210746 ], [ -81.783808, 26.210805 ], [ -81.783921, 26.210827 ], [ -81.783959, 26.210850 ], [ -81.784005, 26.210985 ], [ -81.783996, 26.211083 ], [ -81.784010, 26.211129 ], [ -81.784036, 26.211140 ], [ -81.784096, 26.211133 ], [ -81.784125, 26.211113 ], [ -81.784173, 26.211102 ], [ -81.784308, 26.211109 ], [ -81.784364, 26.211102 ], [ -81.784384, 26.211069 ], [ -81.784378, 26.211017 ], [ -81.784371, 26.210960 ], [ -81.784365, 26.210771 ], [ -81.784332, 26.210441 ], [ -81.784348, 26.210264 ], [ -81.784322, 26.209702 ], [ -81.784298, 26.209183 ], [ -81.784273, 26.208643 ], [ -81.784231, 26.207710 ], [ -81.784253, 26.207703 ], [ -81.784298, 26.207652 ], [ -81.784337, 26.207530 ], [ -81.784322, 26.207305 ], [ -81.784306, 26.207147 ], [ -81.784247, 26.207065 ], [ -81.784238, 26.206671 ], [ -81.784217, 26.205869 ], [ -81.784199, 26.205381 ], [ -81.784184, 26.204548 ], [ -81.784167, 26.203985 ], [ -81.784150, 26.203565 ], [ -81.784116, 26.202845 ], [ -81.783755, 26.202895 ], [ -81.784010, 26.202183 ], [ -81.784088, 26.202179 ], [ -81.784079, 26.201910 ], [ -81.784065, 26.201771 ], [ -81.784019, 26.201548 ], [ -81.784022, 26.201109 ], [ -81.784048, 26.200960 ], [ -81.784060, 26.200891 ], [ -81.784055, 26.200720 ], [ -81.784051, 26.200575 ], [ -81.784028, 26.200436 ], [ -81.783986, 26.200273 ], [ -81.783946, 26.200018 ], [ -81.783936, 26.199507 ], [ -81.783936, 26.199281 ], [ -81.783936, 26.198574 ], [ -81.783919, 26.198468 ], [ -81.783886, 26.198363 ], [ -81.783802, 26.198243 ], [ -81.783735, 26.198092 ], [ -81.783718, 26.197942 ], [ -81.783684, 26.197656 ], [ -81.783718, 26.196737 ], [ -81.783751, 26.196572 ], [ -81.783802, 26.196481 ], [ -81.783819, 26.196451 ], [ -81.783847, 26.196255 ], [ -81.783839, 26.195897 ], [ -81.783824, 26.195500 ], [ -81.783792, 26.194905 ], [ -81.783767, 26.194353 ], [ -81.783762, 26.193506 ], [ -81.783741, 26.193308 ], [ -81.783711, 26.193152 ], [ -81.783667, 26.193029 ], [ -81.783638, 26.192985 ], [ -81.783489, 26.192753 ], [ -81.783163, 26.192341 ], [ -81.783124, 26.192281 ], [ -81.783083, 26.192172 ], [ -81.783075, 26.192112 ], [ -81.783006, 26.192014 ], [ -81.782943, 26.192021 ], [ -81.782888, 26.192014 ], [ -81.782804, 26.191975 ], [ -81.782717, 26.191886 ], [ -81.782707, 26.191828 ], [ -81.782736, 26.191826 ], [ -81.782763, 26.191751 ], [ -81.782698, 26.191576 ], [ -81.782700, 26.191540 ], [ -81.782746, 26.191523 ], [ -81.782787, 26.191520 ], [ -81.782914, 26.191472 ], [ -81.782940, 26.191265 ], [ -81.782940, 26.191190 ], [ -81.782932, 26.191162 ], [ -81.782921, 26.191126 ], [ -81.782869, 26.191009 ], [ -81.782853, 26.190932 ], [ -81.782821, 26.190894 ], [ -81.782805, 26.190778 ], [ -81.782783, 26.190682 ], [ -81.782746, 26.190625 ], [ -81.782711, 26.190552 ], [ -81.782752, 26.190507 ], [ -81.782808, 26.190465 ], [ -81.782944, 26.190315 ], [ -81.782974, 26.190263 ], [ -81.782993, 26.190182 ], [ -81.783000, 26.190002 ], [ -81.783023, 26.189904 ], [ -81.783068, 26.189795 ], [ -81.783162, 26.189630 ], [ -81.783305, 26.189442 ], [ -81.783504, 26.189243 ], [ -81.783575, 26.189108 ], [ -81.783598, 26.188773 ], [ -81.783598, 26.188487 ], [ -81.783587, 26.188289 ], [ -81.783531, 26.187343 ], [ -81.783507, 26.186025 ], [ -81.783463, 26.183615 ], [ -81.783439, 26.183554 ], [ -81.783337, 26.183420 ], [ -81.783292, 26.183342 ], [ -81.783255, 26.183240 ], [ -81.783243, 26.183143 ], [ -81.783243, 26.183049 ], [ -81.783255, 26.182951 ], [ -81.783288, 26.182829 ], [ -81.783360, 26.182551 ], [ -81.783406, 26.182284 ], [ -81.783435, 26.181994 ], [ -81.783420, 26.181008 ], [ -81.783405, 26.180029 ], [ -81.783379, 26.179197 ], [ -81.783409, 26.178789 ], [ -81.783402, 26.178188 ], [ -81.783331, 26.177290 ], [ -81.783352, 26.176979 ], [ -81.783305, 26.176673 ], [ -81.783305, 26.176538 ], [ -81.783341, 26.175959 ], [ -81.783339, 26.175806 ], [ -81.783342, 26.175571 ], [ -81.783333, 26.175091 ], [ -81.783342, 26.174785 ], [ -81.783320, 26.174484 ], [ -81.783320, 26.174305 ], [ -81.783333, 26.174265 ], [ -81.783351, 26.174230 ], [ -81.783436, 26.174188 ], [ -81.783448, 26.174182 ], [ -81.783510, 26.174166 ], [ -81.783590, 26.174126 ], [ -81.783722, 26.174011 ], [ -81.783966, 26.173829 ], [ -81.784105, 26.173762 ], [ -81.784271, 26.173728 ], [ -81.784314, 26.173704 ], [ -81.784416, 26.173615 ], [ -81.784505, 26.173443 ], [ -81.784608, 26.173204 ], [ -81.785277, 26.171912 ], [ -81.785622, 26.171245 ], [ -81.785721, 26.171051 ], [ -81.786154, 26.170196 ], [ -81.786408, 26.168904 ], [ -81.786487, 26.168502 ], [ -81.786589, 26.168133 ], [ -81.786671, 26.167521 ], [ -81.786697, 26.167225 ], [ -81.786738, 26.166765 ], [ -81.786774, 26.166583 ], [ -81.786860, 26.166416 ], [ -81.786894, 26.166370 ], [ -81.784411, 26.161942 ], [ -81.784415, 26.161916 ], [ -81.784355, 26.161897 ], [ -81.784178, 26.161735 ], [ -81.783974, 26.161513 ], [ -81.783955, 26.161237 ], [ -81.784091, 26.161010 ], [ -81.784119, 26.160962 ], [ -81.784263, 26.160741 ], [ -81.784279, 26.160532 ], [ -81.784281, 26.160511 ], [ -81.783916, 26.160332 ], [ -81.783864, 26.160264 ], [ -81.783803, 26.160140 ], [ -81.783856, 26.160028 ], [ -81.783964, 26.159983 ], [ -81.784167, 26.159458 ], [ -81.784203, 26.159366 ], [ -81.784325, 26.159147 ], [ -81.784564, 26.158271 ], [ -81.784598, 26.157992 ], [ -81.784608, 26.157909 ], [ -81.784559, 26.157871 ], [ -81.784422, 26.157656 ], [ -81.784367, 26.157545 ], [ -81.784347, 26.157374 ], [ -81.784370, 26.157166 ], [ -81.784437, 26.157010 ], [ -81.784619, 26.156766 ], [ -81.784719, 26.156632 ], [ -81.784773, 26.156582 ], [ -81.784788, 26.156483 ], [ -81.784802, 26.156487 ], [ -81.784875, 26.156505 ], [ -81.784994, 26.156483 ], [ -81.785517, 26.156543 ], [ -81.785766, 26.156538 ], [ -81.786909, 26.156513 ], [ -81.787420, 26.156502 ], [ -81.789877, 26.156505 ], [ -81.790131, 26.156505 ], [ -81.790194, 26.156501 ], [ -81.790234, 26.156477 ], [ -81.790270, 26.156451 ], [ -81.790922, 26.156442 ] ], [ [ -81.776795, 26.200088 ], [ -81.778140, 26.200009 ], [ -81.778373, 26.199976 ], [ -81.778606, 26.199921 ], [ -81.778837, 26.199857 ], [ -81.779199, 26.199752 ], [ -81.779545, 26.199695 ], [ -81.779891, 26.199657 ], [ -81.780599, 26.199666 ], [ -81.781463, 26.199788 ], [ -81.781762, 26.199902 ], [ -81.781274, 26.199803 ], [ -81.780450, 26.199720 ], [ -81.779785, 26.199703 ], [ -81.779541, 26.199725 ], [ -81.779321, 26.199769 ], [ -81.779053, 26.199841 ], [ -81.778839, 26.199918 ], [ -81.778577, 26.199989 ], [ -81.778138, 26.200072 ], [ -81.777820, 26.200094 ], [ -81.777387, 26.200091 ], [ -81.776795, 26.200088 ] ], [ [ -81.783946, 26.200018 ], [ -81.783782, 26.200054 ], [ -81.783598, 26.200095 ], [ -81.783516, 26.200099 ], [ -81.783409, 26.200106 ], [ -81.783196, 26.200133 ], [ -81.782647, 26.200117 ], [ -81.782444, 26.200073 ], [ -81.783946, 26.200018 ] ] ] ] }
It is that "tail" that is in the Golf Club that is killing it...
The question is, how do I load these multipolygons into BigQuery at scale? (Editing them one by one is not an option)
I took a look at the example geojsoin, it is an interesting one.
I does have three loops, but instead of describing them as multipolygon with three polygons (this is what multipolygons are for - when you have shape consisting of disjoint polygons, it should be described as multipolygon with a list of polygon shapes), it describes it as multipolygon with a single polygon, containing three loops. But loops in a polygon are interpreted as (shell, hole1, hole2, ..). So this is not a valid polygon - the additional loops in the polygon should be holes, but here they are outside of the shell.
What you want
Multipolygon / 3 Polygons / Each with 1 loop
What you have
Multipolygon / 1 polygon / With 3 loops
Or, in geojson, this is what you have:
"coordinates": [ /*start-of-multipolygon*/
[ /*start-of-polygon*/
[ /*first-loop*/ [..,..], .. [..,..] ],
[ /*second-loop*/ [..,..], .. [..,..] ],
[ /*third-loop*/ [..,..], .. [..,..] ]
]
]
What you need is:
"coordinates": [ /*start-of-multipolygon*/
[ /*start-of-polygon*/
[ /*first-loop*/ [..,..], .. [..,..] ]
],
[ /*start-of-polygon*/
[ /*second-loop*/ [..,..], .. [..,..] ]
],
[ /*start-of-polygon*/
[ /*third-loop*/ [..,..], .. [..,..] ]
]
]
For this example it is easy to "fix" the geojson by converting to the proper shape, this fixes the example string:
select st_geogfromgeojson(
REPLACE('<example geojson>', '] ], [ [', '] ] ], [ [ ['));
Of course, the fix is fragile and would be incorrect if the polygon has actual holes - it will convert them to independent shells, and they will disappear.

Why do I get the same result, without matter if I change the file?

Hello I am trying to use the following sdk:
https://github.com/watson-developer-cloud/python-sdk/blob/master/examples/speech_to_text_v1.py
In order to get the text transcription of a wav file as follows:
import json
from os.path import join, dirname
from watson_developer_cloud import SpeechToTextV1
speech_to_text = SpeechToTextV1(
username='XXXXXXXXX',
password='XXXXXXXXX',
x_watson_learning_opt_out=False
)
print(json.dumps(speech_to_text.models(), indent=2))
print('I am using the spanish model for this test')
print(json.dumps(speech_to_text.get_model('es-ES_NarrowbandModel'), indent=2))
with open(join(dirname(__file__), '/Users/Downloads/python-sdk-master/examples/test.wav'),
'rb') as audio_file:
print(json.dumps(speech_to_text.recognize(
audio_file, content_type='audio/wav', timestamps=True,
word_confidence=True),
indent=2))
The problem is that every time that I run the request as follows:
python speech.py
I am getting the same result and it does not matter if I change the name of the file in the parameters I always get:
I am using the spanish model for this test
{
"name": "es-ES_NarrowbandModel",
"language": "es-ES",
"sessions": "https://stream.watsonplatform.net/speech-to-text/api/v1/sessions?model=es-ES_NarrowbandModel",
"url": "https://stream.watsonplatform.net/speech-to-text/api/v1/models/es-ES_NarrowbandModel",
"rate": 8000,
"supported_features": {
"custom_language_model": false,
"speaker_labels": true
},
"description": "Spanish narrowband model."
}
{
"results": [
{
"alternatives": [
{
"word_confidence": [
[
"yeah",
0.361
],
[
"and",
0.867
],
[
"on",
0.448
],
[
"the",
0.243
],
[
"loss",
0.172
],
[
"of",
0.68
],
[
"my",
0.953
],
[
"honor",
0.131
],
[
"and",
0.12
],
[
"sometimes",
0.23
],
[
"platter",
0.659
],
[
"and",
0.339
],
[
"also",
0.337
],
[
"got",
0.227
],
[
"asking",
0.383
],
[
"about",
0.1
],
[
"someone",
0.571
],
[
"economies",
0.144
],
[
"on",
0.146
],
[
"both",
0.093
]
],
"confidence": 0.368,
"transcript": "yeah and on the loss of my honor and sometimes platter and also got asking about someone economies on both ",
"timestamps": [
[
"yeah",
0.18,
0.47
],
[
"and",
0.72,
1.28
],
[
"on",
1.28,
1.41
],
[
"the",
1.41,
1.48
],
[
"loss",
1.48,
1.78
],
[
"of",
1.78,
1.89
],
[
"my",
1.89,
2.04
],
[
"honor",
2.04,
2.37
],
[
"and",
2.37,
2.53
],
[
"sometimes",
2.56,
3.17
],
[
"platter",
3.17,
3.53
],
[
"and",
4.04,
4.17
],
[
"also",
4.17,
4.45
],
[
"got",
4.45,
4.63
],
[
"asking",
4.63,
4.97
],
[
"about",
4.97,
5.18
],
[
"someone",
5.18,
5.45
],
[
"economies",
5.45,
5.97
],
[
"on",
5.97,
6.12
],
[
"both",
6.12,
6.34
]
]
}
],
"final": true
},
{
"alternatives": [
{
"word_confidence": [
[
"even",
0.547
],
[
"in",
0.586
],
[
"the",
0.766
],
[
"planet",
0.276
],
[
"of",
0.131
],
[
"my",
0.188
],
[
So I would like to appreciate support to overcome this task,
You shouldn't need the join(dirname(__file__), if you're specifying a fully qualified file path. If the path of your desired audio file isn't in a relative path, I'd try removing the join, although if that's the problem I'd expect a file not found error.