@Test public void testNPEOnMissingProjectionHandler() throws FactoryException, TransformException { StreamingRendererTester tester = new StreamingRendererTester(); String wkt = "PROJCS[\"World_Eckert_IV\",GEOGCS[\"WGS_1984\",DATUM[\"WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Eckert_IV\"],PARAMETER[\"Central_Meridian\",0.0],UNIT[\"Meter\",1.0]]"; CoordinateReferenceSystem eckert = CRS.parseWKT(wkt); ReferencedEnvelope re = new ReferencedEnvelope(-100, 100, -100, 100, eckert); ReferencedEnvelope reprojected = tester.transformEnvelope(re, WGS84); assertFalse(reprojected.isNull()); }
protected ReferencedEnvelope transformEnvelope( ReferencedEnvelope envelope, CoordinateReferenceSystem crs) throws TransformException, FactoryException { try { ProjectionHandler projectionHandler = ProjectionHandlerFinder.getHandler(envelope, crs, isMapWrappingEnabled()); if (projectionHandler != null) { return projectionHandler.getProjectedEnvelope(envelope, crs); } else { return envelope.transform(crs, true); } } catch (FactoryException e) { return envelope.transform(crs, true); } }
StreamingRenderer implements GTRenderer { protected ReferencedEnvelope transformEnvelope( ReferencedEnvelope envelope, CoordinateReferenceSystem crs) throws TransformException, FactoryException { try { ProjectionHandler projectionHandler = ProjectionHandlerFinder.getHandler(envelope, crs, isMapWrappingEnabled()); if (projectionHandler != null) { return projectionHandler.getProjectedEnvelope(envelope, crs); } else { return envelope.transform(crs, true); } } catch (FactoryException e) { return envelope.transform(crs, true); } } }
StreamingRenderer implements GTRenderer { protected ReferencedEnvelope transformEnvelope( ReferencedEnvelope envelope, CoordinateReferenceSystem crs) throws TransformException, FactoryException { try { ProjectionHandler projectionHandler = ProjectionHandlerFinder.getHandler(envelope, crs, isMapWrappingEnabled()); if (projectionHandler != null) { return projectionHandler.getProjectedEnvelope(envelope, crs); } else { return envelope.transform(crs, true); } } catch (FactoryException e) { return envelope.transform(crs, true); } } StreamingRenderer(); }
StreamingRenderer implements GTRenderer { protected ReferencedEnvelope transformEnvelope( ReferencedEnvelope envelope, CoordinateReferenceSystem crs) throws TransformException, FactoryException { try { ProjectionHandler projectionHandler = ProjectionHandlerFinder.getHandler(envelope, crs, isMapWrappingEnabled()); if (projectionHandler != null) { return projectionHandler.getProjectedEnvelope(envelope, crs); } else { return envelope.transform(crs, true); } } catch (FactoryException e) { return envelope.transform(crs, true); } } StreamingRenderer(); void setThreadPool(ExecutorService threadPool); void setConcatTransforms(boolean flag); boolean getConcatTransforms(); void addRenderListener(RenderListener listener); void removeRenderListener(RenderListener listener); void stopRendering(); void paint(Graphics2D graphics, Rectangle paintArea, AffineTransform worldToScreen); void paint(Graphics2D graphics, Rectangle paintArea, Envelope mapArea); void paint(Graphics2D graphics, Rectangle paintArea, ReferencedEnvelope mapArea); void paint(
            Graphics2D graphics,
            Rectangle paintArea,
            Envelope mapArea,
            AffineTransform worldToScreen); void paint(
            Graphics2D graphics,
            Rectangle paintArea,
            ReferencedEnvelope mapArea,
            AffineTransform worldToScreen); int getMaxBackBufferMemory(int width, int height); boolean isInteractive(); void setInteractive(boolean interactive); double getGeneralizationDistance(); void setGeneralizationDistance(double d); void setJava2DHints(RenderingHints hints); RenderingHints getJava2DHints(); void setRendererHints(Map hints); Map getRendererHints(); void setMapContent(MapContent mapContent); MapContent getMapContent(); boolean isCanTransform(); static MathTransform getMathTransform(
            CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem destCRS); }
StreamingRenderer implements GTRenderer { protected ReferencedEnvelope transformEnvelope( ReferencedEnvelope envelope, CoordinateReferenceSystem crs) throws TransformException, FactoryException { try { ProjectionHandler projectionHandler = ProjectionHandlerFinder.getHandler(envelope, crs, isMapWrappingEnabled()); if (projectionHandler != null) { return projectionHandler.getProjectedEnvelope(envelope, crs); } else { return envelope.transform(crs, true); } } catch (FactoryException e) { return envelope.transform(crs, true); } } StreamingRenderer(); void setThreadPool(ExecutorService threadPool); void setConcatTransforms(boolean flag); boolean getConcatTransforms(); void addRenderListener(RenderListener listener); void removeRenderListener(RenderListener listener); void stopRendering(); void paint(Graphics2D graphics, Rectangle paintArea, AffineTransform worldToScreen); void paint(Graphics2D graphics, Rectangle paintArea, Envelope mapArea); void paint(Graphics2D graphics, Rectangle paintArea, ReferencedEnvelope mapArea); void paint(
            Graphics2D graphics,
            Rectangle paintArea,
            Envelope mapArea,
            AffineTransform worldToScreen); void paint(
            Graphics2D graphics,
            Rectangle paintArea,
            ReferencedEnvelope mapArea,
            AffineTransform worldToScreen); int getMaxBackBufferMemory(int width, int height); boolean isInteractive(); void setInteractive(boolean interactive); double getGeneralizationDistance(); void setGeneralizationDistance(double d); void setJava2DHints(RenderingHints hints); RenderingHints getJava2DHints(); void setRendererHints(Map hints); Map getRendererHints(); void setMapContent(MapContent mapContent); MapContent getMapContent(); boolean isCanTransform(); static MathTransform getMathTransform(
            CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem destCRS); static final String SCALE_ACCURATE; static final String SCALE_OGC; static final String RENDERING_BUFFER; static final String TEXT_RENDERING_STRING; static final String TEXT_RENDERING_OUTLINE; static final String TEXT_RENDERING_ADAPTIVE; static final String TEXT_RENDERING_KEY; static final String LINE_WIDTH_OPTIMIZATION_KEY; static final String OPTIMIZE_FTS_RENDERING_KEY; static final String ADVANCED_PROJECTION_HANDLING_KEY; static final String CONTINUOUS_MAP_WRAPPING; static final String VECTOR_RENDERING_KEY; static final String ADVANCED_PROJECTION_DENSIFICATION_KEY; static final String ADVANCED_PROJECTION_DENSIFICATION_TOLERANCE_KEY; static final String DATELINE_WRAPPING_HEURISTIC_KEY; static final String LABEL_CACHE_KEY; static final String FORCE_EPSG_AXIS_ORDER_KEY; static final String DPI_KEY; static final String DECLARED_SCALE_DENOM_KEY; static final String SCALE_COMPUTATION_METHOD_KEY; static final String BYLAYER_INTERPOLATION; }