예제 #1
0
  /**
   * @throws InstantiationException
   * @throws IllegalAccessException
   * @throws IOException
   * @throws XMLStreamException
   */
  @Test
  public void test_NlsFi_TN_WFS_GMLtoPNG()
      throws InstantiationException, IllegalAccessException, IOException, XMLStreamException {

    GroovyFeatureEngine engine = new GroovyFeatureEngine();

    XMLInputProcessor inputProcessor = new StaxGMLInputProcessor();

    Style sldStyle =
        MapContentOutputProcessor.createSLDStyle(
            "/fi/nls/oskari/fe/output/style/INSPIRE_SLD/TN.RoadTransportNetwork.RoadLink.Default.sld");

    OutputStreamProcessor outputProcessor = new MapContentOutputProcessor("EPSG:3857", sldStyle);

    InputStream inp =
        getClass()
            .getResourceAsStream(
                "/fi/nls/oskari/eu/elf/roadtransportnetwork/nls_fi-ELF-TN-wfs.xml");

    try {
      inputProcessor.setInput(inp);

      File f = getTempFile("TN-nls_fi", ".png");
      logger.info(f.getAbsolutePath());
      FileOutputStream fouts = new FileOutputStream(f);

      try {
        outputProcessor.setOutput(fouts);

        GroovyParserRecipe recipe =
            setupGroovyScript("/fi/nls/oskari/fe/input/format/gml/tn/ELF_generic_TN.groovy")
                .newInstance();
        engine.setRecipe(recipe);

        engine.setInputProcessor(inputProcessor);
        engine.setOutputProcessor(outputProcessor);

        engine.process();

      } finally {
        fouts.close();
      }

    } finally {
      inp.close();
    }
  }
예제 #2
0
  /**
   * @throws InstantiationException
   * @throws IllegalAccessException
   * @throws IOException
   * @throws XMLStreamException
   */
  @Ignore("SLD Problem")
  @Test
  public void test_FgiFi_HY_WatercourseLink_WFS_GMLtoPNG()
      throws InstantiationException, IllegalAccessException, IOException, XMLStreamException {

    GroovyFeatureEngine engine = new GroovyFeatureEngine();

    Style sldStyle =
        MapContentOutputProcessor.createSLDStyle(
            "/fi/nls/oskari/fe/output/style/inspire/hy/fgi_fi_WatercourseLink.xml");

    XMLInputProcessor inputProcessor = new StaxGMLInputProcessor();
    OutputStreamProcessor outputProcessor = new MapContentOutputProcessor("EPSG:3857", sldStyle);

    InputStream inp =
        getClass()
            .getResourceAsStream(
                "/fi/nls/oskari/eu/elf/hydronetwork/fgi_fi_wfs_ELF-HY-WatercourseLink-wfs.xml");

    try {
      inputProcessor.setInput(inp);

      File f = getTempFile("HY-fgi_fi-WatercourseLink", ".png");
      logger.info(f.getAbsolutePath());
      FileOutputStream fouts = new FileOutputStream(f);

      try {
        outputProcessor.setOutput(fouts);

        GroovyParserRecipe recipe =
            setupGroovyScript("/fi/nls/oskari/fe/input/format/gml/hy/ELF_generic_HY.groovy")
                .newInstance();
        engine.setRecipe(recipe);

        engine.setInputProcessor(inputProcessor);
        engine.setOutputProcessor(outputProcessor);

        engine.process();

      } finally {
        fouts.close();
      }

    } finally {
      inp.close();
    }
  }
예제 #3
0
  /**
   * @throws InstantiationException
   * @throws IllegalAccessException
   * @throws IOException
   * @throws XMLStreamException
   */
  @Test
  public void test_LantmaterietSe_AU_WFS_GMLtoPNG()
      throws InstantiationException, IllegalAccessException, IOException, XMLStreamException {

    GroovyFeatureEngine engine = new GroovyFeatureEngine();

    XMLInputProcessor inputProcessor = new StaxGMLInputProcessor();

    Style sldStyle =
        MapContentOutputProcessor.createSLDStyle(
            "/fi/nls/oskari/fe/output/style/INSPIRE_SLD/AU.AdministrativeUnit.Default.xml");

    OutputStreamProcessor outputProcessor = new MapContentOutputProcessor("EPSG:3035", sldStyle);

    InputStream inp =
        getClass()
            .getResourceAsStream(
                "/fi/nls/oskari/eu/elf/administrativeunits/lantmateriet_se-ELF-AU-wfs.xml");

    try {
      inputProcessor.setInput(inp);

      File f = getTempFile("AU-lantmateriet_se", ".png");
      logger.info(f.getAbsolutePath());
      FileOutputStream fouts = new FileOutputStream(f);

      try {
        outputProcessor.setOutput(fouts);

        GroovyParserRecipe recipe =
            setupGroovyScript("/fi/nls/oskari/fe/input/format/gml/au/ELF_generic_AU.groovy")
                .newInstance();
        engine.setRecipe(recipe);

        engine.setInputProcessor(inputProcessor);
        engine.setOutputProcessor(outputProcessor);

        engine.process();

      } finally {
        fouts.close();
      }

    } finally {
      inp.close();
    }
  }
예제 #4
0
  /**
   * @throws InstantiationException
   * @throws IllegalAccessException
   * @throws IOException
   * @throws XMLStreamException
   */
  @Test
  public void test_GeonorgeNo_GN_WFS_GMLtoPNG()
      throws InstantiationException, IllegalAccessException, IOException, XMLStreamException {

    GroovyFeatureEngine engine = new GroovyFeatureEngine();

    XMLInputProcessor inputProcessor = new StaxGMLInputProcessor();
    OutputStreamProcessor outputProcessor = new MapContentOutputProcessor("EPSG:3035");

    InputStream inp =
        getClass()
            .getResourceAsStream(
                "/fi/nls/oskari/eu/elf/geographicalnames/geonorge_no-ELF-GN-wfs.xml");

    try {
      inputProcessor.setInput(inp);

      File f = getTempFile("GN-geonorge_no", ".png");
      logger.info(f.getAbsolutePath());
      FileOutputStream fouts = new FileOutputStream(f);
      try {
        outputProcessor.setOutput(fouts);

        GroovyParserRecipe recipe =
            setupGroovyScript("/fi/nls/oskari/fe/input/format/gml/gn/ELF_generic_GN.groovy")
                .newInstance();
        engine.setRecipe(recipe);

        engine.setInputProcessor(inputProcessor);
        engine.setOutputProcessor(outputProcessor);

        engine.process();

      } finally {
        fouts.close();
      }

    } finally {
      inp.close();
    }
  }