From: Brian D. <do...@co...> - 2007-12-11 22:44:49
|
My research into the shapefile format led me to conclude that the shaded contour routine in grads will need to be rewritten; Arlindo points out some (not all) of the reasons. I am working on this for v2. We also anticipate implementing shapefile support in grads in collaboration with the CPC during 2008... Brian On Dec 11, 2007, at 4:47 PM, Arlindo da Silva wrote: > Efren, > > I am back from vacation. I read quickly the ESRI white paper that > describes the shapefile format. What an awkward format! SVG appears a > much more elegant approach to vector graphics. In any event, here are > my thoughts on how to produce shapefiles from within GrADS: > > 0) I would produce shapefiles associated with 2D lat-lon "naked > plots", that is, those without maps, frames or fonts. Anything else > may not make much sense. (Since GrADS draws its own characters, fonts > could encoded as polylines but they would be deformed if a map > transformation is later applied.) > > 1) GrADS vector graphics includes both POLYLINES and POLYGON type of > shapes. Since one can only have one type of shape per shapefile, a > given image (say contour lines on top of shaded contours) would have 2 > separate shapefiles associated with it: one with POLYGONS, another > with POLYLINE objects, for a total of 6 files if you factor in the > .shp, .shx and .dbx subfiles. This is ugly. > > 2) There is an annoying requirement on the enconding of polygons: one > must order the vertices so that the "inside" is to the right of the > path, something that should have been handled by the renderer. I > believe cairo provides functions to determine whether a point is > inside or outside a closed path, so I may be able to use it. > > 3) Each polygon object would have a single part so as to avoid dealing > with similar vertex ordering issues. > > 4) Now, each POLYLINE or POLYGON object will have a color associated > with it. I am hoping one could save the (r,g,b) values in the > associated .dbx file, but I am not sure what are the conventions for > encoding this. > > 5) In the case of shaded contours, I am not sure how to encode the > color bar (mapping of (r,g,b) into field values). > > With all these caveats, would GrADS produced shapefiles still be of > any interest? I believe Brian has looked into this as well, I'm cc'ing > him as he may not be subscribed to this list. > > Brian: for reference, here is the thread: > > http://sourceforge.net/mailarchive/forum.php? > thread_name=77fcd6b20711251803j746a965j689063db5d6e4da8% > 40mail.gmail.com&forum_name=opengrads-devel > > Arlindo > > -- > Arlindo da Silva > da...@al... |