[Gfoss] MySQL Spatial how to...

Alessandro Pasotti ale.pas at tiscali.it
Wed Jul 11 16:26:06 CEST 2007


Il mercoledì 11 luglio 2007, Fabio D'Ovidio ha scritto:
> Da quanto letto (ma non testato perchè lavoro con PostGIS) posso dire che
> il confronto MySQL Spatial vs PostGIS non regge a discapito di MySQL
> Spatial in quanto a funzionalità di analisi geospaziali.
>
> Però, se io volessi semplicemente mettere delle geometrie in MySQL e
> connettermi tramite:
>
> 1. UMN MapServer


Ciao Fabio,

con mapserver lo puoi fare usando i layer OGR (senza compilare nulla), vedi 
qui:
http://mapserver.gis.umn.edu/docs/reference/vector_data/VirtualSpatialData

Un esempio di ovf per mysql è:


<OGRVRTDataSource>
    <OGRVRTLayer name="News">
        
<SrcDataSource>MYSQL:joomla,user=***,password=***,host=localhost,port=3306,tables=jos_content,jos_georef_items</SrcDataSource>
        <SrcSQL>SELECT jos_georef_items.id as id, layerid, x, y, name, 
jos_georef_items.contentid as contentid FROM jos_georef_items left join 
jos_content as jc on jc.id = jos_georef_items.contentid WHERE layerid=6 AND 
jc.state = 1</SrcSQL>
        <GeometryType>wkbPoint</GeometryType>
        <GeometryField encoding="PointFromColumns" x="x" y="y"/>
        <FID>id</FID>
    </OGRVRTLayer>
</OGRVRTDataSource>


-- 
Alessandro Pasotti
itOpen - "Open Solutions for the Net Age"
w3:  www.itopen.it
Linux User# 167502



More information about the Gfoss mailing list