MySql Spatial Database

Murat BEYHAN beyhan at DEPREM.GOV.TR
Thu Oct 5 10:26:19 EDT 2006


Dear Frank 
Thank you this work well.
I have tried the select statement it works fine.
But my problem How can I send condition term from php to map file
I mean by the following statement how can I send the name of districtname
which I intend to draw it. On php the name of district for example $testname
How can I send this information to the map. 
> DATA "SELECT * from polytable WHERE <some condition>"
 DATA "SELECT * from district WHERE districtname='$testname'"
by using %$testname% (%%) this I sent from html but I dont know how can I send
by using PHP.


Regards 
Murat



On Thu, 5 Oct 2006 10:13:46 -0400, Frank Warmerdam wrote
> Murat BEYHAN wrote:
> > Frank,
> > I'm really getting love mapserver.
> > Its easy to learn and to do any kind of powerful map.
> > But There is another problem.I store the data in the mysql and draw it but How
> > can I query data stored in mysql by using ogr.
> > I mean how can I send variable from php to OGR
> > 
> > I would like to make select statement for the ogr. But How?
> > By following expression I can draw point layer. But the data are not in
> > spatial database. They are Just table and I read the column from table for lat
> > lon and by using connectiontype ogr connection I can draw point.
> > My second issiu to draw polygone layer stored in Mysql spatial database. OK O
> > have succeeded to do, too. And third issiu to draw only one district which
> > data stored in Mysql spatial databese.
> > So I think I have to construct one select statement as follows but How can I
> > construct select statement for the mysql spatial database. I dont have any
> > experiences. Could you give me some point about that. If I could this I can
> > finalize my study then will be ready to publish it on the net.
> > Regards 
> > Murat
> > 
> > <OGRVRTDataSource>
> >     <OGRVRTLayer name="koymrk">
> >        
> >
<SrcDataSource>MYSQL:bina,user=root,password=mysql_123,host=localhost,port=3306,tables=zoneson</SrcDataSource>
> >         <SrcSQL>SELECT lat,lon,koyadi from zoneson  </SrcSQL>
> >         <GeometryType>wkbPoint</GeometryType>
> >         <GeometryField encoding="PointFromColumns" x="lon" y="lat"/>
> >     </OGRVRTLayer>
> > </OGRVRTDataSource>
> > ~
> 
> Murat,
> 
> There are a few query concepts that come into play.  MapServer has a 
> concept of query that should operate against your layers without 
> changing the OVF XML or regular connection info.  There should be 
> description of that on the MapServer site ... I've only rarely used 
> it from mapscript.
> 
> But if you just want to draw a reduced set of features based on a custom
> query, there are other ways to handle that.  For the polygon layer directly
> accessed from MYSQL without an OVF file, you can just put a SELECT statement
> in your DATA line instead of simply listing a table.
> 
> eg.
> DATA "SELECT * from polytable WHERE <some condition>"
> 
> For the above OVF case you can make the SrcSQL statement more 
> complicated as long as the result set still includes the fields you need.
> 
> Good luck,
> -- 
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | President OSGeo, http://osgeo.org
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.


--
Open WebMail Project (http://openwebmail.org)


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the mapserver-users mailing list