I'm using GeoTools v2.7.0.1 and having issues with GML encoding. I have tried 
both the gml2.GMLConfiguration with the org.geotools.xml.Encoder class and also 
the org.geotools.GML utility class.
> 
> 
> 

Cool; hopefully I will learn something from your example. The GML utility class 
is just trying to package up the best way to do things.
> 
> 1. Could you please point out what may be wrong with the following GML2 
> encoding example.
> 
> 
> 

Looks like you have a schema; so that is the first hurdle. GML2 does not 
provide a feature collection; but it looks like you have done that.
Q: does your feature collection extend abstract feature collection?

The GeoTools SimpleFeatureCollection does not handle mixed feature types for 
the children (your single "feature type" can have a geometry; allowing it to 
store point, line or polygon information).

This restriction only applies to SimpleFeatureCollection; but for more details 
you need to talk to the app-schema developers.
>  Also, does the structure of the SimpleFeatureCollection (how the simple 
> feature types are created) impact the ability to encode with a particular 
> schema?
> 
> 
> 

This is a place where I am not always sure; it looks like some of the encoders 
can recognise extra hints provided in:
- attribute / feature getUserData() - not completely sure what is stored here; 
mostly used for application schema work?
- Geometry.getUserData() - sometimes this is a CoordianteReferenceSystem or a 
String indicating the srsName 
> 2. Since I am trying to represent a feature collection using GML that can 
> contain mixed types and the features will have some custom  
> attributes/properties (like GeoJSON), is there an exising defacto "standard" 
> feature collection GML-based schema that can be leveraged (like  some WFS 
> feature collection schema)?
> 
> 
> 


It depends on the configuration; GML2 does not provide one, WFS1.1, WFS1.2 and 
GML3 do provide a generic feature collection to hold stuff.
> 3. I do not see any encoding examples in 
> http://svn.osgeo.org/geotools/trunk/modules/extension/xsd/xsd-gml2/src/test/java/org/geotools/gml2/GMLApplicationSchemaParsingTest.java
>  nor  in any of the other test files inside that package.
> 
> 
> 

You will need to talk to the module maintainer then; or explore some of the 
other packages for an encoding example. 

Cheers,
Jody


------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to