From: markkrawitz <mar...@we...> - 2014-07-23 17:52:41
|
Sorry for double-posting, but i just got my subscription for the mailing list :) Hi, i'm currently trying to export some Files in GML. The export works fine so far and i can import the .gml-files in QGIS, but other tools fail because of the validation. What i've done so far: 1. Create a custom SimpleFeatureType TYPE with a SimpleFeatureTypeBuilder and add some attributes (some Strings, Integers and finally a Geometry with Polygons, Multiparts, Linestrings, ect.) --> builder.add("myattribute", String.class) builder.build..... 2. Get an instance of GML and write a schema file, something like: FileOutputStream fos= new FileOutputStream(new File(c:/test/schema.xsd); GML enc = new GML(Version.GML2); enc.setBaseURL(new URL("http://localhost/")); enc.encode(fos, TYPE); 3. Create a lot of Features and store them in a DefaultFeatureCollection 4. Write the GML of the DefaultFeatureCollection with a new FileOutputStream. The .xsd-File contains only the definition for my SimpleFeatureType, but the (outer) FeatureCollection is missing. If i export the same data with a tool like Quantum GIS, i get a schema-file which contains my own feature type and the feature collection. These files also pass validation in most tools. Is there a mistake in my strategy or is this a known problem? Which strategy should i use to export a valid .gml- and .xsd-File? The tool to import the .gml-files is FME Desktop and i'm currently using the geotools 10.5-release, if that could be part of the problem. Thanks for your answers, i'm already trying to solve this problem for several hours and have tried different Versions of GML, but still can't find any solution. Cheers, Mark -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Problems-with-XSD-Files-for-GML-tp5152871p5152872.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |