org.geotools.xml.Parser Java Examples

The following examples show how to use org.geotools.xml.Parser. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProcessingManager.java    From DataHubSystem with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Check GML Footprint validity
 */
private boolean checkGMLFootprint (String footprint)
{
   try
   {
      Configuration configuration = new GMLConfiguration ();
      Parser parser = new Parser (configuration);
      parser.parse (new InputSource (new StringReader (footprint)));         
      return true;
   }
   catch (Exception e)
   {
      LOGGER.error("Error in extracted footprint: " + e.getMessage());
      return false;
   }
}
 
Example #2
Source File: ProcessingUtils.java    From DataHubSystem with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Check GML Footprint validity
 */
public static boolean checkGMLFootprint (String footprint)
{
   try
   {
      Configuration configuration = new GMLConfiguration ();
      Parser parser = new Parser (configuration);

      Geometry geom =
            (Geometry) parser.parse (new InputSource (
                  new StringReader (footprint)));
      if (!geom.isEmpty() && !geom.isValid())
      {
         LOGGER.error("Wrong footprint");
         return false;
      }
   }
   catch (Exception e)
   {
      LOGGER.error("Error in extracted footprint: " + e.getMessage());
      return false;
   }
   return true;
}
 
Example #3
Source File: GMLConfiguration.java    From GeoTriples with Apache License 2.0 6 votes vote down vote up
public GMLConfiguration(boolean extArcSurfaceSupport) {
    super(GMLd.getInstance());

    this.extArcSurfaceSupport = extArcSurfaceSupport;
    
    //add xlink cdependency
    addDependency(new XLINKConfiguration());

    //add smil depenedncy
    addDependency(new SMIL20Configuration());
    addDependency(new SMIL20LANGConfiguration());

    //add parser properties
    getProperties().add(Parser.Properties.PARSE_UNKNOWN_ELEMENTS);
    getProperties().add(Parser.Properties.PARSE_UNKNOWN_ATTRIBUTES);
}
 
Example #4
Source File: TxtParser.java    From geomajas-project-server with GNU Affero General Public License v3.0 4 votes vote down vote up
public Object read(Object input) throws IOException {
		Parser parser = new Parser(new KMLConfiguration());
//		return parser.parse((InputStream) input);
		return null;
	}