def createFeature(self, feature_dict, id = None): feature = Feature(id) if feature_dict.has_key('geometry'): feature.geometry = feature_dict['geometry'] if feature_dict.has_key('properties'): feature.properties = feature_dict['properties'] return feature
def createFeature(self, feature_dict, id = None): feature = Feature(id) if feature_dict.has_key('geometry'): feature.geometry = feature_dict['geometry'] if feature.geometry['type'] == "Point": feature.geometry['coordinates'] = [feature.geometry['coordinates']] if feature.geometry['type'] == "LineString": feature.geometry['type'] = "Line" if feature_dict.has_key('properties'): feature.properties = feature_dict['properties'] return feature