use of org.geotools.data.ResourceInfo in project polymap4-core by Polymap4.
the class AbstractFeatureSource method getInfo.
public ResourceInfo getInfo() {
return new ResourceInfo() {
final Set<String> words = new HashSet<String>();
{
words.add("features");
words.add(AbstractFeatureSource.this.getTypeName());
}
public ReferencedEnvelope getBounds() {
try {
return AbstractFeatureSource.this.getBounds();
} catch (IOException e) {
return null;
}
}
public CoordinateReferenceSystem getCRS() {
return AbstractFeatureSource.this.getSchema().getCoordinateReferenceSystem();
}
public String getDescription() {
return null;
}
public Set<String> getKeywords() {
return words;
}
public String getName() {
return AbstractFeatureSource.this.getTypeName();
}
public URI getSchema() {
Name name = AbstractFeatureSource.this.getSchema().getName();
URI namespace;
try {
namespace = new URI(name.getNamespaceURI());
return namespace;
} catch (URISyntaxException e) {
return null;
}
}
public String getTitle() {
Name name = AbstractFeatureSource.this.getSchema().getName();
return name.getLocalPart();
}
};
}
use of org.geotools.data.ResourceInfo in project polymap4-core by Polymap4.
the class GridServiceInfo method main.
// test ***********************************************
public static void main(String[] args) throws Exception {
// File f = new File( "/home/falko/Data/tiff/bluemarble.tif" );
File f = new File("/home/falko/Data/ncrast/elevation_4326.tif");
AbstractGridCoverage2DReader reader = GridCoverageReaderFactory.open(f);
System.out.println("reader: " + reader);
System.out.println("reader: " + reader.getInfo().getSource());
System.out.println("reader: " + reader.getInfo().getTitle());
System.out.println("reader: " + Arrays.asList(reader.getGridCoverageNames()));
System.out.println("reader: " + reader.getFormat().getName());
System.out.println("reader: " + reader.getCoordinateReferenceSystem());
System.out.println("reader: " + reader.getOriginalEnvelope());
System.out.println("reader: " + reader.getOriginalGridRange());
for (String name : reader.getGridCoverageNames()) {
ResourceInfo info = reader.getInfo(name);
System.out.println("coverage: " + info.getTitle());
System.out.println("coverage: " + info.getName());
System.out.println("coverage: " + info.getDescription());
System.out.println("coverage: " + info.getBounds());
}
reader.dispose();
}
use of org.geotools.data.ResourceInfo in project polymap4-core by Polymap4.
the class WfsServiceInfo method getResources.
@Override
public Iterable<IResourceInfo> getResources(IProgressMonitor monitor) throws Exception {
List<IResourceInfo> result = new ArrayList();
for (Name name : ds.getNames()) {
ResourceInfo info = ds.getFeatureSource(name).getInfo();
result.add(new WfsResourceInfo(this, info));
}
return result;
}
Aggregations