On 7/20/05, sent1729 <[EMAIL PROTECTED]> wrote: > Hi all, > > I have two questions: > > 1. Can anyone tell me how to convert GML to SVG format. I have read > articles that says XSLT engine transforms GML to SVG but I dont know > how to go about doing it?
XSLT means using an xslt parser (transformer). You can eg. use the one in PHP if you like to make something serving it dynamically, or use a command line one if you want to generate static data. There are most likely simple GML-to-SVG xsl files out there, so you may be able to just use oneone's work there. Possibly MapServer has it, I don't know. If not, you need to write a bunch of code to eg. turn eg. gml:coordinate 's inside gml:LineString s into a path d="..." element and all that. A possible alternative is using javascript and the DOM inside SVG to convert GML on the fly, a possible trick which I believe http://webgisserver.cnuce.cnr.it/centroSI/progetti/proj_gml.html does. That does mean making a lot of code, though, and I don't actually know the extent of GML. I (ab)used the fact that the GML that GRASS outputs seems to be a very constant and simple subset of real GML, and just coded specifically for it, walking the GML with a DOM implementation and creating SVG as strings on the way, then writing them to files. I did so because I wanted to add id's and mouseover details in a relatively procedural way, though in retrospect xsl would have been managable too. > 2. Can I assign a coordinate projection to SVG viewport. In other > words, after converting the GML data to SVG and viewing it in an SVG > viewer, can I display the lat/lon information of the GIS layer by > pointing mouse on the screen. If it is possibly then how? I'm not sure about this. You can work out where the pixel coordinates the mouse events are in are in your main canvas if you don't do very odd things, but I'm not sure you can avoid rounding or small offset errors. I haven't used it myself because my interface design made it harder yet. --Bart ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

