Search in sources :

Example 36 with PathName

use of com.revolsys.io.PathName in project com.revolsys.open by revolsys.

the class ArcGisRestServerRecordLayer method setLayerDescription.

public void setLayerDescription(final FeatureLayer layerDescription) {
    this.layerDescription = layerDescription;
    if (layerDescription != null) {
        final String name = layerDescription.getName();
        setName(name);
        final UrlResource url = layerDescription.getRootServiceUrl();
        setUrl(url);
        final PathName pathName = layerDescription.getPathName();
        setLayerPath(pathName);
        final long minScale = layerDescription.getMinScale();
        setMinimumScale(minScale);
        final long maxScale = layerDescription.getMaxScale();
        setMaximumScale(maxScale);
    }
}
Also used : UrlResource(com.revolsys.spring.resource.UrlResource) PathName(com.revolsys.io.PathName)

Example 37 with PathName

use of com.revolsys.io.PathName in project com.revolsys.open by revolsys.

the class PathNameEditor method setAsText.

@Override
public void setAsText(final String text) throws IllegalArgumentException {
    final PathName pathName = PathName.newPathName(text);
    setValue(pathName);
}
Also used : PathName(com.revolsys.io.PathName)

Example 38 with PathName

use of com.revolsys.io.PathName in project com.revolsys.open by revolsys.

the class PathTest method assertChildPath.

private void assertChildPath(final String parentPath, final String childPath, final String expected) {
    final String childName = PathUtil.getChildPath(parentPath, childPath);
    Assert.assertEquals(expected, childName);
    final PathName pathName1 = PathName.newPathName(parentPath);
    final PathName pathName2 = PathName.newPathName(childPath);
    if (pathName1 != null) {
        final PathName childPathName = pathName1.getChild(pathName2);
        if (expected == null) {
            Assert.assertNull("getChildPath", childPathName);
        } else {
            Assert.assertEquals("getChildPath " + pathName1 + ", " + pathName2, PathName.newPathName(expected), childPathName);
        }
    }
}
Also used : PathName(com.revolsys.io.PathName)

Example 39 with PathName

use of com.revolsys.io.PathName in project com.revolsys.open by revolsys.

the class PathTest method assertPath.

private void assertPath(final String source, final String expected) {
    final String path = PathUtil.getPath(source);
    Assert.assertEquals(expected, path);
    if (Property.hasValue(source)) {
        final PathName parent = PathName.newPathName(source).getParent();
        if (parent != null) {
            Assert.assertEquals(expected, parent.toString());
        }
    }
}
Also used : PathName(com.revolsys.io.PathName)

Example 40 with PathName

use of com.revolsys.io.PathName in project com.revolsys.open by revolsys.

the class FileGdbRecordStore method refreshSchemaElements.

@Override
protected Map<PathName, ? extends RecordStoreSchemaElement> refreshSchemaElements(final RecordStoreSchema schema) {
    synchronized (this.apiSync) {
        synchronized (API_SYNC) {
            final Map<PathName, RecordStoreSchemaElement> elementsByPath = new TreeMap<>();
            final Geodatabase geodatabase = getGeodatabase();
            if (geodatabase != null) {
                try {
                    final PathName schemaPath = schema.getPathName();
                    final String schemaCatalogPath = getCatalogPath(schema);
                    final VectorOfWString childDatasets = getChildDatasets(geodatabase, schemaCatalogPath, "Feature Dataset");
                    if (childDatasets != null) {
                        for (int i = 0; i < childDatasets.size(); i++) {
                            final String childCatalogPath = childDatasets.get(i);
                            final PathName childPath = toPath(childCatalogPath);
                            RecordStoreSchema childSchema = schema.getSchema(childPath);
                            if (childSchema == null) {
                                childSchema = newFeatureDatasetSchema(schema, childPath);
                            } else {
                                if (childSchema.isInitialized()) {
                                    childSchema.refresh();
                                }
                            }
                            elementsByPath.put(childPath, childSchema);
                        }
                    }
                    if (schemaPath.isParentOf(this.defaultSchemaPath) && !elementsByPath.containsKey(this.defaultSchemaPath)) {
                        final SpatialReference spatialReference = getSpatialReference(getGeometryFactory());
                        final RecordStoreSchema childSchema = newSchema(this.defaultSchemaPath, spatialReference);
                        elementsByPath.put(this.defaultSchemaPath, childSchema);
                    }
                    if (schema.equalPath(this.defaultSchemaPath)) {
                        refreshSchemaRecordDefinitions(elementsByPath, schemaPath, "\\", "Feature Class");
                        refreshSchemaRecordDefinitions(elementsByPath, schemaPath, "\\", "Table");
                    }
                    refreshSchemaRecordDefinitions(elementsByPath, schemaPath, schemaCatalogPath, "Feature Class");
                    refreshSchemaRecordDefinitions(elementsByPath, schemaPath, schemaCatalogPath, "Table");
                } finally {
                    releaseGeodatabase();
                }
            }
            return elementsByPath;
        }
    }
}
Also used : Geodatabase(com.revolsys.gis.esri.gdb.file.capi.swig.Geodatabase) VectorOfWString(com.revolsys.gis.esri.gdb.file.capi.swig.VectorOfWString) RecordStoreSchema(com.revolsys.record.schema.RecordStoreSchema) SpatialReference(com.revolsys.record.io.format.esri.gdb.xml.model.SpatialReference) PathName(com.revolsys.io.PathName) VectorOfWString(com.revolsys.gis.esri.gdb.file.capi.swig.VectorOfWString) TreeMap(java.util.TreeMap) RecordStoreSchemaElement(com.revolsys.record.schema.RecordStoreSchemaElement)

Aggregations

PathName (com.revolsys.io.PathName)64 FieldDefinition (com.revolsys.record.schema.FieldDefinition)15 RecordDefinitionImpl (com.revolsys.record.schema.RecordDefinitionImpl)14 DataType (com.revolsys.datatype.DataType)13 RecordDefinition (com.revolsys.record.schema.RecordDefinition)13 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)12 RecordStoreSchema (com.revolsys.record.schema.RecordStoreSchema)11 VectorOfWString (com.revolsys.gis.esri.gdb.file.capi.swig.VectorOfWString)9 RecordStoreSchemaElement (com.revolsys.record.schema.RecordStoreSchemaElement)7 ArrayList (java.util.ArrayList)7 TreeMap (java.util.TreeMap)7 MapEx (com.revolsys.collection.map.MapEx)5 ResultSet (java.sql.ResultSet)5 Geodatabase (com.revolsys.gis.esri.gdb.file.capi.swig.Geodatabase)4 Identifier (com.revolsys.identifier.Identifier)4 JdbcConnection (com.revolsys.jdbc.JdbcConnection)4 Record (com.revolsys.record.Record)4 File (java.io.File)4 PreparedStatement (java.sql.PreparedStatement)4 Geometry (com.revolsys.geometry.model.Geometry)3