Hi Brett,

In AbstractGeometryTypeBinding:
    public Object getProperty(Object object, QName name)
        throws Exception {
        Geometry geometry = (Geometry) object;

        if ("srsName".equals(name.getLocalPart())) {
            CoordinateReferenceSystem crs = GML3EncodingUtils.getCRS(geometry);
            if (crs != null) {
                return GML3EncodingUtils.toURI(crs);
            }
        }

        if ("srsDimension".equals(name.getLocalPart())) {
            CoordinateReferenceSystem crs = GML3EncodingUtils.getCRS(geometry);
            if (crs != null) {
                return crs.getCoordinateSystem().getDimension();
            }
        }

As you can see, it grabs the CRS from the geometry to encode both srsDimension 
and srsName. Since srsDimension is encoded, the CRS object must be set (unless 
the srsDimension is set from app-schema mapping file?).
You can start by looking at GML3EncodingUtils.toURI(), which traces down to 
GML2EncodingUtils.epsgCode() where it could return null.

Cheers
Rini

From: siss-boun...@lists.csiro.au [mailto:siss-boun...@lists.csiro.au] On 
Behalf Of Brett Walker
Sent: Friday, 1 June 2012 3:56 PM
To: geotools-devel@lists.sourceforge.net; s...@lists.csiro.au
Cc: Geoff Williams
Subject: [Siss] Missing srsName from geometry

Hi All,

I think that I have found a bug, perhaps in App-Schema, perhaps in the Postgres 
DataStore, relating to the srsName attribute for GML Geometries.

I have a colleague who has generated a fragment of xml as follows:

<gml:Point srsDimension="2" 
srsName="http://www.opengis.net/gml/srs/epsg.xml#4326";>
<gml:pos>148.9667 35.25</gml:pos>
</gml:Point>

My colleague is using Postgres 8.4 32-bit and PostGIS 1.5.3 32-bit on RHEL 5x

I am using the same App-Schema to build a complex WFS in Geoserver. I am using 
Postgres v9.1.3 64-bit and PostGIS v2.0.0 64-bit on a Windows 7 64-bit system. 
The fragment of xml I generate is:

<gml:Point srsDimension="2">
<gml:pos>148.9667 35.25</gml:pos>
</gml:Point>

I am seeing that the manner in which PostGIS deals with geometry metadata has 
changed in my version of PostGIS. I have a feeling that this may be a bug 
relating to how GeoTools interacts with PostGIS 2.0.0. I don't know where in 
the code to confirm my suspicions. Any ideas to start looking?

Brett

Brett Walker <brett.wal...@geometryit.com<mailto:brett.wal...@geometryit.com>>
Software Developer / Analyst
Geometry Pty Ltd

Telephone               03 6223 1999
Mobile                     0458 498 386
Fax                          03 6223 1988
Web                        www.geometryit.com<http://www.geometryit.com/>
Address                   31 Salamanca Square, Battery Point, TAS 7004, 
Australia

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to