You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sis.apache.org by Martin Desruisseaux <ma...@geomatys.com> on 2019/02/15 10:40:55 UTC

Re: [geotk] Migration from geotk 3.20 to Apache SIS

Hello Christophe

(I took the liberty to copy to user@sis.apache.org)

Le 15/02/2019 à 11:10, Christoph Steinforth a écrit :

> currently we are trying to migrate a project which uses geotk 3.20 to
> the Apache SIS. We removed all the imports org.geotoolkit.* in order
> to let the Eclipse IDE pick up the new imports from Apache SIS. Is
> this the proper way to handle this, or do we need to delve deeper into
> the actual classes to prevent crashes beforehand?
>
Good! The approach you describe should work for many classes, especially
in metadata and referencing packages. On the feature package however the
changes are more significant.


> The second questions concerns some classes from the former
> org.getoolkit.feature.type package (e.g. DefaulAssociationType), which
> does not seem to have a replacement in SIS (maybe I haven't found it
> yet, so please apologize). Is there a replacement for those classes
> already available, or is this some work in progress?

The replacement for DefaultAssociationType is DefaultAssociationRole
[1]. I'm not sure it works the same however. The SIS classes are modeled
according ISO 19109, contrarily to the Geotk classes which were modeled
according an XML schema. At a first look the SIS model may seem
incomplete because it has fewer classes than the Geotk model. In
particular there is nothing special about "simple features" versus
"complex features"; there is only "features". But despite appearance,
the feature model in Apache SIS 0.8 should be complete (except for the
"Moving Features" part, but this is another topic). It should have
equivalent capability for the main tasks, while consuming less memory
and being about twice faster [2]. Do not hesitate to ask if you have any
question!

    Regards,

        Martin

[1] http://sis.apache.org/apidocs/org/apache/sis/feature/DefaultAssociationRole.html
[2] http://htmlpreview.github.io/?https://raw.githubusercontent.com/apache/sis/master/core/sis-feature/src/main/java/org/apache/sis/feature/benchmarks.html


Re: [geotk] Migration from geotk 3.20 to Apache SIS

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Le 15/02/2019 à 12:12, Christoph Steinforth a écrit :

> If I get this right
>
>     In particular there is nothing special about "simple features"
>     versus "complex features"; there is only "features".
>
> something like 
>
>     public class DefaultComplexType extends
>     DefaultAttributeType<AttributeType> implements ComplexType
>
> which is taken from geotk 3.20 is not present in SIS anymore?
>
Right. There is no more ComplexType in SIS. All attributes and features
can potentially be complex. "Simple features" in Geotk were features in
which all attributes are restricted to [1…1] multiplicity, while
"complex features" are everything else. SIS no longer define particular
classes or interfaces for those two cases. Given an AbstractFeature
instance, we can invoke getProperty(name). The result can be an instance
of AbstractAttribute, which provides two methods:

  * getValue() returning a single value and throwing
    IllegalStateException if the attribute contains more than one value.
  * getValues() returning a collection.

Alternatively, AbstractFeature.getPropertyValue(name) [1] can be used as
a shortcut. The return value will be the value directly if the
multiplicity declared in AttributeType is [0…0], [0…1] or [1…1], and a
collection otherwise.

    Martin

[1] http://sis.apache.org/apidocs/org/apache/sis/feature/AbstractFeature.html#getPropertyValue-java.lang.String-