[Geoserver-users] PostGIS connection and SRID

I created a PostGIS table. I retrieve the feature through GeoServer
(1.3.0RC2). I configured GeoServer to use WGS84 (EPSG:4326).

I insert new features into the PostGIS table using the same CRS.
However when I try to display the features in uDig, I get a rendering
error. From the log (extract)

Caused by: org.geotools.ows.ServiceException:
org.geotools.data.DataSourceException: Could not count
  at
org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:229)
  at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(
Unknown Source)
  at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEnd
Element(Unknown Source)
  at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$F
ragmentContentDispatcher.dispatch(Unknown Source)
  at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
canDocument(Unknown Source)
  at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkn
own Source)
  at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkn
own Source)
  at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
  at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unkno
wn Source)
  at javax.xml.parsers.SAXParser.parse(Unknown Source)
  at javax.xml.parsers.SAXParser.parse(Unknown Source)
  at
org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:139)
  at
org.geotools.data.wfs.WFSFeatureReader.run(WFSFeatureReader.java:123)

Curiously: if I change the table to use CRS number 0 (Unknown) and enter
the features with CRS of 0 everything displays nicely in uDig!

I remember reading somewhere that geoserver ignores the CRS code in
PostGIS; but considering my experiences this may not be the entire
truth.

Anybody knows what is going on?

Willem Nieuwenhuis
System Developer
IT-Department, Sector Remote Sensing & GIS
Tel: 458

Some hints:

- When you installed postgis, did you load lwpostgis.sql and
spatial_ref_sys.sql scripts?
- There is a record in spatial_ref_sys table with value "4326" in "srid" field

Eduin

--- Willem Nieuwenhuis <nieuwenhuis@anonymised.com> escribió:

I created a PostGIS table. I retrieve the feature through GeoServer
(1.3.0RC2). I configured GeoServer to use WGS84 (EPSG:4326).

I insert new features into the PostGIS table using the same CRS.
However when I try to display the features in uDig, I get a rendering
error. From the log (extract)

Caused by: org.geotools.ows.ServiceException:
org.geotools.data.DataSourceException: Could not count
  at
org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:229)
  at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(
Unknown Source)
  at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEnd
Element(Unknown Source)
  at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$F
ragmentContentDispatcher.dispatch(Unknown Source)
  at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
canDocument(Unknown Source)
  at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkn
own Source)
  at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkn
own Source)
  at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
  at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unkno
wn Source)
  at javax.xml.parsers.SAXParser.parse(Unknown Source)
  at javax.xml.parsers.SAXParser.parse(Unknown Source)
  at
org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:139)
  at
org.geotools.data.wfs.WFSFeatureReader.run(WFSFeatureReader.java:123)

Curiously: if I change the table to use CRS number 0 (Unknown) and enter
the features with CRS of 0 everything displays nicely in uDig!

I remember reading somewhere that geoserver ignores the CRS code in
PostGIS; but considering my experiences this may not be the entire
truth.

Anybody knows what is going on?

Willem Nieuwenhuis
System Developer
IT-Department, Sector Remote Sensing & GIS
Tel: 458

Eduin Yezid Carrillo Vega
GIS Specialist
http://eduinyezid.carrillovega.com
http://sig.cas.gov.co/~yecarrillo

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/

Hmmm... The first thing to do would be to upgrade GeoServer, as the problem may have already been fixed. The Could not count exception is a bit odd, since I don't think WFS DataStore should be trying to count, although maybe it's trying to go through the whole list.

I don't think the CRS in postgis is entirely ignored any more. And when you configure a CRS it should automatically show up in the FeatureType editor.

So please upgrade to GeoServer 1.3.1, and also try to get a more complete stack trace, as there should be an underlying reason that it couldn't count. Like there should be a 'causedBy' somewhere buried down there I believe.

best regards,

Chris

Willem Nieuwenhuis wrote:

I created a PostGIS table. I retrieve the feature through GeoServer
(1.3.0RC2). I configured GeoServer to use WGS84 (EPSG:4326).

I insert new features into the PostGIS table using the same CRS.
However when I try to display the features in uDig, I get a rendering
error. From the log (extract)

Caused by: org.geotools.ows.ServiceException:
org.geotools.data.DataSourceException: Could not count
  at
org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:229)
  at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(
Unknown Source)
  at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEnd
Element(Unknown Source)
  at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$F
ragmentContentDispatcher.dispatch(Unknown Source)
  at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
canDocument(Unknown Source)
  at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkn
own Source)
  at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkn
own Source)
  at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
  at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unkno
wn Source)
  at javax.xml.parsers.SAXParser.parse(Unknown Source)
  at
org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:139)
  at
org.geotools.data.wfs.WFSFeatureReader.run(WFSFeatureReader.java:123)

Curiously: if I change the table to use CRS number 0 (Unknown) and enter
the features with CRS of 0 everything displays nicely in uDig!

I remember reading somewhere that geoserver ignores the CRS code in
PostGIS; but considering my experiences this may not be the entire
truth.

Anybody knows what is going on?

Willem Nieuwenhuis
System Developer
IT-Department, Sector Remote Sensing & GIS
Tel: 458

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1003,44a1051e31911665516417!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org