On Thu, May 20, 2010 at 5:17 PM, Jody Garnett <jody.garn...@gmail.com> wrote:
> Okay let me try again ...
> gt-wms
> ======
> org.geotools.data.wms.xml.Extent
> -this is a class it does not implement any interfaces
> - the isEmpty fix is applied here :-)
> - this is the end of the line no modules depend on wms so nothing can extent

Hi Jody,

thanks a bunch for pointing me to the right direction and helping me
to understand what it is that makes Geotools' parsing work.

What you wrote above is correct, but you quite lost me with the rest
of the email. I assume that you already started to think ahead on what
Extent should actually be returning instead of just raw values, but
just to be sure I'll reiterate what we are doing so we know we are on
same page.

>From the beginning:

The class where the change for isEmpty method is made is:

org.geotools.data.wms.xml.Extent

Like you already wrote it too.

Currently code there reads:

public boolean isEmpty() {
        return value != null && value.length() > 0;
}

So this is quite the opposite of what is needed.


Why does it matter to us?

We are using WMSGetCapabilitiesResponse (
org.geotools.data.wms.response ) to parse response file.
WMSGetCapabilitiesResponse uses DocumentFactory to parse the xml and
passes in WMSSchema as hints / bindings to java-objects. The actual
code that parses each Dimension element in getCapabilities response is
in WMSComplexTypes.java.

Looking at the code starting from line 3106 ( _DimensionType
definition ) we see in getValue method that finally on line 3199
parsing is passed on to _ExtentType and that returns an Extent object.
This Extent object represents the data inside the dimension element,
for example in following example:

<wms:Dimension name="time" units="ISO8601">
                   2025-01-01/2055-01-01/2085-01-01
</wms:Dimension>

Extent is "2025-01-01/2055-01-01/2085-01-01" describing bounds of time
dimension for this map layer.

Parsing the extent works fine and the object is set just right.

Problem happens on line 3200, where it is tested whether Extent-object
is empty or not.

In current implementation Extent object's isEmpty returns true, even
though there is data set.


Getting just the raw value from the extent is for now sufficient for
us, we parse the data on our own and try to make sense of the
specification. If we get insights on what and how the Extent should
return something more meaningful ( for example some kind of objects
describing time ranges etc. ) we can collaborate and could easily give
whatever code we have to be used in Geotools.


-huima

------------------------------------------------------------------------------

_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to