Hi,
I am Rui Lopes, a Portuguese student of Informatics Engineering. I do
research on territorial self-organization. I have built a model using
Repast with a territory of 2400x1200 cells. Now, I want to use a
POSTGIS database with my model. So far I am just experimenting, before
integrate it with my model. I found some obstacles that don't allow me
to go on. I use ubuntu and installed postgresql and postgresql-postgis
through apt. I have already created a database on the server, installed
on my machine. The code I am using is this:
private void createDataStore() {
Map params = new HashMap();
params.put("dbtype", "postgis"); //must be postgis
params.put("host", "localhost"); //the name or ip address of
the machine running PostGIS
params.put("port", new Integer(5432)); //the port that PostGIS is
running on (generally 5432)
params.put("database", "mytestdb2"); //the name of the database
to connect to.
params.put("user", "ruya"); //the user to connect with
params.put("passwd", ""); //the password of the user.
try {
DataStore pgDatastore = DataStoreFinder.getDataStore(params);
FeatureSource fsBC = pgDatastore.getFeatureSource("bc");
System.out.println("bc count: " + fsBC.getCount(Query.ALL));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
The DataStoreFinder is returning null. Assuming that the parameters are
correct (I can access the mytestdb through command line), what may be
the problem?
Thanks in advance,
Rui Lopes
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users