Hi Justin,
I am as well not sure, if the connection error is a SQL Server configuration thing. I was experimenting a bit with the connection string and found the following:
Establishing connections to the with jdbc (http://msdn.microsoft.com/en-us/library/ms378428(SQL.90).aspx) (as well as ole db) works for me:
"jdbc:sqlserver://SQLSERVER\\SQLEXPRESS:1433;databaseName=gistest;user=user;password=password;"
Or
"jdbc:sqlserver://SQLSERVER:1433;instance=SQLEXPRESS;databaseName=gistest;user=sa;password=password;"
Declaring database in postgres-style does not work:
"jdbc:sqlserver://SQLSERVER:1433/gistest;instance=SQLEXPRESS;user=user;password=password;"
Leads to:
com.microsoft.sqlserver.jdbc.SQLServerException: Invalid portnumber: 1433/gistest.
________________
The only thing about boundingboxes for geography (geometry has STEnvelope) is, that a boundingbox - field is provided in the spatial index:
http://msdn.microsoft.com/en-us/library/bb964712.aspx. But - in my data it is 0 - baaaah.
________________
So thank you once more! I will keep on looking to the mailing list.
Best regards
Sven Axt
___________________________________________________
Hi Sven,
That is great that it works for you! Additional comments inline.
Axt, Sven wrote:
Thank you very much Justin!
I was testing the last days and and in the end I was able to bring data on a map.I imported one shp-file as geography (EPSG:4326) and as geometry (EPSG:31467).
When defining the datastore, supplying a databasename led to this error (Invalid Portnumber):
form connection params { schema="", port=1433, passwd="gisuser",
dbtype="sqlserver", host="localhost\sqlexpress", max connections=10,
user="gisuser", database="gistest", min connections=1}
04 Dez 00:04:56 WARN [geoserver.action] - Unable to fetch a list of FeatureType names from datastore.
java.lang.RuntimeException: Unable to obtain connection
at org.geotools.jdbc.JDBCDataStore.createConnection(JDBCDataStore.java:1101)
at org.geotools.jdbc.JDBCDataStore.createTypeNames(JDBCDataStore.java:597)
at org.geotools.data.store.ContentDataStore.getTypeNames(ContentDataStore.java:263)
at org.vfny.geoserver.util.DataStoreUtils.getDataStore(DataStoreUtils.java:80)
at org.vfny.geoserver.util.DataStoreUtils.acquireDataStore(DataStoreUtils.java:59)
at org.vfny.geoserver.action.data.DataDataStoresEditorAction.execute(DataDataStoresEditorAction.java:145)
at org.vfny.geoserver.action.ConfigAction.execute(ConfigAction.java:101)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
...
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid Portnumber: 1433/gistest.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
... 60 moreOk - no databasename - worked.
I found the same. I am not sure if this is a SQL Server configuration thing?
Next step: Feature type definition.
Autocad seems to import geometry-data with srid = 0 wich leads to an
error in feature data definition of geoserver. After setting the srid
explicitly with update mytable set Geometry.STSrid = 31467 I was able to finish the feature definition and see the geometry-data on the map - great!
It should be possible to simply enter 31467 as the SRS (in the feature type editor) and choose the default SRS handling to ignore the native srs. I will investigate this.
With geography-data (EPSG:4326) I was not that lucky, because srid was UNKOWN or -1. And even with typing 4326 into the srs field the bounding box could not be calculated.
Yeah, this is an issue. Currently the driver only deals with the geometry type, and not the geographic type. Opening a ticket for this:
http://jira.codehaus.org/browse/GEOT-2193
Actually one thing that puzzles me is that the geography datatype does not seem to have an STEnvlope() function...
Thats all so far and I'am very lucky the sqlserver support in geoserver. Time to upgrade!
Best regards
SvenHi Sven,
I believed I have fixed the problem. Due to changes between versions you will need to grab a recent 1.7.1 SNAPSHOT geoserver install. I also fixed an issue in the extension so you will need the latest version of that. You can grab them from:
http://gridlock.openplans.org/geoserver/1.7.x/geoserver-1.7.x-latest-war.zip
http://gridlock.openplans.org/geoserver/1.7.x/ext-latest/geoserver-1.7.1-SNAPSHOT-sqlserver-plugin.zipThat hopefully works for you. Try it out and let me know if you have any more problems.
-Justin
Axt, Sven wrote:
Hi,
I'am running GeoServer Version 1.7.0 Stable in a war install in tomcat 6.0.16.
As well I'am using the latest ms-jdbc driver an the geoserver-1.7.1-SNAPSHOT as plugin.@Justin: Thank you for putting me on the list!
Best regards
Sven-----Ursprüngliche Nachricht-----
Von: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Gesendet: Freitag, 28. November 2008 01:18
An: Sven Axt
Cc: geoserver-users@lists.sourceforge.net
Betreff: Re: [Geoserver-users] Connection to SQL Server 2008 SpatialHi Sven,
A couple of questions. Which version of GeoServer are you running? Also how are you running GeoSever? Via war install? or standalone?
Thanks,
-Justin
Sven Axt wrote:
Hello,
I'am really looking foreward to working with the sql server spatial driver. Connection via oledb (using win xp) works fine:
Provider=SQLOLEDB.1;Password=pass;Persist Security Info=True;User
ID=user;Initial Catalog=mydb;Data Source=127.0.0.1\SQLEXPRESS,1433Installation was no problem. I'am able to choose Microsoft SQL-Server when creating a datastore. I tried various ways, but connecting to the sql server instance is not successful:
form connection params { schema="dbo", port=1433, passwd="pass",
dbtype="sqlserver", host="127.0.0.1\SQLEXPRESS:1433", max
connections=10, user="user", database="mydb", min connections=1}
25 Nov 09:55:15 WARN [geoserver.action] - Unable to fetch a list of FeatureType names from datastore.
java.lang.VerifyError: org/geotools/jdbc/JDBCDataStore at
org.geotools.jdbc.JDBCDataStoreFactory.createDataStore(JDBCDataStoreF
a
ctory.java:115) at
org.geotools.jdbc.JDBCDataStoreFactory.createDataStore(JDBCDataStoreF
a
ctory.java:45) at
org.vfny.geoserver.util.DataStoreUtils.getDataStore(DataStoreUtils.ja
v
a:75) at
org.vfny.geoserver.util.DataStoreUtils.acquireDataStore(DataStoreUtil
s
.java:59) at
org.vfny.geoserver.action.data.DataDataStoresEditorAction.execute(Dat
a
DataStoresEditorAction.java:135) at
org.vfny.geoserver.action.ConfigAction.execute(ConfigAction.java:101)
at
org.apache.struts.action.RequestProcessor.processActionPerform(Reques
t
Processor.java:431) at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
v
a:236) at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:119
6
) at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)Any ideas whats wrong?
Thank you and best regards
Sven--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.----------------------------------------------------------------------
--- This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge Build the coolest Linux based applications with Moblin SDK &
win great prizes Grand prize is a trip for two to an Open Source event
anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.__________ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version 3653 (20081201) __________
E-Mail wurde geprüft mit ESET NOD32 Antivirus.
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.