private void parseData ( ) throws IOException , SQLException { FileInputStream fis = null ; try { fis = new FileInputStream ( fileName ) ; try ( JsonParser jp = jsFactory . createParser ( fis ) ) { jp . nextToken ( ) ; //START_OBJECT jp . nextToken ( ) ; // field_name (type) jp . nextToken ( ) ; // value_string (FeatureCollection) String geomType = jp . getText ( ) ; if ( geomType . equalsIgnoreCase ( GeoJsonField . FEATURECOLLECTION ) ) { parseFeatures ( jp ) ; } else { throw new SQLException ( "Malformed GeoJSON file. Expected 'FeatureCollection', found '" + geomType + "'" ) ; } } //START_OBJECT } catch ( FileNotFoundException ex ) { throw new SQLException ( ex ) ; } finally { try { if ( fis != null ) { fis . close ( ) ; } } catch ( IOException ex ) { throw new SQLException ( ex ) ; } } }
Parses the GeoJSON data and set the values to the table .