Brett, that's great!

Rini
From: Brett Walker [mailto:brett.wal...@geometryit.com]
Sent: Wednesday, 6 June 2012 11:22 AM
To: Angreani, Rini (CESRE, Kensington); geotools-devel@lists.sourceforge.net; 
s...@lists.csiro.au
Cc: g.willia...@bom.gov.au
Subject: RE: Missing srsName from geometry

Hi Rini,

It is not a postgis bug. It is not reading the manual problem. The missing srid 
information can be included in the create view statement.

For the relevant information see section 4.3.4 in the postgis v2.0 manual for 
the details [1].

Brett

[1] http://postgis.refractions.net/download/postgis-2.0.0.pdf

From: Brett Walker
Sent: Wednesday, 6 June 2012 1:01 PM
To: 'rini.angre...@csiro.au'; geotools-devel@lists.sourceforge.net; 
s...@lists.csiro.au
Cc: g.willia...@bom.gov.au
Subject: RE: Missing srsName from geometry

Hi Rini,

I tracked down my problem.

In my postgres (v9.1.3)/postgis (v2.0) database, in the geometry columns view 
(it is a view) it reports that the srid for the view that I am querying is 0. 
Thus it cannot be resolved. This is the reason that it is missing in the xml 
that I am generating.

The base table (it is a table) for the view reports its srid correctly.

Thus it is a postgis bug.  Is this a reasonable conclusion?

Brett

From: rini.angre...@csiro.au<mailto:rini.angre...@csiro.au> 
[mailto:rini.angre...@csiro.au]<mailto:[mailto:rini.angre...@csiro.au]>
Sent: Tuesday, 5 June 2012 1:22 PM
To: Brett Walker; 
geotools-devel@lists.sourceforge.net<mailto:geotools-devel@lists.sourceforge.net>;
 s...@lists.csiro.au<mailto:s...@lists.csiro.au>
Cc: g.willia...@bom.gov.au<mailto:g.willia...@bom.gov.au>
Subject: RE: Missing srsName from geometry

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> 
[mailto:siss-boun...@lists.csiro.au]<mailto:[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<mailto:geotools-devel@lists.sourceforge.net>;
 s...@lists.csiro.au<mailto: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