Hi Justin, thank you for the suggestion. Unfortunately, I think the parser in Geotools (as per 2.5. documentation) is only fit for GML 2.X, is that right? Thanks Martin
Justin Deoliveira wrote: > Hi, > > Looks like you are running up against the property reference pattern > in GML, it is used quite extensively. I can't really comment on the > XMLBeans stuff, our GML parsing uses a different engine. If interested > here is the way you could parse a geometry: > > import org.geotools.gml3.GMLConfiguration; > import org.geotools.xml.Parser; > > GMLConfiguration gml = new GMLConfiguration(); > Parser p = new Parser(gml); > > Polygon p = (Polygon) p.parse( ... ); > > -Justin > > Martin Tomko wrote: >> Possibly a topic not fitting well to Geotools, but I thought that >> people here may know... >> >> I need to get from GML geometry to JTS geometry, and I am using >> custom XML beans generated from GML and a custom parser. It works >> fine most of the time, but today I run into a wall: I have a GML >> element in my xsd, importing GML (feature.xsd) in order tohave an >> element as follows: >> >> <xsd:element name="MyGeometry" type="gml:GeometryPropertyType" >> minOccurs="0"> >> >> When reading this element in XML beans, tI can extract the >> GeometryPropertyType gpt, and from it I can do >> AbstractGeometryType ageom = gpt.getGeometry >> I have troubles to cast from the AbstractGeometryType to a >> PolygonType (I am certain that what comes in is a polygon). >> I wonder if this is a more common problem with GML 3.1.1 ( I seem to >> have found some indications in that respect) or my problem in the >> declaration of the geometry. >> >> Thanks, and apologies if this is not the appropriate forum. >> Martin >> >> ------------------------------------------------------------------------------ >> >> >> Stay on top of everything new and different, both inside and around >> Java (TM) technology - register by April 22, and save >> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. >> 300 plus technical and hands-on sessions. Register today. Use >> priority code J9JMT32. http://p.sf.net/sfu/p >> _______________________________________________ >> Geotools-gt2-users mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > -- Martin Tomko Postdoctoral Research Assistant Geographic Information Systems Division Department of Geography University of Zurich - Irchel Winterthurerstr. 190 CH-8057 Zurich, Switzerland email: [email protected] site: http://www.geo.uzh.ch/~mtomko mob: +41-788 629 558 tel: +41-44-6355256 fax: +41-44-6356848 ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
