예제 #1
0
 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 
예제 #2
0
 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