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 -- Justin Deoliveira OpenGeo - http://opengeo.org Enterprise support for open source geospatial. ------------------------------------------------------------------------------ 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
