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

Sorry it is going to be a slog to work through. As I mentioned you will have 
company next week.

> 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.

Right so I committed that fix.

The part that confused me was where you wrote:

public class Extent extends org.geotools.data.wms.xml.Extent {
....
}

I could not tell what "Extent" was extending org.geotools.data.wms.xml.Extent.


> 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>

Right.

> 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.

Agreed; so that is fixed.

> 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.

Returning something more meaningful (such as a "range") can be a topic for 
another day; and indeed I hope you can contribute some useful methods to the 
Extent class as you need to?

The part that confused me was just in terms of the code example I listed above.
 
Jody

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

_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to