Changeset 1019


Ignore:
Timestamp:
25/05/06 16:42:00 (13 years ago)
Author:
domlowe
Message:

getFeature, getFeatureList methods

Location:
TI02-CSML/trunk/parser/API
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/parser/API/apicalls.py

    r1009 r1019  
    33from parser_api import * 
    44 
    5 abfeat=AbstractFeature() 
    6 print abfeat.testmethod() 
     5f='../coapec.xml' 
    76 
    8 point=PointFeature() 
    9 print point.testmethod() 
     7#Initialise and parse the dataset 
     8csml = Dataset() 
     9csml.parse(f) 
    1010 
    11 profile=ProfileFeature() 
    12 print profile.testmethod() 
     11#get list of features in the dataset 
     12flist= csml.getFeatureList() 
     13print '\n Here are all the features in %s:' %f 
     14print flist 
     15 
     16#select a feature by name (gml:id) 
     17print '\n Selecting feature with gml:id = %s' %flist[5] 
     18feature=csml.getFeature(flist[5]) 
  • TI02-CSML/trunk/parser/API/parser_api.py

    r1009 r1019  
    88try: 
    99    from Parser import * 
     10    import parser_extra 
    1011except: 
    1112    print 'Could not import CSML Parser. Make sure the Parser code is in parent directory.' 
    1213    sys.exit() 
    1314 
     15import ops_Dataset 
    1416import ops_AbstractFeature 
    1517import ops_PointFeature 
    1618import ops_ProfileFeature 
    1719 
    18 #Assign operations to features 
     20 
     21#Assign methods  .. hmmm perhaps a loop needed here!! 
     22 
     23#Dataset methods: 
     24Dataset.parse=ops_Dataset.parse 
     25Dataset.getFeatureList=ops_Dataset.getFeatureList 
     26Dataset.getFeature=ops_Dataset.getFeature 
     27 
     28 
     29#AbstractFeature methods: 
    1930AbstractFeature.testmethod=ops_AbstractFeature.testmethod 
     31 
     32#PointFeature methods: 
    2033PointFeature.testmethod=ops_PointFeature.testmethod 
     34 
     35#ProfileFeature methods: 
    2136ProfileFeature.testmethod=ops_ProfileFeature.testmethod 
Note: See TracChangeset for help on using the changeset viewer.