MapServer supports MS-SQL 2005 {was:: Re: [UMN_MAPSERVER-USERS] Spatial Extensions for SQL Server 2005}
Eduardo Patto Kanegae
epk.lists at GMAIL.COM
Wed Nov 29 09:18:52 PST 2006
Piero,
In fact we already can say that MapServer already supports MS-SQL 2005
with this spatial extension using OGR ODBC driver.
Here's what I did using this with MapServer:
1. install MS SQL 2005 Express ( good! it's freeware, but it's not
like the old MSDE. In this case, it supports many user connections but
your database file can't be greater than 4Gb. But you can split your
database in several 4Gb files)
2. create an empty database and deploy the spatial extension from
Codeplex ( http://www.codeplex.com/Wiki/View.aspx?ProjectName=MsSqlSpatial
)
3. create a polygon table using traditional CREATE TABLE and then
using "ST.AddGeometryColumn" to create a "the_geom" field inside this
table
4. fill the table data. How? Just grab a .sql file generated with
"shp2pgsql -w" ( that tool from PostGIS) and make some little changes(
e.g.: PostGIS says "GeomFromText" , but MS-SQLSpatial says
"ST.GeomFromText" )
5. now, create a DSN ODBC connection using the "SQL Native Client"
provider for SQL2005
6. create, in a MapServer mapfile, a polygon layer pointing to a OGR
Virtual file containing:
<OGRVRTDataSource>
<OGRVRTLayer name="mysql2005layer">
<SrcDataSource>ODBC:myuser/mypasswd at MyODBCSQL05DSN</SrcDataSource>
<SrcLayer>MyPolygonTable</SrcLayer>
<GeometryField encoding="WKB" field="the_geom"/>
</OGRVRTLayer>
</OGRVRTDataSource>
7. and, bingo! got a polygon layer rendered with MapServer without problems.
best regards,
Eduardo Patto Kanegae
http://www.webmapit.com.br
On 11/17/06, piero cavalieri <piero.cavalieri at heidi.it> wrote:
> Only to notice this project:
> http://www.codeplex.com/Wiki/View.aspx?ProjectName=MsSqlSpatial
> Could be great to have Mapserver support it, in the future.
>
> Cheers
> Piero
>
--
More information about the MapServer-users
mailing list