1 /*
2 * WKB4J - WKB reader for geographical mapping toolkits
3 * (C) 2002,2003, David Garnier, dgarnier@users.sourceforge.net
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation,
8 * version 2.1 of the License.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * or visit the web to http://www.gnu.org.
19 *
20 */
21 package org.wkb4j.postgis;
22
23 import java.sql.Connection;
24 import java.util.List;
25
26 import org.apache.log4j.Logger;
27 import org.wkb4j.engine.AbstractWKBGetter;
28 /***
29 * Retrieves PostGIS geometries from the specified database Connectiion and return them in a List.
30 * This is the simplest interface offered by WKB4J. If it does not match your needs, you will
31 * need to handle the WKBParser, WKBReader and WKBFactory yourself.
32 * <code>org.wkb4j.examples.SampleCode</code> is provided as an example.
33 *
34 */
35 public class PostgisGetter extends AbstractWKBGetter{
36 protected static Logger log = Logger.getLogger(PostgisGetter.class);
37
38 public PostgisGetter(){
39 super(new PostGISFactory());
40 }
41
42 public List getData(Connection dbConn, String table, String geocolumn, String whereClause){
43 reader.readDataWithWhereClause(dbConn, geocolumn, table, whereClause, parser);
44 return ((PostGISFactory)factory).getGeometries();
45 }
46
47 public List getData(Connection dbConn, String sqlQuery){
48 reader.readData(dbConn, sqlQuery, parser);
49 return ((PostGISFactory)factory).getGeometries();
50 }
51 }
This page was automatically generated by Maven