Hi everyone, I didn't have the time to implement the map rotation and as I am going on holiday during Christmas, this is apparently not going to be done before January.
I was wondering however, if applying the rotation directly on the CRS (via a MathTransform for instance) would be a good hack. After all, a rotation of the map is the same than projecting the data in a rotated coordinate reference system. The advantage being that I don't need to hack the geotools (which is better for compatibility with the library). What do you think about it ? How can I do this ? Thanks Benoît Le 8 déc. 08 à 00:16, Adrian Custer a écrit : > Hey, > > The only tutorials we have are the pages on the wiki that have been a > labour of love of Jody's but don't yet go into each and every module. > > The test cases also show how to use code. > > For rotations, the Java libraries are the place to start. Master > affine > transforms and you'll never look back. > > However, if you end up having to dive into the renderer then the going > will get hard. There's some info on the uDig site as well as on the > geotools site but mostly you'll have to read code. Yes that's hard, > but > let me tell you it's *much* easier than reading specs. :-) > > g'night > > --adrian > > > On Sun, 2008-12-07 at 23:30 +0100, Benoît Thiébault wrote: >> Hey, >> >> I will give it a try and keep you informed :-) >> >> Can you point me with the most relevant tutorial to start with ? I'm >> discovering geotools as my developments progress and didn't try them >> all yet. I'm not very familiar yet with the renderer... >> >> In my case, the user of my application is going to draw grids on the >> map "by hand" (i.e. with a mouse drag-and-drop). In order to optimize >> the coverage of an area with the minimal number of grid cells, the >> user might want to rotate a long island going from north-east to >> south- >> west (for instance). If you rotate your map of 45 degrees, you can >> draw a grid with fewer cells to cover the whole island (which would >> be >> left-right oriented and not diagonal anymore). Of course, one could >> simply rotate the grid instead, but it is maybe not as easy to >> manipulate for the user... and the specifications I follow did'nt >> mention that option, so I guess I will have to try with the map >> rotation :-) >> >> Le 7 déc. 08 à 22:26, Adrian Custer a écrit : >> >>> Hey Andrea, >>> >>> you are right that it's worth a try to see if the renderer can >>> simply be >>> wrapped with a transform---it would not take long to try. However, >>> if >>> memory serves, a couple of folk have tried over the past few years >>> and >>> left me with the impression that things didn't work right. Hopefully >>> we >>> can hear more if Benoit gives it a shot. >>> >>> There are lots of reasons to rotate maps. The most common these days >>> is >>> on all the car gps units which want up on the screen to be forwards >>> from >>> the driver's point of view. Layout for printing is another, when one >>> works on odd shaped areas and doesn't want to waste lots of paper. >>> The >>> list goes on. >>> >>> cheers, >>> --adrian >>> >>> >>> >>> On Sun, 2008-12-07 at 22:19 +0100, Andrea Aime wrote: >>>> Adrian Custer ha scritto: >>>>> Hey, >>>>> >>>>> It's my impression that you are out of luck for simple solutions >>>>> since >>>>> the renderer that JMapPane uses was not built to simply >>>>> concatenate a >>>>> string of transforms. That would have allowed you to simply add on >>>>> one >>>>> more affine transform and still be able to remap both data to your >>>>> pane >>>>> and mouse-clicks back to features. As things now stand, it will be >>>>> hard >>>>> to rotate your rendering and have things work out correctly--- >>>>> apparently >>>>> people have tried before and things were weird. >>>> >>>> Off the top of my head it seems one just need to chain a rotation >>>> transform to the transformation that is provided to >>>> StreamingRenderer.process(...), without touching the transform >>>> that gets passed to processStylers (since it's apparently used >>>> for querying the database as well). >>>> >>>> However, haven't tried, things could be hairier than this. >>>> >>>> Out of curiosity... why do people want to rotate maps? Maybe >>>> I'm just used to projections that leave the northwards direction >>>> "up"... I know for sure that I would have some troubles locating >>>> my house in my town map if someone rotated the map so that >>>> north points "down"... >>>> >>>> Cheers >>>> Andrea >>>> >> > Benoît Thiébault Société Artenum 24 rue Louis Blanc, 75010 Paris tel: +33 (0)1 46 94 67 54 Artenum - Science & Groupware - http://www.artenum.com ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
