Esempio n. 1
0
 /// <summary>  
 /// Converts a Well-known Text representation to a <c>Geometry</c>.
 /// </summary>
 /// <param name="reader"> 
 /// A Reader which will return a "Geometry Tagged Text"
 /// string (see the OpenGIS Simple Features Specification).
 /// </param>
 /// <returns>A <c>Geometry</c> read from <c>reader</c>.
 /// </returns>
 public IGeometry Read(TextReader reader) 
 {
     StreamTokenizer tokenizer = new StreamTokenizer(reader);
     ArrayList tokens = new ArrayList();
     tokenizer.Tokenize(tokens);     // Read directly all tokens
     index = 0;                      // Reset pointer to start of tokens
     try
     {
         return ReadGeometryTaggedText(tokens);
     }
     catch (IOException e)
     {
         throw new ParseException(e.ToString());
     }            
 }
Esempio n. 2
0
 internal IList<Token> Tokenize(TextReader reader)
 {
     var tokenizer = new StreamTokenizer(reader);
     IList<Token> tokens = new List<Token>();
     tokenizer.Tokenize(tokens);     // Read directly all tokens
     return tokens;
 }