From: <suj...@en...> - 2006-08-30 19:01:10
|
Hi!! First of all, thanks to everybody for being so helpful. I am new in Geotools environment. I am changing an application from SVG to geotools. Currently I have two problems. 1)I have a basic SVG map file that need to be rendered on Geotool canvas. Is it possible? I will highly appreciate if somebody can give any hint of regarding it. 2) I have some information on cities in an xml format. Is it possible to render it as a layer on top by Geotools. Best Regards Sujoy |
From: Andrea A. <and...@al...> - 2006-08-31 13:26:17
|
suj...@en... ha scritto: > Hi!! > > First of all, thanks to everybody for being so helpful. I am new in > Geotools environment. I am changing an application from SVG to geotools. > Currently I have two problems. > > 1)I have a basic SVG map file that need to be rendered on Geotool > canvas. Is it possible? I will highly appreciate if somebody can give > any hint of regarding it. Not thru Geotools, at least in a scalable manner. Geotools renderer need Features, which you can think as records, containing attributes and geometries. We do have various DataStore implementations that allow to turn some data formats, such as shapefiles, oracle databases and the like, into features. SVG in not in the same leagues as Features thought, since it's not data usually, but a way to render it into a vector format. So no, we don't have at the moment any way to turn SVG into features. With the new pluggable renderer subsystem you will be able to add new layers types other than feature based ones, such as SVG layers, but at the moment any modification requires you to alter the rendering code. Btw, the current renderer code in trunk and 2.2.1-SNAPSHOT is able to render SVG as icons, but it's not the same thing, as a icon is used to depict a point usually, and you have to provide a fixed dimension in pixels for the icon in the layer style descriptor, so I guess it won't handle your case properly. > 2) I have some information on cities in an xml format. Is it possible > to render it as a layer on top by Geotools. Provided that the XML file can be turned into a feature collection, yes, you can render it. There are two ways to do that: a) interpret the XML by yourself and do build feature out of them, then store them into a feature collection you'll use as the data for your map layer b) turn the XML into something a geotools datastore can interpret, for example by applying an XSLT transform on it to turn it into standard GML. Btw, both solutions could be applied to the SVG file as well. There are talks about GML to SVG transforms on the web, but it's not trivial stuff, and you would need the opposite transform anyway (something hard to find since usually you go from content to representation, not the opposite). Cheers Andrea Aime |
From: Gabriel <gr...@ax...> - 2006-09-01 19:00:08
|
> b) turn the XML into something a geotools datastore can interpret, for > example by applying an XSLT transform on it to turn it into standard > GML. > > Btw, both solutions could be applied to the SVG file as well. There > are talks about GML to SVG transforms on the web, but it's not trivial > stuff, and you would need the opposite transform anyway (something hard to > find since usually you go from content to representation, not the > opposite). > Actually I think Mr Sujoy could use b) as a only once process, since he sai= d=20 he's migrating from svg to geotools, so it makes sence to convert all his=20 data once and to work on a datastore from there. Sujoy, I think it could be easier for you to write a Java program that=20 performs the conversion, instead of an XSLT (at least it would be for me :) Say, you can write a program that loads your SVG data into a DOM and then=20 write to a properties file. I say to write a java program because I wouldn'= t=20 know how to convert an SVG path to GML coordinates using xslt, but may be i= ts=20 possible. And yes, as a starting point you can write to a single .properties file if = you=20 don't want to deal with the complexities of Gml. We have a properties file= =20 DataStore the demo/properties. The format used to store the geometries is=20 simply WKT, that you get obtain from the JTS Geometry once you managed to=20 parse the SVG path or other element into a JTS Polygon, LineString, etc. So, once you have the features in properties, it will be very easy to expor= t=20 them to a more robust storage like a postgis database or even shapefiles. my 2c. Gabriel > Cheers > Andrea Aime > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users =2D-=20 Gabriel Rold=E1n (gr...@ax...) Axios Engineering (http://www.axios.es) Tel. +34 944 41 63 84 =46ax. +34 944 41 64 90 |