-
Notifications
You must be signed in to change notification settings - Fork 3
Reference
For better or worse the giscore factory methods use variable argument lists. This makes it hard to understand the calling sequences. The following explain the calling sequence for each document type. For each of the following, the call is assumed to be of the form:
GISFactory.getInputStream(DocumentType.<TYPE>,<inputStream>,arguments...) for the Input cases below or GISFactory.getOutputStream(DocumentType.<TYPE>,<outputStream>,arguments...) for the Output cases belowWhere <TYPE> is one the types in the list below, and <inputStream> is an appropriate input stream as documented or <outputStream> is an appropriate OutputStream as documented.
The FileGDB implementation and the Shapefile input implementation use the ESRI library for support and only work on Windows at this point. The other implementations are written in Java and will work on any platform as far as we know.
Arguments are marked (*) for required, or unmarked if not required.
Document Type |
Input Stream |
Input Arguments |
Output Stream |
Output Arguments |
CSV |
InputStream |
Schema String lineDelin Character valueDelim Character quote char |
OutputStream |
String lineDelin Character valueDelim Character quote char Boolean skipHeader |
FileGDB |
ZipInputStream |
IAcceptSchema |
ZipOutputStream |
File(*) IContainerNameStrategy |
GeoAtom | InputStream | n/a | OutputStream | n/a |
KML |
InputStream |
n/a |
OutputStream |
String encoding |
KMZ |
(1) |
n/a |
OutputStream |
String encoding |
Shapefile | ZipInputStream or InputStream(2) |
IAcceptSchema |
ZipOutputStream(3) |
File(*) IContainerNameStrategy PointShapeMapper |
WKT |
InputStream |
n/a |
OutputStream |
File |
XMLGDB |
n/a |
n/a |
OutputStream |
n/a |
(1) KMZ type cannot be passed into GISFactory.getInputStream() but if caller parses a KMZ file and gets an InputStream to the KML content then that may be passed to GISFactory.getInputStream() with KML type from which to parse its features. Otherwise use KmlReader to transparently parse KMZ content directly.
(2)You can pass an input stream that points to either a zip file containing a directory that holds one or more sets of shapefile files, or you can pass an input stream pointing to a single .shp file
(3) Note, if you pass null as the output stream for the shapefile then the shapefiles will be written to the output directory but no output stream will be written. A useful option at times.
There are also input factory methods to read some document types as files for both convenience and efficiency reasons. It hardly makes sense to zip up a shapefile, filegdb or other GIS file just to read it in. The general outline looks like this:
IGISInputStream stream = GISFactory.getInputStream(DocumentType.<TYPE>, File <dirOrFile>, <varargs>);The following table describes the file argument and varargs taken for each supported type:
DocumentType |
File |
Arguments |
KML |
KML File |
n/a |
Shapefile |
Directory holding shapefiles |
IAcceptSchema |
FileGDB |
Directory holding GDB |
IAcceptSchema |
CSV |
CSV File |
Schema String Character Character |
Note KmlReader and KmlWriter are advanced helper classes that are not accessible via the GISFactory and must explicitly be instantiated. Likewise, GeoRSS output writer is also not yet added to the Factory method described above.