Package org.geotools.data.complex

Examples of org.geotools.data.complex.AppSchemaDataAccess


     * relative paths to the data
     */
    @Test
    public void testShapeMappings() throws Exception {
        String mappingFileNameRelativeShape = "ArchSiteNillable.xml";
        AppSchemaDataAccess dSRelative = null;
        try {
            // create the DataAccess based on shapefile configured with a relative path
            dSRelative = buildDataAccess(mappingFileNameRelativeShape);

            // there should be a single target feature in this data access
            assertEquals(1, dSRelative.getNames().size());

            // there should be 25 features in this data access
            assertEquals(25, countFeatures(dSRelative));
        } finally {
            if (dSRelative != null) {
                dSRelative.dispose();
            }
        }
    }
View Full Code Here


    public void testShapeMappingsAbsolute() throws Exception {
        String mappingFileNameRelativeShape = "ArchSiteNillable.xml";
        String configFilePathRelativeShape = getTestDirPath(mappingFileNameRelativeShape);
        String mappingFileNameAbsoluteShape = "ArchSiteAbsolute.xml";
        String configFilePathAbsoluteShape = getTestDirPath(mappingFileNameAbsoluteShape);
        AppSchemaDataAccess dSAbsolute = null;
        try {
            // now lets test a mapping file with an absolute path to the shapefile
            // because we don't know the absolute path in advance, we must create the mapping file
            copyRelativeToAbsolute(configFilePathRelativeShape, configFilePathAbsoluteShape);

            // create the DataAccess based on shapefile configured with a absolute path
            dSAbsolute = buildDataAccess(mappingFileNameAbsoluteShape);

            // there should be a single target feature in this data access
            assertEquals(1, dSAbsolute.getNames().size());

            // there should be 25 features in this data access
            assertEquals(25, countFeatures(dSAbsolute));
        } finally {
            if (dSAbsolute != null) {
                dSAbsolute.dispose();
            }
        }
    }
View Full Code Here

     * around with shapefiles.
     */
    @Test
    public void testPropertiesMappings() throws Exception {
        String mappingFileNameRelativeProperties = "AppSchemaFileDataTest.xml";
        AppSchemaDataAccess dSRelative = null;
        try {
            // create the DataAccess based on properties file configured with a relative path
            dSRelative = buildDataAccess(mappingFileNameRelativeProperties);

            // there should be a single target feature in this data access
            assertEquals(1, dSRelative.getNames().size());

            // there should be 2 features in this data access
            assertEquals(2, countFeatures(dSRelative));
        } finally {
            if (dSRelative != null) {
                dSRelative.dispose();
            }
        }
    }
View Full Code Here

    public void testPropertiesMappingsAbsolute() throws Exception {
        String mappingFileNameRelativeProperties = "AppSchemaFileDataTest.xml";
        String configFilePathRelativeProperties = getTestDirPath(mappingFileNameRelativeProperties);
        String mappingFileNameAbsoluteProperties = "AppSchemaFileDataTestAbsolute.xml";
        String configFilePathAbsoluteProperties = getTestDirPath(mappingFileNameAbsoluteProperties);
        AppSchemaDataAccess dSAbsolute = null;
        try {
            // now let's test a mapping file with an absolute path to the properties file
            // because we don't know the absolute path in advance, we must create the mapping file
            copyRelativeToAbsolute(configFilePathRelativeProperties,
                    configFilePathAbsoluteProperties);

            // create the DataAccess based on properties file configured with a absolute path
            dSAbsolute = buildDataAccess(mappingFileNameAbsoluteProperties);

            // there should be a single target feature in this data access
            assertEquals(1, dSAbsolute.getNames().size());

            // there should be 2 features in this data access
            assertEquals(2, countFeatures(dSAbsolute));
        } finally {
            if (dSAbsolute != null) {
                dSAbsolute.dispose();
            }
        }
    }
View Full Code Here

        AppSchemaDataAccessDTO config = configReader.parse(configFileUrl);

        // generate the set of mappings needed to build the application-schema datastore
        Set<FeatureTypeMapping> mappings;
        mappings = AppSchemaDataAccessConfigurator.buildMappings(config);
        AppSchemaDataAccess datastore = new AppSchemaDataAccess(mappings);

        return datastore;
    }
View Full Code Here

    @Test
    public void testPropertyNameWithXlinkAttribute() throws Exception {
        final String XMMLNS = "http://www.opengis.net/xmml";
        final Name typeName = new NameImpl(XMMLNS, "Borehole");
       
        AppSchemaDataAccess complexDs = (AppSchemaDataAccess) mappingDataStore;
       
        mapping = complexDs.getMappingByElement(typeName);

        NamespaceSupport namespaces = new NamespaceSupport();
        namespaces.declarePrefix("gml", GML.NAMESPACE);
        namespaces.declarePrefix("xmml", XMMLNS);
        namespaces.declarePrefix("xlink", XLINK.NAMESPACE);
View Full Code Here

    @Test
    public void testPropertyNameWithGmlIdAttribute() throws Exception {
        final String XMMLNS = "http://www.opengis.net/xmml";
        final Name typeName = new NameImpl(XMMLNS, "Borehole");

        AppSchemaDataAccess complexDs = (AppSchemaDataAccess) mappingDataStore;

        mapping = complexDs.getMappingByElement(typeName);

        NamespaceSupport namespaces = new NamespaceSupport();
        namespaces.declarePrefix("gml", GML.NAMESPACE);
        namespaces.declarePrefix("xmml", XMMLNS);
        namespaces.declarePrefix("xlink", XLINK.NAMESPACE);
View Full Code Here

    @Test
    public void testCompareFilterMultipleMappingsPerPropertyName() throws Exception {
        final String XMMLNS = "http://www.opengis.net/xmml";
        final Name typeName = new NameImpl(XMMLNS, "Borehole");
       
        AppSchemaDataAccess complexDs = (AppSchemaDataAccess) mappingDataStore;
        mapping = complexDs.getMappingByElement(typeName);

        NamespaceSupport namespaces = new NamespaceSupport();
        namespaces.declarePrefix("gml", GML.NAMESPACE);
        namespaces.declarePrefix("xmml", XMMLNS);
View Full Code Here

TOP

Related Classes of org.geotools.data.complex.AppSchemaDataAccess

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.