[udig-devel] OSMM GML loading - null pointer
Gabriel Roldán
groldan at axios.es
Tue Sep 11 03:05:35 PDT 2007
uh, oh, sorry I replied too early, seems didn't get to the end of the message.
ok, I might have found some light at the end of the tunnel for you.
So you're using:
Configuration configuration = new GMLConfiguration();
Parser parser = new Parser( configuration );
...
AFAIK, using a plain GMLConfiguration will only get you a configuration that
knows where to obtain the gml schemas from. I.e. that configuration has no
location resolver that can handle other schema locations.
You could use org.geotools.gml3.ApplicationSchemaConfiguration as long as you
know the namespace and location of the root schema, like this:
String namsepace = ...
String schemaLocation = ...
Configuration configuration = new ApplicationSchemaConfiguration(namespace,
schemaLocation);
Parser parser = new Parser( configuration );
...
Now, I know Justin has some code as to inferr that directly from the gml file
being parsed, but I don't quite remember where it is off the top of my head,
though I'm pretty positive you have to use a GMLDataStore from the gml3
module in /unsupported and it'll do the job for you
Justin, am I right?
Gabriel
On Tuesday 11 September 2007 10:06:05 Vince Darley wrote:
> At 08:39 11/09/2007, Gabriel Roldán wrote:
> >seems to be simply that the schema referenced by the gml file is not
> >accessible.
>
> That's what we thought/assumed, and that's why Yann wrote this:
>
> On Monday 10 September 2007 19:48:55 Yann Semet wrote:
> > > We did check that the urls for the .xsd files are indeed correct. We
> > > also tried to modify these urls to point directly on the hard drive, in
> > > the .gml file containing folder where copies of all the necessary .xsd
> > > files were present as well. Nothing we tried proved successful yet and
> > > we found no way yet to get our hands on the actual features. There
> > > seems to be a problem in the hierarchical resolution of xsd file names
> > > to their actual physical locations.
>
> But none of that worked. So, what we're really asking is this:
> > > Being newcomers, we're a little confused as to what the step we missed
> > > actually is. Are we facing a simple path problem (just letting the
> > > parser know where to look for .xsd files) or do we need to write a
> > > bunch of code to allow the parser to correctly work with our data? In
> > > particular, do we simply need to override stuff as suggested in
> > > http://docs.codehaus.org/display/GEOTDOC/2+SchemaLocationResolver+and+S
> > >chem a Locator ?
>
> Note: we can easily supply all these schemas and
> the sample GML file to anyone who thinks they know how this should work.
>
> cheers,
>
> Vince.
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
More information about the udig-devel
mailing list