<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><base href="x-msg://314/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Gery</div><div><br></div><div>I never tried/changed the GeoAlchemy data source, however I'm going to try your setup and have a look if I get the same error.</div><div><br></div><div>Cheers,</div><div>Michel</div><div><br></div><div><br></div><div><blockquote type="cite"><font face="Arial" color="#366092" size="2" style="font-size: 10pt; ">I get this error recently, I'm not sure why, someone has an idea? thanks<br><br></font><pre style="font-size: 13px; ">An error occurred: 'NoneType' object has no attribute 'items'
  File "/var/www/html/mop/fs/web_request/handlers.py", line 236, in cgi
    for (key, value) in returned_data[2].items():


{}</pre></blockquote><div><br></div></div><div><br></div><div><br></div><br><div><div>On Dec 4, 2012, at 10:31 AM, Gery . <<a href="mailto:gamejihou@hotmail.com">gamejihou@hotmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div dir="ltr"><font face="Arial" color="#366092" size="2" style="font-size: 10pt; ">Hello,<br><br>I'm using GeoAlchemy with FeatureServer, but I'm new using both, so sorry for the very simple questions. This is my model (boreholes.model) for one of my PostGis tables:<br><br>*****************************<br>print "Content-type: text/html\n\n";<br><br>from sqlalchemy import *<br>from sqlalchemy.orm import *<br>from sqlalchemy.dialects.postgresql import *<br>from geoalchemy import *<br>from geoalchemy.postgis import *<br><br>engine = create_engine('<a href="postgresql://postgres:pass@localhost:5432/map'">postgresql://postgres:pass@localhost:5432/map'</a>, echo=False)<br>metadata = MetaData(engine)<br><br>session = sessionmaker(bind=engine)()<br><br>boreholes_table = Table('boreholes_point_wgs84', metadata,<br>                        Column('id', SMALLINT, primary_key=True),<br>                        Column('fid', SMALLINT),<br>                        Column('longitude', DOUBLE_PRECISION),<br>                        Column('latitude', DOUBLE_PRECISION),<br>                        Column('w_depth_m', DOUBLE_PRECISION),<br>                        Column('station', VARCHAR(150)),<br>                        Column('type', VARCHAR(150)),<br>                        Column('survey', VARCHAR(150)),<br>                        Column('source', VARCHAR(150)),<br>                        Column('max_pen_m', VARCHAR(150)),<br>                        Column('core_rec_m', VARCHAR(150)),<br>                        Column('t_g_ckm1', VARCHAR(150)),<br>                        Column('h_f_mwm2', VARCHAR(150)),<br>                        Column('comments', TEXT),<br>                        GeometryExtensionColumn('geom', Geometry(3)))<br><br>class Boreholes(object):<br>    def __init__ (self, id, fid, longitude, latitude, w_depth_m, station, type, survey, source, max_pen_m, core_rec_m, t_g_ckm1, h_f_mwm2, comments):<br>        self.id = id<br>        self.fid = fid<br>        self.longitude = longitude<br>        self.latitude = latitude<br>        self.w_depth_m = w_depth_m<br>        self.station = station<br>        self.type = type<br>        self.survey = survey<br>        self.source = source<br>        self.max_pen_m = max_pen_m<br>        self.core_rec_m = core_rec_m<br>        self.t_g_ckm1 = t_g_ckm1<br>        self.h_f_mwm2 = h_f_mwm2<br>        self.comments = comments<br><br>mapper(Boreholes, boreholes_table,<br>       properties={<br>                 'geom': GeometryColumn(boreholes_table.c.geom,<br>                                        comparator=PGComparator)<br>                  })<br><br>GeometryDDL(boreholes_table)<br><br></font><font face="Arial" color="#366092" size="2" style="font-size: 10pt; ">*****************************</font><br><font face="Arial" color="#366092" size="2" style="font-size: 10pt; "><br>and this is what I have in my featureserver.cfg:<br><br></font><font face="Arial" color="#366092" size="2" style="font-size: 10pt; ">*****************************<br>[boreholes]<br>type=GeoAlchemy<br>dburi=<a href="postgresql://postgres:pass@localhost:5432/map">postgresql://postgres:pass@localhost:5432/map</a><br>model=../model/boreholes.model<br>cls=boreholes_point_wgs84<br>fid=id<br>geometry=geom<br></font><font face="Arial" color="#366092" size="2" style="font-size: 10pt; ">*****************************</font><br><font face="Arial" color="#366092" size="2" style="font-size: 10pt; "><br>so what I want is to query this table and output that in GeoJSON format. I'm doing the query in OpenLayers using GeoExt like this:<br><br></font><font face="Arial" color="#366092" size="2" style="font-size: 10pt; ">*****************************</font><br><font face="Arial" color="#366092" size="2" style="font-size: 10pt; ">var searchformPanel = new GeoExt.form.FormPanel(<br>        {<br>            width: 250,<br>            bodyStyle: 'padding:5px',<br>            labelAlign: 'top',<br>            defaults:<br>            {<br>                anchor: '100%'<br>            },<br>            protocol: new OpenLayers.Protocol.HTTP(<br>            {<br>                url: '<a href="http://www.mop.org/fs/boreholes?format=GeoJSON'">http://www.mop.org/fs/boreholes?format=GeoJSON'</a>,<br>                format: new OpenLayers.Format.GeoJSON(<br>                {<br>                    ignoreExtraDims: true,<br>                    'internalProjection': new OpenLayers.Projection("EPSG:900913"),<br>                    'externalProjection': new OpenLayers.Projection("EPSG:4326")<br>                }<br>                )<br>            }<br>            ),<br>            items:<br>            [<br>            {<br>                xtype: 'textfield',<br>                name: 'station__like',<br>                fieldLabel: 'Enter a word',<br>                allowBlank: false<br>            }<br>            ],<br>...<br>...<br></font><font face="Arial" color="#366092" size="2" style="font-size: 10pt; ">*****************************</font><br><font face="Arial" color="#366092" size="2" style="font-size: 10pt; "><br>by the way, this PostGis table is served by MarServer as WMS, but I think this has nothing to do with the query. So, to do this query I'm sure I need something else related to GeoAlchemy and featureserver itself but not sure what it is, I'd be grateful for some support on this, thanks in advance for any help.<br><br>Best regards,<br><br>Gery<br> <br id="ecxFontBreak"></font><font face="Arial" color="#1F497D" size="2" style="font-size: 10pt; "><br>__________________________________________________________________________________________<br>Piensa en el medio ambie<font face="Arial">nte - mantenlo en la pantalla. NO lo imprimas si NO es necesario.</font></font><font face="Arial" color="#1F497D" size="2" style="font-size: 10pt; "><br></font><font face="Arial" color="#1F497D" size="2" style="font-size: 10pt; ">Think green - keep it on the screen. Do NOT print if it is NOT necessary.</font><font face="Arial" color="#1F497D" size="2" style="font-size: 10pt; "><br></font><font face="Arial" color="#1F497D" size="2" style="font-size: 10pt; "><span id="ecxresult_box" class="ecxshort_text" lang="de"><span class="ecxhps">Denken Sie an</span><span class="Apple-converted-space"> </span><span class="ecxhps">die Umwelt</span></span></font><font face="Arial" color="#1F497D" size="2" style="font-size: 10pt; "><span id="ecxresult_box" lang="de"><span class="ecxhps"></span> <span class="ecxhps">-</span><span class="Apple-converted-space"> </span><span class="ecxhps">bewahren Sie es</span><span class="Apple-converted-space"> </span><span class="ecxhps">auf dem Bildschirm.</span><span class="Apple-converted-space"> </span><span class="ecxhps">Drucken Sie NICHT</span><span>, wenn</span><span class="Apple-converted-space"> </span><span class="ecxhps">es NICHT notwendig ist</span><span>.</span></span></font><br></div>_______________________________________________<br>FeatureServer mailing list<br><a href="mailto:FeatureServer@lists.osgeo.org">FeatureServer@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/featureserver">http://lists.osgeo.org/mailman/listinfo/featureserver</a><br></div></blockquote></div><br></body></html>