01: package org.geotools.demo.metadata.example;
02:
03: import java.util.Collection;
04: import java.util.Collections;
05: import java.util.Date;
06: import java.util.Locale;
07:
08: import org.geotools.metadata.iso.citation.CitationImpl;
09: import org.geotools.metadata.iso.citation.Citations;
10: import org.geotools.metadata.iso.citation.ResponsiblePartyImpl;
11: import org.geotools.metadata.iso.citation.TelephoneImpl;
12: import org.geotools.referencing.crs.DefaultGeographicCRS;
13: import org.opengis.metadata.citation.Citation;
14: import org.opengis.referencing.crs.CoordinateReferenceSystem;
15:
16: public class MetadataExample {
17:
18: public static void referenceDocument(Citation citation) {
19: System.out.println(citation.getTitle());
20: System.out.println(citation.getTitle().toString(Locale.FRENCH));
21:
22: System.out.println(citation.getIdentifiers());
23: System.out.println(citation.getAlternateTitles());
24: }
25:
26: public static void telephone() {
27: TelephoneImpl phone = new TelephoneImpl();
28: phone.setVoices(Collections.singleton("555-1234"));
29: phone.setFacsimiles(Collections.singleton("555-2FAX"));
30: System.out.println(phone);
31: }
32:
33: public static void wkt() {
34: CoordinateReferenceSystem crs = DefaultGeographicCRS.WGS84;
35: System.out.println(crs.toWKT());
36: }
37:
38: public static void main(String[] args) {
39: referenceDocument(Citations.EPSG);
40: referenceDocument(Citations.OGC);
41: referenceDocument(Citations.ORACLE);
42:
43: CitationImpl citation = new CitationImpl();
44: citation.setEditionDate(new Date()); // today
45:
46: Collection parties = Collections
47: .singleton(ResponsiblePartyImpl.GEOTOOLS);
48: citation.setCitedResponsibleParties(parties);
49:
50: referenceDocument(Citations.ORACLE);
51:
52: telephone();
53: wkt();
54: }
55: }
|