GeoTools : SIS Meta Infrastructure current software

Current Software

Prepared by:

Paolo Rizzi, AMA - Agenzia Mobilità e Ambiente Milano (Italy)

download from here

Module explanation

I tried to divide up source code and jars with respect to dependencies.
The "GT" present in many file names means a dependency with GeoTools.
Where the "GT" is not present, the module has no dependency at all with GeoTools.
All the code has been ported to GeoTools 2.1, but it hasn't been througly tested yet.

Each zip file contains an Eclipse module plus a simple Ant build file that
jars up the resulting classes and copy it to the SISlib module.
There is no absolute path written inside the projects modules (I hope)
so it should be possible to simply unzip each one inside its own directory
and open them all from Eclipse.
Directories should have the same name of the zips, like this:

The modules also make references to a "GTlib" project that has to contain
all the required GeoTools jars. I didn't included it, but the jars needed are these:

So you also need a directory named something like:

The two jars for PostgreSQL and PostGIS are for the new 8.x version,
but the older ones should work as well, if you have a 7.x PostgreSQL.

Modules listing

  • (sismeta-core.jar, sismetadict-structure.jar)
    This is the central module, that contains the MetaSpace and all the
    other fundamental classes. It also contains the content classes
    used to describe the structure of data. This module has no
    dependency at all with GeoTools.
  • (sisgt-meta.jar)
    This module contains all the classes needed to use the Meta Infrastructure
    with GeoTools. The most important class is GTMetaUtils, that is basically
    a collection of static methods that makes easier the use of MetaSpace with GeoTools.
    It will be divided up in something more organic as soon as possible.
    It has methods to build a FetureType on the fly and to attach DataStores and
    FeatureTypes to MetaSpace.MetaTypes (using the content classes GTMetaSpaceContent
    and GTMetaTypeContent).
    The other important class is DataStoreMetaSpaceLoader, that's capable of loading
    a MetaSpace from a DataStore containing the relevant tables (Meta_Type, Meta_TypeAttr,
    etc.). The other classes are experiments or obsolete.
  • (sisgt-utils.jar)
    This module contains utility classes for use with GT. In Particular there're the
    two classes for binding, but I think it will grow much in the future.
    These classes gives a mean to copy data from Features to Java classes and vice-versa,
    using a mapping like this:
    Feature("road_length") <-> Class.getRoadLength() / Class.setRoadLength()
    The mapping can be automatic or you can specify an arbitrary one.
    Using these classes you no longer have to use feature.getAttribute() or
    feature.setAttribute() (look into the DataStoreMetaSpaceLoader).
    At the moment the mechanism is very simple, but it can be expanded with
    many more functionalities, like Collections/Lists, bytecode generation, etc.
  • (sis-utils.jar)
    This module contains utility classes for use without GT. There're classes for
    adding JARs to the classpath at runtime and the Capsule classes, that I'll plan
    to use for creating various encapsulating DataStores (for Security, Views, etc.).
  • (sisgeom-utils.jar)
    This module contains utility classes for use with Geometries.
  • (sissecurity-core.jar, sismetadict-security.jar)
    This module contains the classes that implements the JAAS security mechanism.
    There are classes that let's you load a MetaSpace with the User relevant information
    using the inheritance engine provided by the MetaSpace. That is to say you can define
    a base simple "User" that has no Roles, you can then derive from it a "Guest" user
    and an "Authenticated" users, and then derive from it all your real users.
    Every Role, or other information, assigned to a User will be inherited by the others.
    The permissions to "SEE", "READ" and "WRITE" a certain FeatureType are instead
    defined inside the definition of the types themselves, and are Role based,
    so for each FeatureType you can say which Role or Roles has rights to SEE, READ
    and WRITE it, and this permissions are also inherited between FeatureTypes.
    I will expand this mechanism to Attribute level permissions and to instance
    level. Also I'll try to expand it to geographical level, so that a Role
    will have certain permissions only inside a certain region.
    This mechanism will also be like a sort of WFS Lock Features in empty space.
    That is, you should be able to "lock" a certain region to work upon it,
    even if there are no Features inside it yet.
  • (sisgt-securitydatastore.jar)
    This module contains a "wrapper" DataStore that imposes security constraints
    on a "wrappee", using the mechanism above.
  • (sisgt-postgisdatastore.jar)
    This is a modified version of the PostgisDataStore, capable of actually doing
    createSchema() using the MetaSpace to get information about the PK Attributes
    to use. It also contains fixes for the table and field names case sensitiveness,
    that has already been rolled in the official PostgisDataStore.
  • (sisserver-core.jar)
    This module contains all the classes that integrates the MetaSpace, GeoServer and
    the JAAS security under JBoss. It's possible to add a DataStore to the server by
    symply throwing a .SAR definition file inside the deploy directory of JBoss.
    This definition file needs only to contain the connection parameters for the DataStore
    and the connection parameters for the DataStore that contains the Meta information
    (we call it a MetaStore). If the Meta information are contained inside the DataStore
    itself, no connection parameters for the MetaStore are needed.
    At the moment the actual instantiation of each DataStore is done by GeoServer.
    We have a Tomcat Valve that intercepts every call to GeoServer and plays with
    its Data and DTO instances adding all the connection parameter from the SAR files.
    It also "stoles" from the GeoServer Data object the DataStores instances and attach
    them to the corresponding MetaSpace instances.
    It also wrap the call inside a JAAS doAsPrivileged() so that all the security mechanism
    has a Subject to work upon.
    This is simply a collection of only the required JBoss jars.
    This module has no source code of its own, but it contains the jars resulting
    from all the other modules, so it's basically a "bin" module.


The file contains the SQL for an example PostGIS Meta DB to give a feeling
of the managed information. It's an excerpt of our actual Meta DB and so it's in Italian.
As soon as possibile we should put up a test DB in English.
I'd also like to put together a working example of a server, so you can deploy it under
JBoss and see it in action. In this very moment it's all a little trapped between GeoTools
2.1 and 2.2 and GeoServer 1.3.0, so I'm not able to do it now.
We also have small Java "main()s" programs that we use to load our system and that can be
good examples of how to use all of the above, but I have to look a bit inside them, because
I'm not sure of their status at the moment.
The same applies for the MIF/MID MIFDataStore and for the SISLocator, that is a service
DataStore capable of transforming addresses into X,Y and the like.

Final notice

All of the above, even if copyright notices are yet to be included
in the source code, is copyrighted by:
"AMA - Agenzia Mobilità e Ambiente Milano (Italy)"
We'll deliver it as Open Source, but we have not yet identified the exact License flavour
so, at the moment, we give anyone only the rights to use it for study, experiment and comment.

Attachments: (application/x-zip-compressed)