<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<font style="font-size: 10pt;" face="Arial" color="#366092" size="2">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('postgresql://postgres:pass@localhost:5432/map', 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 style="font-size:10pt" face="Arial" color="#366092" size="2">*****************************</font><br><font style="font-size: 10pt;" face="Arial" color="#366092" size="2"><br>and this is what I have in my featureserver.cfg:<br><br></font><font style="font-size: 10pt;" face="Arial" color="#366092" size="2">*****************************<br>[boreholes]<br>type=GeoAlchemy<br>dburi=postgresql://postgres:pass@localhost:5432/map<br>model=../model/boreholes.model<br>cls=boreholes_point_wgs84<br>fid=id<br>geometry=geom<br></font><font style="font-size:10pt" face="Arial" color="#366092" size="2">*****************************</font><br><font style="font-size: 10pt;" face="Arial" color="#366092" size="2"><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 style="font-size:10pt" face="Arial" color="#366092" size="2">*****************************</font><br><font style="font-size: 10pt;" face="Arial" color="#366092" size="2">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: 'http://www.mop.org/fs/boreholes?format=GeoJSON',<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 style="font-size:10pt" face="Arial" color="#366092" size="2">*****************************</font><br><font style="font-size:10pt" face="Arial" color="#366092" size="2"><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 style="font-size:10pt" face="Arial" color="#1F497D" size="2"><br>__________________________________________________________________________________________<br>Piensa en el medio ambie<font style="" face="Arial">nte - mantenlo en la pantalla. NO lo imprimas si NO es necesario.</font></font><font style="font-size:10pt" face="Arial" color="#1F497D" size="2"><br></font><font style="font-size:10pt" face="Arial" color="#1F497D" size="2">Think green - keep it on the screen. Do NOT print if it is NOT necessary.</font><font style="font-size:10pt" face="Arial" color="#1F497D" size="2"><br></font><font style="font-size:10pt" face="Arial" color="#1F497D" size="2"><span id="ecxresult_box" class="ecxshort_text" lang="de"><span class="ecxhps">Denken Sie an</span> <span class="ecxhps">die Umwelt</span></span></font><font style="font-size:10pt" face="Arial" color="#1F497D" size="2"><span id="ecxresult_box" lang="de"><span class="ecxhps"></span> <span class="ecxhps">-</span> <span class="ecxhps">bewahren Sie es</span> <span class="ecxhps">auf dem Bildschirm.</span> <span class="ecxhps">Drucken Sie NICHT</span><span>, wenn</span> <span class="ecxhps">es NICHT notwendig ist</span><span>.</span></span></font><br> </div></body>
</html>