|
From: Combe, C. <C....@na...> - 2003-08-29 13:16:47
|
Hi, Martin - thanks for your help, as you pointed out, I'm experiencing problems caused by the renderer using a geographic (lat/long) coordinate system when the data's based on a projected (cartesian) coordinate system. I've attatched the code i'm using, some sample gml and the output from 2 attempts to get it to work. My data uses the British National Grid so I copied code from CreationTest.java (in the cts-coordtrans module) which sets up an appropriate cs. Creating the cs appears to work (it produces the same output as in the test), i then pass the new ProjectedCoordinateSystem object into the constructor for StyledMapPane, which should create a map pane using that cs. But when the renderer comes to display the map I get an error from org.geotools.cs.Ellipsoid.orthodromicDistance Ellipsoid.java:382) (see output1.txt), as Martin said: >The fact that Ellipsoid.orthodromicDistance(...) >were invoked is an indication that the renderer is assuming a >non-cartesian CS. So, my nice new coordinate system isn't getting used. :( It looked to me as if setCoordinateSystem(CoordinateSystem cs) in the Renderer class wasn't really doing anything because the context hadn't been set and so no layers needed to be changed - but i'm not sure about this. As an alternative, i tried using the default constructor for StyledMapPane, setting the context to the one which contains my data and then changing the cs of the renderer using: mapPane.getRenderer().setCoordinateSystem(projectCS); but the transformation from the default cs to the projected cs fails, giving the message "Bursa Wolf parameters required", as changing the cs failed i then get the same error from the orthodromicDistance method as before - see output2.txt. I haven't been able to get very far working out where these parameters should come from or how to fix the problem - any help much appreciated, cheers, colin |