Henry Chow ha scritto:
> Hi all,
>
> I and the UCOSP team have been working on getting the JUnit tests to
> pass in FeatureSourceTest.java for Ingres for the past few weeks. I am
> happy to report that after implementing the getMapping method in
> IngresDialect.java, I was able to get the following tests to pass:
> testCount, testCountWithOffsetLimit, testGetFeatures,
> testGetFeaturesWithInvalidFilter, testGetFeaturesWithInvalidQuery,
> testQueryCapabilitiesReliableFid.
>
> After specifying the query to align with Ingres database table
> constructs and columns, I was able to get the getMapping method to
> retrieve data from the geometry_columns table in the Ingres database.
> The class mapping is then determined and returned.
>
> Please let me know if you see any problems in the code or if you have
> any question at all!
I had a very quick look at the patches you've committed and this
one looks wrong:
@@ -102,15 +171,18 @@
public boolean includeTable(String schemaName, String tableName,
Connection cx)
throws SQLException {
if (tableName.equals("geometry_columns")) {
- return false;
+ return true;
} else if (tableName.startsWith("spatial_ref_sys")) {
- return false;
+ return true;
} else if (tableName.equals("geography_columns")) {
- return false;
+ return true;
}
+ else if (tableName.equals("ft1")) {
+ return true;
+ }
// others?
- return true;
+ return false;
}
The method was actually ok before the patch: it's there for you
to exclude tables that you don't want the _user_ to see.
Usually you try to hide metadata tables and system tables.
I'm wondering, does INGRES use the same metadata tables as PostGIS?
It does not look like that. Mind that every dialect uses the
database native way to identify the geometry type.
For PostGIS it's actually looking into the geometry_columns table.
For Oracle we have to look into the MDSYS.ALL_SDO_INDEX_METADATA,
since Oracle does not really have a specific geometry type, but
allows the user to specify a type constraint in the spatial index.
What's the native Ingres own way to tell a certain column contains
points?
From what I can see here:
http://community.ingres.com/wiki/SpatialTypes
you have specific type names for each geometry type, so you
should declare your data as "POINT" in the test and make the
getMappings method use the column TYPE_NAME to decide which
kind of geometry it is.
Generally speaking you cannot go and copy methods from another
dialect. Dialects try to factor out the differences between
the various datatabase, so normally each method is implemented
in a different way according to the specific functions, types
and conventions of the database.
Before trying to copy a method have a look in the method
javadoc and in the implementations of the method in 3-4 different
dialects to better understand what the method is supposed to do,
then go an implement the Ingres specific way.
Hope this helps
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel