Hi Justin, all
thanks for that, my mistake I did not notice that. I will give it a try, 
although in the meantime I solved the issue using some local workarounds.
Now I have a different problem - I am acquiring a FeatureCollection as a 
result of some processing, where features included have some attributes. 
I need to output the Features in GML. I was using MultiPolygon for my 
needs, as ultimately the result IS a MultiPolygon. I however, don't know 
how best to handle the attributes. My understanding is that I need to 
declare a new complex XML element that will have GML  geometry and any 
other attributes. The problem is that there may be different values for 
the attribute for each of the Polygons contained. Hence, it would 
probably be better to declare the geometry as a collection of Polygons 
somehow.
Does anyone have a GML 3.1.1 example doing something like that? I find 
it incredibely difficult to find examples for GML3.1.1, and the schemas 
are much more complex then anything in GML2.

Thanks
Martin


Justin Deoliveira wrote:
> Nope, it does gml 3 as well, you just have to use a different 
> configuration.
>
> org.geotools.gml2.GMLConfiguration vs
> org.geotools.gml3.GMLConfiguration
>
> -Justin
>
> Martin Tomko wrote:
>> 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
>>>
>>>
>>
>>
>
>


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to