0

I am trying to get JMapFrame to work to visualize some feature. Unfortunately I keep getting errors although this test app can be started. Toolbars etc. are shown.

18.02.2011 16:44:38 org.geotools.renderer.lite.StreamingRenderer paint

SEVERE: null

java.lang.NullPointerException
at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1771)
at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:722)

(full stack trace here)

My source code is here. (And pom.xml here)

I assume the problem must be anywhere in "myStyle". Is there maybe a default style?

2 Answers 2

1

This one looks like the culprit:

Graphic graph = sb.createGraphic(null, new Mark[] { testMark }, null,
            sb.literalExpression(1), sb.attributeExpression("size"),
            sb.attributeExpression("rotation"));

you are creating graphic marker with a null graphic. I'm pretty sure you're hitting this issue (not an issue imo, more an error on the user side):

http://jira.codehaus.org/browse/GEOT-1772

2
  • Thanks for the answer. Unfortunately I cannot test it but if it works for anyone, I'll accept it.
    – Philip
    Commented Dec 27, 2011 at 12:34
  • well, voting up wouldn't be a bad start ;-)
    – unicoletti
    Commented Dec 27, 2011 at 13:37
0

From a quick scan it seems that you are trying to symbolize a line with a PointSymbolizer. The first thing to try would be to load a simple SLD file that you know works (build and test it in UDig). This would allow you be sure that it isn't a problem with your features. Then I'd add a logger and turn up the logging level before stepping through the program in a debugger to see what exactly is null.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.