From: Martin D. <mar...@te...> - 2004-06-22 07:55:44
|
Casson Stallings a =E9crit : > Map data does not have a defined coordinate system until it is added to= =20 > a mapContext with a defined coordinate system. I could find no way to=20 > define the coordinate system at the DataStore or FeatureCollection=20 > level. (After some more reading I did find the SLDRenderedGeometries,=20 > but its not clear to me if this is its role.) Right, for now SLDRenderedGeometries could be used as a workaround, but=20 it should not be its role. I think that DataStore should be the right=20 place for defining a coordinate system. They were a discussion on this=20 topic a while ago. For now DataStore just ignore CS, but it shouldn't. I=20 don't remember who was in charge of introducing CS concept in DataStore.=20 Andrea may know more. > When you pull a renderer off of the StyledMapPane with a defined=20 > coordinate system, the renderer does not keep the knowledge of the=20 > coordinate system. It must be assigned separately if the renderer needs= =20 > to know it. In the output see "Renderer Coorsys 1" and "Renderer Coorsy= s=20 > 2". The first is pulled off of the renderer before the separate=20 > assigning of the coordinate system. It sound like a bug. We should fill a JIRA task for it. > NEW QUESTIONS > =20 > Should the renderer maintain the coordinate system of the MapPane it is= =20 > pulled from? Yes. > At least in my tests (as an applet under eclipse) the coordinates=20 > returned by MouseEvent.getMapCoordinates were always initially the pixe= l=20 > coordinates. See output log below. The mapPane knew the appropriate=20 > boundaries in real world coordinates. It was not until I resized the=20 > applet window or zoomed in on the data that getMapCoordinates started=20 > returning the correct coordinates. I tried doing .resets .validates,=20 > and resetting the bounds of the data in the program, but these did not= =20 > seem to help. Any idea what is going on? Sound like a bug again... It is somewhat strange, since I didn't=20 experimented this behavior in my own application ('getMapCoordinate' was=20 working properly right from the first draw). In may be worth to monitor=20 the value of the 'zoom' AffineTransform field in ZoomPane. I suspect=20 that it is left to the identity transform when is should have been some=20 more complex transform (but in this case, I find it strange that the=20 rendering is done properly). If the ZoomPane.zoom value is okay (not the=20 identity transform), then a second possibility is to check if its value=20 is consistent with Renderer.mapToText (an other AffineTransform, but=20 should have the same value than zoom after a rendering as been=20 completed). If the values are consistent as they should be, then we will=20 advise (there is some other possibilities). > Clearly there is something I am missing. I do not see how you can set u= p=20 > a mappane to display multiple set of data stored in different coordinat= e=20 > systems if you cannot define separate coordinate systems or transforms=20 > for them. How is this done unless you use SLDRenderedGeometries to=20 > create RenderedLayers? However, the documentation on this class does no= t=20 > seem to indicate it is for general use. Maybe I'll have to test it. Setting of CS should be done at DataStore or Feature level. If there is=20 no method for that in the current API, this is because the CS and=20 Geotools framework in Geotools were developped by different peoples, and=20 the Feature / DataStore framework has not yet taken CS in account. But=20 they should. An other issue is that the CRS framework is under=20 refactoring right now, in order to mirror the change in OpenGIS=20 specification. We are in process of switching to the interfaces defined=20 in the GeoAPI process. Regards, Martin. |