001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2006, GeoTools Project Managment Committee (PMC)
005: * (C) 2006, Adrian Custer, assigned to the PMC.
006: *
007: * This file is hereby placed into the Public Domain. This means anyone is
008: * free to do whatever they wish with this file. Use it well and enjoy!
009: */
010:
011: package org.example.geotools.base;
012:
013: import java.awt.Color;
014: import java.io.IOException;
015: import java.net.URI;
016: import java.net.URISyntaxException;
017: import java.net.URL;
018: import java.util.ArrayList;
019: import java.util.HashMap;
020: import java.util.Iterator;
021: import java.util.LinkedList;
022: import java.util.List;
023: import java.util.Map;
024:
025: import org.geotools.catalog.Catalog;
026: import org.geotools.catalog.GeoResource;
027: import org.geotools.catalog.Service;
028: import org.geotools.catalog.defaults.DefaultCatalog;
029: import org.geotools.catalog.defaults.DefaultServiceFinder;
030: import org.geotools.data.FeatureSource;
031: import org.geotools.data.memory.MemoryDataStore;
032: import org.geotools.data.postgis.PostgisDataStoreFactory;
033: import org.geotools.data.shapefile.ShapefileDataStoreFactory;
034: import org.geotools.data.wfs.WFSDataStoreFactory;
035: import org.geotools.demo.mappane.MapViewer;
036: import org.geotools.feature.AttributeType;
037: import org.geotools.feature.AttributeTypeFactory;
038: import org.geotools.feature.Feature;
039: import org.geotools.feature.FeatureType;
040: import org.geotools.feature.FeatureTypes;
041: import org.geotools.feature.GeometryAttributeType;
042: import org.geotools.feature.IllegalAttributeException;
043: import org.geotools.feature.SchemaException;
044: import org.geotools.styling.Graphic;
045: import org.geotools.styling.Mark;
046: import org.geotools.styling.SLDParser;
047: import org.geotools.styling.Style;
048: import org.geotools.styling.StyleBuilder;
049: import org.geotools.styling.StyleFactory;
050: import org.geotools.styling.StyleFactoryFinder;
051: import org.geotools.styling.Symbolizer;
052:
053: import com.vividsolutions.jts.geom.Coordinate;
054: import com.vividsolutions.jts.geom.GeometryFactory;
055: import com.vividsolutions.jts.geom.Point;
056:
057: /**
058: * A demo class illustrating some of the various parts of the geotools api.
059: *
060: * @author Adrian Custer, gnuGIS
061: *
062: * @version 0.03
063: * @since 2.3-M0
064: *
065: */
066: public class DemoData {
067:
068: /**
069: * The List of Features used to store data outside the localCatalog.
070: */
071: List theFeatureList;
072: // List <Feature> theFeatureList;
073:
074: /**
075: * The List of FeatureCollections used to store data outside the localCatalog.
076: */
077: List theFeatureCollectionList;
078: // List <FeatureCollection> theFeatureCollectionList;
079:
080: /**
081: * The List of DataStores used to store data outside the localCatalog.
082: */
083: List theDataStoreList;
084: // List <DataStore> theDataStoreList;
085:
086: /**
087: * The local Catalog used to store the services pointing to data in data stores.
088: */
089: Catalog localCatalog;
090:
091: /**
092: * A Network Catalog used to store the services pointing to data on the network.
093: */
094: Catalog aNetworkCatalog;
095:
096: /**
097: * The Map of Styles used to render the different layers stored as:
098: * String name, Style s.
099: */
100: Map theStyleMap;
101:
102: /**
103: * Creates the demo class and an underlying catalog for storing data.
104: */
105: public DemoData() {
106: theFeatureList = new LinkedList();
107: theFeatureCollectionList = new LinkedList();
108: theDataStoreList = new LinkedList();
109: localCatalog = new DefaultCatalog();
110: aNetworkCatalog = new DefaultCatalog();//TODO: How is this done?
111: theStyleMap = new HashMap();
112: }
113:
114: /**
115: * @return The List used to store data as Features.
116: */
117: public List getFeaturenList() {
118: return theFeatureList;
119: }
120:
121: /**
122: * @return The List used to store data in FeatureCollections.
123: */
124: public List getFeatureCollectionList() {
125: return theFeatureCollectionList;
126: }
127:
128: /**
129: * @return The List used to store data in DataStores.
130: */
131: public List getDataStoreList() {
132: return theDataStoreList;
133: }
134:
135: /**
136: * @return The catalog used to store data.
137: */
138: public Catalog getLocalCatalog() {
139: return localCatalog;
140: }
141:
142: }
|